* 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.
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;
};
SearchFunctionHook *SearchFunctionHookTable = NULL;
-CleanupFunctionHook *CleanupHookTable = NULL;
-CleanupFunctionHook *EVCleanupHookTable = NULL;
-
ServiceFunctionHook *ServiceHookTable = NULL;
typedef struct ProtoFunctionHook ProtoFunctionHook;
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);
}
-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;
}
-void CtdlRegisterMessageHook(int (*handler)(struct CtdlMessage *, recptypes *), int EventType)
+void CtdlRegisterMessageHook(int (*handler)(struct CtdlMessage *, struct recptypes *), int EventType)
{
MessageFunctionHook *newfcn;
}
-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;
}
}
-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;