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.c | |
parent | 2c5b4f3c3d79190367595ccf84ae90f50666ddbf (diff) | |
download | rsyslog-918f281d8226689f5c997a07c0bcd9a691ddb178.tar.gz rsyslog-918f281d8226689f5c997a07c0bcd9a691ddb178.tar.xz rsyslog-918f281d8226689f5c997a07c0bcd9a691ddb178.zip |
implemented class type registry
Diffstat (limited to 'obj.c')
-rw-r--r-- | obj.c | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -38,6 +38,7 @@ #include "obj.h" /* static data */ +static objInfo_t *arrObjInfo[OBJ_NUM_IDS]; /* array with object information pointers */ /* methods */ @@ -276,6 +277,37 @@ finalize_it: /* --------------- end object serializiation / deserialization support --------------- */ +/* register a classe's info pointer, so that we can reference it later, if needed to + * (e.g. for de-serialization support). + * rgerhards, 2008-01-07 + */ +rsRetVal objRegisterObj(objID_t oID, objInfo_t *pInfo) +{ + DEFiRet; + + assert(pInfo != NULL); + if(oID < 1 || oID > OBJ_NUM_IDS) + ABORT_FINALIZE(RS_RET_INVALID_OID); + + arrObjInfo[oID] = pInfo; + +finalize_it: + return iRet; +} + + +/* initialize our own class */ +rsRetVal objClassInit(void) +{ + int i; + + for(i = 0 ; i < OBJ_NUM_IDS ; ++i) { + arrObjInfo[i] = NULL; + } + + return RS_RET_OK; +} + /* * vi:set ai: */ |