summaryrefslogtreecommitdiffstats
path: root/obj.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-07 11:04:24 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-07 11:04:24 +0000
commit918f281d8226689f5c997a07c0bcd9a691ddb178 (patch)
tree2abf9558cda60580d7ec16d96d1f915ca016320d /obj.h
parent2c5b4f3c3d79190367595ccf84ae90f50666ddbf (diff)
downloadrsyslog-918f281d8226689f5c997a07c0bcd9a691ddb178.tar.gz
rsyslog-918f281d8226689f5c997a07c0bcd9a691ddb178.tar.xz
rsyslog-918f281d8226689f5c997a07c0bcd9a691ddb178.zip
implemented class type registry
Diffstat (limited to 'obj.h')
-rw-r--r--obj.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/obj.h b/obj.h
index 6c5fbd12..f4c9f6cd 100644
--- a/obj.h
+++ b/obj.h
@@ -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 */