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 "%s Modules: " FORMAT, IOSTR, __VA_ARGS__)
27 #define MODM_syslog(LEVEL, FORMAT) \
28 MDBGLOG(LEVEL) syslog(LEVEL, \
29 "%s Modules: " FORMAT, IOSTR);
32 extern int EnableMarkers;
33 #define MARKLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (EnableMarkers != 0))
35 #define MARK_syslog(LEVEL, FORMAT, ...) \
36 MARKLOG(LEVEL) syslog(LEVEL, \
37 "%s: " FORMAT, IOSTR, __VA_ARGS__)
39 #define MARKM_syslog(LEVEL, FORMAT) \
40 MARKLOG(LEVEL) syslog(LEVEL, \
41 "%s: " FORMAT, IOSTR);
44 extern int EnableCtlProto;
45 #define CTDLLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (EnableCtlProto != 0))
47 #define CTDL_syslog(LEVEL, FORMAT, ...) \
48 CTDLLOG(LEVEL) syslog(LEVEL, \
49 "%s CC[%d]: " FORMAT, IOSTR, CCCID, __VA_ARGS__)
51 #define CTDLM_syslog(LEVEL, FORMAT) \
52 CTDLLOG(LEVEL) syslog(LEVEL, \
53 "%s CC[%d]: " FORMAT, IOSTR, CCCID);
58 * ServiceFunctionHook extensions are used for hooks which implement various
59 * protocols (either on TCP or on unix domain sockets) directly in the Citadel server.
61 typedef struct ServiceFunctionHook ServiceFunctionHook;
62 struct ServiceFunctionHook {
63 ServiceFunctionHook *next;
66 void (*h_greeting_function) (void) ;
67 void (*h_command_function) (void) ;
68 void (*h_async_function) (void) ;
70 const char* ServiceName; /* this is just for debugging and logging purposes. */
72 extern ServiceFunctionHook *ServiceHookTable;
74 typedef struct CleanupFunctionHook CleanupFunctionHook;
75 struct CleanupFunctionHook {
76 CleanupFunctionHook *next;
77 void (*h_function_pointer) (void);
79 extern CleanupFunctionHook *CleanupHookTable;
82 typedef struct __LogDebugEntry {
88 extern HashList *LogDebugEntryTable;
89 void initialize_server_extensions(void);
90 int DLoader_Exec_Cmd(char *cmdbuf);
91 char *Dynamic_Module_Init(void);
93 void CtdlDestroySessionHooks(void);
94 void PerformSessionHooks(int EventType);
96 int CheckTDAPVeto (int DBType, StrBuf *ErrMsg);
97 void CtdlDestroyTDAPVetoHooks(void);
99 void CtdlDestroyUserHooks(void);
100 void PerformUserHooks(struct ctdluser *usbuf, int EventType);
102 int PerformXmsgHooks(char *, char *, char *, char *);
103 void CtdlDestroyXmsgHooks(void);
107 void CtdlDestroyMessageHook(void);
108 int PerformMessageHooks(struct CtdlMessage *, recptypes *recps, int EventType);
111 void CtdlDestroyNetprocHooks(void);
112 int PerformNetprocHooks(struct CtdlMessage *, char *);
114 void CtdlDestroyRoomHooks(void);
115 int PerformRoomHooks(struct ctdlroom *);
118 void CtdlDestroyDeleteHooks(void);
119 void PerformDeleteHooks(char *, long);
122 void CtdlDestroyCleanupHooks(void);
124 void CtdlDestroyProtoHooks(void);
126 void CtdlDestroyServiceHook(void);
128 void CtdlDestroySearchHooks(void);
130 void CtdlDestroyFixedOutputHooks(void);
131 int PerformFixedOutputHooks(char *, char *, int);
133 void CtdlRegisterDebugFlagHook(const char *Name, long len, CtdlDbgFunction F, const int *);
134 void CtdlSetDebugLogFacilities(const char **Str, long n);
135 void CtdlDestroyDebugTable(void);
137 void netcfg_keyname(char *keybuf, long roomnum);
139 #endif /* SERV_EXTENSIONS_H */