X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Finclude%2Fctdl_module.h;h=cba6917149cc81334444bea9abcc959f8cc0c837;hp=e7a9510e91958a2b6ff25ea4ca37948b9ae887dc;hb=c1b1936458ccd0d517148615a6ed753f6a3e30c2;hpb=6b59ff3184393801bb0b4d96359e2fbfac13f38a diff --git a/citadel/include/ctdl_module.h b/citadel/include/ctdl_module.h index e7a9510e9..cba691714 100644 --- a/citadel/include/ctdl_module.h +++ b/citadel/include/ctdl_module.h @@ -163,4 +163,48 @@ int CtdlIsSingleUser(void); */ 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 */ +}; + #endif /* CTDL_MODULE_H */