Back to index

citadel  8.12
serv_extensions.h
Go to the documentation of this file.
00001 
00002 #ifndef SERV_EXTENSIONS_H
00003 #define SERV_EXTENSIONS_H
00004 
00005 #include "server.h"
00006 
00007 /*
00008  * This is where we declare all of the server extensions we have.
00009  * We'll probably start moving these to a more sane location in the near
00010  * future.  For now, this just shuts up the compiler.
00011  */
00012 //void serv_calendar_destroy(void);
00013 //char *serv_test_init(void);
00014 //char *serv_postfix_tcpdict(void);
00015 /*
00016  */
00017 
00018 typedef void (*CtdlDbgFunction) (const int);
00019 
00020 extern int DebugModules;
00021 #define MDBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (DebugModules != 0))
00022 
00023 #define MOD_syslog(LEVEL, FORMAT, ...)                         \
00024        MDBGLOG(LEVEL) syslog(LEVEL,                            \
00025                            "Modules: " FORMAT, __VA_ARGS__)
00026 
00027 #define MODM_syslog(LEVEL, FORMAT)               \
00028        MDBGLOG(LEVEL) syslog(LEVEL,                     \
00029                            "Modules: " FORMAT);
00030 
00031 
00032 
00033 
00034 /*
00035  * ServiceFunctionHook extensions are used for hooks which implement various
00036  * protocols (either on TCP or on unix domain sockets) directly in the Citadel server.
00037  */
00038 typedef struct ServiceFunctionHook ServiceFunctionHook;
00039 struct ServiceFunctionHook {
00040        ServiceFunctionHook *next;
00041        int tcp_port;
00042        char *sockpath;
00043        void (*h_greeting_function) (void) ;
00044        void (*h_command_function) (void) ;
00045        void (*h_async_function) (void) ;
00046        int msock;
00047        const char* ServiceName; /* this is just for debugging and logging purposes. */
00048 };
00049 extern ServiceFunctionHook *ServiceHookTable;
00050 
00051 typedef struct CleanupFunctionHook CleanupFunctionHook;
00052 struct CleanupFunctionHook {
00053        CleanupFunctionHook *next;
00054        void (*h_function_pointer) (void);
00055 };
00056 extern CleanupFunctionHook *CleanupHookTable;
00057 
00058 
00059 void initialize_server_extensions(void);
00060 int DLoader_Exec_Cmd(char *cmdbuf);
00061 char *Dynamic_Module_Init(void);
00062 
00063 void CtdlDestroySessionHooks(void);
00064 void PerformSessionHooks(int EventType);
00065 
00066 void CtdlDestroyUserHooks(void);
00067 void PerformUserHooks(struct ctdluser *usbuf, int EventType);
00068 
00069 int PerformXmsgHooks(char *, char *, char *, char *);
00070 void CtdlDestroyXmsgHooks(void);
00071 
00072 
00073 
00074 void CtdlDestroyMessageHook(void);
00075 int PerformMessageHooks(struct CtdlMessage *, int EventType);
00076 
00077 
00078 void CtdlDestroyNetprocHooks(void);
00079 int PerformNetprocHooks(struct CtdlMessage *, char *);
00080 
00081 void CtdlDestroyRoomHooks(void);
00082 int PerformRoomHooks(struct ctdlroom *);
00083 
00084 
00085 void CtdlDestroyDeleteHooks(void);
00086 void PerformDeleteHooks(char *, long);
00087 
00088 
00089 void CtdlDestroyCleanupHooks(void);
00090 
00091 void CtdlDestroyProtoHooks(void);
00092 
00093 void CtdlDestroyServiceHook(void);
00094 
00095 void CtdlDestroySearchHooks(void);
00096 
00097 void CtdlDestroyFixedOutputHooks(void);
00098 int PerformFixedOutputHooks(char *, char *, int);
00099 
00100 void CtdlRegisterDebugFlagHook(const char *Name, long len, CtdlDbgFunction F, const int *);
00101 void CtdlSetDebugLogFacilities(const char **Str, long n);
00102 void CtdlDestroyDebugTable(void);
00103 
00104 #endif /* SERV_EXTENSIONS_H */