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);
21 * Structure defentitions for hook tables
25 struct LogFunctionHook {
26 struct LogFunctionHook *next;
28 void (*h_function_pointer) (char *);
30 extern struct LogFunctionHook *LogHookTable;
32 struct CleanupFunctionHook {
33 struct CleanupFunctionHook *next;
34 void (*h_function_pointer) (void);
36 extern struct CleanupFunctionHook *CleanupHookTable;
38 struct FixedOutputHook {
39 struct FixedOutputHook *next;
40 char content_type[64];
41 void (*h_function_pointer) (char *, int);
43 extern struct FixedOutputHook *FixedOutputTable;
48 * SessionFunctionHook extensions are used for any type of hook for which
49 * the context in which it's being called (which is determined by the event
50 * type) will make it obvious for the hook function to know where to look for
53 struct SessionFunctionHook {
54 struct SessionFunctionHook *next;
55 void (*h_function_pointer) (void);
58 extern struct SessionFunctionHook *SessionHookTable;
62 * UserFunctionHook extensions are used for any type of hook which implements
63 * an operation on a user or username (potentially) other than the one
64 * operating the current session.
66 struct UserFunctionHook {
67 struct UserFunctionHook *next;
68 void (*h_function_pointer) (struct ctdluser *usbuf);
71 extern struct UserFunctionHook *UserHookTable;
74 * MessageFunctionHook extensions are used for hooks which implement handlers
75 * for various types of message operations (save, read, etc.)
77 struct MessageFunctionHook {
78 struct MessageFunctionHook *next;
79 int (*h_function_pointer) (struct CtdlMessage *msg);
82 extern struct MessageFunctionHook *MessageHookTable;
86 * NetprocFunctionHook extensions are used for hooks which implement handlers
87 * for incoming network messages.
89 struct NetprocFunctionHook {
90 struct NetprocFunctionHook *next;
91 int (*h_function_pointer) (struct CtdlMessage *msg, char *target_room);
93 extern struct NetprocFunctionHook *NetprocHookTable;
97 * DeleteFunctionHook extensions are used for hooks which get called when a
98 * message is about to be deleted.
100 struct DeleteFunctionHook {
101 struct DeleteFunctionHook *next;
102 void (*h_function_pointer) (char *target_room, long msgnum);
104 extern struct DeleteFunctionHook *DeleteHookTable;
108 * ExpressMessageFunctionHook extensions are used for hooks which implement
109 * the sending of an instant message through various channels. Any function
110 * registered should return the number of recipients to whom the message was
111 * successfully transmitted.
113 struct XmsgFunctionHook {
114 struct XmsgFunctionHook *next;
115 int (*h_function_pointer) (char *, char *, char *, char *);
118 extern struct XmsgFunctionHook *XmsgHookTable;
124 * ServiceFunctionHook extensions are used for hooks which implement various
125 * protocols (either on TCP or on unix domain sockets) directly in the Citadel server.
127 struct ServiceFunctionHook {
128 struct ServiceFunctionHook *next;
131 void (*h_greeting_function) (void) ;
132 void (*h_command_function) (void) ;
133 void (*h_async_function) (void) ;
135 const char* ServiceName; /* this is just for debugging and logging purposes. */
137 extern struct ServiceFunctionHook *ServiceHookTable;
141 * RoomFunctionHook extensions are used for hooks which impliment room
142 * processing functions when new messages are added EG. SIEVE.
144 struct RoomFunctionHook {
145 struct RoomFunctionHook *next;
146 int (*fcn_ptr) (struct ctdlroom *);
148 extern struct RoomFunctionHook *RoomHookTable;
152 struct SearchFunctionHook {
153 struct SearchFunctionHook *next;
154 void (*fcn_ptr) (int *, long **, const char *);
157 extern struct SearchFunctionHook *SearchFunctionHookTable;
161 void initialize_server_extensions(void);
162 int DLoader_Exec_Cmd(char *cmdbuf);
163 char *Dynamic_Module_Init(void);
165 void CtdlDestroySessionHooks(void);
166 void PerformSessionHooks(int EventType);
168 void CtdlDestroyUserHooks(void);
169 void PerformUserHooks(struct ctdluser *usbuf, int EventType);
171 int PerformXmsgHooks(char *, char *, char *, char *);
172 void CtdlDestroyXmsgHooks(void);
176 void CtdlDestroyMessageHook(void);
177 int PerformMessageHooks(struct CtdlMessage *, int EventType);
180 void CtdlDestroyNetprocHooks(void);
181 int PerformNetprocHooks(struct CtdlMessage *, char *);
183 void CtdlDestroyRoomHooks(void);
184 int PerformRoomHooks(struct ctdlroom *);
187 void CtdlDestroyDeleteHooks(void);
188 void PerformDeleteHooks(char *, long);
191 void CtdlDestroyCleanupHooks(void);
193 void CtdlDestroyProtoHooks(void);
195 void CtdlDestroyServiceHook(void);
197 void CtdlDestroySearchHooks(void);
199 void CtdlDestroyFixedOutputHooks(void);
200 int PerformFixedOutputHooks(char *, char *, int);
203 #endif /* SERV_EXTENSIONS_H */