Commit 273af6ca authored by claes's avatar claes

Modifications for Programmer's Referens Manual

parent a6976a2b
......@@ -24,6 +24,13 @@
# include <time.h>
#endif
/*! \file pwr.h
\brief Basic type definitions.
This include file contains the Proview basic type definitions.
*/
/*! \addtogroup Pwr */
/*@{*/
#ifdef VAXC
# define pwr_dExport globaldef
# define pwr_dImport globalref
......@@ -76,43 +83,46 @@
#define pwr_cSizPathName 63
#define pwr_cSizFullName 79
typedef void *pwr_tAddress;
typedef unsigned int pwr_tBit;
typedef unsigned int pwr_tBitMask;
typedef unsigned int pwr_tBoolean;
typedef float pwr_tFloat32;
typedef double pwr_tFloat64;
typedef void *pwr_tAddress; //!< Generic pointer type.
typedef unsigned int pwr_tBit; //!< Bit type.
typedef unsigned int pwr_tBitMask; //!< Bitmask type.
typedef unsigned int pwr_tBoolean; //!< Boolean type.
typedef float pwr_tFloat32; //!< 32-bit float.
typedef double pwr_tFloat64; //!< 64-big float.
typedef unsigned int pwr_tGeneration;
typedef char pwr_tChar;
typedef char pwr_tString[];
typedef char pwr_tText[];
typedef char pwr_tInt8;
typedef short pwr_tInt16;
typedef int pwr_tInt32;
typedef int pwr_tStatus;
typedef char pwr_tChar; //!< Character type.
typedef char pwr_tString[]; //!< String type.
typedef char pwr_tText[]; //!< Text type.
typedef char pwr_tInt8; //!< 8-bit integer type.
typedef short pwr_tInt16; //!< 16-bit integer type.
typedef int pwr_tInt32; //!< 32-bit integer type.
typedef int pwr_tStatus; //!< Status type.
//! 64-bit integer type.
typedef struct {
unsigned int low;
int high;
} pwr_tInt64;
//! 64-bit unsigned integer type.
typedef struct {
unsigned int low;
unsigned int high;
} pwr_tUInt64;
typedef unsigned char pwr_tUInt8;
typedef unsigned short pwr_tUInt16;
typedef unsigned int pwr_tUInt32;
typedef unsigned int pwr_tVid;
typedef pwr_tVid pwr_tVolumeId;
typedef unsigned int pwr_tAix;
typedef unsigned int pwr_tOix;
typedef pwr_tOix pwr_tObjectIx;
typedef unsigned int pwr_tMask;
typedef unsigned int pwr_tEnum;
typedef unsigned char pwr_tUInt8; //!< 8-bit unsigned integer type.
typedef unsigned short pwr_tUInt16; //!< 16-bit unsigned integer type.
typedef unsigned int pwr_tUInt32; //!< 32-bit unsigned integer type.
typedef unsigned int pwr_tVid; //!< Volume identity type.
typedef pwr_tVid pwr_tVolumeId; //!< Volume identity type.
typedef unsigned int pwr_tAix; //!< Attribute index type.
typedef unsigned int pwr_tOix; //!< Object index type.
typedef pwr_tOix pwr_tObjectIx; //!< Object index type.
typedef unsigned int pwr_tMask; //!< Mask type.
typedef unsigned int pwr_tEnum; //!< Enumeration type.
//! Body index enumeration.
typedef enum {
pwr_eBix__ = 0,
pwr_eBix_sys = 1,
......@@ -122,37 +132,40 @@ typedef enum {
pwr_eBix_
} pwr_eBix;
//! Object identity type.
typedef struct {
pwr_tOix oix;
pwr_tVid vid;
} pwr_tOid;
typedef pwr_tOid pwr_tObjid;
typedef pwr_tOid pwr_tObjid; //!< Object identity type.
typedef pwr_tOid pwr_tObjDId;
typedef unsigned int pwr_tCid;
typedef pwr_tCid pwr_tClassId;
typedef unsigned int pwr_tTid;
typedef pwr_tTid pwr_tTypeId;
typedef unsigned int pwr_tCid; //!< Class identity type.
typedef pwr_tCid pwr_tClassId; //!< Class identity type.
typedef unsigned int pwr_tTid; //!< Type identity type.
typedef pwr_tTid pwr_tTypeId; //!< Type identity type.
typedef unsigned int pwr_tBid;
typedef unsigned int pwr_tVersion;
typedef unsigned int pwr_tPwrVersion;
typedef unsigned int pwr_tProjVersion;
typedef unsigned int pwr_tUserId;
typedef unsigned int pwr_tDbId;
typedef pwr_tVolumeId pwr_tNid;
typedef pwr_tNid pwr_tNodeId;
typedef pwr_tNid pwr_tNodeIndex;
typedef pwr_tVolumeId pwr_tNid; //!< Node identity type.
typedef pwr_tNid pwr_tNodeId; //!< Node identity type.
typedef pwr_tNid pwr_tNodeIndex; //!< Node index type.
//! Reference identity type.
typedef struct {
pwr_tUInt32 rix;
pwr_tNid nid;
} pwr_tRid;
typedef pwr_tRid pwr_tRefId;
typedef pwr_tRid pwr_tDlid;
typedef pwr_tRid pwr_tSubid;
typedef pwr_tRid pwr_tRefId; //!< Reference identity type.
typedef pwr_tRid pwr_tDlid; //!< Direct link identity type.
typedef pwr_tRid pwr_tSubid; //!< Subscription identity type.
//! Vax time.
typedef struct {
int low;
int high;
......@@ -166,17 +179,20 @@ typedef struct {
} timespec_t;
#endif
typedef struct timespec pwr_tTime;
typedef struct timespec pwr_tTime; //!< Abolute time type.
//! Delta time type.
typedef struct {
int tv_sec;
int tv_nsec;
int tv_sec; //!< Seconds.
int tv_nsec; //!< Nano seconds.
} pwr_tDeltaTime;
//! Proview version type
typedef union {
pwr_tPwrVersion i;
//! Word representation
struct {
#if (pwr_dHost_byteOrder == pwr_dLittleEndian)
......@@ -196,27 +212,30 @@ typedef union {
} s;
} pwr_uPwrVersion;
typedef char pwr_tObjName [pwr_cSizObjName + 1];
typedef char pwr_tPgmName [pwr_cSizPgmName + 1];
typedef char pwr_tXRef [pwr_cSizXRef + 1];
typedef char pwr_tGraphName [pwr_cSizGraphName + 1];
typedef char pwr_tStructName [pwr_cSizStructName + 1];
typedef char pwr_tAttrName [pwr_cSizAttrName + 1];
typedef char pwr_tPathName [pwr_cSizPathName + 1];
typedef char pwr_tFullName [pwr_cSizFullName + 1];
typedef char pwr_tString256 [256];
typedef char pwr_tString132 [132];
typedef char pwr_tString80 [80];
typedef char pwr_tString40 [40];
typedef char pwr_tString32 [32];
typedef char pwr_tString16 [16];
typedef char pwr_tString8 [8];
typedef char pwr_tString1 [1];
typedef char pwr_tText1024 [1024];
typedef char pwr_tURL [160];
typedef char pwr_tObjName [pwr_cSizObjName + 1]; //!< Object name type.
typedef char pwr_tPgmName [pwr_cSizPgmName + 1]; //!< PgmName type.
typedef char pwr_tXRef [pwr_cSizXRef + 1]; //!< XRef type.
typedef char pwr_tGraphName [pwr_cSizGraphName + 1]; //!< GraphName type.
typedef char pwr_tStructName [pwr_cSizStructName + 1]; //!< StructName type.
typedef char pwr_tAttrName [pwr_cSizAttrName + 1]; //!< AttrName type.
typedef char pwr_tPathName [pwr_cSizPathName + 1]; //!< PathName type.
typedef char pwr_tFullName [pwr_cSizFullName + 1]; //!< FullName type.
typedef char pwr_tString256 [256]; //!< 256 byte string type.
typedef char pwr_tString132 [132]; //!< 132 byte string type.
typedef char pwr_tString80 [80]; //!< 80 byte string type.
typedef char pwr_tString40 [40]; //!< 40 byte string type.
typedef char pwr_tString32 [32]; //!< 32 byte string type.
typedef char pwr_tString16 [16]; //!< 16 byte string type.
typedef char pwr_tString8 [8]; //!< 8 byte string type.
typedef char pwr_tString1 [1]; //!< 1 byte string type.
typedef char pwr_tText1024 [1024]; //!< 1024 byte text type.
typedef char pwr_tURL [160]; //!< URL type.
//! Attribute reference flags type.
typedef union {
pwr_tBitMask m;
//! Bitmask representation.
struct {
#if (pwr_dHost_byteOrder == pwr_dLittleEndian)
......@@ -237,50 +256,56 @@ typedef union {
} pwr_mAttrRef;
//! Attribute reference.
typedef struct {
pwr_tOid Objid;
pwr_tCid Body;
pwr_tUInt32 Offset;
pwr_tUInt32 Size;
pwr_mAttrRef Flags;
pwr_tOid Objid; //!< Object identity.
pwr_tCid Body; //!< Class identity of body.
pwr_tUInt32 Offset; //!< Offset in body.
pwr_tUInt32 Size; //!< Attribute size.
pwr_mAttrRef Flags; //!< Attribute flags.
} pwr_sAttrRef;
//! Zero attribute reference constant.
#ifdef OS_ELN
static const pwr_sAttrRef pwr_cNAttrRef = {0, 0, 0, 0, 0};
#else
static const pwr_sAttrRef pwr_cNAttrRef = {{0, 0}, 0, 0, 0, {0}};
#endif
static const pwr_tOid pwr_cNOid = {0, 0};
static const pwr_tObjid pwr_cNObjid = {0, 0};
static const pwr_tDlid pwr_cNRefId = {0, 0};
#define pwr_cNSubid pwr_cNRefId
#define pwr_cNDlid pwr_cNRefId
static const pwr_tOix pwr_cNOix = 0;
static const pwr_tObjectIx pwr_cNObjectIx = 0;
static const pwr_tClassId pwr_cNClassId = 0;
static const pwr_tTypeId pwr_cNTypeId = 0;
static const pwr_tVolumeId pwr_cNVolumeId = 0;
static const pwr_tNodeId pwr_cNNodeId = 0;
static const pwr_tCid pwr_cNCid = 0;
static const pwr_tTid pwr_cNTid = 0;
static const pwr_tVid pwr_cNVid = 0;
static const pwr_tNid pwr_cNNid = 0;
static const pwr_tOid pwr_cNOid = {0, 0}; //!< Zero object identity constant.
static const pwr_tObjid pwr_cNObjid = {0, 0}; //!< Zero object identity constant.
static const pwr_tDlid pwr_cNRefId = {0, 0}; //!< Zero reference identity constant.
#define pwr_cNSubid pwr_cNRefId //!< Zero subscription identity constant.
#define pwr_cNDlid pwr_cNRefId //!< Zero direct link identity constant.
static const pwr_tOix pwr_cNOix = 0; //!< Zero object index constant.
static const pwr_tObjectIx pwr_cNObjectIx = 0; //!< Zero object index constant.
static const pwr_tClassId pwr_cNClassId = 0; //!< Zero class identity constant.
static const pwr_tTypeId pwr_cNTypeId = 0; //!< Zero type identity constant.
static const pwr_tVolumeId pwr_cNVolumeId = 0; //!< Zero volume identity constant.
static const pwr_tNodeId pwr_cNNodeId = 0; //!< Zero node identity constant.
static const pwr_tCid pwr_cNCid = 0; //!< Zero class identity constant.
static const pwr_tTid pwr_cNTid = 0; //!< Zero type identity constant.
static const pwr_tVid pwr_cNVid = 0; //!< Zero volume identity constant.
static const pwr_tNid pwr_cNNid = 0; //!< Zero node identity constant.
/* Gereral macro definitions */
#ifndef MIN
//! Return the smallest of two values
#define MIN(a,b) (((a)<(b))?(a):(b))
#endif
#ifndef MAX
//! Return the largest of two values
#define MAX(a,b) (((a)>(b))?(a):(b))
#endif
#ifndef ODD
//! Check if value is odd
#define ODD(a) (((int)(a) & 1) != 0)
#endif
#ifndef EVEN
//! Check if value is even
#define EVEN(a) (((int)(a) & 1) == 0)
#endif
......@@ -433,5 +458,8 @@ static const pwr_tNid pwr_cNNid = 0;
#a,__FILE__,__LINE__),exit(EXIT_FAILURE)))
#endif
/*@}*/
#endif
......@@ -37,6 +37,13 @@
#include "co_cdh.h"
#include "co_time.h"
/*! \file co_cdh.c
\brief Class definition handler.
Functions for class definitions.
*/
/*! \addtogroup Cdh */
/*@{*/
#ifdef OS_ELN
struct p1_ctx {
int p1$errno; /* UNIX-style error code */
......@@ -46,12 +53,12 @@ struct p1_ctx {
};
#endif
/* 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. */
//! 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.
*/
int
cdh_ObjidCompare (
......@@ -75,10 +82,11 @@ cdh_ObjidCompare (
}
/* Test if two object identities are equal.
return 1 if Object_1 == Object_2
return 0 if Object_1 != Object_2. */
//! Test if two object identities are equal.
/*!
- return 1 if Object_1 == Object_2
- return 0 if Object_1 != Object_2.
*/
int
cdh_ObjidIsEqual (
......@@ -90,10 +98,11 @@ cdh_ObjidIsEqual (
return (Objid_1.vid == Objid_2.vid) && (Objid_1.oix == Objid_2.oix);
}
/* Test if two object identities are different.
return 1 if Object_1 != Object_2
return 0 if Object_1 == Object_2. */
//! Test if two object identities are different.
/*!
- return 1 if Object_1 != Object_2
- return 0 if Object_1 == Object_2.
*/
int
cdh_ObjidIsNotEqual (
......@@ -106,10 +115,11 @@ cdh_ObjidIsNotEqual (
}
/* Test if object identity is null.
return 1 if Object_1 == pwr_cNObjid
return 0 if Object_1 != pwr_cNObjid. */
//! Test if object identity is null.
/*!
- return 1 if Object_1 == pwr_cNObjid
- return 0 if Object_1 != pwr_cNObjid.
*/
int
cdh_ObjidIsNull (
......@@ -120,10 +130,11 @@ cdh_ObjidIsNull (
}
/* Test if object identity is not null.
return 1 if Object_1 != pwr_cNObjid
return 0 if Object_1 == pwr_cNObjid. */
//! Test if object identity is not null.
/*!
- return 1 if Object_1 != pwr_cNObjid
- return 0 if Object_1 == pwr_cNObjid.
*/
int
cdh_ObjidIsNotNull (
......@@ -278,7 +289,11 @@ cdh_DlidIsNotNull (
}
/* Convert Objid to ClassId. */
//! Convert Objid to ClassId.
/*!
\param Objid Objid of $ClassDef object for class.
\return ClassId.
*/
pwr_tClassId
cdh_ClassObjidToId (
......@@ -300,7 +315,11 @@ cdh_ClassObjidToId (
}
/* Convert ClassId to Objid. */
//! Convert ClassId to Objid.
/*!
\param Class ClassId
\return Objid for $ClassDef object of class.
*/
pwr_tObjid
cdh_ClassIdToObjid (
......@@ -325,7 +344,11 @@ cdh_ClassIdToObjid (
return oid.pwr;
}
/* Convert Objid to TypeId. */
//! Convert Objid to TypeId.
/*!
\param Objid Objid for $TypeDef object of type.
\return TypeId.
*/
pwr_tTypeId
cdh_TypeObjidToId (
......@@ -364,7 +387,7 @@ cdh_TypeObjidToId (
}
/* Convert TypeId to index. */
//! Convert TypeId to index.
int
cdh_TypeIdToIndex (
......@@ -378,7 +401,7 @@ cdh_TypeIdToIndex (
return tid.t.tix;
}
/* Convert TypeId to Objid. */
//! Convert TypeId to Objid.
pwr_tObjid
cdh_TypeIdToObjid (
......@@ -415,9 +438,7 @@ cdh_TypeIdToObjid (
return oid.pwr;
}
/* Converts an attribute given in internal binary format
to a text string.
*/
//! Converts an attribute given in internal binary format to a text string.
pwr_tStatus
cdh_AttrValueToString (
......@@ -498,8 +519,7 @@ cdh_AttrValueToString (
return sts;
}
/* Converts an attribute value given as a text string,
to internal binary format. */
//! Converts an attribute value given as a text string, to internal binary format.
pwr_tStatus
cdh_StringToAttrValue (
......@@ -748,7 +768,17 @@ cdh_StringToAttrValue (
return sts;
}
//! 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.
\param s String.
\param cid ClassId.
\return Status of the operation. CDH__SUCCESS or CDH__INVCID.
*/
pwr_tStatus
cdh_StringToClassId (
const char *s,
......@@ -782,6 +812,16 @@ cdh_StringToClassId (
return CDH__SUCCESS;
}
//! 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.
\param s String.
\param oid Objid.
\return Status of the operation. CDH__SUCCESS or CDH__INVCID.
*/
pwr_tStatus
cdh_StringToObjid (
const char *s,
......@@ -824,6 +864,14 @@ cdh_StringToObjid (
return CDH__SUCCESS;
}
//! Convert TypeId string to id.
/*!
Convert a string of format "_T1.2:bit.tyg.tix" to id ("_T" is optional).
\param s String.
\param tid TypeId.
\return Status of the operation. CDH__SUCCESS or CDH__INVTID.
*/
pwr_tStatus
cdh_StringToTypeId (
const char *s,
......@@ -876,6 +924,15 @@ cdh_StringToTypeId (
return CDH__SUCCESS;
}
//! 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.
\param s String.
\param vid Volume id.
\return Status of the operation. CDH__SUCCESS or CDH__INVTID.
*/
pwr_tStatus
cdh_StringToVolumeId (
const char *s,
......@@ -914,6 +971,15 @@ cdh_StringToVolumeId (
return CDH__SUCCESS;
}
//! Converts ObjectIx string to index.
/*!
Converts string of format "_Xoix" to index ("_X" is optional)
where oix is object index.
\param s String.
\param oix ObjectIx.
\return Status of the operation. CDH__SUCCESS or CDH__INVOIX.
*/
pwr_tStatus
cdh_StringToObjectIx (
const char *s,
......@@ -1018,7 +1084,8 @@ cdh_StringToDlid (
return CDH__SUCCESS;
}
/* Converts a class identifier, 'cid' to a string.
//! 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
......@@ -1028,7 +1095,8 @@ cdh_StringToDlid (
to 's', otherwise the resultant string will be returned.
If 'prefix' is not zero, a '_C' prefix will be included in
the resultant string. */
the resultant string.
*/
char *
cdh_ClassIdToString (
......@@ -1060,7 +1128,8 @@ cdh_ClassIdToString (
}
/* Converts a type identifier, 'tid' to a string.
//! 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
......@@ -1077,7 +1146,8 @@ cdh_ClassIdToString (
to 's', otherwise the resultant string will be returned.
If 'prefix' is not zero, a '_T' prefix will be included in
the resultant string. */
the resultant string.
*/
char *
cdh_TypeIdToString (
......@@ -1110,7 +1180,8 @@ cdh_TypeIdToString (
}
/* Converts a object index, 'oix' to a string.
//! Converts a object index, 'oix' to a string.
/*!
The output string will be in the format:
1234
......@@ -1119,7 +1190,8 @@ cdh_TypeIdToString (
to 's', otherwise the resultant string will be returned.
If 'prefix' is not zero, a '_X' prefix will be included in
the resultant string. */
the resultant string.
*/
char *
cdh_ObjectIxToString (
......@@ -1138,7 +1210,8 @@ cdh_ObjectIxToString (
return ls;
}
/* Converts an attribute reference , 'aref' to a string.
//! 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]
......@@ -1147,7 +1220,8 @@ cdh_ObjectIxToString (
to 's', otherwise the resultant string will be returned.
If 'prefix' is not zero, a '_A' prefix will be included in
the resultant string. */
the resultant string.
*/
char *
cdh_ArefToString (
......@@ -1179,7 +1253,8 @@ cdh_ArefToString (
return ls;
}
/* Converts a volume identifier, 'vid' to a string.
//! Converts a volume identifier, 'vid' to a string.
/*!
The output string will be in the format:
0.1.2.3
......@@ -1191,7 +1266,8 @@ cdh_ArefToString (
the resultant string.
If 'suffix' is not zero, a ':' suffix will be included in
the resultant string. */
the resultant string.
*/
char *
cdh_NodeIdToString (
......@@ -1216,7 +1292,8 @@ cdh_NodeIdToString (
}
/* Converts a object identifier, 'oid' to a string.
//! Converts a object identifier, 'oid' to a string.
/*!
The output string will be in the format:
0.1.2.3:1234
......@@ -1225,7 +1302,8 @@ cdh_NodeIdToString (
to 's', otherwise the resultant string will be returned.
If 'prefix' is not zero, a '_O' prefix will be included in
the resultant string. */
the resultant string.
*/
char *
cdh_ObjidToString (
......@@ -1249,7 +1327,8 @@ cdh_ObjidToString (
}
/* Converts a volume identifier, 'vid' to a string.
//! Converts a volume identifier, 'vid' to a string.
/*!
The output string will be in the format:
0.1.2.3
......@@ -1261,7 +1340,8 @@ cdh_ObjidToString (
the resultant string.
If 'suffix' is not zero, a ':' suffix will be included in
the resultant string. */
the resultant string.
*/
char *
cdh_VolumeIdToString (
......@@ -1286,7 +1366,8 @@ cdh_VolumeIdToString (
}
/* Converts a subscription identifier, 'sid' to a string.
//! Converts a subscription identifier, 'sid' to a string.
/*!
The output string will be in the format:
0.1.2.3:1234
......@@ -1295,7 +1376,8 @@ cdh_VolumeIdToString (
to 's', otherwise the resultant string will be returned.
If 'prefix' is not zero, a '_S' prefix will be included in
the resultant string. */
the resultant string.
*/
char *
cdh_SubidToString (
......@@ -1319,7 +1401,8 @@ cdh_SubidToString (
}
/* Converts a direct link identifier, 'did' to a string.
//! Converts a direct link identifier, 'did' to a string.
/*!
The output string will be in the format:
0.1.2.3:1234
......@@ -1328,7 +1411,8 @@ cdh_SubidToString (
to 's', otherwise the resultant string will be returned.
If 'prefix' is not zero, a '_D' prefix will be included in
the resultant string. */
the resultant string.
*/
char *
cdh_DlidToString (
......@@ -2185,6 +2269,12 @@ cdh_PackName (
return pack.key;
}
//! Convert string to lower case.
/*!
Returns a pointer to a static string.
NOTE! The function should only be called once in one expression.
*/
char *
cdh_Low (
const char *s
......@@ -2195,6 +2285,14 @@ cdh_Low (
return cdh_ToLower(buf, s);
}
//! Convert string to lower case.
/*!
If s is NULL, t is used also as input string.
\param t Output string.
\param s Input string.
\return Returns t.
*/
char *
cdh_ToLower (
char *t,
......@@ -2226,6 +2324,14 @@ cdh_ToLower (
return rs;
}
//! Convert string to upper case.
/*!
If s is NULL, t is used also as input string.
\param t Output string.
\param s Input string.
\return Returns t.
*/
char *
cdh_ToUpper (
char *t,
......@@ -2258,8 +2364,8 @@ cdh_ToUpper (
}
/* Compare two strings not regarding their casing.
//! Compare two strings not regarding their casing.
/*!
This routine works only on alphabetic characters.
It works on the standard ascii a-z and on the
DEC multinational extensions.
......@@ -2268,7 +2374,8 @@ cdh_ToUpper (
when you change the case of a character.
The function returns the uppercase offset between
the two first differing characters. */
the two first differing characters.
*/
int
cdh_NoCaseStrcmp (
......@@ -2308,3 +2415,12 @@ char *cdh_OpSysToStr( pwr_mOpSys opsys)
}
return str;
}
/*@}*/
......@@ -24,6 +24,19 @@
extern "C" {
#endif
/*! \file co_cdh.h
\brief Class definition handler.
This include file contains definitions and function prototypes
needed to use CDH.
*/
/*! \defgroup Cdh_DS Data Structures
\ingroup Cdh
*/
/*! \addtogroup Cdh_DS */
/*@{*/
#define cdh_cMaxVidGroup 255
#define cdh_cMaxCix 4095
#define cdh_cMaxBix 7
......@@ -39,18 +52,28 @@ typedef enum {
} cdh_eVId3;
//! Get volme identity for class identity.
#define cdh_CidToVid(cid) ((cid) >> 16)
//! Get volume identity for type identity.
#define cdh_TidToVid(tid) ((tid) >> 16)
//! Get class identity for class index
#define cdh_cixToCid( Vid, Cix) (0 + (Vid << 16) + (Cix << 3))
//! Get type identity for type index.
#define cdh_tixToTid( Vid, Tyg, Tix) (0 + (Vid << 16) + (1 << 15) + (Tyg << 11) + Tix)
//! Get object index for class index.
#define cdh_cixToOix( Cix, Bix, Aix) (0 + (1 << 31) + (Cix << 18) + (Bix << 15) + Aix)
//! Get object index for type index.
#define cdh_tixToOix( Tyg, Tix) (0 + (1 << 31) + (1 << 30) + (Tyg << 26) + (Tix << 15))
//! Get object index for body index.
#define cdh_oixToBix( Oix) ((pwr_eBix)((Oix >> 15) & 7))
//! Get class index for object index.
#define cdh_oixToCix( Oix) ((Oix >> 18) & 0xfff)
//! Get attribute index for object index.
#define cdh_oixToAix( Oix) (Oix & 0xfff)
//! Internal representatin of object identity.
typedef struct {
unsigned int oix : 32;
unsigned int oix : 32; //! Object index.
#if (pwr_dHost_byteOrder == pwr_dBigEndian)
......@@ -68,8 +91,9 @@ typedef struct {
#endif
} cdh_mOid;
typedef cdh_mOid cdh_mObjid;
typedef cdh_mOid cdh_mObjid; //!< Internal representation of object identity.
//! Internal representation of reference identity.
typedef struct {
unsigned int rix : 32;
......@@ -89,8 +113,9 @@ typedef struct {
#endif
} cdh_mRid;
typedef cdh_mRid cdh_mRefId;
typedef cdh_mRid cdh_mRefId; //!< Internal representation of reference identity.
//! Internal representations of volume identity.
typedef struct {
#if (pwr_dHost_byteOrder == pwr_dBigEndian)
......@@ -108,8 +133,9 @@ typedef struct {
#endif
} cdh_mVid;
typedef cdh_mVid cdh_mVolumeId;
typedef cdh_mVid cdh_mVolumeId; //!< Internal representation of volume identity.
//! Internal representation of node identity.
typedef struct {
#if (pwr_dHost_byteOrder == pwr_dBigEndian)
......@@ -127,8 +153,9 @@ typedef struct {
#endif
} cdh_mNid;
typedef cdh_mNid cdh_mNodeId;
typedef cdh_mNid cdh_mNodeId; //!< Internal representation of node identity.
//! Internal representation of $ClassDef object identity.
typedef struct {
#if (pwr_dHost_byteOrder == pwr_dBigEndian)
......@@ -159,6 +186,7 @@ typedef struct {
#endif
} cdh_mClassObjid;
//! Internal represention of class identity.
typedef struct {
#if (pwr_dHost_byteOrder == pwr_dBigEndian)
......@@ -180,8 +208,9 @@ typedef struct {
#endif
} cdh_mCid;
typedef cdh_mCid cdh_mClassId;
typedef cdh_mCid cdh_mClassId; //!< Internal representation of class identity.
//! Internal representation of $TypeDef object identity.
typedef struct {
#if (pwr_dHost_byteOrder == pwr_dBigEndian)
......@@ -212,6 +241,7 @@ typedef struct {
#endif
} cdh_mTypeObjid;
//! Internal representation of type identity.
typedef struct {
#if (pwr_dHost_byteOrder == pwr_dBigEndian)
......@@ -233,54 +263,61 @@ typedef struct {
#endif
} cdh_mTid;
typedef cdh_mTid cdh_mTypeId;
typedef cdh_mTid cdh_mTypeId; //!< Internal representation of type identity.
//! Type for representions of object identity.
typedef union {
pwr_tOid pwr;
cdh_mObjid o;
cdh_mClassObjid c;
cdh_mTypeObjid t;
pwr_tOid pwr; //!< Extern representation.
cdh_mObjid o; //!< Common object representation.
cdh_mClassObjid c; //!< ClassDef object representation.
cdh_mTypeObjid t; //!< TypeDef object representation.
} cdh_uOid;
typedef cdh_uOid cdh_uObjid;
typedef cdh_uOid cdh_uObjid; //!< Type for representations of object identity.
//! Type for representations of reference identity.
typedef union {
pwr_tRid pwr;
cdh_mRid r;
pwr_tRid pwr; //!< Extern representation.
cdh_mRid r; //!< Intern representation
} cdh_uRid;
typedef cdh_uRid cdh_uRefId;
typedef cdh_uRid cdh_uRefId; //!< Type for representation of reference identity.
//! Type for representation of type identity.
typedef union {
pwr_tCid pwr;
cdh_mCid c;
cdh_mTid t;
pwr_tCid pwr; //!< Extern representation.
cdh_mCid c; //!< Class identity representation.
cdh_mTid t; //!< Type identity representation.
} cdh_uTid;
typedef cdh_uTid cdh_uTypeId;
typedef cdh_uTid cdh_uTypeId; //!< Type for representation of type identity.
//! Type for representation of volume identity.
typedef union {
pwr_tVid pwr;
cdh_mVid v;
pwr_tVid pwr; //!< Extern representation.
cdh_mVid v; //!< Intern representation.
} cdh_uVid;
typedef cdh_uVid cdh_uVolumeId;
typedef cdh_uVid cdh_uVolumeId; //!< Type for represenation of volume identity.
//! Type for representation of node identity.
typedef union {
pwr_tNid pwr;
cdh_mNid n;
pwr_tNid pwr; //!< Extern representation.
cdh_mNid n; //!< Intern representation.
} cdh_uNid;
typedef cdh_uNid cdh_uNodeId;
typedef cdh_uNid cdh_uNodeId; //!< Type for representation of node idenity.
//! Enumeration for identities.
typedef enum {
cdh_eId__ = 0,
cdh_eId_objectIx,
cdh_eId_objid,
cdh_eId_classId,
cdh_eId_volumeId,
cdh_eId_typeId,
cdh_eId_subid,
cdh_eId_dlid,
cdh_eId_aref,
cdh_eId_objectIx, //!< Object index.
cdh_eId_objid, //!< Object identity.
cdh_eId_classId, //!< Class identity.
cdh_eId_volumeId, //!< Volume identity.
cdh_eId_typeId, //!< Type identity.
cdh_eId_subid, //!< Subscription identity.
cdh_eId_dlid, //!< Direct link identity.
cdh_eId_aref, //!< Attribute reference.
cdh_eId_
} cdh_eId;
//! Union for identities.
typedef union {
pwr_tOix oix;
pwr_tOid oid;
......@@ -292,8 +329,10 @@ typedef union {
pwr_sAttrRef aref;
} cdh_uId;
//! Pack name
typedef union {
pwr_tUInt32 key;
//! Name structure
struct {
#if (pwr_dHost_byteOrder == pwr_dBigEndian)
......@@ -313,18 +352,22 @@ typedef union {
} c;
} cdh_uPackName;
//! Object name struct
typedef struct {
pwr_tObjName orig;
pwr_tObjName norm;
cdh_uPackName pack;
} cdh_sObjName;
//! Family struct.
typedef struct {
cdh_sObjName name;
pwr_tOid poid;
} cdh_sFamily;
//! Parse name mask
typedef union {
//! Bitmask representation.
struct {
#if (pwr_dHost_byteOrder == pwr_dBigEndian)
......@@ -347,93 +390,94 @@ typedef union {
#define cdh_mParseName_ (~cdh_mParseName__)
} cdh_mParseName;
/* Describe the format of a namestring.
//! Name string format description.
/*!
Let us assume we have an object of class Ai.
The object has an attribute called FilterAttribute.
Object name: Eobj
Object id : 1234567890
Class name : pwrb:Class-Ai
Class id : 0.2:34
Volume name: Avol
Volume id : 0.123.34.63
Parents : Bobj, Cobj, Dobj
Attribute : FilterAttribute
Index : 2
Offset : 60
Size : 4
Body name : pwrb:Class-Ai-RtBody
Body id : 0.2:0.34.1
- Object name: Eobj
- Object id : 1234567890
- Class name : pwrb:Class-Ai
- Class id : 0.2:34
- Volume name: Avol
- Volume id : 0.123.34.63
- Parents : Bobj, Cobj, Dobj
- Attribute : FilterAttribute
- Index : 2
- Offset : 60
- Size : 4
- Body name : pwrb:Class-Ai-RtBody
- Body id : 0.2:0.34.1
The name of this object can be written in different ways.
The type cdh_mName is used to define the way an object is named.
V P O B B A I E S I Form Fallback String
o a b o o t n s e d
l t j d d t d c p T
u h e y y r e a a y
m c I N i x p r p
e t d a b e a e
m u G t
e t M o
e S r
1 * * * * * * * 0 1 Id * _V0.123.34.63
1 * * * * * * * 1 1 Id * _V0.123.34.63:
1 * * * * * * * 0 0 Id * 0.123.34.63
1 * * * * * * * 1 0 Id * 0.123.34.63:
0 * 1 * * * * * * 1 Id * _O0.123.34.63:1234567890
0 * 1 * * * * * * 0 Id * 0.123.34.63:1234567890
0 * 0 1 * 1 0 * * * Id * _A0.123.34.63:1234567890(_T0.2:0.34.1)
0 * 0 1 * 1 1 * * * Id * _A0.123.34.63:1234567890(_T0.2:0.34.1)[60.4]
1 * * * * * * * * * Std Export _V0.123.34.63:
0 0 0 * * 1 * * * * Std Export _O0.123.34.63:1234567890
0 0 0 0 1 1 * * * * Std Export _A0.123.34.63:1234567890(pwrb:Class-Ai-RtBody)FilterAttribute[2]
1 1 1 0 0 1 1 0 * * Std Strict Avol:Bobj-Cobj-Dobj-Eobj.FilterAttribute[2]
0 1 1 0 0 1 1 0 * * Std Strict Bobj-Cobj-Dobj-Eobj.FilterAttribute[2]
0 0 1 0 0 1 1 0 * * Std Strict Eobj.FilterAttribute[2]
0 0 0 0 0 1 1 0 0 * Std Strict FilterAttribute[2]
0 0 0 0 0 1 1 0 1 * Std Strict .FilterAttribute[2]
0 0 0 0 0 1 0 0 0 * Std Strict FilterAttribute
0 0 0 0 0 1 0 0 1 * Std Strict .FilterAttribute
1 1 1 0 0 1 0 0 * * Std Strict Avol:Bobj-Cobj-Dobj-Eobj.FilterAttribute
1 1 1 0 0 0 0 0 0 * Std Strict Avol:Bobj-Cobj-Dobj-Eobj
1 1 1 0 0 0 0 0 1 * Std Strict Avol:Bobj-Cobj-Dobj-Eobj-
1 1 0 0 0 0 0 0 0 * Std Strict Avol:Bobj-Cobj-Dobj
1 1 0 0 0 0 0 0 1 * Std Strict Avol:Bobj-Cobj-Dobj-
1 0 0 0 0 0 0 0 0 * Std Strict Avol
1 0 0 0 0 0 0 0 1 * Std Strict Avol:
1 1 1 0 0 1 1 1 0 * Std Strict Avol\:Bobj\-Cobj\-Dobj\-Eobj\.FilterAttribute[2]
0 1 1 0 0 1 1 1 0 * Std Strict Bobj\-Cobj\-Dobj\-Eobj\.FilterAttribute[2]
0 0 1 0 0 1 1 1 0 * Std Strict Eobj\.FilterAttribute[2]
0 0 0 0 0 1 1 1 0 * Std Strict FilterAttribute[2]
1 1 1 0 0 1 0 1 0 * Std Strict Avol\:Bobj\-Cobj\-Dobj\-Eobj\.FilterAttribute
1 1 1 0 0 0 0 1 0 * Std Strict Avol\:Bobj\-Cobj\-Dobj\-Eobj
1 1 0 0 0 0 0 1 0 * Std Strict Avol\:Bobj\-Cobj\-Dobj
1 0 0 0 0 0 0 1 0 * Std Strict Avol
1 1 1 0 0 1 1 0 * * Root Strict //Avol/Bobj/Cobj/Dobj/Eobj.FilterAttribute[2]
0 1 1 0 0 1 1 0 * * Root Strict /Bobj/Cobj/Dobj/Eobj.FilterAttribute[2]
0 0 1 0 0 1 1 0 * * Root Strict Eobj.FilterAttribute[2]
0 0 0 0 0 1 1 0 0 * Root Strict FilterAttribute[2]
1 1 1 0 0 1 0 0 0 * Root Strict //Avol/Bobj/Cobj/Dobj/Eobj.FilterAttribute
1 1 1 0 0 0 0 0 0 * Root Strict //Avol/Bobj/Cobj/Dobj/Eobj
1 1 1 0 0 0 0 0 1 * Root Strict //Avol/Bobj/Cobj/Dobj/Eobj/
1 1 0 0 0 0 0 0 0 * Root Strict //Avol/Bobj/Cobj/Dobj
1 1 0 0 0 0 0 0 1 * Root Strict //Avol/Bobj/Cobj/Dobj/
1 0 0 0 0 0 0 0 0 * Root Strict //Avol
1 0 0 0 0 0 0 0 1 * Root Strict //Avol/
*/
- V P O B B A I E S I Form Fallback String
- o a b o o t n s e d
- l t j d d t d c p T
- u h e y y r e a a y
- m c I N i x p r p
- e t d a b e a e
- m u G t
- e t M o
- e S r
- 1 * * * * * * * 0 1 Id * _V0.123.34.63
- 1 * * * * * * * 1 1 Id * _V0.123.34.63:
- 1 * * * * * * * 0 0 Id * 0.123.34.63
- 1 * * * * * * * 1 0 Id * 0.123.34.63:
- 0 * 1 * * * * * * 1 Id * _O0.123.34.63:1234567890
- 0 * 1 * * * * * * 0 Id * 0.123.34.63:1234567890
- 0 * 0 1 * 1 0 * * * Id * _A0.123.34.63:1234567890(_T0.2:0.34.1)
- 0 * 0 1 * 1 1 * * * Id * _A0.123.34.63:1234567890(_T0.2:0.34.1)[60.4]
- 1 * * * * * * * * * Std Export _V0.123.34.63:
- 0 0 0 * * 1 * * * * Std Export _O0.123.34.63:1234567890
- 0 0 0 0 1 1 * * * * Std Export _A0.123.34.63:1234567890(pwrb:Class-Ai-RtBody)FilterAttribute[2]
- 1 1 1 0 0 1 1 0 * * Std Strict Avol:Bobj-Cobj-Dobj-Eobj.FilterAttribute[2]
- 0 1 1 0 0 1 1 0 * * Std Strict Bobj-Cobj-Dobj-Eobj.FilterAttribute[2]
- 0 0 1 0 0 1 1 0 * * Std Strict Eobj.FilterAttribute[2]
- 0 0 0 0 0 1 1 0 0 * Std Strict FilterAttribute[2]
- 0 0 0 0 0 1 1 0 1 * Std Strict .FilterAttribute[2]
- 0 0 0 0 0 1 0 0 0 * Std Strict FilterAttribute
- 0 0 0 0 0 1 0 0 1 * Std Strict .FilterAttribute
- 1 1 1 0 0 1 0 0 * * Std Strict Avol:Bobj-Cobj-Dobj-Eobj.FilterAttribute
- 1 1 1 0 0 0 0 0 0 * Std Strict Avol:Bobj-Cobj-Dobj-Eobj
- 1 1 1 0 0 0 0 0 1 * Std Strict Avol:Bobj-Cobj-Dobj-Eobj-
- 1 1 0 0 0 0 0 0 0 * Std Strict Avol:Bobj-Cobj-Dobj
- 1 1 0 0 0 0 0 0 1 * Std Strict Avol:Bobj-Cobj-Dobj-
- 1 0 0 0 0 0 0 0 0 * Std Strict Avol
- 1 0 0 0 0 0 0 0 1 * Std Strict Avol:
- 1 1 1 0 0 1 1 1 0 * Std Strict Avol\:Bobj\-Cobj\-Dobj\-Eobj\.FilterAttribute[2]
- 0 1 1 0 0 1 1 1 0 * Std Strict Bobj\-Cobj\-Dobj\-Eobj\.FilterAttribute[2]
- 0 0 1 0 0 1 1 1 0 * Std Strict Eobj\.FilterAttribute[2]
- 0 0 0 0 0 1 1 1 0 * Std Strict FilterAttribute[2]
- 1 1 1 0 0 1 0 1 0 * Std Strict Avol\:Bobj\-Cobj\-Dobj\-Eobj\.FilterAttribute
- 1 1 1 0 0 0 0 1 0 * Std Strict Avol\:Bobj\-Cobj\-Dobj\-Eobj
- 1 1 0 0 0 0 0 1 0 * Std Strict Avol\:Bobj\-Cobj\-Dobj
- 1 0 0 0 0 0 0 1 0 * Std Strict Avol
- 1 1 1 0 0 1 1 0 * * Root Strict //Avol/Bobj/Cobj/Dobj/Eobj.FilterAttribute[2]
- 0 1 1 0 0 1 1 0 * * Root Strict /Bobj/Cobj/Dobj/Eobj.FilterAttribute[2]
- 0 0 1 0 0 1 1 0 * * Root Strict Eobj.FilterAttribute[2]
- 0 0 0 0 0 1 1 0 0 * Root Strict FilterAttribute[2]
- 1 1 1 0 0 1 0 0 0 * Root Strict //Avol/Bobj/Cobj/Dobj/Eobj.FilterAttribute
- 1 1 1 0 0 0 0 0 0 * Root Strict //Avol/Bobj/Cobj/Dobj/Eobj
- 1 1 1 0 0 0 0 0 1 * Root Strict //Avol/Bobj/Cobj/Dobj/Eobj/
- 1 1 0 0 0 0 0 0 0 * Root Strict //Avol/Bobj/Cobj/Dobj
- 1 1 0 0 0 0 0 0 1 * Root Strict //Avol/Bobj/Cobj/Dobj/
- 1 0 0 0 0 0 0 0 0 * Root Strict //Avol
- 1 0 0 0 0 0 0 0 1 * Root Strict //Avol/
*/
typedef union {
pwr_tBitMask m;
//! Bit mask representation.
struct {
#if (pwr_dHost_byteOrder == pwr_dBigEndian)
......@@ -477,6 +521,7 @@ typedef union {
#endif
} b;
//! Word representation.
struct {
#if (pwr_dHost_byteOrder == pwr_dBigEndian)
......@@ -536,6 +581,7 @@ typedef union {
cdh_mName_index | cdh_mName_form_std | cdh_mName_fallback_strict)
} cdh_mName;
//! Parse name struct.
typedef struct {
pwr_tOid poid; /* Parent objid, or NOBJID */
cdh_mParseName parseFlags;
......@@ -556,6 +602,10 @@ typedef struct {
cdh_sFamily attribute;
} cdh_sParseName;
/*@}*/
/*! \addtogroup Cdh */
/*@{*/
/* Function prototypes to exported functions. */
int
......@@ -865,8 +915,11 @@ cdh_NoCaseStrcmp (
char *cdh_OpSysToStr( pwr_mOpSys opsys);
/*@}*/
#ifdef __cplusplus
}
#endif
#endif
......@@ -47,11 +47,6 @@
pwr_Assert((p->tv_sec < 0) ? (p->tv_nsec <= 0 && p->tv_nsec > -1000000000) : TRUE);\
} while (0)
typedef struct {
int tv_sec;
int tv_nsec;
} tTime;
/* String representations of months. */
static const char *monStr[] =
......
......@@ -121,7 +121,9 @@ static void log_message (errh_sLog*, char, char*, va_list);
static int msg_vsprintf (char *, const char *, aa_list, va_list);
#if defined(OS_LYNX) || defined(OS_LINUX) || defined(OS_ELN)
static size_t strnlen (const char*, size_t);
static size_t errh_strnlen (const char*, size_t);
#else
#define errh_strnlen strnlen
#endif
static unsigned int do_div (int*, unsigned int);
......@@ -818,7 +820,7 @@ repeat:
if (!s)
s = "<NULL>";
len = strnlen(s, precision);
len = errh_strnlen(s, precision);
if (!(flags & LEFT))
while (len < field_width--)
......@@ -907,7 +909,7 @@ repeat:
whatever comes true first. */
static size_t
strnlen (
errh_strnlen (
const char *s,
size_t count
)
......
......@@ -27,6 +27,7 @@
#include "rt_mh_util.h"
#include "rt_errh.h"
//! Application context.
typedef struct {
mh_sHead head;
qcom_sQid handler;
......
......@@ -129,9 +129,7 @@ static const qcom_sQid qcom_cQhdClient = {qcom_cIhdClient, 0};
static const qcom_sQid qcom_cQnacp = {qcom_cInacp, 0};
static const qcom_sQid qcom_cQini = {qcom_cIini, 0};
/**
* ZZZ
*/
//! Application identity
typedef struct {
qcom_tAix aix; /**< Application index */
pwr_tNodeId nid; /**< Node identity */
......@@ -139,27 +137,32 @@ typedef struct {
static const qcom_sAid qcom_cNAid = {0, 0};
//! Qcom application
typedef struct {
qcom_sAid aid;
pid_t pid;
} qcom_sAppl;
//! Qcom event
typedef struct {
qcom_sAid aid;
pid_t pid;
int mask;
} qcom_sEvent;
//! Queue attributes
typedef struct {
qcom_eQtype type;
unsigned int quota;
} qcom_sQattr;
//! Qcom type
typedef struct {
qcom_eBtype b;
qcom_eStype s;
} qcom_sType;
//! Put data structure.
typedef struct {
qcom_sQid reply;
qcom_sType type;
......@@ -167,6 +170,7 @@ typedef struct {
void *data;
} qcom_sPut;
//! Get data structure
typedef struct {
qcom_sAid sender;
pid_t pid;
......@@ -179,8 +183,10 @@ typedef struct {
void *data;
} qcom_sGet;
//! Node status
typedef union {
pwr_tBitMask m;
//! Bitmask representation
pwr_32Bits (
pwr_Bits( initiated , 1),
pwr_Bits( connected , 1),
......@@ -203,17 +209,16 @@ typedef union {
} qcom_mNode;
/**
* Strucure describing a node ???
*/
//! Data for a Qcom node.
typedef struct {
pwr_tNodeId nid; /**< node index */
qcom_mNode flags; /**< node flags */
char name[80]; /**< node name */
co_eOS os; /**< operating system */
co_eHW hw; /**< hardware */
co_eBO bo; /**< big/little endian */
co_eFT ft; /**< float type */
pwr_tNodeId nid; //!< node index
qcom_mNode flags; //!< node flags
char name[80]; //!< node name
co_eOS os; //!< operating system
co_eHW hw; //!< hardware
co_eBO bo; //!< big/little endian
co_eFT ft; //!< float type
} qcom_sNode;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment