de8502648f6ea42295aca05056841cd0e5dae60d
[citadel.git] / citadel / serv_extensions.h
1
2 #ifndef SERV_EXTENSIONS_H
3 #define SERV_EXTENSIONS_H
4
5 #include "server.h"
6
7 /*
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.
11  */
12 //void serv_calendar_destroy(void);
13 //char *serv_test_init(void);
14 //char *serv_postfix_tcpdict(void);
15 /*
16  */
17
18 typedef void (*CtdlDbgFunction) (const int);
19
20 extern int DebugModules;
21 #define MDBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (DebugModules != 0))
22
23 #define MOD_syslog(LEVEL, FORMAT, ...)                          \
24         MDBGLOG(LEVEL) syslog(LEVEL,                            \
25                               "Modules: " FORMAT, __VA_ARGS__)
26
27 #define MODM_syslog(LEVEL, FORMAT)                      \
28         MDBGLOG(LEVEL) syslog(LEVEL,                    \
29                               "Modules: " FORMAT);
30
31
32
33
34 /*
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.
37  */
38 typedef struct ServiceFunctionHook ServiceFunctionHook;
39 struct ServiceFunctionHook {
40         ServiceFunctionHook *next;
41         int tcp_port;
42         char *sockpath;
43         void (*h_greeting_function) (void) ;
44         void (*h_command_function) (void) ;
45         void (*h_async_function) (void) ;
46         int msock;
47         const char* ServiceName; /* this is just for debugging and logging purposes. */
48 };
49 extern ServiceFunctionHook *ServiceHookTable;
50
51 typedef struct CleanupFunctionHook CleanupFunctionHook;
52 struct CleanupFunctionHook {
53         CleanupFunctionHook *next;
54         void (*h_function_pointer) (void);
55 };
56 extern CleanupFunctionHook *CleanupHookTable;
57
58
59 void initialize_server_extensions(void);
60 int DLoader_Exec_Cmd(char *cmdbuf);
61 char *Dynamic_Module_Init(void);
62
63 void CtdlDestroySessionHooks(void);
64 void PerformSessionHooks(int EventType);
65
66 int CheckTDAPVeto (int DBType, StrBuf *ErrMsg);
67 void CtdlDestroyTDAPVetoHooks(void);
68
69 void CtdlDestroyUserHooks(void);
70 void PerformUserHooks(struct ctdluser *usbuf, int EventType);
71
72 int PerformXmsgHooks(char *, char *, char *, char *);
73 void CtdlDestroyXmsgHooks(void);
74
75
76
77 void CtdlDestroyMessageHook(void);
78 int PerformMessageHooks(struct CtdlMessage *, int EventType);
79
80
81 void CtdlDestroyNetprocHooks(void);
82 int PerformNetprocHooks(struct CtdlMessage *, char *);
83
84 void CtdlDestroyRoomHooks(void);
85 int PerformRoomHooks(struct ctdlroom *);
86
87
88 void CtdlDestroyDeleteHooks(void);
89 void PerformDeleteHooks(char *, long);
90
91
92 void CtdlDestroyCleanupHooks(void);
93
94 void CtdlDestroyProtoHooks(void);
95
96 void CtdlDestroyServiceHook(void);
97
98 void CtdlDestroySearchHooks(void);
99
100 void CtdlDestroyFixedOutputHooks(void);
101 int PerformFixedOutputHooks(char *, char *, int);
102
103 void CtdlRegisterDebugFlagHook(const char *Name, long len, CtdlDbgFunction F, const int *);
104 void CtdlSetDebugLogFacilities(const char **Str, long n);
105 void CtdlDestroyDebugTable(void);
106
107 #endif /* SERV_EXTENSIONS_H */