summaryrefslogtreecommitdiffstats
path: root/vmop.h
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 /vmop.h
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 'vmop.h')
-rw-r--r--vmop.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/vmop.h b/vmop.h
index 6c74054a..30e64888 100644
--- a/vmop.h
+++ b/vmop.h
@@ -66,14 +66,22 @@ typedef struct vmop_s {
} vmop_t;
-/* prototypes */
-rsRetVal vmopConstruct(vmop_t **ppThis);
-rsRetVal vmopConstructFinalize(vmop_t __attribute__((unused)) *pThis);
-rsRetVal vmopDestruct(vmop_t **ppThis);
-rsRetVal vmopSetOpcode(vmop_t *pThis, opcode_t opcode);
-rsRetVal vmopSetVar(vmop_t *pThis, var_t *pVar);
-rsRetVal vmopOpcode2Str(vmop_t *pThis, uchar **ppName);
+/* interfaces */
+typedef struct vmop_if_s {
+ ifBEGIN; /* This MUST always be the first interface member */
+ INTERFACEObjDebugPrint(vmop);
+ rsRetVal (*Construct)(vmop_t **ppThis);
+ rsRetVal (*ConstructFinalize)(vmop_t __attribute__((unused)) *pThis);
+ rsRetVal (*Destruct)(vmop_t **ppThis);
+ rsRetVal (*SetOpcode)(vmop_t *pThis, opcode_t opcode);
+ rsRetVal (*SetVar)(vmop_t *pThis, var_t *pVar);
+ rsRetVal (*Opcode2Str)(vmop_t *pThis, uchar **ppName);
+} vmop_if_t;
+
+#define vmopCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */
+
+/* the remaining prototypes */
PROTOTYPEObjClassInit(vmop);
-PROTOTYPEObjDebugPrint(vmop);
+PROTOTYPEObjQueryInterface(vmop);
#endif /* #ifndef INCLUDED_VMOP_H */