2 #ifndef SERV_EXTENSIONS_H
3 #define SERV_EXTENSIONS_H
8 * This is where we declare all of the server extensions we have.
9 * We'll probably start moving these to a more sane location in the near
10 * future. For now, this just shuts up the compiler.
12 //void serv_calendar_destroy(void);
13 //char *serv_test_init(void);
14 //char *serv_postfix_tcpdict(void);
18 typedef void (*CtdlDbgFunction) (const int);
20 extern int DebugModules;
21 #define MDBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (DebugModules != 0))
23 #define MOD_syslog(LEVEL, FORMAT, ...) \
24 MDBGLOG(LEVEL) syslog(LEVEL, \
25 "Modules: " FORMAT, __VA_ARGS__)
27 #define MODM_syslog(LEVEL, FORMAT) \
28 MDBGLOG(LEVEL) syslog(LEVEL, \
35 * ServiceFunctionHook extensions are used for hooks which implement various
36 * protocols (either on TCP or on unix domain sockets) directly in the Citadel server.
38 typedef struct ServiceFunctionHook ServiceFunctionHook;
39 struct ServiceFunctionHook {
40 ServiceFunctionHook *next;
43 void (*h_greeting_function) (void) ;
44 void (*h_command_function) (void) ;
45 void (*h_async_function) (void) ;
47 const char* ServiceName; /* this is just for debugging and logging purposes. */
49 extern ServiceFunctionHook *ServiceHookTable;
51 typedef struct CleanupFunctionHook CleanupFunctionHook;
52 struct CleanupFunctionHook {
53 CleanupFunctionHook *next;
54 void (*h_function_pointer) (void);
56 extern CleanupFunctionHook *CleanupHookTable;
59 void initialize_server_extensions(void);
60 int DLoader_Exec_Cmd(char *cmdbuf);
61 char *Dynamic_Module_Init(void);
63 void CtdlDestroySessionHooks(void);
64 void PerformSessionHooks(int EventType);
66 void CtdlDestroyUserHooks(void);
67 void PerformUserHooks(struct ctdluser *usbuf, int EventType);
69 int PerformXmsgHooks(char *, char *, char *, char *);
70 void CtdlDestroyXmsgHooks(void);
74 void CtdlDestroyMessageHook(void);
75 int PerformMessageHooks(struct CtdlMessage *, int EventType);
78 void CtdlDestroyNetprocHooks(void);
79 int PerformNetprocHooks(struct CtdlMessage *, char *);
81 void CtdlDestroyRoomHooks(void);
82 int PerformRoomHooks(struct ctdlroom *);
85 void CtdlDestroyDeleteHooks(void);
86 void PerformDeleteHooks(char *, long);
89 void CtdlDestroyCleanupHooks(void);
91 void CtdlDestroyProtoHooks(void);
93 void CtdlDestroyServiceHook(void);
95 void CtdlDestroySearchHooks(void);
97 void CtdlDestroyFixedOutputHooks(void);
98 int PerformFixedOutputHooks(char *, char *, int);
100 void CtdlRegisterDebugFlagHook(const char *Name, long len, CtdlDbgFunction F, const int *);
101 void CtdlSetDebugLogFacilities(const char **Str, long n);
102 void CtdlDestroyDebugTable(void);
104 #endif /* SERV_EXTENSIONS_H */