diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2007-07-23 17:24:41 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2007-07-23 17:24:41 +0000 |
commit | 9ee5888309e1f39f52546deaea4bcd3bdc216d8d (patch) | |
tree | a46550eb83762539b375063e6e74d828d1ebb42f /ommysql.c | |
parent | 8f236abd49739c0f791c5b893433f7dfa40d3dd8 (diff) | |
download | rsyslog-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 'ommysql.c')
-rw-r--r-- | ommysql.c | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -268,6 +268,42 @@ int doActionMySQL(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 = doActionMySQL; + } /*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 modInitMySQL(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; +} #endif /* #ifdef WITH_DB */ /* * vi:set ai: |