X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Finclude%2Fctdl_module.h;h=345a786f642086eef8e456c3022b0f3ae51d8345;hb=38b3aec67e67dfaff67670494e6e570bff2246aa;hp=e554783f58cad5d5e208babd2d244223f098c60e;hpb=85a7e6b84462d72e14a287d4bbdbd3e41c97e76d;p=citadel.git diff --git a/citadel/include/ctdl_module.h b/citadel/include/ctdl_module.h index e554783f5..345a786f6 100644 --- a/citadel/include/ctdl_module.h +++ b/citadel/include/ctdl_module.h @@ -3,7 +3,40 @@ #ifndef CTDL_MODULE_H #define CTDL_MODULE_H +#include "sysdep.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +#include +#include +#include + + +#ifndef HAVE_SNPRINTF +#include "snprintf.h" +#endif + + #include + #include "server.h" #include "sysdep_decls.h" #include "msgbase.h" @@ -27,11 +60,7 @@ void CtdlLogPrintf(enum LogLevel loglevel, const char *format, ...); -/* - * Fix the interface to aide_message so that it complies with the Coding style - */ - -#define CtdlAideMessage(TEXT, SUBJECT) aide_message(TEXT, SUBJECT) +#define CtdlAideMessage(TEXT, SUBJECT) quickie_message("Citadel",NULL,NULL,AIDEROOM,TEXT,FMT_CITADEL,SUBJECT) /* * Hook functions available to modules. @@ -64,7 +93,6 @@ void CtdlRegisterCleanupHook(void (*fcn_ptr)(void)); void CtdlUnregisterCleanupHook(void (*fcn_ptr)(void)); void CtdlRegisterProtoHook(void (*handler)(char *), char *cmd, char *desc); -void CtdlUnregisterProtoHook(void (*handler)(char *), char *cmd); void CtdlRegisterServiceHook(int tcp_port, char *sockpath, @@ -147,7 +175,98 @@ void CtdlThreadAllocTSD(void); * You must free the returned pointer when done. */ struct CitContext *CtdlGetContextArray (int *count); +void CtdlFillSystemContext(struct CitContext *context, char *name); + +int CtdlTrySingleUser(void); +void CtdlEndSingleUser(void); +int CtdlWantSingleUser(void); +int CtdlIsSingleUser(void); + + +/* + * CtdlGetCurrentMessageNumber() - Obtain the current highest message number in the system + * This provides a quick way to initialise a variable that might be used to indicate + * messages that should not be processed. EG. a new Sieve script will use this + * to record determine that messages older than this should not be processed. + * This function is defined in control.c + */ +long CtdlGetCurrentMessageNumber(void); + + + +/* + * Expose various room operation functions from room_ops.c to the modules API + */ +unsigned CtdlCreateRoom(char *new_room_name, + int new_room_type, + char *new_room_pass, + int new_room_floor, + int really_create, + int avoid_access, + int new_room_view); +int CtdlGetRoom(struct ctdlroom *qrbuf, char *room_name); +int CtdlGetRoomLock(struct ctdlroom *qrbuf, char *room_name); +int CtdlDoIHavePermissionToDeleteThisRoom(struct ctdlroom *qr); +void CtdlRoomAccess(struct ctdlroom *roombuf, struct ctdluser *userbuf, + int *result, int *view); +void CtdlPutRoomLock(struct ctdlroom *qrbuf); +void CtdlForEachRoom(void (*CallBack)(struct ctdlroom *EachRoom, void *out_data), + void *in_data); +void CtdlDeleteRoom(struct ctdlroom *qrbuf); +int CtdlRenameRoom(char *old_name, char *new_name, int new_floor); +void CtdlUserGoto (char *where, int display_result, int transiently, + int *msgs, int *new); +struct floor *CtdlGetCachedFloor(int floor_num); +void CtdlScheduleRoomForDeletion(struct ctdlroom *qrbuf); +void CtdlGetFloor (struct floor *flbuf, int floor_num); +void CtdlPutFloor (struct floor *flbuf, int floor_num); +int CtdlIsNonEditable(struct ctdlroom *qrbuf); +void CtdlPutRoom(struct ctdlroom *); + +/* + * Possible return values for CtdlRenameRoom() + */ +enum { + crr_ok, /* success */ + crr_room_not_found, /* room not found */ + crr_already_exists, /* new name already exists */ + crr_noneditable, /* cannot edit this room */ + crr_invalid_floor, /* target floor does not exist */ + crr_access_denied /* not allowed to edit this room */ +}; + + + +/* + * API declarations from citserver.h + */ +int CtdlAccessCheck(int); +/* 'required access level' values which may be passed to CtdlAccessCheck() + */ +enum { + ac_none, + ac_logged_in, + ac_room_aide, + ac_aide, + ac_internal +}; + + + +/* + * API declarations from serv_extensions.h + */ +void CtdlModuleDoSearch(int *num_msgs, long **search_msgs, char *search_string, char *func_name); +/* + * Global system configuration. Don't change anything here. It's all in dtds/config-defs.h now. + */ +struct config { +#include "datadefinitions.h" +#include "dtds/config-defs.h" +#include "undef_data.h" +}; +extern struct config config; #endif /* CTDL_MODULE_H */