summaryrefslogtreecommitdiffstats
path: root/module-template.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-11-21 10:52:19 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-11-21 10:52:19 +0000
commit8d606ea26d5fc79b845bafbc08d979ecc2ba0529 (patch)
treef17916ff1579340b723b9253cdab6d117697ab37 /module-template.h
parent214c7bd7f8552f0a07a15373b4a222da6e9e6ba6 (diff)
downloadrsyslog-8d606ea26d5fc79b845bafbc08d979ecc2ba0529.tar.gz
rsyslog-8d606ea26d5fc79b845bafbc08d979ecc2ba0529.tar.xz
rsyslog-8d606ea26d5fc79b845bafbc08d979ecc2ba0529.zip
added an identifier to command handler table - need to identify which
command handler entries need to be removed when module is unloaded
Diffstat (limited to 'module-template.h')
-rw-r--r--module-template.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/module-template.h b/module-template.h
index efe977d7..9521d08f 100644
--- a/module-template.h
+++ b/module-template.h
@@ -32,6 +32,18 @@
#define DEF_OMOD_STATIC_DATA \
static rsRetVal (*omsdRegCFSLineHdlr)();
+/* macro to define a unique module id. This must be able to fit in a void*. The
+ * module id must be unique inside a running rsyslogd application. It is used to
+ * track ownership of several objects. Most importantly, when the module is
+ * unloaded the module id value is used to find what needs to be destroyed.
+ * We currently use a pointer to modExit() as the module id. This sounds to be
+ * reasonable save, as each module must have this entry point AND there is no valid
+ * reason for twice this entry point being in memory.
+ * rgerhards, 2007-11-21
+ */
+#define STD_LOADABLE_MODULE_ID ((void*) modExit)
+
+
/* to following macros are used to generate function headers and standard
* functionality. It works as follows (described on the sample case of
* createInstance()):
@@ -378,7 +390,6 @@ finalize_it:\
#define BEGINmodExit \
static rsRetVal modExit(void)\
{\
-dbgprintf("in modExit\n");\
DEFiRet;
#define CODESTARTmodExit