X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fserv_extensions.c;h=f066846d7e58fbc44e49be8594a0194aedd0344d;hb=f4d96b5cb3e5b6020db528f9571b3da20618f9a0;hp=21d36c66804fff9367ef32c07cc464d294eb2a50;hpb=8eacce58cbc89e62b60fbdd0d3e1c5238f2bef1a;p=citadel.git diff --git a/citadel/serv_extensions.c b/citadel/serv_extensions.c index 21d36c668..f066846d7 100644 --- a/citadel/serv_extensions.c +++ b/citadel/serv_extensions.c @@ -28,7 +28,6 @@ #include "snprintf.h" #endif -struct LogFunctionHook *LogHookTable = NULL; struct CleanupFunctionHook *CleanupHookTable = NULL; struct SessionFunctionHook *SessionHookTable = NULL; struct UserFunctionHook *UserHookTable = NULL; @@ -128,43 +127,6 @@ void initialize_server_extensions(void) -void CtdlRegisterLogHook(void (*fcn_ptr) (char *), int loglevel) -{ - - struct LogFunctionHook *newfcn; - - newfcn = (struct LogFunctionHook *) - malloc(sizeof(struct LogFunctionHook)); - newfcn->next = LogHookTable; - newfcn->h_function_pointer = fcn_ptr; - newfcn->loglevel = loglevel; - LogHookTable = newfcn; - - lprintf(CTDL_INFO, "Registered a new logging function\n"); -} - - -void CtdlUnregisterLogHook(void (*fcn_ptr) (char *), int loglevel) -{ - struct LogFunctionHook *cur, *p; - - for (cur = LogHookTable; cur != NULL; cur = cur->next) { - /* This will also remove duplicates if any */ - while (cur != NULL && - fcn_ptr == cur->h_function_pointer && - loglevel == cur->loglevel) { - lprintf(CTDL_INFO, "Unregistered logging function\n"); - p = cur->next; - if (cur == LogHookTable) { - LogHookTable = p; - } - free(cur); - cur = p; - } - } -} - - void CtdlRegisterCleanupHook(void (*fcn_ptr) (void)) { @@ -520,17 +482,6 @@ void PerformSessionHooks(int EventType) } } -void PerformLogHooks(int loglevel, char *logmsg) -{ - struct LogFunctionHook *fcn; - - for (fcn = LogHookTable; fcn != NULL; fcn = fcn->next) { - if (fcn->loglevel >= loglevel) { - (*fcn->h_function_pointer) (logmsg); - } - } -} - void PerformUserHooks(struct ctdluser *usbuf, int EventType) { struct UserFunctionHook *fcn;