ProviewR Programmer's Reference Manual  V6.1.4
co_cdh.h
Go to the documentation of this file.
1 /*
2  * ProviewR Open Source Process Control.
3  * Copyright (C) 2005-2025 SSAB EMEA AB.
4  *
5  * This file is part of ProviewR.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation, either version 2 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with ProviewR. If not, see <http://www.gnu.org/licenses/>
19  *
20  * Linking ProviewR statically or dynamically with other modules is
21  * making a combined work based on ProviewR. Thus, the terms and
22  * conditions of the GNU General Public License cover the whole
23  * combination.
24  *
25  * In addition, as a special exception, the copyright holders of
26  * ProviewR give you permission to, from the build function in the
27  * ProviewR Configurator, combine ProviewR with modules generated by the
28  * ProviewR PLC Editor to a PLC program, regardless of the license
29  * terms of these modules. You may copy and distribute the resulting
30  * combined work under the terms of your choice, provided that every
31  * copy of the combined work is accompanied by a complete copy of
32  * the source code of ProviewR (the version used to produce the
33  * combined work), being distributed under the terms of the GNU
34  * General Public License plus this exception.
35  */
36 
37 #ifndef co_cdh_h
38 #define co_cdh_h
39 
40 /* co_cdh.h -- class definition handler
41  This include file contains definitions and function prototypes
42  needed to use CDH. */
43 
44 #include <limits.h>
45 
46 #include "pwr_class.h"
47 
48 #include "co_math.h"
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
66 #define cdh_cMaxVidGroup 255
67 #define cdh_cMaxCix 4095
68 #define cdh_cMaxBix 7
69 #define cdh_cMaxTix 2047
70 #define cdh_cMaxTyg 1
71 #define cdh_cMaxOix UINT_MAX
72 
73 typedef enum {
74  cdh_eVid3_local = 1,
75  cdh_eVid3_subid = 128,
76  cdh_eVid3_dlid = 129,
77  cdh_eVid3_qid = 130
78 } cdh_eVId3;
79 
80 #define cdh_cIoConnectVolume \
81  (0 + ((pwr_tVolumeId)254 << 24) + (254 << 16) + (254 << 8) + 249)
82 #define cdh_cRtVolume \
83  (0 + ((pwr_tVolumeId)254 << 24) + (254 << 16) + (254 << 8) + 245)
84 #define cdh_cSourceVolume \
85  (0 + ((pwr_tVolumeId)254 << 24) + (254 << 16) + (254 << 8) + 244)
86 
88 #define cdh_CidToVid(cid) ((cid) >> 16)
90 #define cdh_TidToVid(tid) ((tid) >> 16)
92 #define cdh_cixToCid(Vid, Cix) (0 + ((Vid) << 16) + ((Cix) << 3))
94 #define cdh_cidToCix(Cid) (((Cid) >> 3) & 0xfff)
96 #define cdh_tixToTid(Vid, Tyg, Tix) \
97  (0 + ((Vid) << 16) + (1 << 15) + ((Tyg) << 11) + (Tix))
99 #define cdh_cixToOix(Cix, Bix, Aix) \
100  (0 + (1 << 31) + ((Cix) << 18) + ((Bix) << 15) + (Aix))
102 #define cdh_tixToOix(Tyg, Tix) \
103  (0 + (1 << 31) + (1 << 30) + ((Tyg) << 26) + ((Tix) << 15))
105 #define cdh_oixToBix(Oix) ((pwr_eBix)(((Oix) >> 15) & 7))
107 #define cdh_oixToCix(Oix) (((Oix) >> 18) & 0xfff)
109 #define cdh_oixToAix(Oix) ((Oix)&0xfff)
111 #define cdh_cidToBid(Cid, Bix) ((Cid) & (Bix))
113 #define cdh_bidToBix(Bid) ((Bid)&7)
115 #define cdh_tidIsCid(Tid) (((Tid) & (1 << 15)) == 0)
116 
118 #define cdh_cUserVolMin \
119  (0 + ((pwr_tVolumeId)0 << 24) + (1 << 16) + (1 << 8) + 1)
121 #define cdh_cUserVolMax \
122  (0 + ((pwr_tVolumeId)0 << 24) + (254 << 16) + (254 << 8) + 254)
124 #define cdh_cManufactClassVolMin \
125  (0 + ((pwr_tVolumeId)0 << 24) + (0 << 16) + (250 << 8) + 0)
127 #define cdh_cManufactClassVolMax \
128  (0 + ((pwr_tVolumeId)0 << 24) + (0 << 16) + (254 << 8) + 254)
130 #define cdh_cUserClassVolMin \
131  (0 + ((pwr_tVolumeId)0 << 24) + (0 << 16) + (2 << 8) + 1)
133 #define cdh_cUserClassVolMax \
134  (0 + ((pwr_tVolumeId)0 << 24) + (0 << 16) + (249 << 8) + 254)
136 #define cdh_cSystemClassVolMin \
137  (0 + ((pwr_tVolumeId)0 << 24) + (0 << 16) + (0 << 8) + 1)
139 #define cdh_cSystemClassVolMax \
140  (0 + ((pwr_tVolumeId)0 << 24) + (0 << 16) + (1 << 8) + 254)
141 
142 #define cdh_isClassVolumeClass(Cid) \
143  ((Cid) == pwr_eClass_ClassVolume || (Cid) == pwr_eClass_DetachedClassVolume)
144 
146 typedef struct {
147  unsigned int oix : 32;
148 
149 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
150 
151  unsigned int vid_3 : 8;
152  unsigned int vid_2 : 8;
153  unsigned int vid_1 : 8;
154  unsigned int vid_0 : 8;
155 
156 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
157 
158  unsigned int vid_0 : 8;
159  unsigned int vid_1 : 8;
160  unsigned int vid_2 : 8;
161  unsigned int vid_3 : 8;
162 
163 #endif
164 } cdh_mOid;
166 
168 typedef struct {
169  unsigned int rix : 32;
170 
171 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
172 
173  unsigned int vid_3 : 8;
174  unsigned int vid_2 : 8;
175  unsigned int vid_1 : 8;
176  unsigned int vid_0 : 8;
177 
178 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
179 
180  unsigned int vid_0 : 8;
181  unsigned int vid_1 : 8;
182  unsigned int vid_2 : 8;
183  unsigned int vid_3 : 8;
184 
185 #endif
186 } cdh_mRid;
188 
190 typedef struct {
191 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
192 
193  unsigned int vid_3 : 8;
194  unsigned int vid_2 : 8;
195  unsigned int vid_1 : 8;
196  unsigned int vid_0 : 8;
197 
198 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
199 
200  unsigned int vid_0 : 8;
201  unsigned int vid_1 : 8;
202  unsigned int vid_2 : 8;
203  unsigned int vid_3 : 8;
204 
205 #endif
206 } cdh_mVid;
208 
210 typedef struct {
211 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
212 
213  unsigned int nid_3 : 8;
214  unsigned int nid_2 : 8;
215  unsigned int nid_1 : 8;
216  unsigned int nid_0 : 8;
217 
218 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
219 
220  unsigned int nid_0 : 8;
221  unsigned int nid_1 : 8;
222  unsigned int nid_2 : 8;
223  unsigned int nid_3 : 8;
224 
225 #endif
226 } cdh_mNid;
228 
230 typedef struct {
231 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
232 
233  unsigned int must_be_two : 2;
234  unsigned int cix : 12;
235  unsigned int bix : 3;
236  unsigned int reserved : 3;
237  unsigned int aix : 12;
238 
239  unsigned int vid_3 : 8;
240  unsigned int vid_2 : 8;
241  unsigned int vid_1 : 8;
242  unsigned int vid_0 : 8;
243 
244 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
245 
246  unsigned int aix : 12;
247  unsigned int reserved : 3;
248  unsigned int bix : 3;
249  unsigned int cix : 12;
250  unsigned int must_be_two : 2;
251 
252  unsigned int vid_0 : 8;
253  unsigned int vid_1 : 8;
254  unsigned int vid_2 : 8;
255  unsigned int vid_3 : 8;
256 
257 #endif
259 
261 typedef struct {
262 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
263 
264  unsigned int vid_1 : 8;
265  unsigned int vid_0 : 8;
266 
267  unsigned int must_be_zero : 1;
268  unsigned int cix : 12;
269  unsigned int bix : 3;
270 
271 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
272 
273  unsigned int bix : 3;
274  unsigned int cix : 12;
275  unsigned int must_be_zero : 1;
276 
277  unsigned int vid_0 : 8;
278  unsigned int vid_1 : 8;
279 
280 #endif
281 } cdh_mCid;
283 
285 typedef struct {
286 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
287 
288  unsigned int must_be_three : 2;
289  unsigned int tyg : 4;
290  unsigned int tix : 11;
291  unsigned int reserved : 3;
292  unsigned int aix : 12;
293 
294  unsigned int vid_3 : 8;
295  unsigned int vid_2 : 8;
296  unsigned int vid_1 : 8;
297  unsigned int vid_0 : 8;
298 
299 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
300 
301  unsigned int aix : 12;
302  unsigned int reserved : 3;
303  unsigned int tix : 11;
304  unsigned int tyg : 4;
305  unsigned int must_be_three : 2;
306 
307  unsigned int vid_0 : 8;
308  unsigned int vid_1 : 8;
309  unsigned int vid_2 : 8;
310  unsigned int vid_3 : 8;
311 
312 #endif
314 
316 typedef struct {
317 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
318 
319  unsigned int vid_1 : 8;
320  unsigned int vid_0 : 8;
321 
322  unsigned int must_be_one : 1;
323  unsigned int tyg : 4;
324  unsigned int tix : 11;
325 
326 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
327 
328  unsigned int tix : 11;
329  unsigned int tyg : 4;
330  unsigned int must_be_one : 1;
331 
332  unsigned int vid_0 : 8;
333  unsigned int vid_1 : 8;
334 
335 #endif
336 } cdh_mTid;
338 
340 typedef union {
345 } cdh_uOid;
347 
349 typedef union {
350  pwr_tRid pwr;
352 } cdh_uRid;
354 
356 typedef union {
360 } cdh_uTid;
362 
364 typedef union {
367 } cdh_uVid;
369 
371 typedef union {
374 } cdh_uNid;
376 
378 typedef enum {
379  cdh_eId__ = 0,
388  cdh_eId_
389 } cdh_eId;
390 
392 typedef union {
393  pwr_tOix oix;
394  pwr_tOid oid;
395  pwr_tCid cid;
396  pwr_tVid vid;
397  pwr_tTid tid;
398  pwr_tSubid sid;
399  pwr_tDlid did;
400  pwr_sAttrRef aref;
401 } cdh_uId;
402 
404 typedef union {
405  pwr_tUInt32 key;
407  struct {
408 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
409 
410  char last;
411  char first;
412  pwr_tUInt8 hash;
413  pwr_tUInt8 len;
414 
415 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
416 
417  pwr_tUInt8 len;
418  pwr_tUInt8 hash;
419  char first;
420  char last;
421 
422 #endif
423  } c;
424 } cdh_uPackName;
425 
427 typedef struct {
428  pwr_tObjName orig;
429  pwr_tObjName norm;
430  cdh_uPackName pack;
431 } cdh_sObjName;
432 
434 typedef struct {
435  cdh_sObjName name;
436  pwr_tOid poid;
437 } cdh_sFamily;
438 
440 typedef union {
442  struct {
443 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
444 
445  pwr_tBit fill : 31;
446 
447  pwr_tBit ascii_7 : 1;
448 
449 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
450 
451  pwr_tBit ascii_7 : 1;
452 
453  pwr_tBit fill : 31;
454 
455 #endif
456  } b;
457  pwr_tBitMask m;
458 
459 #define cdh_mParseName__ 0
460 #define cdh_mParseName_ascii_7 pwr_Bit(0)
461 #define cdh_mParseName_ (~cdh_mParseName__)
463 
465 
566 typedef union {
567  pwr_tBitMask m;
569  struct {
570 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
571 
572  pwr_tBit fallback : 8;
573 
574  pwr_tBit form : 8;
575 
576  pwr_tBit fill : 3;
577  pwr_tBit trueAttr : 1;
578  pwr_tBit ref : 1;
579  pwr_tBit parent : 1;
580  pwr_tBit idString : 1;
581  pwr_tBit separator : 1;
582 
583  pwr_tBit escapeGMS : 1;
584  pwr_tBit index : 1;
585  pwr_tBit attribute : 1;
586  pwr_tBit bodyName : 1;
587  pwr_tBit bodyId : 1;
588  pwr_tBit object : 1;
589  pwr_tBit path : 1;
590  pwr_tBit volume : 1;
591 
592 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
593 
594  pwr_tBit volume : 1;
595  pwr_tBit path : 1;
596  pwr_tBit object : 1;
597  pwr_tBit bodyId : 1;
598  pwr_tBit bodyName : 1;
599  pwr_tBit attribute : 1;
600  pwr_tBit index : 1;
601  pwr_tBit escapeGMS : 1;
602 
603  pwr_tBit separator : 1;
604  pwr_tBit idString : 1;
605  pwr_tBit parent : 1;
606  pwr_tBit ref : 1;
607  pwr_tBit trueAttr : 1;
608  pwr_tBit fill : 3;
609 
610  pwr_tBit form : 8;
611 
612  pwr_tBit fallback : 8;
613 
614 #endif
615  } b;
617  struct {
618 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
619 
620  pwr_tUInt8 fallback;
621  pwr_tUInt8 form;
622  pwr_tUInt16 bits;
623 
624 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
625 
626  pwr_tUInt16 bits;
627  pwr_tUInt8 form;
628  pwr_tUInt8 fallback;
629 
630 #endif
631  } e;
632 
633 #define cdh_mNName 0
634 #define cdh_mName__ 0
635 #define cdh_mName_volume pwr_Bit(0)
636 #define cdh_mName_path pwr_Bit(1)
637 #define cdh_mName_object pwr_Bit(2)
638 #define cdh_mName_bodyId pwr_Bit(3)
639 #define cdh_mName_bodyName pwr_Bit(4)
640 #define cdh_mName_attribute pwr_Bit(5)
641 #define cdh_mName_index pwr_Bit(6)
642 #define cdh_mName_escapeGMS pwr_Bit(7)
643 #define cdh_mName_separator pwr_Bit(8)
644 #define cdh_mName_idString pwr_Bit(9)
645 #define cdh_mName_parent pwr_Bit(10)
646 #define cdh_mName_ref pwr_Bit(11)
647 #define cdh_mName_trueAttr pwr_Bit(12)
648 #define cdh_mName_ (~cdh_mName__)
649 
650 #define cdh_mName_eForm_std 1
651 #define cdh_mName_eForm_root 2
652 #define cdh_mName_eForm_id 3
653 
654 #define cdh_mName_form_std pwr_SetByte(2, cdh_mName_eForm_std)
655 #define cdh_mName_form_root pwr_SetByte(2, cdh_mName_eForm_root)
656 #define cdh_mName_form_id pwr_SetByte(2, cdh_mName_eForm_id)
657 
658 #define cdh_mName_eFallback_bestTry 1
659 #define cdh_mName_eFallback_strict 2
660 #define cdh_mName_eFallback_export 3
661 #define cdh_mName_eFallback_volumeDump 4
662 
663 #define cdh_mName_fallback_bestTry pwr_SetByte(3, cdh_mName_eFallback_bestTry)
664 #define cdh_mName_fallback_strict pwr_SetByte(3, cdh_mName_eFallback_strict)
665 #define cdh_mName_fallback_export pwr_SetByte(3, cdh_mName_eFallback_export)
666 #define cdh_mName_fallback_volumeDump \
667  pwr_SetByte(3, cdh_mName_eFallback_volumeDump)
668 
669 #define cdh_mName_pathBestTry \
670  (cdh_mName_path | cdh_mName_object | cdh_mName_attribute | cdh_mName_index \
671  | cdh_mName_form_std | cdh_mName_Fallback_bestTry)
672 #define cdh_mName_volumeBestTry \
673  (cdh_mName_volume | cdh_mName_path | cdh_mName_object | cdh_mName_attribute \
674  | cdh_mName_index | cdh_mName_form_std | cdh_mName_fallback_bestTry)
675 #define cdh_mName_pathStrict \
676  (cdh_mName_path | cdh_mName_object | cdh_mName_attribute | cdh_mName_index \
677  | cdh_mName_form_std | cdh_mName_fallback_strict)
678 #define cdh_mName_volumeStrict \
679  (cdh_mName_volume | cdh_mName_path | cdh_mName_object | cdh_mName_attribute \
680  | cdh_mName_index | cdh_mName_form_std | cdh_mName_fallback_strict)
681 } cdh_mName;
682 
684 typedef struct {
685  pwr_tOid poid; /* Parent objid, or NOBJID */
686  cdh_mParseName parseFlags;
687 
688  cdh_mName flags;
689  void* ohp;
690  cdh_eId eId;
691  cdh_uId uId;
692  pwr_tTid bid;
693  pwr_tUInt32 offset;
694  pwr_tUInt32 size;
695  pwr_tUInt32 nObject;
696  pwr_tUInt32 nAttribute;
697  pwr_tUInt32 nBody;
698  cdh_sFamily volume;
699  cdh_sFamily object[20];
700  cdh_sFamily body[10];
701  cdh_sFamily attribute[20];
702  pwr_tUInt32 index[20];
703  pwr_tBoolean hasIndex[20];
705 
712 /* Function prototypes to exported functions. */
713 
714 int cdh_ObjidCompare(pwr_tOid Object_1, pwr_tOid Object_2);
715 
716 int cdh_ObjidIsEqual(pwr_tOid Object_1, pwr_tOid Object_2);
717 
718 int cdh_ObjidIsNotEqual(pwr_tOid Object_1, pwr_tOid Object_2);
719 
720 int cdh_ObjidIsNull(pwr_tOid Object);
721 
722 int cdh_ObjidIsNotNull(pwr_tOid Object);
723 
724 int cdh_SubidCompare(pwr_tSubid Subscription_1, pwr_tSubid Subscription_2);
725 
726 int cdh_SubidIsEqual(pwr_tSubid Subscription_1, pwr_tSubid Subscription_2);
727 
728 int cdh_SubidIsNotEqual(pwr_tSubid Subscription_1, pwr_tSubid Subscription_2);
729 
730 int cdh_SubidIsNull(pwr_tSubid Subscription);
731 
732 int cdh_SubidIsNotNull(pwr_tSubid Subscription);
733 
734 int cdh_RefIdCompare(pwr_tRefId Reference_1, pwr_tRefId Reference_2);
735 
736 int cdh_RefIdIsEqual(pwr_tRefId Reference_1, pwr_tRefId Reference_2);
737 
738 int cdh_RefIdIsNotEqual(pwr_tRefId Reference_1, pwr_tRefId Reference_2);
739 
740 int cdh_RefIdIsNull(pwr_tRefId Reference);
741 
742 int cdh_RefIdIsNotNull(pwr_tRefId Reference);
743 
744 int cdh_DlidCompare(pwr_tDlid DirectLink_1, pwr_tDlid DirectLink_2);
745 
746 int cdh_DlidIsEqual(pwr_tDlid DirectLink_1, pwr_tDlid DirectLink_2);
747 
748 int cdh_DlidIsNotEqual(pwr_tDlid DirectLink_1, pwr_tDlid DirectLink_2);
749 
750 int cdh_DlidIsNull(pwr_tDlid DirectLink);
751 
752 int cdh_DlidIsNotNull(pwr_tDlid DirectLink);
753 
754 int cdh_ArefIsEqual(pwr_sAttrRef* arp1, pwr_sAttrRef* arp2);
755 
756 int cdh_IsClassVolume(pwr_tVid vid);
757 
759 
761 
763 
764 int cdh_TypeIdToIndex(pwr_tTid Type);
765 
767 
769 
771  pwr_eType Type, void* Value, char* String, int MaxSize);
772 
774  pwr_eType Type, const char* String, void* Value);
775 
776 void cdh_MaskToBinaryString(unsigned int mask, int noofbits, char* str);
777 
778 pwr_tStatus cdh_StringToClassId(const char* s, pwr_tCid* cid);
779 
780 pwr_tStatus cdh_StringToTypeId(const char* s, pwr_tTid* tid);
781 
782 pwr_tStatus cdh_StringToVolumeId(const char* s, pwr_tVid* tid);
783 
784 pwr_tStatus cdh_StringToObjectIx(const char* s, pwr_tOix* oix);
785 
786 pwr_tStatus cdh_StringToObjid(const char* s, pwr_tOid* oid);
787 
788 pwr_tStatus cdh_StringToAref(const char* s, pwr_tAttrRef* aref);
789 
790 pwr_tStatus cdh_StringToSubid(const char* s, pwr_tSubid* sid);
791 
792 pwr_tStatus cdh_StringToDlid(const char* s, pwr_tDlid* did);
793 
794 void cdh_ClassIdToString(char* s, int size, pwr_tCid cid, int prefix);
795 
796 void cdh_ObjectIxToString(char* s, int size, pwr_tOix oix, int prefix);
797 
798 void cdh_OidToString(char* s, int size, pwr_tOid oid, int prefix);
799 
800 char* cdh_ObjidToString(pwr_tOid oid, int prefix);
801 
802 char* cdh_ObjidToFnString(char* s, pwr_tOid oid);
803 
804 void cdh_ArefToString(char* s, int size, pwr_sAttrRef* aref, int prefix);
805 
806 char* cdh_AttrRefToString(pwr_sAttrRef* aref, int prefix);
807 
808 char* cdh_NodeIdToString(char* s, pwr_tNid nid, int prefix, int suffix);
809 
810 void cdh_TypeIdToString(char* s, int size, pwr_tTid tid, int prefix);
811 
813  char* s, int size, pwr_tVid vid, int prefix, int suffix);
814 
815 char* cdh_VolumeIdToFnString(char* s, int size, pwr_tVolumeId vid);
816 
817 void cdh_SubidToString(char* s, int size, pwr_tSubid sid, int prefix);
818 
819 void cdh_DlidToString(char* s, int size, pwr_tDlid did, int prefix);
820 
821 cdh_sFamily* cdh_Family(cdh_sFamily* f, const char* name, pwr_tOid poid);
822 
823 cdh_sObjName* cdh_ObjName(cdh_sObjName* on, const char* name);
824 
825 pwr_tUInt32 cdh_PackName(const char* name);
826 
827 cdh_sParseName* cdh_ParseName(pwr_tStatus* sts, cdh_sParseName* pn,
828  pwr_tOid poid, const char* name, pwr_tUInt32 flags);
829 
830 char* cdh_Low(const char* s);
831 
832 char* cdh_OpSysToStr(pwr_mOpSys opsys);
833 
834 char* cdh_OpSysToDirStr(pwr_mOpSys opsys);
835 
836 pwr_sAttrRef cdh_ArefToCastAref(pwr_sAttrRef* arp);
837 
838 pwr_sAttrRef cdh_ArefToDisableAref(pwr_sAttrRef* arp);
839 
840 pwr_sAttrRef cdh_ArefAdd(pwr_sAttrRef* arp1, pwr_sAttrRef* arp2);
841 
842 void cdh_SuppressSuper(char* out, char* in);
843 
844 void cdh_SuppressSuperAll(char* out, char* in);
845 
846 int cdh_TypeToMaxStrSize(pwr_eType type, int attr_size, int attr_elements);
847 
848 int cdh_TypeToSize(pwr_eType type);
849 
850 char* cdh_StringToObjectName(char* t, const char* s);
851 
852 pwr_tStatus cdh_NextObjectName(char* t, const char* s);
853 
854 void cdh_CutNameSegments(char* outname, char* name, int segments);
855 
856 pwr_tUInt32 cdh_AttrSize(pwr_sParInfo* info);
857 
858 pwr_tUInt32 cdh_AttrElemSize(pwr_sParInfo* info);
859 
863 #ifdef __cplusplus
864 }
865 #endif
866 
867 #endif
cdh_mCid cdh_mClassId
Internal representation of class identity.
Definition: co_cdh.h:282
cdh_mRid cdh_mRefId
Internal representation of reference identity.
Definition: co_cdh.h:187
cdh_uOid cdh_uObjid
Type for representations of object identity.
Definition: co_cdh.h:346
cdh_uTid cdh_uTypeId
Type for representation of type identity.
Definition: co_cdh.h:361
cdh_mOid cdh_mObjid
Internal representation of object identity.
Definition: co_cdh.h:165
cdh_mVid cdh_mVolumeId
Internal representation of volume identity.
Definition: co_cdh.h:207
cdh_uVid cdh_uVolumeId
Type for represenation of volume identity.
Definition: co_cdh.h:368
cdh_mTid cdh_mTypeId
Internal representation of type identity.
Definition: co_cdh.h:337
cdh_uRid cdh_uRefId
Type for representation of reference identity.
Definition: co_cdh.h:353
cdh_eId
Enumeration for identities.
Definition: co_cdh.h:378
cdh_uNid cdh_uNodeId
Type for representation of node idenity.
Definition: co_cdh.h:375
cdh_mNid cdh_mNodeId
Internal representation of node identity.
Definition: co_cdh.h:227
@ cdh_eId_objid
Object identity.
Definition: co_cdh.h:381
@ cdh_eId_objectIx
Object index.
Definition: co_cdh.h:380
@ cdh_eId_typeId
Type identity.
Definition: co_cdh.h:384
@ cdh_eId_volumeId
Volume identity.
Definition: co_cdh.h:383
@ cdh_eId_classId
Class identity.
Definition: co_cdh.h:382
@ cdh_eId_dlid
Direct link identity.
Definition: co_cdh.h:386
@ cdh_eId_aref
Attribute reference.
Definition: co_cdh.h:387
@ cdh_eId_subid
Subscription identity.
Definition: co_cdh.h:385
char * cdh_VolumeIdToString(char *s, int size, pwr_tVid vid, int prefix, int suffix)
Converts a volume identifier, 'vid' to a string.
Definition: co_cdh.c:1401
void cdh_DlidToString(char *s, int size, pwr_tDlid did, int prefix)
Converts a direct link identifier, 'did' to a string.
Definition: co_cdh.c:1470
int cdh_ObjidIsNull(pwr_tOid Object)
Test if object identity is null.
Definition: co_cdh.c:110
char * cdh_ObjidToFnString(char *s, pwr_tOid oid)
Converts a object identifier, 'oid' to a filename string.
Definition: co_cdh.c:1367
pwr_tStatus cdh_StringToAref(const char *s, pwr_tAttrRef *aref)
Convert AttrRef string to id.
Definition: co_cdh.c:850
void cdh_ObjectIxToString(char *s, int size, pwr_tOix oix, int prefix)
Converts a object index, 'oix' to a string.
Definition: co_cdh.c:1216
char * cdh_AttrRefToString(pwr_sAttrRef *aref, int prefix)
Converts an attribute reference , 'aref' to a string.
Definition: co_cdh.c:1266
int cdh_ObjidIsNotNull(pwr_tOid Object)
Test if object identity is not null.
Definition: co_cdh.c:121
char * cdh_VolumeIdToFnString(char *s, int size, pwr_tVolumeId vid)
Converts a volume identifier, 'vid' to a filename string.
Definition: co_cdh.c:1428
pwr_tStatus cdh_StringToObjid(const char *s, pwr_tOid *oid)
Convert Objid string to id.
Definition: co_cdh.c:800
char * cdh_OpSysToDirStr(pwr_mOpSys opsys)
Convert operating system to directory string.
Definition: co_cdh.c:2387
pwr_tStatus cdh_AttrValueToString(pwr_eType Type, void *Value, char *String, int MaxSize)
Converts an attribute given in internal binary format to a text string.
Definition: co_cdh.c:365
pwr_tStatus cdh_StringToClassId(const char *s, pwr_tCid *cid)
Convert ClassId string to id.
Definition: co_cdh.c:759
void cdh_CutNameSegments(char *outname, char *name, int segments)
Cut the leading segments of an object name.
Definition: co_cdh.c:2740
char * cdh_Low(const char *s)
Convert string to lower case.
Definition: co_cdh.c:2326
char * cdh_StringToObjectName(char *t, const char *s)
Convert string to valid object name.
Definition: co_cdh.c:2658
pwr_tStatus cdh_StringToVolumeId(const char *s, pwr_tVid *tid)
Convert VolumeId string to id.
Definition: co_cdh.c:995
void cdh_SubidToString(char *s, int size, pwr_tSubid sid, int prefix)
Converts a subscription identifier, 'sid' to a string.
Definition: co_cdh.c:1450
pwr_tUInt32 cdh_AttrElemSize(pwr_sParInfo *info)
Get attribute array element size.
Definition: co_cdh.c:2786
void cdh_MaskToBinaryString(unsigned int mask, int noofbits, char *str)
Definition: co_cdh.c:734
pwr_tStatus cdh_StringToObjectIx(const char *s, pwr_tOix *oix)
Converts ObjectIx string to index.
Definition: co_cdh.c:1042
void cdh_TypeIdToString(char *s, int size, pwr_tTid tid, int prefix)
Converts a type identifier, 'tid' to a string.
Definition: co_cdh.c:1188
void cdh_OidToString(char *s, int size, pwr_tOid oid, int prefix)
Converts a object identifier, 'oid' to a string.
Definition: co_cdh.c:1316
void cdh_ClassIdToString(char *s, int size, pwr_tCid cid, int prefix)
Converts a class identifier, 'cid' to a string.
Definition: co_cdh.c:1151
pwr_tCid cdh_ClassObjidToId(pwr_tOid Object)
Convert Objid to ClassId.
Definition: co_cdh.c:227
pwr_tStatus cdh_NextObjectName(char *t, const char *s)
Create an similar objectname from another object name.
Definition: co_cdh.c:2702
pwr_tOid cdh_ClassIdToObjid(pwr_tCid Class)
Convert ClassId to Objid.
Definition: co_cdh.c:249
pwr_tTid cdh_TypeObjidToId(pwr_tOid Object)
Convert Objid to TypeId.
Definition: co_cdh.c:275
int cdh_ObjidCompare(pwr_tOid Object_1, pwr_tOid Object_2)
Compare two object identities.
Definition: co_cdh.c:67
pwr_tStatus cdh_StringToAttrValue(pwr_eType Type, const char *String, void *Value)
Definition: co_cdh.c:465
int cdh_ObjidIsEqual(pwr_tOid Object_1, pwr_tOid Object_2)
Test if two object identities are equal.
Definition: co_cdh.c:88
void cdh_ArefToString(char *s, int size, pwr_sAttrRef *aref, int prefix)
Converts an attribute reference , 'aref' to a string.
Definition: co_cdh.c:1231
int cdh_ObjidIsNotEqual(pwr_tOid Object_1, pwr_tOid Object_2)
Test if two object identities are different.
Definition: co_cdh.c:99
char * cdh_OpSysToStr(pwr_mOpSys opsys)
Convert operating system to string.
Definition: co_cdh.c:2341
pwr_sAttrRef cdh_ObjidToAref(pwr_tObjid Objid)
Converts an objid to an attrref.
Definition: co_cdh.c:354
pwr_tOid cdh_TypeIdToObjid(pwr_tTid Type)
Convert TypeId to Objid.
Definition: co_cdh.c:321
pwr_tStatus cdh_StringToTypeId(const char *s, pwr_tTid *tid)
Convert TypeId string to id.
Definition: co_cdh.c:937
int cdh_TypeIdToIndex(pwr_tTid Type)
Convert TypeId to index.
Definition: co_cdh.c:310
char * cdh_NodeIdToString(char *s, pwr_tNid nid, int prefix, int suffix)
Converts a volume identifier, 'vid' to a string.
Definition: co_cdh.c:1290
char * cdh_ObjidToString(pwr_tOid oid, int prefix)
Converts a object identifier, 'oid' to a string.
Definition: co_cdh.c:1340
pwr_tUInt32 cdh_AttrSize(pwr_sParInfo *info)
Get attribute size.
Definition: co_cdh.c:2773
unsigned int pwr_tUInt32
32-bit unsigned integer type.
Definition: pwr.h:233
unsigned int pwr_tVid
Volume identity type.
Definition: pwr.h:237
unsigned int pwr_tBitMask
Bitmask type.
Definition: pwr.h:123
unsigned int pwr_tOix
Object index type.
Definition: pwr.h:243
unsigned int pwr_tBoolean
Boolean type.
Definition: pwr.h:127
pwr_tRid pwr_tSubid
Subscription identity type.
Definition: pwr.h:312
unsigned int pwr_tCid
Class identity type.
Definition: pwr.h:273
unsigned int pwr_tBit
Bit type.
Definition: pwr.h:122
unsigned char pwr_tUInt8
8-bit unsigned integer type.
Definition: pwr.h:225
int pwr_tStatus
Status type.
Definition: pwr.h:284
pwr_tVid pwr_tVolumeId
Volume identity type.
Definition: pwr.h:238
pwr_tRid pwr_tDlid
Direct link identity type.
Definition: pwr.h:311
pwr_tRid pwr_tRefId
Reference identity type.
Definition: pwr.h:310
unsigned int pwr_tTid
Type identity type.
Definition: pwr.h:278
pwr_tVolumeId pwr_tNid
Node identity type.
Definition: pwr.h:297
unsigned short pwr_tUInt16
16-bit unsigned integer type.
Definition: pwr.h:229
char pwr_tObjName[31+1]
Object name type.
Definition: pwr.h:377
Internal represention of class identity.
Definition: co_cdh.h:261
Internal representation of $ClassDef object identity.
Definition: co_cdh.h:230
Internal representation of node identity.
Definition: co_cdh.h:210
Internal representatin of object identity.
Definition: co_cdh.h:146
unsigned int vid_3
Object index.
Definition: co_cdh.h:151
Internal representation of reference identity.
Definition: co_cdh.h:168
Internal representation of type identity.
Definition: co_cdh.h:316
Internal representation of $TypeDef object identity.
Definition: co_cdh.h:285
Internal representations of volume identity.
Definition: co_cdh.h:190
Family struct.
Definition: co_cdh.h:434
Object name struct.
Definition: co_cdh.h:427
Parse name struct.
Definition: co_cdh.h:684
Attribute reference.
Definition: pwr.h:557
Object identity type.
Definition: pwr.h:263
Name string format description.
Definition: co_cdh.h:566
Parse name mask.
Definition: co_cdh.h:440
Union for identities.
Definition: co_cdh.h:392
Type for representation of node identity.
Definition: co_cdh.h:371
pwr_tNid pwr
Extern representation.
Definition: co_cdh.h:372
cdh_mNid n
Intern representation.
Definition: co_cdh.h:373
Type for representions of object identity.
Definition: co_cdh.h:340
cdh_mClassObjid c
ClassDef object representation.
Definition: co_cdh.h:343
cdh_mObjid o
Common object representation.
Definition: co_cdh.h:342
pwr_tOid pwr
Extern representation.
Definition: co_cdh.h:341
cdh_mTypeObjid t
TypeDef object representation.
Definition: co_cdh.h:344
Pack name.
Definition: co_cdh.h:404
Type for representations of reference identity.
Definition: co_cdh.h:349
cdh_mRid r
Intern representation.
Definition: co_cdh.h:351
pwr_tRid pwr
Extern representation.
Definition: co_cdh.h:350
Type for representation of type identity.
Definition: co_cdh.h:356
cdh_mCid c
Class identity representation.
Definition: co_cdh.h:358
cdh_mTid t
Type identity representation.
Definition: co_cdh.h:359
pwr_tCid pwr
Extern representation.
Definition: co_cdh.h:357
Type for representation of volume identity.
Definition: co_cdh.h:364
cdh_mVid v
Intern representation.
Definition: co_cdh.h:366
pwr_tVid pwr
Extern representation.
Definition: co_cdh.h:365