diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-21 13:27:51 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-21 13:27:51 +0000 |
commit | 04622f7d2210cbb8036502afadf5bcdcb0394d28 (patch) | |
tree | 1ba5f0321aaf86f6050193dd8283d85a7f4acd39 /obj.c | |
parent | 1cc790fae01e4392d4cf96820f6402528f611c44 (diff) | |
download | rsyslog-04622f7d2210cbb8036502afadf5bcdcb0394d28.tar.gz rsyslog-04622f7d2210cbb8036502afadf5bcdcb0394d28.tar.xz rsyslog-04622f7d2210cbb8036502afadf5bcdcb0394d28.zip |
first steps in implementing object interfaces (stage work for later dynamic
class loading)
Diffstat (limited to 'obj.c')
-rw-r--r-- | obj.c | 22 |
1 files changed, 16 insertions, 6 deletions
@@ -40,6 +40,7 @@ #include "stream.h" /* static data */ +DEFobjCurrIf(var) static objInfo_t *arrObjInfo[OBJ_NUM_IDS]; /* array with object information pointers */ /* some defines */ @@ -612,15 +613,15 @@ static rsRetVal objDeserializeProperties(obj_t *pObj, objID_t oID, strm_t *pStrm ISOBJ_TYPE_assert(pStrm, strm); ASSERT(oID > 0 && oID < OBJ_NUM_IDS); - CHKiRet(varConstruct(&pVar)); - CHKiRet(varConstructFinalize(pVar)); + CHKiRet(var.Construct(&pVar)); + CHKiRet(var.ConstructFinalize(pVar)); iRet = objDeserializeProperty(pVar, pStrm); while(iRet == RS_RET_OK) { CHKiRet(arrObjInfo[oID]->objMethods[objMethod_SETPROPERTY](pObj, pVar)); iRet = objDeserializeProperty(pVar, pStrm); } - varDestruct(&pVar); + var.Destruct(&pVar); if(iRet != RS_RET_NO_PROPLINE) FINALIZE; @@ -860,15 +861,24 @@ finalize_it: /* initialize our own class */ -rsRetVal objClassInit(void) +rsRetVal +objClassInit(void) { + DEFiRet; int i; - + + /* first, initialize the object system itself. This must be done + * before any other object is created. + */ for(i = 0 ; i < OBJ_NUM_IDS ; ++i) { arrObjInfo[i] = NULL; } - return RS_RET_OK; + /* request objects we use */ + CHKiRet(objUse(var)); + +finalize_it: + RETiRet; } /* |