* es.po: the correct license for this file was supposed to be GPL v2-or-later, not...
[citadel.git] / citadel / serv_extensions.h
blob9256798e5d1daf8e08682fd928782d2b65226730
1 /* $Id$ */
3 #ifndef SERV_EXTENSIONS_H
4 #define SERV_EXTENSIONS_H
6 #include "server.h"
8 /*
9 * This is where we declare all of the server extensions we have.
10 * We'll probably start moving these to a more sane location in the near
11 * future. For now, this just shuts up the compiler.
13 //void serv_calendar_destroy(void);
14 //char *serv_test_init(void);
15 //char *serv_postfix_tcpdict(void);
22 * Structure defentitions for hook tables
26 struct LogFunctionHook {
27 struct LogFunctionHook *next;
28 int loglevel;
29 void (*h_function_pointer) (char *);
31 extern struct LogFunctionHook *LogHookTable;
33 struct CleanupFunctionHook {
34 struct CleanupFunctionHook *next;
35 void (*h_function_pointer) (void);
37 extern struct CleanupFunctionHook *CleanupHookTable;
39 struct FixedOutputHook {
40 struct FixedOutputHook *next;
41 char content_type[64];
42 void (*h_function_pointer) (char *, int);
44 extern struct FixedOutputHook *FixedOutputTable;
49 * SessionFunctionHook extensions are used for any type of hook for which
50 * the context in which it's being called (which is determined by the event
51 * type) will make it obvious for the hook function to know where to look for
52 * pertinent data.
54 struct SessionFunctionHook {
55 struct SessionFunctionHook *next;
56 void (*h_function_pointer) (void);
57 int eventtype;
59 extern struct SessionFunctionHook *SessionHookTable;
63 * UserFunctionHook extensions are used for any type of hook which implements
64 * an operation on a user or username (potentially) other than the one
65 * operating the current session.
67 struct UserFunctionHook {
68 struct UserFunctionHook *next;
69 void (*h_function_pointer) (struct ctdluser *usbuf);
70 int eventtype;
72 extern struct UserFunctionHook *UserHookTable;
75 * MessageFunctionHook extensions are used for hooks which implement handlers
76 * for various types of message operations (save, read, etc.)
78 struct MessageFunctionHook {
79 struct MessageFunctionHook *next;
80 int (*h_function_pointer) (struct CtdlMessage *msg);
81 int eventtype;
83 extern struct MessageFunctionHook *MessageHookTable;
87 * NetprocFunctionHook extensions are used for hooks which implement handlers
88 * for incoming network messages.
90 struct NetprocFunctionHook {
91 struct NetprocFunctionHook *next;
92 int (*h_function_pointer) (struct CtdlMessage *msg, char *target_room);
94 extern struct NetprocFunctionHook *NetprocHookTable;
98 * DeleteFunctionHook extensions are used for hooks which get called when a
99 * message is about to be deleted.
101 struct DeleteFunctionHook {
102 struct DeleteFunctionHook *next;
103 void (*h_function_pointer) (char *target_room, long msgnum);
105 extern struct DeleteFunctionHook *DeleteHookTable;
109 * ExpressMessageFunctionHook extensions are used for hooks which implement
110 * the sending of an instant message through various channels. Any function
111 * registered should return the number of recipients to whom the message was
112 * successfully transmitted.
114 struct XmsgFunctionHook {
115 struct XmsgFunctionHook *next;
116 int (*h_function_pointer) (char *, char *, char *, char *);
117 int order;
119 extern struct XmsgFunctionHook *XmsgHookTable;
125 * ServiceFunctionHook extensions are used for hooks which implement various
126 * protocols (either on TCP or on unix domain sockets) directly in the Citadel server.
128 struct ServiceFunctionHook {
129 struct ServiceFunctionHook *next;
130 int tcp_port;
131 char *sockpath;
132 void (*h_greeting_function) (void) ;
133 void (*h_command_function) (void) ;
134 void (*h_async_function) (void) ;
135 int msock;
136 const char* ServiceName; /* this is just for debugging and logging purposes. */
138 extern struct ServiceFunctionHook *ServiceHookTable;
142 * RoomFunctionHook extensions are used for hooks which impliment room
143 * processing functions when new messages are added EG. SIEVE.
145 struct RoomFunctionHook {
146 struct RoomFunctionHook *next;
147 int (*fcn_ptr) (struct ctdlroom *);
149 extern struct RoomFunctionHook *RoomHookTable;
153 struct SearchFunctionHook {
154 struct SearchFunctionHook *next;
155 void (*fcn_ptr) (int *, long **, char *);
156 char *name;
158 extern struct SearchFunctionHook *SearchFunctionHookTable;
162 void initialize_server_extensions(void);
163 int DLoader_Exec_Cmd(char *cmdbuf);
164 char *Dynamic_Module_Init(void);
166 void CtdlDestroySessionHooks(void);
167 void PerformSessionHooks(int EventType);
169 void CtdlDestroyUserHooks(void);
170 void PerformUserHooks(struct ctdluser *usbuf, int EventType);
172 int PerformXmsgHooks(char *, char *, char *, char *);
173 void CtdlDestroyXmsgHooks(void);
177 void CtdlDestroyMessageHook(void);
178 int PerformMessageHooks(struct CtdlMessage *, int EventType);
181 void CtdlDestroyNetprocHooks(void);
182 int PerformNetprocHooks(struct CtdlMessage *, char *);
184 void CtdlDestroyRoomHooks(void);
185 int PerformRoomHooks(struct ctdlroom *);
188 void CtdlDestroyDeleteHooks(void);
189 void PerformDeleteHooks(char *, long);
192 void CtdlDestroyCleanupHooks(void);
194 void CtdlDestroyProtoHooks(void);
196 void CtdlDestroyServiceHook(void);
198 void CtdlDestroyFixedOutputHooks(void);
199 int PerformFixedOutputHooks(char *, char *, int);
201 void CtdlModuleDoSearch(int *num_msgs, long **search_msgs, char *search_string, char *func_name);
203 void CtdlDestroyDirectoryServiceFuncs(void);
205 #endif /* SERV_EXTENSIONS_H */