diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-07 11:04:24 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-07 11:04:24 +0000 |
commit | 918f281d8226689f5c997a07c0bcd9a691ddb178 (patch) | |
tree | 2abf9558cda60580d7ec16d96d1f915ca016320d /obj.h | |
parent | 2c5b4f3c3d79190367595ccf84ae90f50666ddbf (diff) | |
download | rsyslog-918f281d8226689f5c997a07c0bcd9a691ddb178.tar.gz rsyslog-918f281d8226689f5c997a07c0bcd9a691ddb178.tar.xz rsyslog-918f281d8226689f5c997a07c0bcd9a691ddb178.zip |
implemented class type registry
Diffstat (limited to 'obj.h')
-rw-r--r-- | obj.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -43,6 +43,7 @@ typedef enum { /* IDs of known object "types/classes" */ objNull = 0, /* no valid object (we do not start at zero so we can detect calloc()) */ objMsg = 1 } objID_t; +#define OBJ_NUM_IDS 2 typedef enum { /* IDs of base methods supported by all objects - used for jump table, so * they must start at zero and be incremented. -- rgerahrds, 2008-01-04 @@ -88,7 +89,8 @@ rsRetVal objName##ClassInit(void) \ DEFiRet; \ CHKiRet(objInfoConstruct(&pObjInfoOBJ, obj##objName, (uchar*) #objName, objVers, (rsRetVal (*)(void*))objName##Destruct)); -#define ENDObjClassInit \ +#define ENDObjClassInit(objName) \ + objRegisterObj(obj##objName, pObjInfoOBJ); \ finalize_it: \ return iRet; \ } @@ -104,5 +106,7 @@ rsRetVal objBeginSerialize(rsCStrObj **ppCStr, obj_t *pObj, size_t iExpectedObjS rsRetVal objSerializePsz(rsCStrObj *pCStr, uchar *psz, size_t len); rsRetVal objEndSerialize(rsCStrObj **ppCStr, obj_t *pObj); rsRetVal objSerializeProp(rsCStrObj *pCStr, uchar *pszPropName, propertyType_t propType, void *pUsr); +rsRetVal objRegisterObj(objID_t oID, objInfo_t *pInfo); +PROTOTYPEObjClassInit(obj); #endif /* #ifndef OBJ_H_INCLUDED */ |