Removed test_binary_compatibility() from ctdlvisor.c because we don't do it that...
[citadel.git] / citadel / serv_extensions.c
index 3c62694c04706039b3a4ad503fb707e018f96f94..6197d2880563869a7d5dce70dd2f2ef5aa0affa3 100644 (file)
@@ -2,7 +2,7 @@
  * Citadel Extension Loader
  * Originally written by Brian Costello <btx@calyx.net>
  *
- * 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.
@@ -75,7 +75,7 @@ UserFunctionHook *UserHookTable = NULL;
 typedef struct MessageFunctionHook MessageFunctionHook;
 struct MessageFunctionHook {
        MessageFunctionHook *next;
-       int (*h_function_pointer) (struct CtdlMessage *msg, recptypes *recps);
+       int (*h_function_pointer) (struct CtdlMessage *msg, struct recptypes *recps);
        int eventtype;
 };
 MessageFunctionHook *MessageHookTable = NULL;
@@ -128,9 +128,6 @@ struct SearchFunctionHook {
 };
 SearchFunctionHook *SearchFunctionHookTable = NULL;
 
-CleanupFunctionHook *CleanupHookTable = NULL;
-CleanupFunctionHook *EVCleanupHookTable = NULL;
-
 ServiceFunctionHook *ServiceHookTable = NULL;
 
 typedef struct ProtoFunctionHook ProtoFunctionHook;
@@ -211,8 +208,8 @@ void LogPrintMessages(long err)
        StrBufAppendBufPlain(Message, HKEY("\n\n"), 0);
        StrBufAppendBufPlain(Message, CKEY(ErrGeneral[3]), 0);
 
-       syslog(LOG_EMERG, "extensions: %s", ChrPtr(Message));
-       syslog(LOG_EMERG, "extensions: %s", ErrSubject);
+       syslog(LOG_ERR, "extensions: %s", ChrPtr(Message));
+       syslog(LOG_ERR, "extensions: %s", ErrSubject);
        quickie_message("Citadel", NULL, NULL, AIDEROOM, ChrPtr(Message), FMT_FIXED, ErrSubject);
 
        FreeStrBuf(&Message);
@@ -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;
@@ -465,7 +374,7 @@ void CtdlUnregisterUserHook(void (*fcn_ptr) (struct ctdluser *), int EventType)
 }
 
 
-void CtdlRegisterMessageHook(int (*handler)(struct CtdlMessage *, recptypes *), int EventType)
+void CtdlRegisterMessageHook(int (*handler)(struct CtdlMessage *, struct recptypes *), int EventType)
 {
 
        MessageFunctionHook *newfcn;
@@ -481,7 +390,7 @@ void CtdlRegisterMessageHook(int (*handler)(struct CtdlMessage *, recptypes *),
 }
 
 
-void CtdlUnregisterMessageHook(int (*handler)(struct CtdlMessage *, recptypes *), int EventType)
+void CtdlUnregisterMessageHook(int (*handler)(struct CtdlMessage *, struct recptypes *), int EventType)
 {
        MessageFunctionHook *cur, *p, *last;
        last = NULL;
@@ -901,7 +810,7 @@ void PerformUserHooks(ctdluser *usbuf, int EventType)
        }
 }
 
-int PerformMessageHooks(struct CtdlMessage *msg, recptypes *recps, int EventType)
+int PerformMessageHooks(struct CtdlMessage *msg, struct recptypes *recps, int EventType)
 {
        MessageFunctionHook *fcn = NULL;
        int total_retval = 0;