X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fserv_extensions.h;h=f4f720144d090da94eb6d5d816dddf35cbe31cb8;hb=9f3bb5c0737c12bd1765425ad8676d5cde03f52f;hp=f0e1cedb097baf6d5fe58670ee0bef406048d488;hpb=01cc19a4c2da27b4db0e980ccd3ca54d834319c8;p=citadel.git diff --git a/citadel/serv_extensions.h b/citadel/serv_extensions.h index f0e1cedb0..f4f720144 100644 --- a/citadel/serv_extensions.h +++ b/citadel/serv_extensions.h @@ -1,4 +1,3 @@ -/* $Id$ */ #ifndef SERV_EXTENSIONS_H #define SERV_EXTENSIONS_H @@ -10,12 +9,53 @@ * We'll probably start moving these to a more sane location in the near * future. For now, this just shuts up the compiler. */ -void serv_calendar_destroy(void); -char *serv_test_init(void); -char *serv_postfix_tcpdict(void); +//void serv_calendar_destroy(void); +//char *serv_test_init(void); +//char *serv_postfix_tcpdict(void); /* */ +typedef void (*CtdlDbgFunction) (const int); + +extern int DebugModules; +#define MDBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (DebugModules != 0)) + +#define MOD_syslog(LEVEL, FORMAT, ...) \ + MDBGLOG(LEVEL) syslog(LEVEL, \ + "Modules: " FORMAT, __VA_ARGS__) + +#define MODM_syslog(LEVEL, FORMAT) \ + MDBGLOG(LEVEL) syslog(LEVEL, \ + "Modules: " FORMAT); + + + + +/* + * ServiceFunctionHook extensions are used for hooks which implement various + * protocols (either on TCP or on unix domain sockets) directly in the Citadel server. + */ +typedef struct ServiceFunctionHook ServiceFunctionHook; +struct ServiceFunctionHook { + ServiceFunctionHook *next; + int tcp_port; + char *sockpath; + void (*h_greeting_function) (void) ; + void (*h_command_function) (void) ; + void (*h_async_function) (void) ; + int msock; + const char* ServiceName; /* this is just for debugging and logging purposes. */ +}; +extern ServiceFunctionHook *ServiceHookTable; + +typedef struct CleanupFunctionHook CleanupFunctionHook; +struct CleanupFunctionHook { + CleanupFunctionHook *next; + void (*h_function_pointer) (void); +}; +extern CleanupFunctionHook *CleanupHookTable; + + void initialize_server_extensions(void); int DLoader_Exec_Cmd(char *cmdbuf); char *Dynamic_Module_Init(void); @@ -26,7 +66,7 @@ void PerformSessionHooks(int EventType); void CtdlDestroyUserHooks(void); void PerformUserHooks(struct ctdluser *usbuf, int EventType); -int PerformXmsgHooks(char *, char *, char *); +int PerformXmsgHooks(char *, char *, char *, char *); void CtdlDestroyXmsgHooks(void); @@ -52,7 +92,13 @@ void CtdlDestroyProtoHooks(void); void CtdlDestroyServiceHook(void); +void CtdlDestroySearchHooks(void); + void CtdlDestroyFixedOutputHooks(void); int PerformFixedOutputHooks(char *, char *, int); +void CtdlRegisterDebugFlagHook(const char *Name, long len, CtdlDbgFunction F, const int *); +void CtdlSetDebugLogFacilities(const char **Str, long n); +void CtdlDestroyDebugTable(void); + #endif /* SERV_EXTENSIONS_H */