summaryrefslogtreecommitdiffstats
path: root/vmprg.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-21 11:03:34 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-21 11:03:34 +0000
commit1cc790fae01e4392d4cf96820f6402528f611c44 (patch)
tree8d1c66f712cd53cf1b8a847dab97556c7c456a2d /vmprg.c
parent3e22b60c70d04d5bce245103de7d2aafc43d3f05 (diff)
downloadrsyslog-1cc790fae01e4392d4cf96820f6402528f611c44.tar.gz
rsyslog-1cc790fae01e4392d4cf96820f6402528f611c44.tar.xz
rsyslog-1cc790fae01e4392d4cf96820f6402528f611c44.zip
first steps in implementing object interfaces (stage work for later dynamic
class loading)
Diffstat (limited to 'vmprg.c')
-rw-r--r--vmprg.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/vmprg.c b/vmprg.c
index 2d522426..4856ebb2 100644
--- a/vmprg.c
+++ b/vmprg.c
@@ -32,6 +32,7 @@
/* static data */
DEFobjStaticHelpers
+DEFobjCurrIf(vmop)
/* Standard-Constructor
@@ -60,7 +61,7 @@ CODESTARTobjDestruct(vmprg)
for(pOp = pThis->vmopRoot ; pOp != NULL ; ) {
pTmp = pOp;
pOp = pOp->pNext;
- vmopDestruct(&pTmp);
+ vmop.Destruct(&pTmp);
}
ENDobjDestruct(vmprg)
@@ -71,7 +72,7 @@ BEGINobjDebugPrint(vmprg) /* be sure to specify the object type also in END and
CODESTARTobjDebugPrint(vmprg)
dbgoprint((obj_t*) pThis, "program contents:\n");
for(pOp = pThis->vmopRoot ; pOp != NULL ; pOp = pOp->pNext) {
- vmopDebugPrint(pOp);
+ vmop.DebugPrint(pOp);
}
ENDobjDebugPrint(vmprg)
@@ -90,12 +91,12 @@ vmprgAddVarOperation(vmprg_t *pThis, opcode_t opcode, var_t *pVar)
ISOBJ_TYPE_assert(pThis, vmprg);
/* construct and fill vmop */
- CHKiRet(vmopConstruct(&pOp));
- CHKiRet(vmopConstructFinalize(pOp));
- CHKiRet(vmopConstructFinalize(pOp));
- CHKiRet(vmopSetOpcode(pOp, opcode));
+ CHKiRet(vmop.Construct(&pOp));
+ CHKiRet(vmop.ConstructFinalize(pOp));
+ CHKiRet(vmop.ConstructFinalize(pOp));
+ CHKiRet(vmop.SetOpcode(pOp, opcode));
if(pVar != NULL)
- CHKiRet(vmopSetVar(pOp, pVar));
+ CHKiRet(vmop.SetVar(pOp, pVar));
/* and add it to the program */
CHKiRet(vmprgAddOperation(pThis, pOp));
@@ -134,6 +135,11 @@ vmprgAddOperation(vmprg_t *pThis, vmop_t *pOp)
* rgerhards, 2008-02-19
*/
BEGINObjClassInit(vmprg, 1) /* class, version */
+ /* request objects we use */
+ //objUse(vmop);
+ CHKiRet(vmopQueryInterface(&vmop));
+
+ /* set our own handlers */
OBJSetMethodHandler(objMethod_DEBUGPRINT, vmprgDebugPrint);
OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, vmprgConstructFinalize);
ENDObjClassInit(vmprg)