46 #include "pwr_class.h"
66 #define cdh_cMaxVidGroup 255
67 #define cdh_cMaxCix 4095
69 #define cdh_cMaxTix 2047
71 #define cdh_cMaxOix UINT_MAX
75 cdh_eVid3_subid = 128,
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)
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)
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)
142 #define cdh_isClassVolumeClass(Cid) \
143 ((Cid) == pwr_eClass_ClassVolume || (Cid) == pwr_eClass_DetachedClassVolume)
147 unsigned int oix : 32;
149 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
152 unsigned int vid_2 : 8;
153 unsigned int vid_1 : 8;
154 unsigned int vid_0 : 8;
156 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
158 unsigned int vid_0 : 8;
159 unsigned int vid_1 : 8;
160 unsigned int vid_2 : 8;
161 unsigned int vid_3 : 8;
169 unsigned int rix : 32;
171 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
173 unsigned int vid_3 : 8;
174 unsigned int vid_2 : 8;
175 unsigned int vid_1 : 8;
176 unsigned int vid_0 : 8;
178 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
180 unsigned int vid_0 : 8;
181 unsigned int vid_1 : 8;
182 unsigned int vid_2 : 8;
183 unsigned int vid_3 : 8;
191 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
193 unsigned int vid_3 : 8;
194 unsigned int vid_2 : 8;
195 unsigned int vid_1 : 8;
196 unsigned int vid_0 : 8;
198 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
200 unsigned int vid_0 : 8;
201 unsigned int vid_1 : 8;
202 unsigned int vid_2 : 8;
203 unsigned int vid_3 : 8;
211 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
213 unsigned int nid_3 : 8;
214 unsigned int nid_2 : 8;
215 unsigned int nid_1 : 8;
216 unsigned int nid_0 : 8;
218 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
220 unsigned int nid_0 : 8;
221 unsigned int nid_1 : 8;
222 unsigned int nid_2 : 8;
223 unsigned int nid_3 : 8;
231 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
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;
239 unsigned int vid_3 : 8;
240 unsigned int vid_2 : 8;
241 unsigned int vid_1 : 8;
242 unsigned int vid_0 : 8;
244 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
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;
252 unsigned int vid_0 : 8;
253 unsigned int vid_1 : 8;
254 unsigned int vid_2 : 8;
255 unsigned int vid_3 : 8;
262 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
264 unsigned int vid_1 : 8;
265 unsigned int vid_0 : 8;
267 unsigned int must_be_zero : 1;
268 unsigned int cix : 12;
269 unsigned int bix : 3;
271 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
273 unsigned int bix : 3;
274 unsigned int cix : 12;
275 unsigned int must_be_zero : 1;
277 unsigned int vid_0 : 8;
278 unsigned int vid_1 : 8;
286 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
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;
294 unsigned int vid_3 : 8;
295 unsigned int vid_2 : 8;
296 unsigned int vid_1 : 8;
297 unsigned int vid_0 : 8;
299 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
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;
307 unsigned int vid_0 : 8;
308 unsigned int vid_1 : 8;
309 unsigned int vid_2 : 8;
310 unsigned int vid_3 : 8;
317 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
319 unsigned int vid_1 : 8;
320 unsigned int vid_0 : 8;
322 unsigned int must_be_one : 1;
323 unsigned int tyg : 4;
324 unsigned int tix : 11;
326 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
328 unsigned int tix : 11;
329 unsigned int tyg : 4;
330 unsigned int must_be_one : 1;
332 unsigned int vid_0 : 8;
333 unsigned int vid_1 : 8;
408 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
415 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
443 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
449 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
459 #define cdh_mParseName__ 0
460 #define cdh_mParseName_ascii_7 pwr_Bit(0)
461 #define cdh_mParseName_ (~cdh_mParseName__)
570 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
592 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
618 #if (pwr_dHost_byteOrder == pwr_dBigEndian)
624 #elif (pwr_dHost_byteOrder == pwr_dLittleEndian)
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__)
650 #define cdh_mName_eForm_std 1
651 #define cdh_mName_eForm_root 2
652 #define cdh_mName_eForm_id 3
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)
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
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)
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)
732 int cdh_SubidIsNotNull(
pwr_tSubid Subscription);
750 int cdh_DlidIsNull(
pwr_tDlid DirectLink);
752 int cdh_DlidIsNotNull(
pwr_tDlid DirectLink);
756 int cdh_IsClassVolume(
pwr_tVid vid);
771 pwr_eType Type,
void* Value,
char* String,
int MaxSize);
774 pwr_eType Type,
const char* String,
void* Value);
813 char* s,
int size,
pwr_tVid vid,
int prefix,
int suffix);
842 void cdh_SuppressSuper(
char* out,
char* in);
844 void cdh_SuppressSuperAll(
char* out,
char* in);
846 int cdh_TypeToMaxStrSize(pwr_eType type,
int attr_size,
int attr_elements);
848 int cdh_TypeToSize(pwr_eType type);
cdh_mCid cdh_mClassId
Internal representation of class identity.
cdh_mRid cdh_mRefId
Internal representation of reference identity.
cdh_uOid cdh_uObjid
Type for representations of object identity.
cdh_uTid cdh_uTypeId
Type for representation of type identity.
cdh_mOid cdh_mObjid
Internal representation of object identity.
cdh_mVid cdh_mVolumeId
Internal representation of volume identity.
cdh_uVid cdh_uVolumeId
Type for represenation of volume identity.
cdh_mTid cdh_mTypeId
Internal representation of type identity.
cdh_uRid cdh_uRefId
Type for representation of reference identity.
cdh_eId
Enumeration for identities.
cdh_uNid cdh_uNodeId
Type for representation of node idenity.
cdh_mNid cdh_mNodeId
Internal representation of node identity.
@ cdh_eId_objid
Object identity.
@ cdh_eId_objectIx
Object index.
@ cdh_eId_typeId
Type identity.
@ cdh_eId_volumeId
Volume identity.
@ cdh_eId_classId
Class identity.
@ cdh_eId_dlid
Direct link identity.
@ cdh_eId_aref
Attribute reference.
@ cdh_eId_subid
Subscription identity.
char * cdh_VolumeIdToString(char *s, int size, pwr_tVid vid, int prefix, int suffix)
Converts a volume identifier, 'vid' to a string.
void cdh_DlidToString(char *s, int size, pwr_tDlid did, int prefix)
Converts a direct link identifier, 'did' to a string.
int cdh_ObjidIsNull(pwr_tOid Object)
Test if object identity is null.
char * cdh_ObjidToFnString(char *s, pwr_tOid oid)
Converts a object identifier, 'oid' to a filename string.
pwr_tStatus cdh_StringToAref(const char *s, pwr_tAttrRef *aref)
Convert AttrRef string to id.
void cdh_ObjectIxToString(char *s, int size, pwr_tOix oix, int prefix)
Converts a object index, 'oix' to a string.
char * cdh_AttrRefToString(pwr_sAttrRef *aref, int prefix)
Converts an attribute reference , 'aref' to a string.
int cdh_ObjidIsNotNull(pwr_tOid Object)
Test if object identity is not null.
char * cdh_VolumeIdToFnString(char *s, int size, pwr_tVolumeId vid)
Converts a volume identifier, 'vid' to a filename string.
pwr_tStatus cdh_StringToObjid(const char *s, pwr_tOid *oid)
Convert Objid string to id.
char * cdh_OpSysToDirStr(pwr_mOpSys opsys)
Convert operating system to directory string.
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.
pwr_tStatus cdh_StringToClassId(const char *s, pwr_tCid *cid)
Convert ClassId string to id.
void cdh_CutNameSegments(char *outname, char *name, int segments)
Cut the leading segments of an object name.
char * cdh_Low(const char *s)
Convert string to lower case.
char * cdh_StringToObjectName(char *t, const char *s)
Convert string to valid object name.
pwr_tStatus cdh_StringToVolumeId(const char *s, pwr_tVid *tid)
Convert VolumeId string to id.
void cdh_SubidToString(char *s, int size, pwr_tSubid sid, int prefix)
Converts a subscription identifier, 'sid' to a string.
pwr_tUInt32 cdh_AttrElemSize(pwr_sParInfo *info)
Get attribute array element size.
void cdh_MaskToBinaryString(unsigned int mask, int noofbits, char *str)
pwr_tStatus cdh_StringToObjectIx(const char *s, pwr_tOix *oix)
Converts ObjectIx string to index.
void cdh_TypeIdToString(char *s, int size, pwr_tTid tid, int prefix)
Converts a type identifier, 'tid' to a string.
void cdh_OidToString(char *s, int size, pwr_tOid oid, int prefix)
Converts a object identifier, 'oid' to a string.
void cdh_ClassIdToString(char *s, int size, pwr_tCid cid, int prefix)
Converts a class identifier, 'cid' to a string.
pwr_tCid cdh_ClassObjidToId(pwr_tOid Object)
Convert Objid to ClassId.
pwr_tStatus cdh_NextObjectName(char *t, const char *s)
Create an similar objectname from another object name.
pwr_tOid cdh_ClassIdToObjid(pwr_tCid Class)
Convert ClassId to Objid.
pwr_tTid cdh_TypeObjidToId(pwr_tOid Object)
Convert Objid to TypeId.
int cdh_ObjidCompare(pwr_tOid Object_1, pwr_tOid Object_2)
Compare two object identities.
pwr_tStatus cdh_StringToAttrValue(pwr_eType Type, const char *String, void *Value)
int cdh_ObjidIsEqual(pwr_tOid Object_1, pwr_tOid Object_2)
Test if two object identities are equal.
void cdh_ArefToString(char *s, int size, pwr_sAttrRef *aref, int prefix)
Converts an attribute reference , 'aref' to a string.
int cdh_ObjidIsNotEqual(pwr_tOid Object_1, pwr_tOid Object_2)
Test if two object identities are different.
char * cdh_OpSysToStr(pwr_mOpSys opsys)
Convert operating system to string.
pwr_sAttrRef cdh_ObjidToAref(pwr_tObjid Objid)
Converts an objid to an attrref.
pwr_tOid cdh_TypeIdToObjid(pwr_tTid Type)
Convert TypeId to Objid.
pwr_tStatus cdh_StringToTypeId(const char *s, pwr_tTid *tid)
Convert TypeId string to id.
int cdh_TypeIdToIndex(pwr_tTid Type)
Convert TypeId to index.
char * cdh_NodeIdToString(char *s, pwr_tNid nid, int prefix, int suffix)
Converts a volume identifier, 'vid' to a string.
char * cdh_ObjidToString(pwr_tOid oid, int prefix)
Converts a object identifier, 'oid' to a string.
pwr_tUInt32 cdh_AttrSize(pwr_sParInfo *info)
Get attribute size.
unsigned int pwr_tUInt32
32-bit unsigned integer type.
unsigned int pwr_tVid
Volume identity type.
unsigned int pwr_tBitMask
Bitmask type.
unsigned int pwr_tOix
Object index type.
unsigned int pwr_tBoolean
Boolean type.
pwr_tRid pwr_tSubid
Subscription identity type.
unsigned int pwr_tCid
Class identity type.
unsigned int pwr_tBit
Bit type.
unsigned char pwr_tUInt8
8-bit unsigned integer type.
int pwr_tStatus
Status type.
pwr_tVid pwr_tVolumeId
Volume identity type.
pwr_tRid pwr_tDlid
Direct link identity type.
pwr_tRid pwr_tRefId
Reference identity type.
unsigned int pwr_tTid
Type identity type.
pwr_tVolumeId pwr_tNid
Node identity type.
unsigned short pwr_tUInt16
16-bit unsigned integer type.
char pwr_tObjName[31+1]
Object name type.
Internal represention of class identity.
Internal representation of $ClassDef object identity.
Internal representation of node identity.
Internal representatin of object identity.
unsigned int vid_3
Object index.
Internal representation of reference identity.
Internal representation of type identity.
Internal representation of $TypeDef object identity.
Internal representations of volume identity.
Name string format description.
Type for representation of node identity.
pwr_tNid pwr
Extern representation.
cdh_mNid n
Intern representation.
Type for representions of object identity.
cdh_mClassObjid c
ClassDef object representation.
cdh_mObjid o
Common object representation.
pwr_tOid pwr
Extern representation.
cdh_mTypeObjid t
TypeDef object representation.
Type for representations of reference identity.
cdh_mRid r
Intern representation.
pwr_tRid pwr
Extern representation.
Type for representation of type identity.
cdh_mCid c
Class identity representation.
cdh_mTid t
Type identity representation.
pwr_tCid pwr
Extern representation.
Type for representation of volume identity.
cdh_mVid v
Intern representation.
pwr_tVid pwr
Extern representation.