diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2007-08-02 13:22:23 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2007-08-02 13:22:23 +0000 |
commit | 2b2cdb5a6c2e8659771451571c77844488c6fa92 (patch) | |
tree | 003a80adf06626daaa4effa81fe63a50383642b0 /module-template.h | |
parent | 9f7b03b801ed82e499666e5c29b4dda094fb1d57 (diff) | |
download | rsyslog-2b2cdb5a6c2e8659771451571c77844488c6fa92.tar.gz rsyslog-2b2cdb5a6c2e8659771451571c77844488c6fa92.tar.xz rsyslog-2b2cdb5a6c2e8659771451571c77844488c6fa92.zip |
added tryResume() API to module interface
Diffstat (limited to 'module-template.h')
-rw-r--r-- | module-template.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/module-template.h b/module-template.h index 9cad16ff..2ef4a174 100644 --- a/module-template.h +++ b/module-template.h @@ -235,6 +235,29 @@ do_abort:\ } +/* tryResume() + * This entry point is called to check if a module can resume operations. This + * happens when a module requested that it be suspended. In suspended state, + * the engine periodically tries to resume the module. If that succeeds, normal + * processing continues. If not, the module will not be called unless a + * tryResume() call succeeds. + * Returns RS_RET_OK, if resumption succeeded, RS_RET_SUSPENDED otherwise + * rgerhard, 2007-08-02 + */ +#define BEGINtryResume \ +static rsRetVal tryResume(instanceData __attribute__((unused)) *pData)\ +{\ + DEFiRet; + +#define CODESTARTtryResume \ + assert(pData != NULL); + +#define ENDtryResume \ + return iRet;\ +} + + + /* queryEtryPt() */ #define BEGINqueryEtryPt \ @@ -274,6 +297,8 @@ static rsRetVal queryEtryPt(uchar *name, rsRetVal (**pEtryPoint)())\ *pEtryPoint = onSelectReadyWrite;\ } else if(!strcmp((char*) name, "needUDPSocket")) {\ *pEtryPoint = needUDPSocket;\ + } else if(!strcmp((char*) name, "tryResume")) {\ + *pEtryPoint = tryResume;\ } /* modInit() |