59dcfec3a3b93d11d3e064b1351eb3b99a016d17
[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
21
22 /*
23  * ServiceFunctionHook extensions are used for hooks which implement various
24  * protocols (either on TCP or on unix domain sockets) directly in the Citadel server.
25  */
26 typedef struct ServiceFunctionHook ServiceFunctionHook;
27 struct ServiceFunctionHook {
28         ServiceFunctionHook *next;
29         int tcp_port;
30         char *sockpath;
31         void (*h_greeting_function) (void) ;
32         void (*h_command_function) (void) ;
33         void (*h_async_function) (void) ;
34         int msock;
35         const char* ServiceName; /* this is just for debugging and logging purposes. */
36 };
37 extern ServiceFunctionHook *ServiceHookTable;
38
39 typedef struct CleanupFunctionHook CleanupFunctionHook;
40 struct CleanupFunctionHook {
41         CleanupFunctionHook *next;
42         void (*h_function_pointer) (void);
43 };
44 extern CleanupFunctionHook *CleanupHookTable;
45
46
47 void initialize_server_extensions(void);
48 int DLoader_Exec_Cmd(char *cmdbuf);
49 char *Dynamic_Module_Init(void);
50
51 void CtdlDestroySessionHooks(void);
52 void PerformSessionHooks(int EventType);
53
54 void CtdlDestroyUserHooks(void);
55 void PerformUserHooks(struct ctdluser *usbuf, int EventType);
56
57 int PerformXmsgHooks(char *, char *, char *, char *);
58 void CtdlDestroyXmsgHooks(void);
59
60
61
62 void CtdlDestroyMessageHook(void);
63 int PerformMessageHooks(struct CtdlMessage *, int EventType);
64
65
66 void CtdlDestroyNetprocHooks(void);
67 int PerformNetprocHooks(struct CtdlMessage *, char *);
68
69 void CtdlDestroyRoomHooks(void);
70 int PerformRoomHooks(struct ctdlroom *);
71
72
73 void CtdlDestroyDeleteHooks(void);
74 void PerformDeleteHooks(char *, long);
75
76
77 void CtdlDestroyCleanupHooks(void);
78
79 void CtdlDestroyProtoHooks(void);
80
81 void CtdlDestroyServiceHook(void);
82
83 void CtdlDestroySearchHooks(void);
84
85 void CtdlDestroyFixedOutputHooks(void);
86 int PerformFixedOutputHooks(char *, char *, int);
87
88 void CtdlRegisterDebugFlagHook(const char *Name, long len, CtdlDbgFunction F, const int *);
89 void CtdlSetDebugLogFacilities(const char **Str, long n);
90 void CtdlDestroyDebugTable(void);
91
92 #endif /* SERV_EXTENSIONS_H */