#include <string.h>
#include <limits.h>
#include <ctype.h>
+#include <libcitadel.h>
#include "citadel.h"
#include "server.h"
#include "serv_extensions.h"
#include "sysdep_decls.h"
#include "msgbase.h"
-#include "tools.h"
#include "config.h"
#include "modules/crypto/serv_crypto.h" /* Needed until a universal crypto startup hook is implimented for CtdlStartTLS */
struct ServiceFunctionHook *ServiceHookTable = NULL;
struct FixedOutputHook *FixedOutputTable = NULL;
struct RoomFunctionHook *RoomHookTable = NULL;
-struct MaintenanceThreadHook *MaintenanceThreadHookTable = NULL;
struct SearchFunctionHook *SearchFunctionHookTable = NULL;
struct ProtoFunctionHook {
char *ErrPortHint = "If you want citadel to provide you with that functionality, "
"check the output of \"netstat -lnp\" on linux Servers or \"netstat -na\" on *BSD"
" and stop the programm, that binds these ports. You should eventually remove "
-" their initscripts in /etc/init.d so that you won't get this trouble once more.\n";
+" their initscripts in /etc/init.d so that you won't get this trouble once more.\n"
+" After that goto Administration -> Shutdown Citadel to make Citadel retry to bind this port.\n";
void LogPrintMessages(long err)
}
+int DLoader_Exec_Cmd(char *cmdbuf)
+{
+ struct ProtoFunctionHook *p;
+
+ for (p = ProtoHookList; p; p = p->next) {
+ if (!strncasecmp(cmdbuf, p->cmd, 4)) {
+ p->handler(&cmdbuf[5]);
+ return 1;
+ }
+ }
+ return 0;
+}
+
+
void CtdlRegisterProtoHook(void (*handler) (char *), char *cmd, char *desc)
{
struct ProtoFunctionHook *p;
}
-int DLoader_Exec_Cmd(char *cmdbuf)
-{
- struct ProtoFunctionHook *p;
-
- for (p = ProtoHookList; p; p = p->next) {
- if (!strncasecmp(cmdbuf, p->cmd, 4)) {
- p->handler(&cmdbuf[5]);
- return 1;
- }
- }
- return 0;
-}
-
-
void CtdlRegisterCleanupHook(void (*fcn_ptr) (void))
{
-void CtdlRegisterXmsgHook(int (*fcn_ptr) (char *, char *, char *), int order)
+void CtdlRegisterXmsgHook(int (*fcn_ptr) (char *, char *, char *, char *), int order)
{
struct XmsgFunctionHook *newfcn;
- newfcn = (struct XmsgFunctionHook *)
- malloc(sizeof(struct XmsgFunctionHook));
+ newfcn = (struct XmsgFunctionHook *) malloc(sizeof(struct XmsgFunctionHook));
newfcn->next = XmsgHookTable;
newfcn->order = order;
newfcn->h_function_pointer = fcn_ptr;
}
-void CtdlUnregisterXmsgHook(int (*fcn_ptr) (char *, char *, char *), int order)
+void CtdlUnregisterXmsgHook(int (*fcn_ptr) (char *, char *, char *, char *), int order)
{
struct XmsgFunctionHook *cur, *p;
-int PerformXmsgHooks(char *sender, char *recp, char *msg)
+int PerformXmsgHooks(char *sender, char *sender_email, char *recp, char *msg)
{
struct XmsgFunctionHook *fcn;
int total_sent = 0;
if (fcn->order == p) {
total_sent +=
(*fcn->h_function_pointer)
- (sender, recp, msg);
+ (sender, sender_email, recp, msg);
}
}
/* Break out of the loop if a higher-priority function
return total_sent;
}
-void CtdlRegisterMaintenanceThread(char *name, void *(*thread_proc)(void *arg))
-{
- struct MaintenanceThreadHook *newfcn;
-
- newfcn = (struct MaintenanceThreadHook *)
- malloc(sizeof(struct MaintenanceThreadHook));
- newfcn->name = name;
- newfcn->next = MaintenanceThreadHookTable;
- newfcn->fcn_ptr = thread_proc;
- MaintenanceThreadHookTable = newfcn;
-
- lprintf(CTDL_INFO, "Registered a new maintenance thread function\n");
-}