summaryrefslogtreecommitdiffstats
path: root/obj.c
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.c
parent2c5b4f3c3d79190367595ccf84ae90f50666ddbf (diff)
downloadrsyslog-918f281d8226689f5c997a07c0bcd9a691ddb178.tar.gz
rsyslog-918f281d8226689f5c997a07c0bcd9a691ddb178.tar.xz
rsyslog-918f281d8226689f5c997a07c0bcd9a691ddb178.zip
implemented class type registry
Diffstat (limited to 'obj.c')
-rw-r--r--obj.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/obj.c b/obj.c
index 420850be..458f7856 100644
--- a/obj.c
+++ b/obj.c
@@ -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:
*/