ProviewR Programmer's Reference Manual  V6.1.4
Functions

Functions

int cdh_ObjidCompare (pwr_tOid Object_1, pwr_tOid Object_2)
 Compare two object identities. More...
 
int cdh_ObjidIsEqual (pwr_tOid Object_1, pwr_tOid Object_2)
 Test if two object identities are equal. More...
 
int cdh_ObjidIsNotEqual (pwr_tOid Object_1, pwr_tOid Object_2)
 Test if two object identities are different. More...
 
int cdh_ObjidIsNull (pwr_tOid Object)
 Test if object identity is null. More...
 
int cdh_ObjidIsNotNull (pwr_tOid Object)
 Test if object identity is not null. More...
 
pwr_tCid cdh_ClassObjidToId (pwr_tOid Object)
 Convert Objid to ClassId. More...
 
pwr_tOid cdh_ClassIdToObjid (pwr_tCid Class)
 Convert ClassId to Objid. More...
 
pwr_tTid cdh_TypeObjidToId (pwr_tOid Object)
 Convert Objid to TypeId. More...
 
int cdh_TypeIdToIndex (pwr_tTid Type)
 Convert TypeId to index.
 
pwr_tOid cdh_TypeIdToObjid (pwr_tTid Type)
 Convert TypeId to Objid.
 
pwr_sAttrRef cdh_ObjidToAref (pwr_tObjid Objid)
 Converts an objid to an attrref.
 
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_StringToAttrValue (pwr_eType Type, const char *String, void *Value)
 
void cdh_MaskToBinaryString (unsigned int mask, int noofbits, char *str)
 
pwr_tStatus cdh_StringToClassId (const char *s, pwr_tCid *cid)
 Convert ClassId string to id. More...
 
pwr_tStatus cdh_StringToTypeId (const char *s, pwr_tTid *tid)
 Convert TypeId string to id. More...
 
pwr_tStatus cdh_StringToVolumeId (const char *s, pwr_tVid *tid)
 Convert VolumeId string to id. More...
 
pwr_tStatus cdh_StringToObjectIx (const char *s, pwr_tOix *oix)
 Converts ObjectIx string to index. More...
 
pwr_tStatus cdh_StringToObjid (const char *s, pwr_tOid *oid)
 Convert Objid string to id. More...
 
pwr_tStatus cdh_StringToAref (const char *s, pwr_tAttrRef *aref)
 Convert AttrRef string to id. More...
 
void cdh_ClassIdToString (char *s, int size, pwr_tCid cid, int prefix)
 Converts a class identifier, 'cid' to a string. More...
 
void cdh_ObjectIxToString (char *s, int size, pwr_tOix oix, int prefix)
 Converts a object index, 'oix' to a string. More...
 
void cdh_OidToString (char *s, int size, pwr_tOid oid, int prefix)
 Converts a object identifier, 'oid' to a string. More...
 
char * cdh_ObjidToString (pwr_tOid oid, int prefix)
 Converts a object identifier, 'oid' to a string. More...
 
char * cdh_ObjidToFnString (char *s, pwr_tOid oid)
 Converts a object identifier, 'oid' to a filename string. More...
 
void cdh_ArefToString (char *s, int size, pwr_sAttrRef *aref, int prefix)
 Converts an attribute reference , 'aref' to a string. More...
 
char * cdh_AttrRefToString (pwr_sAttrRef *aref, int prefix)
 Converts an attribute reference , 'aref' to a string. More...
 
char * cdh_NodeIdToString (char *s, pwr_tNid nid, int prefix, int suffix)
 Converts a volume identifier, 'vid' to a string. More...
 
void cdh_TypeIdToString (char *s, int size, pwr_tTid tid, int prefix)
 Converts a type identifier, 'tid' to a string. More...
 
char * cdh_VolumeIdToString (char *s, int size, pwr_tVid vid, int prefix, int suffix)
 Converts a volume identifier, 'vid' to a string. More...
 
char * cdh_VolumeIdToFnString (char *s, int size, pwr_tVolumeId vid)
 Converts a volume identifier, 'vid' to a filename string. More...
 
void cdh_SubidToString (char *s, int size, pwr_tSubid sid, int prefix)
 Converts a subscription identifier, 'sid' to a string. More...
 
void cdh_DlidToString (char *s, int size, pwr_tDlid did, int prefix)
 Converts a direct link identifier, 'did' to a string. More...
 
char * cdh_Low (const char *s)
 Convert string to lower case. More...
 
char * cdh_OpSysToStr (pwr_mOpSys opsys)
 Convert operating system to string. More...
 
char * cdh_OpSysToDirStr (pwr_mOpSys opsys)
 Convert operating system to directory string. More...
 
char * cdh_StringToObjectName (char *t, const char *s)
 Convert string to valid object name. More...
 
pwr_tStatus cdh_NextObjectName (char *t, const char *s)
 Create an similar objectname from another object name. More...
 
void cdh_CutNameSegments (char *outname, char *name, int segments)
 Cut the leading segments of an object name. More...
 
pwr_tUInt32 cdh_AttrSize (pwr_sParInfo *info)
 Get attribute size. More...
 
pwr_tUInt32 cdh_AttrElemSize (pwr_sParInfo *info)
 Get attribute array element size. More...
 

Detailed Description

Function Documentation

◆ cdh_ArefToString()

void cdh_ArefToString ( char *  s,
int  size,
pwr_sAttrRef aref,
int  prefix 
)

Converts an attribute reference , 'aref' to a string.

The output string will be in the format:

0.1.2.3:1234(_T0.34.1)[34.60]

If 'prefix' is not zero, a '_A' prefix will be included in the resultant string.

Definition at line 1231 of file co_cdh.c.

References pwr_sAttrRef::Body, cdh_OidToString(), and pwr_sAttrRef::Objid.

Referenced by cdh_AttrRefToString().

◆ cdh_AttrElemSize()

pwr_tUInt32 cdh_AttrElemSize ( pwr_sParInfo *  info)

Get attribute array element size.

Get the array elements size of an array attribut from parinfo.

Definition at line 2786 of file co_cdh.c.

References cdh_AttrSize().

◆ cdh_AttrRefToString()

char* cdh_AttrRefToString ( pwr_sAttrRef aref,
int  prefix 
)

Converts an attribute reference , 'aref' to a string.

The output string will be in the format:

0.1.2.3:1234(_T0.34.1)[34.60]

If 'prefix' is not zero, a '_A' prefix will be included in the resultant string.

Returns the string,

Not threadsafe.

Definition at line 1266 of file co_cdh.c.

References cdh_ArefToString().

◆ cdh_AttrSize()

pwr_tUInt32 cdh_AttrSize ( pwr_sParInfo *  info)

Get attribute size.

Get the attribute size from parinfo.

Definition at line 2773 of file co_cdh.c.

Referenced by cdh_AttrElemSize().

◆ cdh_ClassIdToObjid()

pwr_tOid cdh_ClassIdToObjid ( pwr_tClassId  Class)

Convert ClassId to Objid.

Parameters
ClassClassId
Returns
Objid for $ClassDef object of class.

Definition at line 249 of file co_cdh.c.

References cdh_uOid::c, cdh_uTid::c, cdh_uOid::pwr, and cdh_uTid::pwr.

◆ cdh_ClassIdToString()

void cdh_ClassIdToString ( char *  s,
int  size,
pwr_tClassId  cid,
int  prefix 
)

Converts a class identifier, 'cid' to a string.

The output string will be in the format:

0.1:34 where 0.1 is the volume identifier and 34 is the class index within that volume.

If 's' is non null the resultant string will be catenated to 's', otherwise the resultant string will be returned.

If 'prefix' is not zero, a '_C' prefix will be included in the resultant string.

Definition at line 1151 of file co_cdh.c.

References cdh_uTid::c, and cdh_uTid::pwr.

◆ cdh_ClassObjidToId()

pwr_tCid cdh_ClassObjidToId ( pwr_tObjid  Objid)

Convert Objid to ClassId.

Parameters
ObjidObjid of $ClassDef object for class.
Returns
ClassId.

Definition at line 227 of file co_cdh.c.

References cdh_uOid::c, cdh_uTid::c, cdh_uOid::pwr, and cdh_uTid::pwr.

◆ cdh_CutNameSegments()

void cdh_CutNameSegments ( char *  outname,
char *  name,
int  segments 
)

Cut the leading segments of an object name.

Cut the leading segments of the name, and return the specified number of segments.

Parameters
outnameOut string.
nameIn string.
segmentsNumber of segments to return.

Definition at line 2740 of file co_cdh.c.

◆ cdh_DlidToString()

void cdh_DlidToString ( char *  s,
int  size,
pwr_tDlid  did,
int  prefix 
)

Converts a direct link identifier, 'did' to a string.

The output string will be in the format:

0.1.2.3:1234

If 'prefix' is not zero, a '_D' prefix will be included in the resultant string.

Definition at line 1470 of file co_cdh.c.

References cdh_uRid::pwr, and cdh_uRid::r.

◆ cdh_Low()

char* cdh_Low ( const char *  s)

Convert string to lower case.

Returns a pointer to a static string.

NOTE! The function should only be called once in one expression.

Definition at line 2326 of file co_cdh.c.

◆ cdh_MaskToBinaryString()

void cdh_MaskToBinaryString ( unsigned int  mask,
int  noofbits,
char *  str 
)

Converts a bitmask to a binary string. Sizes of str should be larger than noofbits.

Definition at line 734 of file co_cdh.c.

◆ cdh_NextObjectName()

pwr_tStatus cdh_NextObjectName ( char *  t,
const char *  s 
)

Create an similar objectname from another object name.

Converts an object name consisting of a number at the end of the name, The number is incremented by 1 in the new name. If no number is found error status is returned.

Parameters
tOut string.
sIn string.
Returns
Status.

Definition at line 2702 of file co_cdh.c.

◆ cdh_NodeIdToString()

char* cdh_NodeIdToString ( char *  s,
pwr_tNodeId  nid,
int  prefix,
int  suffix 
)

Converts a volume identifier, 'vid' to a string.

The output string will be in the format:

0.1.2.3

If 's' is non null the resultant string will be catenated to 's', otherwise the resultant string will be returned.

If 'prefix' is not zero, a '_N' prefix will be included in the resultant string.

If 'suffix' is not zero, a ':' suffix will be included in the resultant string.

Definition at line 1290 of file co_cdh.c.

References cdh_uVid::pwr, and cdh_uVid::v.

◆ cdh_ObjectIxToString()

void cdh_ObjectIxToString ( char *  s,
int  size,
pwr_tObjectIx  oix,
int  prefix 
)

Converts a object index, 'oix' to a string.

The output string will be in the format:

1234

If 's' is non null the resultant string will be catenated to 's', otherwise the resultant string will be returned.

If 'prefix' is not zero, a '_X' prefix will be included in the resultant string.

Definition at line 1216 of file co_cdh.c.

◆ cdh_ObjidCompare()

int cdh_ObjidCompare ( pwr_tObjid  Objid_1,
pwr_tObjid  Objid_2 
)

Compare two object identities.

  • return <0 if Object_1 < Object_2.
  • return 0 if Object_1 == Object_2.
  • return >0 if Object_1 > Object_2.

Definition at line 67 of file co_cdh.c.

◆ cdh_ObjidIsEqual()

int cdh_ObjidIsEqual ( pwr_tObjid  Objid_1,
pwr_tObjid  Objid_2 
)

Test if two object identities are equal.

  • return 1 if Object_1 == Object_2
  • return 0 if Object_1 != Object_2.

Definition at line 88 of file co_cdh.c.

◆ cdh_ObjidIsNotEqual()

int cdh_ObjidIsNotEqual ( pwr_tObjid  Objid_1,
pwr_tObjid  Objid_2 
)

Test if two object identities are different.

  • return 1 if Object_1 != Object_2
  • return 0 if Object_1 == Object_2.

Definition at line 99 of file co_cdh.c.

◆ cdh_ObjidIsNotNull()

int cdh_ObjidIsNotNull ( pwr_tObjid  Objid)

Test if object identity is not null.

  • return 1 if Object_1 != pwr_cNObjid
  • return 0 if Object_1 == pwr_cNObjid.

Definition at line 121 of file co_cdh.c.

◆ cdh_ObjidIsNull()

int cdh_ObjidIsNull ( pwr_tObjid  Objid)

Test if object identity is null.

  • return 1 if Object_1 == pwr_cNObjid
  • return 0 if Object_1 != pwr_cNObjid.

Definition at line 110 of file co_cdh.c.

Referenced by gdh_DeleteObject(), gdh_DeleteObjectTree(), and gdh_MoveObject().

◆ cdh_ObjidToFnString()

char* cdh_ObjidToFnString ( char *  s,
pwr_tOid  oid 
)

Converts a object identifier, 'oid' to a filename string.

The output string will be in the format:

xxx_xxx_xxx_xxx_yyyyyyyy

where xxx are the volume id in decimal form and yyyyyyyy the object index in hex form.

If 's' is non null the resultant string will be catenated to 's', otherwise the resultant string will be returned.

Not threadsafe.

Definition at line 1367 of file co_cdh.c.

References cdh_uOid::o, cdh_uOid::pwr, and cdh_mOid::vid_3.

◆ cdh_ObjidToString()

char* cdh_ObjidToString ( pwr_tObjid  oid,
int  prefix 
)

Converts a object identifier, 'oid' to a string.

The output string will be in the format:

0.1.2.3:1234

If 'prefix' is not zero, a '_O' prefix will be included in the resultant string.

Returns the string.

Not threadsafe.

Definition at line 1340 of file co_cdh.c.

References cdh_uOid::o, cdh_uOid::pwr, and cdh_mOid::vid_3.

◆ cdh_OidToString()

void cdh_OidToString ( char *  s,
int  size,
pwr_tObjid  oid,
int  prefix 
)

Converts a object identifier, 'oid' to a string.

The output string will be in the format:

0.1.2.3:1234

If 'prefix' is not zero, a '_O' prefix will be included in the resultant string.

Definition at line 1316 of file co_cdh.c.

References cdh_uOid::o, cdh_uOid::pwr, and cdh_mOid::vid_3.

Referenced by cdh_ArefToString().

◆ cdh_OpSysToDirStr()

char* cdh_OpSysToDirStr ( pwr_mOpSys  opsys)

Convert operating system to directory string.

For example pwr_mOpSys_X86_LINUX will be converted to "os_linux/hw_x86". A pointer to a static string is returned.

Parameters
opsysOperating system.
Returns
String

Definition at line 2387 of file co_cdh.c.

◆ cdh_OpSysToStr()

char* cdh_OpSysToStr ( pwr_mOpSys  opsys)

Convert operating system to string.

For example pwr_mOpSys_X86_LINUX will be converted to "x86_linux". A pointer to a static string is returned.

Parameters
opsysOperating system.
Returns
String

Definition at line 2341 of file co_cdh.c.

◆ cdh_StringToAref()

pwr_tStatus cdh_StringToAref ( const char *  s,
pwr_tAttrRef aref 
)

Convert AttrRef string to id.

Convert a string of format "_A1.2.3.4:34(_T44.33:0.5.1)[760.4]" ('_A' is optional), where 1.2.3.4 is the volume id and 34 is the object index, _T44.33:0.5.1 is the body typeid, 760 the offset and 4 the size.

Parameters
sString.
arefAttribute reference.
Returns
Status of the operation. CDH__SUCCESS or CDH__INVCID.

Definition at line 850 of file co_cdh.c.

◆ cdh_StringToAttrValue()

pwr_tStatus cdh_StringToAttrValue ( pwr_eType  Type,
const char *  String,
void *  Value 
)

Converts an attribute value given as a text string, to internal binary format.

Definition at line 465 of file co_cdh.c.

◆ cdh_StringToClassId()

pwr_tStatus cdh_StringToClassId ( const char *  s,
pwr_tClassId cid 
)

Convert ClassId string to id.

Convert a string of format "_C1.2:34" to id ('_C' is optional), where 1.2 is the volume identity and 34 the class index.

Parameters
sString.
cidClassId.
Returns
Status of the operation. CDH__SUCCESS or CDH__INVCID.

Definition at line 759 of file co_cdh.c.

◆ cdh_StringToObjectIx()

pwr_tStatus cdh_StringToObjectIx ( const char *  s,
pwr_tObjectIx oix 
)

Converts ObjectIx string to index.

Converts string of format "_Xoix" to index ("_X" is optional) where oix is object index.

Parameters
sString.
oixObjectIx.
Returns
Status of the operation. CDH__SUCCESS or CDH__INVOIX.

Definition at line 1042 of file co_cdh.c.

◆ cdh_StringToObjectName()

char* cdh_StringToObjectName ( char *  t,
const char *  s 
)

Convert string to valid object name.

Invalid characters in the string are replaced by '_'. If the first char is invalid it is replaced by 'O'.

Parameters
tOut string.
sIn string.
Returns
Returns t.

Definition at line 2658 of file co_cdh.c.

◆ cdh_StringToObjid()

pwr_tStatus cdh_StringToObjid ( const char *  s,
pwr_tObjid oid 
)

Convert Objid string to id.

Convert a string of format "_O1.2.3.4:34" ('_O' is optional), where 1.2.3.4 is the volume id and 34 is the object index. Strings beginning with "_A" are also accepted.

Parameters
sString.
oidObjid.
Returns
Status of the operation. CDH__SUCCESS or CDH__INVCID.

Definition at line 800 of file co_cdh.c.

◆ cdh_StringToTypeId()

pwr_tStatus cdh_StringToTypeId ( const char *  s,
pwr_tTypeId tid 
)

Convert TypeId string to id.

Convert a string of format "_T1.2:bit.tyg.tix" to id ("_T" is optional).

Parameters
sString.
tidTypeId.
Returns
Status of the operation. CDH__SUCCESS or CDH__INVTID.

Definition at line 937 of file co_cdh.c.

◆ cdh_StringToVolumeId()

pwr_tStatus cdh_StringToVolumeId ( const char *  s,
pwr_tVolumeId vid 
)

Convert VolumeId string to id.

Convert a string of format "_V1.2.3.4" to id ("_V" is optional). Strings beginning with "_O" and "_A" are also accepted.

Parameters
sString.
vidVolume id.
Returns
Status of the operation. CDH__SUCCESS or CDH__INVTID.

Definition at line 995 of file co_cdh.c.

◆ cdh_SubidToString()

void cdh_SubidToString ( char *  s,
int  size,
pwr_tSubid  sid,
int  prefix 
)

Converts a subscription identifier, 'sid' to a string.

The output string will be in the format:

0.1.2.3:1234

If 'prefix' is not zero, a '_S' prefix will be included in the resultant string.

Definition at line 1450 of file co_cdh.c.

References cdh_uRid::pwr, and cdh_uRid::r.

◆ cdh_TypeIdToString()

void cdh_TypeIdToString ( char *  s,
int  size,
pwr_tTypeId  tid,
int  prefix 
)

Converts a type identifier, 'tid' to a string.

The output string will be in the format:

0.1:0.34.1 where 0.1 is the volume identifier and 0.34.1 is the RtBody of class 34 in that volume.

or

0.1:1.0.3 where 0.1 is the volume identifier and 1.0.3 is the simple type with index 3 in that volume.

If 's' is non null the resultant string will be catenated to 's', otherwise the resultant string will be returned.

If 'prefix' is not zero, a '_T' prefix will be included in the resultant string.

Definition at line 1188 of file co_cdh.c.

References cdh_uTid::c, cdh_uTid::pwr, and cdh_uTid::t.

◆ cdh_TypeObjidToId()

pwr_tTid cdh_TypeObjidToId ( pwr_tObjid  Objid)

Convert Objid to TypeId.

Parameters
ObjidObjid for $TypeDef object of type.
Returns
TypeId.

Definition at line 275 of file co_cdh.c.

References cdh_uOid::c, cdh_uTid::c, cdh_uOid::pwr, cdh_uTid::pwr, cdh_uOid::t, and cdh_uTid::t.

◆ cdh_VolumeIdToFnString()

char* cdh_VolumeIdToFnString ( char *  s,
int  size,
pwr_tVolumeId  vid 
)

Converts a volume identifier, 'vid' to a filename string.

The output string will be in the format:

xxx_xxx_xxx_xxx

where xxx are the volume id in decimal form.

Definition at line 1428 of file co_cdh.c.

References cdh_uVid::pwr, and cdh_uVid::v.

◆ cdh_VolumeIdToString()

char* cdh_VolumeIdToString ( char *  s,
int  size,
pwr_tVolumeId  vid,
int  prefix,
int  suffix 
)

Converts a volume identifier, 'vid' to a string.

The output string will be in the format:

0.1.2.3

If 's' is non null the resultant string will be catenated to 's', otherwise the resultant string will be returned.

If 'prefix' is not zero, a '_V' prefix will be included in the resultant string.

If 'suffix' is not zero, a ':' suffix will be included in the resultant string.

Not threadsafe if 's' is null.

Definition at line 1401 of file co_cdh.c.

References cdh_uVid::pwr, and cdh_uVid::v.