X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fserv_extensions.c;h=cc594ce655f1a839a636245fa1aaf8116a71c450;hp=3c62694c04706039b3a4ad503fb707e018f96f94;hb=8e944083763c9ddcb32d763cf8f19c966d01f873;hpb=ab6b11ab4005e990fbb368b14c42630b7694c54f diff --git a/citadel/serv_extensions.c b/citadel/serv_extensions.c index 3c62694c0..cc594ce65 100644 --- a/citadel/serv_extensions.c +++ b/citadel/serv_extensions.c @@ -2,7 +2,7 @@ * Citadel Extension Loader * Originally written by Brian Costello * - * Copyright (c) 1987-2020 by the citadel.org team + * Copyright (c) 1987-2021 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 3. @@ -128,9 +128,6 @@ struct SearchFunctionHook { }; SearchFunctionHook *SearchFunctionHookTable = NULL; -CleanupFunctionHook *CleanupHookTable = NULL; -CleanupFunctionHook *EVCleanupHookTable = NULL; - ServiceFunctionHook *ServiceHookTable = NULL; typedef struct ProtoFunctionHook ProtoFunctionHook; @@ -278,94 +275,6 @@ void CtdlRegisterProtoHook(void (*handler) (char *), char *cmd, char *desc) } -void CtdlRegisterCleanupHook(void (*fcn_ptr) (void)) -{ - - CleanupFunctionHook *newfcn; - - newfcn = (CleanupFunctionHook *) - malloc(sizeof(CleanupFunctionHook)); - newfcn->next = CleanupHookTable; - newfcn->h_function_pointer = fcn_ptr; - CleanupHookTable = newfcn; - - syslog(LOG_DEBUG, "extensions: registered a new cleanup function"); -} - - -void CtdlUnregisterCleanupHook(void (*fcn_ptr) (void)) -{ - CleanupFunctionHook *cur, *p, *last; - last = NULL; - cur = CleanupHookTable; - while (cur != NULL) - { - if (fcn_ptr == cur->h_function_pointer) - { - syslog(LOG_DEBUG, "extensions: unregistered cleanup function"); - p = cur->next; - - free(cur); - cur = NULL; - - if (last != NULL) - last->next = p; - else - CleanupHookTable = p; - cur = p; - } - else { - last = cur; - cur = cur->next; - } - } -} - - -void CtdlRegisterEVCleanupHook(void (*fcn_ptr) (void)) -{ - - CleanupFunctionHook *newfcn; - - newfcn = (CleanupFunctionHook *) - malloc(sizeof(CleanupFunctionHook)); - newfcn->next = EVCleanupHookTable; - newfcn->h_function_pointer = fcn_ptr; - EVCleanupHookTable = newfcn; - - syslog(LOG_DEBUG, "extensions: registered a new cleanup function"); -} - - -void CtdlUnregisterEVCleanupHook(void (*fcn_ptr) (void)) -{ - CleanupFunctionHook *cur, *p, *last; - last = NULL; - cur = EVCleanupHookTable; - while (cur != NULL) - { - if (fcn_ptr == cur->h_function_pointer) - { - syslog(LOG_DEBUG, "extensions: unregistered cleanup function"); - p = cur->next; - - free(cur); - cur = NULL; - - if (last != NULL) - last->next = p; - else - EVCleanupHookTable = p; - cur = p; - } - else { - last = cur; - cur = cur->next; - } - } -} - - void CtdlRegisterSessionHook(void (*fcn_ptr) (void), int EventType, int Priority) { SessionFunctionHook *newfcn;