diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-21 11:03:34 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-21 11:03:34 +0000 |
commit | 1cc790fae01e4392d4cf96820f6402528f611c44 (patch) | |
tree | 8d1c66f712cd53cf1b8a847dab97556c7c456a2d /vmop.h | |
parent | 3e22b60c70d04d5bce245103de7d2aafc43d3f05 (diff) | |
download | rsyslog-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.h | 24 |
1 files changed, 16 insertions, 8 deletions
@@ -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 */ |