summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-04-27 14:02:00 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-04-27 14:02:00 +0200
commit17e3f6b49cccb99316f2907eb3c131ec998ee3c3 (patch)
tree5b8ed0a9bd0fc09e9c9e766d961d6fb4eb203395 /runtime
parent706121052d2c2c0bca42b3f8f1e785dd96369772 (diff)
downloadrsyslog-17e3f6b49cccb99316f2907eb3c131ec998ee3c3.tar.gz
rsyslog-17e3f6b49cccb99316f2907eb3c131ec998ee3c3.tar.xz
rsyslog-17e3f6b49cccb99316f2907eb3c131ec998ee3c3.zip
step: $ModLoad handler no longe requries conf obj
re-doing the interface, global var "loadConf" now holds that data. Makes things simpler with legacy handler, as well as new functionality.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/conf.c5
-rw-r--r--runtime/conf.h2
-rw-r--r--runtime/rsconf.c16
-rw-r--r--runtime/rsconf.h6
-rw-r--r--runtime/typedefs.h1
5 files changed, 13 insertions, 17 deletions
diff --git a/runtime/conf.c b/runtime/conf.c
index 9fecc34d..c8c4d938 100644
--- a/runtime/conf.c
+++ b/runtime/conf.c
@@ -249,10 +249,9 @@ finalize_it:
}
-/* process a $ModLoad config line.
- */
+/* process a $ModLoad config line. */
rsRetVal
-doModLoad(rsconf_t * conf, uchar **pp, __attribute__((unused)) void* pVal)
+doModLoad(uchar **pp, __attribute__((unused)) void* pVal)
{
DEFiRet;
uchar szName[512];
diff --git a/runtime/conf.h b/runtime/conf.h
index c169a9c0..096af630 100644
--- a/runtime/conf.h
+++ b/runtime/conf.h
@@ -35,7 +35,7 @@ extern int bConfStrictScoping; /* force strict scoping during config processing?
BEGINinterface(conf) /* name must also be changed in ENDinterface macro! */
rsRetVal (*doNameLine)(uchar **pp, void* pVal);
rsRetVal (*cfsysline)(rsconf_t *conf, uchar *p);
- rsRetVal (*doModLoad)(rsconf_t *conf, uchar **pp, __attribute__((unused)) void* pVal);
+ rsRetVal (*doModLoad)(uchar **pp, __attribute__((unused)) void* pVal);
rsRetVal (*doIncludeLine)(rsconf_t *conf, uchar **pp, __attribute__((unused)) void* pVal);
rsRetVal (*cfline)(rsconf_t *conf, uchar *line, rule_t **pfCurr);
rsRetVal (*processConfFile)(rsconf_t *conf, uchar *pConfFile);
diff --git a/runtime/rsconf.c b/runtime/rsconf.c
index 2a87756f..a32205d9 100644
--- a/runtime/rsconf.c
+++ b/runtime/rsconf.c
@@ -380,18 +380,6 @@ finalize_it:
* TODO: move to conf.c?
*/
-/* this method is needed to shuffle the current conf object down to the
- * IncludeConfig handler.
- */
-static rsRetVal
-doModLoad(void *pVal, uchar *pNewVal)
-{
- DEFiRet;
- iRet = conf.doModLoad(ourConf, pVal, pNewVal);
- free(pNewVal);
- RETiRet;
-}
-
/* legacy config system: set the action resume interval */
static rsRetVal setActionResumeInterval(void __attribute__((unused)) *pVal, int iNewVal)
{
@@ -685,8 +673,10 @@ initLegacyConf(void)
CHKiRet(regCfSysLineHdlr((uchar *)"actionresumeinterval", 0, eCmdHdlrInt,
setActionResumeInterval, NULL, NULL, eConfObjGlobal));
+ //CHKiRet(regCfSysLineHdlr((uchar *)"modload", 0, eCmdHdlrCustomHandler,
+ //doModLoad, NULL, NULL, eConfObjGlobal));
CHKiRet(regCfSysLineHdlr((uchar *)"modload", 0, eCmdHdlrCustomHandler,
- doModLoad, NULL, NULL, eConfObjGlobal));
+ conf.doModLoad, NULL, NULL, eConfObjGlobal));
CHKiRet(regCfSysLineHdlr((uchar *)"includeconfig", 0, eCmdHdlrCustomHandler,
doIncludeLine, NULL, NULL, eConfObjGlobal));
CHKiRet(regCfSysLineHdlr((uchar *)"umask", 0, eCmdHdlrFileCreateMode,
diff --git a/runtime/rsconf.h b/runtime/rsconf.h
index 5cd6bfd0..2eb09851 100644
--- a/runtime/rsconf.h
+++ b/runtime/rsconf.h
@@ -91,6 +91,11 @@ struct globals_s {
struct defaults_s {
};
+
+/* list of modules loaded in this configuration (config specific module list) */
+struct cfgmodules_s {
+};
+
/* outchannel-specific data */
struct outchannels_s {
struct outchannel *ochRoot; /* the root of the outchannel list */
@@ -123,6 +128,7 @@ struct rulesets_s {
/* the rsconf object */
struct rsconf_s {
BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */
+ cfgmodules_t modules;
globals_t globals;
defaults_t defaults;
templates_t templates;
diff --git a/runtime/typedefs.h b/runtime/typedefs.h
index 0d23e880..ca78d820 100644
--- a/runtime/typedefs.h
+++ b/runtime/typedefs.h
@@ -87,6 +87,7 @@ typedef struct globals_s globals_t;
typedef struct defaults_s defaults_t;
typedef struct actions_s actions_t;
typedef struct rsconf_s rsconf_t;
+typedef struct cfgmodules_s cfgmodules_t;
typedef struct outchannels_s outchannels_t;
typedef rsRetVal (*prsf_t)(struct vmstk_s*, int); /* pointer to a RainerScript function */
typedef uint64 qDeqID; /* queue Dequeue order ID. 32 bits is considered dangerously few */