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