summaryrefslogtreecommitdiffstats
path: root/omshell.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-07-23 17:24:41 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-07-23 17:24:41 +0000
commit9ee5888309e1f39f52546deaea4bcd3bdc216d8d (patch)
treea46550eb83762539b375063e6e74d828d1ebb42f /omshell.c
parent8f236abd49739c0f791c5b893433f7dfa40d3dd8 (diff)
downloadrsyslog-9ee5888309e1f39f52546deaea4bcd3bdc216d8d.tar.gz
rsyslog-9ee5888309e1f39f52546deaea4bcd3bdc216d8d.tar.xz
rsyslog-9ee5888309e1f39f52546deaea4bcd3bdc216d8d.zip
continued working on modularization; begun to create interface for
configuring actions selector lines; begun basic functionality for module initialization and loading built-in modules.
Diffstat (limited to 'omshell.c')
-rw-r--r--omshell.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/omshell.c b/omshell.c
index 001fbe2d..05d61a9e 100644
--- a/omshell.c
+++ b/omshell.c
@@ -61,6 +61,42 @@ int doActionShell(selector_t *f)
return 0;
}
+/* query an entry point
+ */
+static rsRetVal queryEtryPt(uchar *name, rsRetVal (**pEtryPoint)())
+{
+ if((name == NULL) || (pEtryPoint == NULL))
+ return RS_RET_PARAM_ERROR;
+
+ *pEtryPoint = NULL;
+ if(!strcmp((char*) name, "doAction")) {
+ *pEtryPoint = doActionShell;
+ } /*else if(!strcmp((char*) name, "freeInstance")) {
+ *pEtryPoint = freeInstanceFile;
+ }*/
+
+ return(*pEtryPoint == NULL) ? RS_RET_NOT_FOUND : RS_RET_OK;
+}
+
+/* initialize the module
+ *
+ * Later, much more must be done. So far, we only return a pointer
+ * to the queryEtryPt() function
+ * TODO: do interface version checking & handshaking
+ * iIfVersRequeted is the version of the interface specification that the
+ * caller would like to see being used. ipIFVersProvided is what we
+ * decide to provide.
+ */
+rsRetVal modInitShell(int iIFVersRequested __attribute__((unused)), int *ipIFVersProvided, rsRetVal (**pQueryEtryPt)())
+{
+ if((pQueryEtryPt == NULL) || (ipIFVersProvided == NULL))
+ return RS_RET_PARAM_ERROR;
+
+ *ipIFVersProvided = 1; /* so far, we only support the initial definition */
+
+ *pQueryEtryPt = queryEtryPt;
+ return RS_RET_OK;
+}
/*
* vi:set ai:
*/