summaryrefslogtreecommitdiffstats
path: root/modules.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-03-05 10:30:06 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-03-05 10:30:06 +0000
commit545346e697fe930b8b7b9bd0ede47890b26a4832 (patch)
treed0cfea13a087e00238107347dd3ffb7b9e20f31e /modules.h
parent89fac41d646711e40a0549dfc197cdd7a7d5f18c (diff)
downloadrsyslog-545346e697fe930b8b7b9bd0ede47890b26a4832.tar.gz
rsyslog-545346e697fe930b8b7b9bd0ede47890b26a4832.tar.xz
rsyslog-545346e697fe930b8b7b9bd0ede47890b26a4832.zip
- changed modules.c calling conventions to be interface-based
- moved module loader from conf.c to module.c, where it belongs - made the necessary plumbing to auto-load library modules - upgraded debug system to include iRet in function exit message - changed module interface so that instances need only to be supported by output plugins (if we actually need them for input plugins, we can always add it again...) - milestone: first implementation of library modules (but do not get unloaded on exit/hup so far)
Diffstat (limited to 'modules.h')
-rw-r--r--modules.h27
1 files changed, 19 insertions, 8 deletions
diff --git a/modules.h b/modules.h
index a2011b17..2a26d5e3 100644
--- a/modules.h
+++ b/modules.h
@@ -102,15 +102,26 @@ typedef struct moduleInfo {
void *pModHdlr; /* handler to the dynamic library holding the module */
} modInfo_t;
+/* interfaces */
+BEGINinterface(module) /* name must also be changed in ENDinterface macro! */
+ modInfo_t *(*GetNxt)(modInfo_t *pThis);
+ modInfo_t *(*GetNxtType)(modInfo_t *pThis, eModType_t rqtdType);
+ uchar *(*GetName)(modInfo_t *pThis);
+ uchar *(*GetStateName)(modInfo_t *pThis);
+ void (*PrintList)(void);
+ rsRetVal (*UnloadAndDestructAll)(void);
+ rsRetVal (*UnloadAndDestructDynamic)(void);
+ rsRetVal (*doModInit)(rsRetVal (*modInit)(), uchar *name, void *pModHdlr);
+ rsRetVal (*Load)(uchar *name);
+ENDinterface(module)
+#define moduleCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */
+
/* prototypes */
-rsRetVal doModInit(rsRetVal (*modInit)(), uchar *name, void *pModHdlr);
-modInfo_t *modGetNxt(modInfo_t *pThis);
-modInfo_t *modGetNxtType(modInfo_t *pThis, eModType_t rqtdType);
-uchar *modGetName(modInfo_t *pThis);
-uchar *modGetStateName(modInfo_t *pThis);
-void modPrintList(void);
-rsRetVal modUnloadAndDestructAll(void);
-rsRetVal modUnloadAndDestructDynamic(void);
+PROTOTYPEObj(module);
+
+/* TODO: remove them below (means move the config init code) -- rgerhards, 2008-02-19 */
+extern uchar *pModDir; /* read-only after startup */
+
#endif /* #ifndef MODULES_H_INCLUDED */
/*