X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Finclude%2Fctdl_module.h;h=b452f5c05e734b06bcba166ba996c823514a9b8a;hb=d04e1208cf6c71816adb600c6493c48c7b9610f1;hp=c3db1af9c81c9be9963491d285783a085815c437;hpb=6106c1da54f0923550c7bdceb45246fb88e9ea19;p=citadel.git diff --git a/citadel/include/ctdl_module.h b/citadel/include/ctdl_module.h index c3db1af9c..b452f5c05 100644 --- a/citadel/include/ctdl_module.h +++ b/citadel/include/ctdl_module.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #if TIME_WITH_SYS_TIME @@ -71,21 +72,14 @@ #define CTDL_UPGRADE_CALL(module_name) ctdl_module_##module_name##_upgrade () - -/* - * Prototype for making log entries in Citadel. - */ - -void CtdlLogPrintf(enum LogLevel loglevel, const char *format, ...); - #define CtdlAideMessage(TEXT, SUBJECT) quickie_message("Citadel",NULL,NULL,AIDEROOM,TEXT,FMT_CITADEL,SUBJECT) - /* * Hook functions available to modules. */ void CtdlRegisterSessionHook(void (*fcn_ptr)(void), int EventType); void CtdlUnregisterSessionHook(void (*fcn_ptr)(void), int EventType); +void CtdlShutdownServiceHooks(void); void CtdlRegisterUserHook(void (*fcn_ptr)(struct ctdluser *), int EventType); void CtdlUnregisterUserHook(void (*fcn_ptr)(struct ctdluser *), int EventType); @@ -155,38 +149,7 @@ int CtdlDoDirectoryServiceFunc(char *cn, char *ou, void **object, char *module, */ void CtdlModuleStartCryptoMsgs(char *ok_response, char *nosup_response, char *error_response); - -/* - * Citadel Threads API - */ -struct CtdlThreadNode *CtdlThreadCreate(char *name, long flags, void *(*thread_func) (void *arg), void *args); -struct CtdlThreadNode *CtdlThreadSchedule(char *name, long flags, void *(*thread_func) (void *arg), void *args, time_t when); -void CtdlThreadSleep(int secs); -void CtdlThreadStop(struct CtdlThreadNode *thread); -int CtdlThreadCheckStop(void); -/* void CtdlThreadCancel2(struct CtdlThreadNode *thread); Leave this out, it should never be needed */ -const char *CtdlThreadName(const char *name); -struct CtdlThreadNode *CtdlThreadSelf(void); -int CtdlThreadGetCount(void); -int CtdlThreadGetWorkers(void); -double CtdlThreadGetWorkerAvg(void); -double CtdlThreadGetLoadAvg(void); -void CtdlThreadGC(void); -void CtdlThreadStopAll(void); -int CtdlThreadSelect(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); -void CtdlThreadAllocTSD(void); - -#define CTDLTHREAD_BIGSTACK 0x0001 -#define CTDLTHREAD_WORKER 0x0002 - -/* Macros to speed up getting outr thread */ - -#define MYCURSORS (((ThreadTSD*)pthread_getspecific(ThreadKey))->cursors) -#define MYTID (((ThreadTSD*)pthread_getspecific(ThreadKey))->tid) -#define CT (((ThreadTSD*)pthread_getspecific(ThreadKey))->self) -#define CTP ((ThreadTSD*)pthread_getspecific(ThreadKey)) - -/** return the current context list as an array and do it in a safe manner +/* return the current context list as an array and do it in a safe manner * The returned data is a copy so only reading is useful * The number of contexts is returned in count. * Beware, this does not copy any of the data pointed to by the context. @@ -274,10 +237,11 @@ int CtdlAccessCheck(int); */ enum { ac_none, + ac_logged_in_or_guest, ac_logged_in, ac_room_aide, ac_aide, - ac_internal + ac_internal, };