From 3bb7ad8246bca95c89d68a8b0402b8482489c877 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 21 Nov 2007 16:34:48 +0000 Subject: - added an identifier to command handler table - need to identify which command handler entries need to be removed when module is unloaded - added support so that linkedlist key can be used for owner handle - enhanced llExecFunc to support deletion of list elements (on behalf of user function being called, slight interface change) - enhanced linkedlist class so that list elements can now be deleted based on the key value they have - created entry point so that CfSysLine handlers are removed on modExit() --- module-template.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'module-template.h') diff --git a/module-template.h b/module-template.h index 9521d08f..13ae4b86 100644 --- a/module-template.h +++ b/module-template.h @@ -44,6 +44,16 @@ #define STD_LOADABLE_MODULE_ID ((void*) modExit) +/* macro to implement the "modGetID()" interface function + * rgerhards 2007-11-21 + */ +#define DEFmodGetID \ +static rsRetVal modGetID(void **pID) \ + { \ + *pID = STD_LOADABLE_MODULE_ID;\ + return RS_RET_OK;\ + } + /* to following macros are used to generate function headers and standard * functionality. It works as follows (described on the sample case of * createInstance()): @@ -284,6 +294,7 @@ static rsRetVal tryResume(instanceData __attribute__((unused)) *pData)\ /* queryEtryPt() */ #define BEGINqueryEtryPt \ +DEFmodGetID \ static rsRetVal queryEtryPt(uchar *name, rsRetVal (**pEtryPoint)())\ {\ DEFiRet; @@ -324,6 +335,8 @@ static rsRetVal queryEtryPt(uchar *name, rsRetVal (**pEtryPoint)())\ *pEtryPoint = needUDPSocket;\ } else if(!strcmp((char*) name, "tryResume")) {\ *pEtryPoint = tryResume;\ + } else if(!strcmp((char*) name, "modGetID")) {\ + *pEtryPoint = modGetID;\ } -- cgit v1.2.3