Citadel API clean up.
authorDave West <davew@uncensored.citadel.org>
Sat, 17 Oct 2009 12:21:17 +0000 (12:21 +0000)
committerDave West <davew@uncensored.citadel.org>
Sat, 17 Oct 2009 12:21:17 +0000 (12:21 +0000)
Moved public function prototypes for room operations into ctdl_module.h and
renamed them to match the documented naming convention.

create_room -> CtdlCreateRoom
getroom -> CtdlGetRoom
putroom -> CtdlPutRoom
lgetroom -> CtdlGetRoomLock
lputroom -> CtdlPutRoomLock
getfloor -> CtdlGetFloor
putfloor -> CtdlPutFloor
do_i_have_permission_to_delete_this_room -> CtdlDoIHavePermissionToDeleteThisRoom
ForEachRoom -> CtdlForEachRoom
delete_room -> CtdlDeleteRoom
usergoto -> CtdlUserGoto
cgetfloor -> CtdlGetCachedFloor
schedule_room_for_deletion -> CtdlScheduleRoomForDeletion
is_noneditable -> CtdlIsNonEditable

This is probably not all of the functions from room_ops.c that should be
exposed but it is all the ones that any current module uses.

No module should now need to include "room_ops.h"

49 files changed:
citadel/citserver.c
citadel/control.c
citadel/euidindex.c
citadel/file_ops.c
citadel/housekeeping.c
citadel/include/ctdl_module.h
citadel/modules/autocompletion/serv_autocompletion.c
citadel/modules/bio/serv_bio.c
citadel/modules/calendar/serv_calendar.c
citadel/modules/chat/serv_chat.c
citadel/modules/clamav/serv_virus.c
citadel/modules/dspam/serv_dspam.c
citadel/modules/expire/serv_expire.c
citadel/modules/extnotify/extnotify_main.c
citadel/modules/fulltext/serv_fulltext.c
citadel/modules/imap/imap_acl.c
citadel/modules/imap/imap_fetch.c
citadel/modules/imap/imap_list.c
citadel/modules/imap/imap_metadata.c
citadel/modules/imap/imap_misc.c
citadel/modules/imap/imap_search.c
citadel/modules/imap/imap_store.c
citadel/modules/imap/imap_tools.c
citadel/modules/imap/serv_imap.c
citadel/modules/inetcfg/serv_inetcfg.c
citadel/modules/jabber/serv_xmpp.c
citadel/modules/listsub/serv_listsub.c
citadel/modules/managesieve/serv_managesieve.c
citadel/modules/migrate/serv_migrate.c
citadel/modules/mrtg/serv_mrtg.c
citadel/modules/netfilter/serv_netfilter.c
citadel/modules/network/serv_network.c
citadel/modules/newuser/serv_newuser.c
citadel/modules/notes/serv_notes.c
citadel/modules/pop3/serv_pop3.c
citadel/modules/pop3client/serv_pop3client.c
citadel/modules/rssclient/serv_rssclient.c
citadel/modules/rwho/serv_rwho.c
citadel/modules/sieve/serv_sieve.c
citadel/modules/smtp/serv_smtp.c
citadel/modules/spam/serv_spam.c
citadel/modules/upgrade/serv_upgrade.c
citadel/modules/vcard/serv_vcard.c
citadel/modules/wiki/serv_wiki.c
citadel/msgbase.c
citadel/policy.c
citadel/room_ops.c
citadel/room_ops.h
citadel/user_ops.c

index 1f19d0c002bc8e8d40a49d56b987f8bd8734f1bf..94132babc1c2f85abb322641a384df3364ef94e6 100644 (file)
@@ -159,21 +159,21 @@ void master_startup(void) {
        check_ref_counts();
 
        CtdlLogPrintf(CTDL_INFO, "Creating base rooms (if necessary)\n");
-       create_room(config.c_baseroom,  0, "", 0, 1, 0, VIEW_BBS);
-       create_room(AIDEROOM,           3, "", 0, 1, 0, VIEW_BBS);
-       create_room(SYSCONFIGROOM,      3, "", 0, 1, 0, VIEW_BBS);
-       create_room(config.c_twitroom,  0, "", 0, 1, 0, VIEW_BBS);
+       CtdlCreateRoom(config.c_baseroom,       0, "", 0, 1, 0, VIEW_BBS);
+       CtdlCreateRoom(AIDEROOM,                3, "", 0, 1, 0, VIEW_BBS);
+       CtdlCreateRoom(SYSCONFIGROOM,   3, "", 0, 1, 0, VIEW_BBS);
+       CtdlCreateRoom(config.c_twitroom,       0, "", 0, 1, 0, VIEW_BBS);
 
        /* The "Local System Configuration" room doesn't need to be visible */
-        if (lgetroom(&qrbuf, SYSCONFIGROOM) == 0) {
+        if (CtdlGetRoomLock(&qrbuf, SYSCONFIGROOM) == 0) {
                 qrbuf.QRflags2 |= QR2_SYSTEM;
-                lputroom(&qrbuf);
+                CtdlPutRoomLock(&qrbuf);
         }
 
        /* Aide needs to be public postable, else we're not RFC conformant. */
-        if (lgetroom(&qrbuf, AIDEROOM) == 0) {
+        if (CtdlGetRoomLock(&qrbuf, AIDEROOM) == 0) {
                 qrbuf.QRflags2 |= QR2_SMTP_PUBLIC;
-                lputroom(&qrbuf);
+                CtdlPutRoomLock(&qrbuf);
         }
 
        CtdlLogPrintf(CTDL_INFO, "Seeding the pseudo-random number generator...\n");
index 327270bccff88f7b5aedd85415d43ce0be9674bb..65a6d0fd62e9677fbbb67fcc23c98e31291a7579 100644 (file)
@@ -110,7 +110,7 @@ void control_find_highest(struct ctdlroom *qrbuf, void *data)
                room_fixed = 1;
        }
                
-       getroom (&room, qrbuf->QRname);
+       CtdlGetRoom (&room, qrbuf->QRname);
        
        /* Load the message list */
        cdbfr = cdb_fetch(CDB_MSGLISTS, &room.QRnumber, sizeof(long));
@@ -232,7 +232,7 @@ void check_control(void)
        CtdlLogPrintf(CTDL_INFO, "Checking/re-building control record\n");
        get_control();
        // Find highest room number and message number.
-       ForEachRoom(control_find_highest, NULL);
+       CtdlForEachRoom(control_find_highest, NULL);
        ForEachUser(control_find_user, NULL);
        put_control();
 }
@@ -669,7 +669,7 @@ void cmd_conf(char *argbuf)
                aide_message(buf,"Citadel Configuration Manager Message");
 
                if (!IsEmptyStr(config.c_logpages))
-                       create_room(config.c_logpages, 3, "", 0, 1, 1, VIEW_BBS);
+                       CtdlCreateRoom(config.c_logpages, 3, "", 0, 1, 1, VIEW_BBS);
 
                /* If full text indexing has been disabled, invalidate the
                 * index so it doesn't try to use it later.
index 2dac3730fd79a66e1e509d4f8164fe73abc20303..ce46a459feea5f2ee25f161f7871dfff851331f3 100644 (file)
@@ -171,7 +171,7 @@ void rebuild_euid_index_for_room(struct ctdlroom *qrbuf, void *data) {
        struct RoomProcList *ptr;
        struct ctdlroom qr;
 
-       /* Lazy programming here.  Call this function as a ForEachRoom backend
+       /* Lazy programming here.  Call this function as a CtdlForEachRoom backend
         * in order to queue up the room names, or call it with a null room
         * to make it do the processing.
         */
@@ -187,12 +187,12 @@ void rebuild_euid_index_for_room(struct ctdlroom *qrbuf, void *data) {
        }
 
        while (rplist != NULL) {
-               if (getroom(&qr, rplist->name) == 0) {
+               if (CtdlGetRoom(&qr, rplist->name) == 0) {
                        if (DoesThisRoomNeedEuidIndexing(&qr)) {
                                CtdlLogPrintf(CTDL_DEBUG,
                                        "Rebuilding EUID index for <%s>\n",
                                        rplist->name);
-                               usergoto(rplist->name, 0, 0, NULL, NULL);
+                               CtdlUserGoto(rplist->name, 0, 0, NULL, NULL);
                                CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, NULL,
                                        rebuild_euid_index_for_msg, NULL);
                        }
@@ -209,7 +209,7 @@ void rebuild_euid_index_for_room(struct ctdlroom *qrbuf, void *data) {
  */
 void rebuild_euid_index(void) {
        cdb_trunc(CDB_EUIDINDEX);               /* delete the old indices */
-       ForEachRoom(rebuild_euid_index_for_room, NULL); /* enumerate rm names */
+       CtdlForEachRoom(rebuild_euid_index_for_room, NULL);     /* enumerate rm names */
        rebuild_euid_index_for_room(NULL, NULL);        /* and index them */
 }
 
index 165fd281f52c0eed0ffc79796ced2a5d8bf15b2d..2544077bd41b0a50101f6a13c3a02a0457ce255d 100644 (file)
@@ -195,7 +195,7 @@ void cmd_movf(char *cmdbuf)
                return;
        }
 
-       if (getroom(&qrbuf, newroom) != 0) {
+       if (CtdlGetRoom(&qrbuf, newroom) != 0) {
                cprintf("%d '%s' does not exist.\n", ERROR + ROOM_NOT_FOUND, newroom);
                return;
        }
index 7fed1541883efc9f4abdf397554d52a1bb2f9455..742291c5a653338e16f48c66f787cf4f59f25b43 100644 (file)
@@ -117,7 +117,7 @@ void check_ref_counts(void) {
        }
 
        cdb_begin_transaction();
-       ForEachRoom(check_ref_counts_backend, (void *)new_refcounts );
+       CtdlForEachRoom(check_ref_counts_backend, (void *)new_refcounts );
        cdb_end_transaction();
 
        for (a=0; a<MAXFLOORS; ++a) {
index e7a9510e91958a2b6ff25ea4ca37948b9ae887dc..cba6917149cc81334444bea9abcc959f8cc0c837 100644 (file)
@@ -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 */
index d2ab6f5f5f0f06d5a037eac1a4cc82fcef12c61a..0eb9b6e7f189d312344a0a6d342fe9aff646ef4c 100644 (file)
@@ -53,7 +53,6 @@
 #include "config.h"
 #include "msgbase.h"
 #include "user_ops.h"
-#include "room_ops.h"
 #include "database.h"
 #include "serv_autocompletion.h"
 
@@ -204,7 +203,7 @@ void cmd_auto(char *argbuf) {
         * Gather up message pointers in rooms containing vCards
         */
        for (r=0; r < (sizeof(rooms_to_try) / sizeof(char *)); ++r) {
-               if (getroom(&CC->room, rooms_to_try[r]) == 0) {
+               if (CtdlGetRoom(&CC->room, rooms_to_try[r]) == 0) {
                        cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long));
                        if (cdbfr != NULL) {
                                msglist = realloc(msglist, (num_msgs * sizeof(long)) + cdbfr->len + 1);
@@ -254,7 +253,7 @@ void cmd_auto(char *argbuf) {
        
        cprintf("000\n");
        if (strcmp(CC->room.QRname, hold_rm)) {
-               getroom(&CC->room, hold_rm);    /* return to saved room */
+               CtdlGetRoom(&CC->room, hold_rm);    /* return to saved room */
        }
 
        if (msglist) {
index 6d09c1bf4b93ed486336bcad31eccfa7a11e928c..afebe1242b4f5665f3c1b247d179c435cb9a2162 100644 (file)
@@ -53,7 +53,6 @@
 #include "support.h"
 #include "config.h"
 #include "control.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
index 1dd5935e045f3459d88804e52659b4e08e7685d0..8fc85611115269d49334da2cc490c48e6614f1bd 100644 (file)
@@ -43,7 +43,6 @@
 #include "support.h"
 #include "config.h"
 #include "user_ops.h"
-#include "room_ops.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
 #include "serv_calendar.h"
@@ -616,8 +615,8 @@ int ical_update_my_calendar_with_reply(icalcomponent *cal) {
 
        strcpy(hold_rm, CC->room.QRname);       /* save current room */
 
-       if (getroom(&CC->room, USERCALENDARROOM) != 0) {
-               getroom(&CC->room, hold_rm);
+       if (CtdlGetRoom(&CC->room, USERCALENDARROOM) != 0) {
+               CtdlGetRoom(&CC->room, hold_rm);
                CtdlLogPrintf(CTDL_CRIT, "cannot get user calendar room\n");
                return(2);
        }
@@ -630,7 +629,7 @@ int ical_update_my_calendar_with_reply(icalcomponent *cal) {
         */
        msgnum_being_replaced = locate_message_by_euid(uid, &CC->room);
 
-       getroom(&CC->room, hold_rm);    /* return to saved room */
+       CtdlGetRoom(&CC->room, hold_rm);        /* return to saved room */
 
        CtdlLogPrintf(CTDL_DEBUG, "msgnum_being_replaced == %ld\n", msgnum_being_replaced);
        if (msgnum_being_replaced == 0) {
@@ -1188,8 +1187,8 @@ void ical_hunt_for_conflicts(icalcomponent *cal) {
 
        strcpy(hold_rm, CC->room.QRname);       /* save current room */
 
-       if (getroom(&CC->room, USERCALENDARROOM) != 0) {
-               getroom(&CC->room, hold_rm);
+       if (CtdlGetRoom(&CC->room, USERCALENDARROOM) != 0) {
+               CtdlGetRoom(&CC->room, hold_rm);
                cprintf("%d You do not have a calendar.\n", ERROR + ROOM_NOT_FOUND);
                return;
        }
@@ -1204,7 +1203,7 @@ void ical_hunt_for_conflicts(icalcomponent *cal) {
        );
 
        cprintf("000\n");
-       getroom(&CC->room, hold_rm);    /* return to saved room */
+       CtdlGetRoom(&CC->room, hold_rm);        /* return to saved room */
 
 }
 
@@ -1507,9 +1506,9 @@ void ical_freebusy(char *who) {
 
        strcpy(hold_rm, CC->room.QRname);       /* save current room */
 
-       if (getroom(&CC->room, calendar_room_name) != 0) {
+       if (CtdlGetRoom(&CC->room, calendar_room_name) != 0) {
                cprintf("%d Cannot open calendar\n", ERROR + ROOM_NOT_FOUND);
-               getroom(&CC->room, hold_rm);
+               CtdlGetRoom(&CC->room, hold_rm);
                return;
        }
 
@@ -1519,7 +1518,7 @@ void ical_freebusy(char *who) {
        if (fb == NULL) {
                cprintf("%d Internal error: cannot allocate memory.\n",
                        ERROR + INTERNAL_ERROR);
-               getroom(&CC->room, hold_rm);
+               CtdlGetRoom(&CC->room, hold_rm);
                return;
        }
 
@@ -1561,7 +1560,7 @@ void ical_freebusy(char *who) {
                icalcomponent_free(fb);
                cprintf("%d Internal error: cannot allocate memory.\n",
                        ERROR + INTERNAL_ERROR);
-               getroom(&CC->room, hold_rm);
+               CtdlGetRoom(&CC->room, hold_rm);
                return;
        }
 
@@ -1582,7 +1581,7 @@ void ical_freebusy(char *who) {
        cprintf("\n000\n");
 
        /* Go back to the room from which we came... */
-       getroom(&CC->room, hold_rm);
+       CtdlGetRoom(&CC->room, hold_rm);
 }
 
 
@@ -1920,22 +1919,22 @@ void cmd_ical(char *argbuf)
 /*
  * We don't know if the calendar room exists so we just create it at login
  */
-void ical_create_room(void)
+void ical_CtdlCreateRoom(void)
 {
        struct ctdlroom qr;
        struct visit vbuf;
 
        /* Create the calendar room if it doesn't already exist */
-       create_room(USERCALENDARROOM, 4, "", 0, 1, 0, VIEW_CALENDAR);
+       CtdlCreateRoom(USERCALENDARROOM, 4, "", 0, 1, 0, VIEW_CALENDAR);
 
        /* Set expiration policy to manual; otherwise objects will be lost! */
-       if (lgetroom(&qr, USERCALENDARROOM)) {
+       if (CtdlGetRoomLock(&qr, USERCALENDARROOM)) {
                CtdlLogPrintf(CTDL_CRIT, "Couldn't get the user calendar room!\n");
                return;
        }
        qr.QRep.expire_mode = EXPIRE_MANUAL;
        qr.QRdefaultview = VIEW_CALENDAR;       /* 3 = calendar view */
-       lputroom(&qr);
+       CtdlPutRoomLock(&qr);
 
        /* Set the view to a calendar view */
        CtdlGetRelationship(&vbuf, &CC->user, &qr);
@@ -1943,16 +1942,16 @@ void ical_create_room(void)
        CtdlSetRelationship(&vbuf, &CC->user, &qr);
 
        /* Create the tasks list room if it doesn't already exist */
-       create_room(USERTASKSROOM, 4, "", 0, 1, 0, VIEW_TASKS);
+       CtdlCreateRoom(USERTASKSROOM, 4, "", 0, 1, 0, VIEW_TASKS);
 
        /* Set expiration policy to manual; otherwise objects will be lost! */
-       if (lgetroom(&qr, USERTASKSROOM)) {
+       if (CtdlGetRoomLock(&qr, USERTASKSROOM)) {
                CtdlLogPrintf(CTDL_CRIT, "Couldn't get the user calendar room!\n");
                return;
        }
        qr.QRep.expire_mode = EXPIRE_MANUAL;
        qr.QRdefaultview = VIEW_TASKS;
-       lputroom(&qr);
+       CtdlPutRoomLock(&qr);
 
        /* Set the view to a task list view */
        CtdlGetRelationship(&vbuf, &CC->user, &qr);
@@ -1960,16 +1959,16 @@ void ical_create_room(void)
        CtdlSetRelationship(&vbuf, &CC->user, &qr);
 
        /* Create the notes room if it doesn't already exist */
-       create_room(USERNOTESROOM, 4, "", 0, 1, 0, VIEW_NOTES);
+       CtdlCreateRoom(USERNOTESROOM, 4, "", 0, 1, 0, VIEW_NOTES);
 
        /* Set expiration policy to manual; otherwise objects will be lost! */
-       if (lgetroom(&qr, USERNOTESROOM)) {
+       if (CtdlGetRoomLock(&qr, USERNOTESROOM)) {
                CtdlLogPrintf(CTDL_CRIT, "Couldn't get the user calendar room!\n");
                return;
        }
        qr.QRep.expire_mode = EXPIRE_MANUAL;
        qr.QRdefaultview = VIEW_NOTES;
-       lputroom(&qr);
+       CtdlPutRoomLock(&qr);
 
        /* Set the view to a notes view */
        CtdlGetRelationship(&vbuf, &CC->user, &qr);
@@ -2605,7 +2604,7 @@ CTDL_MODULE_INIT(calendar)
                /* Initialize our hook functions */
                CtdlRegisterMessageHook(ical_obj_beforesave, EVT_BEFORESAVE);
                CtdlRegisterMessageHook(ical_obj_aftersave, EVT_AFTERSAVE);
-               CtdlRegisterSessionHook(ical_create_room, EVT_LOGIN);
+               CtdlRegisterSessionHook(ical_CtdlCreateRoom, EVT_LOGIN);
                CtdlRegisterProtoHook(cmd_ical, "ICAL", "Citadel iCal commands");
                CtdlRegisterSessionHook(ical_session_startup, EVT_START);
                CtdlRegisterSessionHook(ical_session_shutdown, EVT_STOP);
index d5c7be32c68e2ca9b74c073e36d3e09088a243b6..e0515963f0a8ffb5c810cf099e0868ef2bd931a1 100644 (file)
@@ -54,7 +54,6 @@
 #include "config.h"
 #include "msgbase.h"
 #include "user_ops.h"
-#include "room_ops.h"
 
 #ifndef HAVE_SNPRINTF
 #include "snprintf.h"
@@ -498,7 +497,7 @@ void cmd_chat(char *argbuf)
                                                        CtdlInvtKick(CC->user.fullname, 0);
 
                                                        /* And return to the Lobby */
-                                                       usergoto(config.c_baseroom, 0, 0, NULL, NULL);
+                                                       CtdlUserGoto(config.c_baseroom, 0, 0, NULL, NULL);
                                                        return;
                                                }
                                        }
@@ -903,20 +902,20 @@ void flush_individual_conversation(struct imlog *im) {
         * prefix will be created.  That's ok because the auto-purger will clean it up later.
         */
        snprintf(roomname, sizeof roomname, "%010ld.%s", im->usernums[1], PAGELOGROOM);
-       create_room(roomname, 5, "", 0, 1, 1, VIEW_BBS);
+       CtdlCreateRoom(roomname, 5, "", 0, 1, 1, VIEW_BBS);
        msgnum = CtdlSubmitMsg(msg, NULL, roomname, 0);
        CtdlFreeMessage(msg);
 
        /* If there is a valid user number in usernums[0], save a copy for them too. */
        if (im->usernums[0] > 0) {
                snprintf(roomname, sizeof roomname, "%010ld.%s", im->usernums[0], PAGELOGROOM);
-               create_room(roomname, 5, "", 0, 1, 1, VIEW_BBS);
+               CtdlCreateRoom(roomname, 5, "", 0, 1, 1, VIEW_BBS);
                CtdlSaveMsgPointerInRoom(roomname, msgnum, 0, NULL);
        }
 
        /* Finally, if we're logging instant messages globally, do that now. */
        if (!IsEmptyStr(config.c_logpages)) {
-               create_room(config.c_logpages, 3, "", 0, 1, 1, VIEW_BBS);
+               CtdlCreateRoom(config.c_logpages, 3, "", 0, 1, 1, VIEW_BBS);
                CtdlSaveMsgPointerInRoom(config.c_logpages, msgnum, 0, NULL);
        }
 
index a7bb22cd760c38372dadce6b10f6824315fa2856..31086072015039335297be1bd3c1786f13cb5dea 100644 (file)
@@ -57,7 +57,6 @@
 #include "support.h"
 #include "config.h"
 #include "control.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
index cd96e61352ba4b56e39aa18a2e56a1fbc3c412f3..8285b5368adc7967666dca8645ba21efb79b579b 100644 (file)
@@ -51,7 +51,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "room_ops.h"
 #include "policy.h"
 #include "database.h"
 #include "msgbase.h"
index 00466cf77c0274eccbbaa35f71e27c0585ec04fe..00869827d0a0e1edd742cc987c66dfae773a2728 100644 (file)
@@ -75,7 +75,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "room_ops.h"
 #include "policy.h"
 #include "database.h"
 #include "msgbase.h"
@@ -260,7 +259,7 @@ void PurgeMessages(void) {
                return;
        }
 
-       ForEachRoom(GatherPurgeMessages, (void *)purgelist );
+       CtdlForEachRoom(GatherPurgeMessages, (void *)purgelist );
        DoPurgeMessages(purgelist);
        fclose(purgelist);
 }
@@ -311,7 +310,7 @@ void DoPurgeRooms(struct ctdlroom *qrbuf, void *data) {
                if (qrbuf->QRflags & QR_NETWORK) return;
                if (qrbuf->QRflags2 & QR2_SYSTEM) return;
                if (!strcasecmp(qrbuf->QRname, SYSCONFIGROOM)) return;
-               if (is_noneditable(qrbuf)) return;
+               if (CtdlIsNonEditable(qrbuf)) return;
 
                /* If we don't know the modification date, be safe and don't purge */
                if (qrbuf->QRmtime <= (time_t)0) return;
@@ -353,7 +352,7 @@ int PurgeRooms(void) {
        ForEachUser(AddValidUser, NULL);
 
        /* Then cycle through the room file */
-       ForEachRoom(DoPurgeRooms, NULL);
+       CtdlForEachRoom(DoPurgeRooms, NULL);
 
        /* Free the valid user list */
        while (ValidUserList != NULL) {
@@ -367,11 +366,11 @@ int PurgeRooms(void) {
        strcpy(transcript, "The following rooms have been auto-purged:\n");
 
        while (RoomPurgeList != NULL) {
-               if (getroom(&qrbuf, RoomPurgeList->name) == 0) {
+               if (CtdlGetRoom(&qrbuf, RoomPurgeList->name) == 0) {
                        transcript=realloc(transcript, strlen(transcript)+SIZ);
                        snprintf(&transcript[strlen(transcript)], SIZ, " %s\n",
                                qrbuf.QRname);
-                       delete_room(&qrbuf);
+                       CtdlDeleteRoom(&qrbuf);
                }
                pptr = RoomPurgeList->next;
                free(RoomPurgeList);
@@ -626,7 +625,7 @@ int PurgeVisits(void) {
        int RoomIsValid, UserIsValid;
 
        /* First, load up a table full of valid room/gen combinations */
-       ForEachRoom(AddValidRoom, NULL);
+       CtdlForEachRoom(AddValidRoom, NULL);
 
        /* Then load up a table full of valid user numbers */
        ForEachUser(AddValidUser, NULL);
@@ -966,7 +965,7 @@ void do_fsck_msg(long msgnum, void *userdata) {
 
 void do_fsck_room(struct ctdlroom *qrbuf, void *data)
 {
-       getroom(&CC->room, qrbuf->QRname);
+       CtdlGetRoom(&CC->room, qrbuf->QRname);
        CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, NULL, do_fsck_msg, NULL);
 }
 
@@ -992,7 +991,7 @@ void cmd_fsck(char *argbuf) {
 
        cprintf("\nThis could take a while.  Please be patient!\n\n");
        cprintf("Gathering pointers...\n");
-       ForEachRoom(do_fsck_room, NULL);
+       CtdlForEachRoom(do_fsck_room, NULL);
 
        get_control();
        cprintf("Checking message base...\n");
index 6f33e687e4847ea983087a590a0913ddaa91d936..b772bbb09070913433b3041cdc2b6c94b6dcd01f 100644 (file)
@@ -57,7 +57,6 @@
 #include "support.h"
 #include "config.h"
 #include "control.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
@@ -147,15 +146,15 @@ StrBuf** GetNotifyHosts(void)
 void create_extnotify_queue(void) {
        struct ctdlroom qrbuf;
     
-       create_room(FNBL_QUEUE_ROOM, 3, "", 0, 1, 0, VIEW_MAILBOX);
+       CtdlCreateRoom(FNBL_QUEUE_ROOM, 3, "", 0, 1, 0, VIEW_MAILBOX);
     
        /*
         * Make sure it's set to be a "system room" so it doesn't show up
         * in the <K>nown rooms list for Aides.
         */
-       if (lgetroom(&qrbuf, FNBL_QUEUE_ROOM) == 0) {
+       if (CtdlGetRoomLock(&qrbuf, FNBL_QUEUE_ROOM) == 0) {
                qrbuf.QRflags2 |= QR2_SYSTEM;
-               lputroom(&qrbuf);
+               CtdlPutRoomLock(&qrbuf);
        }
 }
 /*!
@@ -183,7 +182,7 @@ void do_extnotify_queue(void)
     
        memset(&Ctx, 0, sizeof(NotifyContext));
        Ctx.NotifyHostList = GetNotifyHosts();
-       if (getroom(&CC->room, FNBL_QUEUE_ROOM) != 0) {
+       if (CtdlGetRoom(&CC->room, FNBL_QUEUE_ROOM) != 0) {
                CtdlLogPrintf(CTDL_ERR, "Cannot find room <%s>\n", FNBL_QUEUE_ROOM);
                return;
        }
@@ -370,7 +369,7 @@ long extNotify_getConfigMessage(char *username) {
     
        MailboxName(configRoomName, sizeof configRoomName, &user, USERCONFIGROOM);
        // Fill qrbuf
-       getroom(&qrbuf, configRoomName);
+       CtdlGetRoom(&qrbuf, configRoomName);
        /* Do something really, really stoopid here. Raid the room on ourselves,
         * loop through the messages manually and find it. I don't want
         * to use a CtdlForEachMessage callback here, as we would be
index 74e0b22eebe65334452710467a0fc48598547257..68f5f4136785fee740cba71cc19eb6a084e18ad5 100644 (file)
@@ -55,7 +55,6 @@
 #include "database.h"
 #include "msgbase.h"
 #include "control.h"
-#include "room_ops.h"
 #include "serv_fulltext.h"
 #include "ft_wordbreaker.h"
 #include "threads.h"
@@ -226,7 +225,7 @@ void ft_index_room(struct ctdlroom *qrbuf, void *data)
        if (CtdlThreadCheckStop())
                return;
                
-       getroom(&CC->room, qrbuf->QRname);
+       CtdlGetRoom(&CC->room, qrbuf->QRname);
        CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, NULL, ft_index_msg, NULL);
 }
 
@@ -290,7 +289,7 @@ void do_fulltext_indexing(void) {
         * Now go through each room and find messages to index.
         */
        ft_newhighest = CitControl.MMhighest;
-       ForEachRoom(ft_index_room, NULL);       /* load all msg pointers */
+       CtdlForEachRoom(ft_index_room, NULL);   /* load all msg pointers */
 
        if (ft_num_msgs > 0) {
                qsort(ft_newmsgs, ft_num_msgs, sizeof(long), longcmp);
index 11b400b9ee0c8a9c17cc0408d6f41b70beb362ee..7ef289db5cc069f450b5a3570b8958c660311cab 100644 (file)
@@ -54,7 +54,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
@@ -67,6 +66,7 @@
 #include "genstamp.h"
 
 
+#include "ctdl_module.h"
 
 /*
  * Implements the SETACL command.
@@ -170,13 +170,13 @@ void imap_getacl(int num_parms, char *parms[]) {
        }
 
        /*
-        * usergoto() formally takes us to the desired room.  (If another
+        * CtdlUserGoto() formally takes us to the desired room.  (If another
         * folder is selected, save its name so we can return there!!!!!)
         */
        if (IMAP->selected) {
                strcpy(savedroom, CC->room.QRname);
        }
-       usergoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
 
        cprintf("* ACL");
        cprintf(" ");
@@ -209,7 +209,7 @@ void imap_getacl(int num_parms, char *parms[]) {
         * our happy day without violent explosions.
         */
        if (IMAP->selected) {
-               usergoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
        }
 
        cprintf("%s OK GETACL completed\r\n", parms[0]);
@@ -260,13 +260,13 @@ void imap_listrights(int num_parms, char *parms[]) {
        }
 
        /*
-        * usergoto() formally takes us to the desired room.  (If another
+        * CtdlUserGoto() formally takes us to the desired room.  (If another
         * folder is selected, save its name so we can return there!!!!!)
         */
        if (IMAP->selected) {
                strcpy(savedroom, CC->room.QRname);
        }
-       usergoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
 
 
        /*
@@ -286,7 +286,7 @@ void imap_listrights(int num_parms, char *parms[]) {
         * our happy day without violent explosions.
         */
        if (IMAP->selected) {
-               usergoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
        }
 
        cprintf("%s OK LISTRIGHTS completed\r\n", parms[0]);
@@ -318,13 +318,13 @@ void imap_myrights(int num_parms, char *parms[]) {
        }
 
        /*
-        * usergoto() formally takes us to the desired room.  (If another
+        * CtdlUserGoto() formally takes us to the desired room.  (If another
         * folder is selected, save its name so we can return there!!!!!)
         */
        if (IMAP->selected) {
                strcpy(savedroom, CC->room.QRname);
        }
-       usergoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
 
        CtdlRoomAccess(&CC->room, &CC->user, &ra, NULL);
        imap_acl_flags(rights, ra);
@@ -337,7 +337,7 @@ void imap_myrights(int num_parms, char *parms[]) {
         * If a different folder was previously selected, return there now.
         */
        if ( (IMAP->selected) && (strcasecmp(roomname, savedroom)) ) {
-               usergoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
        }
 
        cprintf("%s OK MYRIGHTS completed\r\n", parms[0]);
index 19d92dafd4422147f5ab0ca77250c9620e3b9971..2d6363103be68a64af8dabab53c625adf89bb198 100644 (file)
@@ -54,7 +54,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
index 8e41927127db0d170ff28cc9f27dbcb5ec29eeeb..e6f6c19d46760ad5696284d4a1bc9b3d216fd36a 100644 (file)
@@ -52,7 +52,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
@@ -80,7 +79,7 @@ void imap_list_floors(char *verb, int num_patterns, char **patterns)
        int match = 0;
 
        for (i = 0; i < MAXFLOORS; ++i) {
-               fl = cgetfloor(i);
+               fl = CtdlGetCachedFloor(i);
                if (fl->f_flags & F_INUSE) {
                        match = 0;
                        for (j=0; j<num_patterns; ++j) {
@@ -360,7 +359,7 @@ void imap_list(int num_parms, char *parms[])
                }
        }
 
-       /* Now start setting up the data we're going to send to the ForEachRoom() callback.
+       /* Now start setting up the data we're going to send to the CtdlForEachRoom() callback.
         */
        data_for_callback[0] = (char *) verb;
        data_for_callback[1] = (char *) subscribed_rooms_only;
@@ -383,7 +382,7 @@ void imap_list(int num_parms, char *parms[])
         */
        else {
                imap_list_floors(verb, num_patterns, patterns);
-               ForEachRoom(imap_listroom, data_for_callback);
+               CtdlForEachRoom(imap_listroom, data_for_callback);
        }
 
        /* 
index 54f17ccb27883fdc03a8561ef0fe1db3130df52a..8e173a0f396a64ec3d08b24fc9e2f9e96cbd0470 100644 (file)
@@ -55,7 +55,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
@@ -67,7 +66,7 @@
 #include "imap_misc.h"
 #include "genstamp.h"
 
-
+#include "ctdl_module.h"
 
 /*
  * Implements the SETMETADATA command.
@@ -146,13 +145,13 @@ void imap_setmetadata(int num_parms, char *parms[]) {
        }
 
        /*
-        * usergoto() formally takes us to the desired room.  (If another
+        * CtdlUserGoto() formally takes us to the desired room.  (If another
         * folder is selected, save its name so we can return there!!!!!)
         */
        if (IMAP->selected) {
                strcpy(savedroom, CC->room.QRname);
        }
-       usergoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
 
        /*
         * Always set the per-user view to the requested one.
@@ -177,9 +176,9 @@ void imap_setmetadata(int num_parms, char *parms[]) {
                        )
                ||      (msgs == 0)             /* hack: if room is empty, assume we just created it */
        ) {
-               lgetroom(&CC->room, CC->room.QRname);
+               CtdlGetRoomLock(&CC->room, CC->room.QRname);
                CC->room.QRdefaultview = set_view;
-               lputroom(&CC->room);
+               CtdlPutRoomLock(&CC->room);
                cprintf("%s OK SETANNOTATION complete\r\n", parms[0]);
        }
 
@@ -192,7 +191,7 @@ void imap_setmetadata(int num_parms, char *parms[]) {
         * If a different folder was previously selected, return there now.
         */
        if ( (IMAP->selected) && (strcasecmp(roomname, savedroom)) ) {
-               usergoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
        }
        return;
 }
@@ -223,13 +222,13 @@ void imap_getmetadata(int num_parms, char *parms[]) {
        }
 
        /*
-        * usergoto() formally takes us to the desired room.  (If another
+        * CtdlUserGoto() formally takes us to the desired room.  (If another
         * folder is selected, save its name so we can return there!!!!!)
         */
        if (IMAP->selected) {
                strcpy(savedroom, CC->room.QRname);
        }
-       usergoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
 
        cprintf("* METADATA ");
        imap_strout(parms[2]);
@@ -295,7 +294,7 @@ void imap_getmetadata(int num_parms, char *parms[]) {
         * If a different folder was previously selected, return there now.
         */
        if ( (IMAP->selected) && (strcasecmp(roomname, savedroom)) ) {
-               usergoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
        }
 
        cprintf("%s OK GETMETADATA complete\r\n", parms[0]);
index c5c7dfbbd03acda001efb2317ee0e2a2f176c292..5c3a127969482b1ba0272a7ae69657444a8e2b95 100644 (file)
@@ -53,7 +53,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
@@ -143,7 +142,7 @@ int imap_do_copy(char *destination_folder) {
        }
 
        /* Set the flags... */
-       i = getroom(&qrbuf, roomname);
+       i = CtdlGetRoom(&qrbuf, roomname);
        if (i == 0) {
                CtdlSetSeen(seen_yes, num_seen_yes, 1, ctdlsetseen_seen, NULL, &qrbuf);
                CtdlSetSeen(seen_no, num_seen_no, 0, ctdlsetseen_seen, NULL, &qrbuf);
@@ -383,13 +382,13 @@ void imap_append(int num_parms, char *parms[]) {
        }
 
        /*
-        * usergoto() formally takes us to the desired room.  (If another
+        * CtdlUserGoto() formally takes us to the desired room.  (If another
         * folder is selected, save its name so we can return there!!!!!)
         */
        if (Imap->selected) {
                strcpy(savedroom, CC->room.QRname);
        }
-       usergoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
 
        /* If the user is locally authenticated, FORCE the From: header to
         * show up as the real sender.  FIXME do we really want to do this?
@@ -441,7 +440,7 @@ void imap_append(int num_parms, char *parms[]) {
         * our happy day without violent explosions.
         */
        if (Imap->selected) {
-               usergoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
        }
 
        /* We don't need this buffer anymore */
index 1cb38c97b940472232e5f29be992a33d0c0afd64..90644b1e4efea9cc70f7a20f14a30c3d1955fffc 100644 (file)
@@ -53,7 +53,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
index 9750a6538d899d31d8e27f087c568b3e384b3ae2..892933025c2fe424fc68d40e27354574e4f86950 100644 (file)
@@ -54,7 +54,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
index 0ca98feb701d53fa4458615e825dbcf0372dd0d3..52844462a89aec49e869584ad33d85f9c8f9369f 100644 (file)
@@ -29,7 +29,6 @@
 #include <libcitadel.h>
 #include "citadel.h"
 #include "sysdep_decls.h"
-#include "room_ops.h"
 #include "internet_addressing.h"
 #include "imap_tools.h"
 #include "ctdl_module.h"
@@ -500,7 +499,7 @@ void imap_mailboxname(char *buf, int bufsize, struct ctdlroom *qrbuf)
        {
                /* Otherwise, prefix the floor name as a "public folders" moniker. */
 
-               fl = cgetfloor(qrbuf->QRfloor);
+               fl = CtdlGetCachedFloor(qrbuf->QRfloor);
                p = toimap(p, bufend, fl->f_name);
                if (p < bufend)
                        *p++ = '/';
@@ -575,7 +574,7 @@ int imap_roomname(char *rbuf, int bufsize, char *foldername)
                
                for (i = 0; i < MAXFLOORS; ++i)
                {
-                       fl = cgetfloor(i);
+                       fl = CtdlGetCachedFloor(i);
                        if (fl->f_flags & F_INUSE)
                        {
                                if (strcasecmp(floorname, fl->f_name) == 0)
index 3d5d2ac7bb8c685ae36235295c0dccf4b4fb15dc..e06dd562376b8baa7079af479ac43f08ab9a5bba 100644 (file)
@@ -55,7 +55,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
@@ -292,7 +291,7 @@ void imap_rescan_msgids(void)
         * Check to see if the room's contents have changed.
         * If not, we can avoid this rescan.
         */
-       getroom(&CC->room, CC->room.QRname);
+       CtdlGetRoom(&CC->room, CC->room.QRname);
        if (IMAP->last_mtime == CC->room.QRmtime) {     /* No changes! */
                return;
        }
@@ -717,13 +716,13 @@ void imap_select(int num_parms, char *parms[])
        roomflags = (i & 0xff00);
 
        /* First try a regular match */
-       c = getroom(&QRscratch, towhere);
+       c = CtdlGetRoom(&QRscratch, towhere);
 
        /* Then try a mailbox name match */
        if (c != 0) {
                MailboxName(augmented_roomname, sizeof augmented_roomname,
                            &CC->user, towhere);
-               c = getroom(&QRscratch, augmented_roomname);
+               c = CtdlGetRoom(&QRscratch, augmented_roomname);
                if (c == 0)
                        strcpy(towhere, augmented_roomname);
        }
@@ -750,11 +749,11 @@ void imap_select(int num_parms, char *parms[])
        imap_do_expunge();
 
        /*
-        * usergoto() formally takes us to the desired room, happily returning
+        * CtdlUserGoto() formally takes us to the desired room, happily returning
         * the number of messages and number of new messages.
         */
        memcpy(&CC->room, &QRscratch, sizeof(struct ctdlroom));
-       usergoto(NULL, 0, 0, &msgs, &new);
+       CtdlUserGoto(NULL, 0, 0, &msgs, &new);
        IMAP->selected = 1;
 
        if (!strcasecmp(parms[1], "EXAMINE")) {
@@ -881,7 +880,7 @@ void imap_namespace(int num_parms, char *parms[])
        /* Show all floors as shared namespaces.  Neato! */
        cprintf("(");
        for (i = 0; i < MAXFLOORS; ++i) {
-               fl = cgetfloor(i);
+               fl = CtdlGetCachedFloor(i);
                if (fl->f_flags & F_INUSE) {
                        if (floors > 0) cprintf(" ");
                        cprintf("(");
@@ -954,7 +953,7 @@ void imap_create(int num_parms, char *parms[])
        CtdlLogPrintf(CTDL_INFO, "Create new room <%s> on floor <%d> with type <%d>\n",
                roomname, floornum, newroomtype);
 
-       ret = create_room(roomname, newroomtype, "", floornum, 1, 0, newroomview);
+       ret = CtdlCreateRoom(roomname, newroomtype, "", floornum, 1, 0, newroomview);
        if (ret == 0) {
                /*** DO NOT CHANGE THIS ERROR MESSAGE IN ANY WAY!  BYNARI CONNECTOR DEPENDS ON IT! ***/
                cprintf("%s NO Mailbox already exists, or create failed\r\n", parms[0]);
@@ -997,13 +996,13 @@ int imap_grabroom(char *returned_roomname, char *foldername, int zapped_ok)
        }
 
        /* First try a regular match */
-       c = getroom(&QRscratch, roomname);
+       c = CtdlGetRoom(&QRscratch, roomname);
 
        /* Then try a mailbox name match */
        if (c != 0) {
                MailboxName(augmented_roomname, sizeof augmented_roomname,
                            &CC->user, roomname);
-               c = getroom(&QRscratch, augmented_roomname);
+               c = CtdlGetRoom(&QRscratch, augmented_roomname);
                if (c == 0)
                        strcpy(roomname, augmented_roomname);
        }
@@ -1054,14 +1053,14 @@ void imap_status(int num_parms, char *parms[])
        }
 
        /*
-        * usergoto() formally takes us to the desired room, happily returning
+        * CtdlUserGoto() formally takes us to the desired room, happily returning
         * the number of messages and number of new messages.  (If another
         * folder is selected, save its name so we can return there!!!!!)
         */
        if (IMAP->selected) {
                strcpy(savedroom, CC->room.QRname);
        }
-       usergoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
 
        /*
         * Tell the client what it wants to know.  In fact, tell it *more* than
@@ -1082,7 +1081,7 @@ void imap_status(int num_parms, char *parms[])
         * our happy day without violent explosions.
         */
        if (IMAP->selected) {
-               usergoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
        }
 
        /*
@@ -1115,21 +1114,21 @@ void imap_subscribe(int num_parms, char *parms[])
        }
 
        /*
-        * usergoto() formally takes us to the desired room, which has the side
+        * CtdlUserGoto() formally takes us to the desired room, which has the side
         * effect of marking the room as not-zapped ... exactly the effect
         * we're looking for.
         */
        if (IMAP->selected) {
                strcpy(savedroom, CC->room.QRname);
        }
-       usergoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
 
        /*
         * If another folder is selected, go back to that room so we can resume
         * our happy day without violent explosions.
         */
        if (IMAP->selected) {
-               usergoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
        }
 
        cprintf("%s OK SUBSCRIBE completed\r\n", parms[0]);
@@ -1156,12 +1155,12 @@ void imap_unsubscribe(int num_parms, char *parms[])
        }
 
        /*
-        * usergoto() formally takes us to the desired room.
+        * CtdlUserGoto() formally takes us to the desired room.
         */
        if (IMAP->selected) {
                strcpy(savedroom, CC->room.QRname);
        }
-       usergoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
 
        /* 
         * Now make the API call to zap the room
@@ -1179,7 +1178,7 @@ void imap_unsubscribe(int num_parms, char *parms[])
         * our happy day without violent explosions.
         */
        if (IMAP->selected) {
-               usergoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
        }
 }
 
@@ -1204,20 +1203,20 @@ void imap_delete(int num_parms, char *parms[])
        }
 
        /*
-        * usergoto() formally takes us to the desired room, happily returning
+        * CtdlUserGoto() formally takes us to the desired room, happily returning
         * the number of messages and number of new messages.  (If another
         * folder is selected, save its name so we can return there!!!!!)
         */
        if (IMAP->selected) {
                strcpy(savedroom, CC->room.QRname);
        }
-       usergoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
 
        /*
         * Now delete the room.
         */
        if (CtdlDoIHavePermissionToDeleteThisRoom(&CC->room)) {
-               schedule_room_for_deletion(&CC->room);
+               CtdlScheduleRoomForDeletion(&CC->room);
                cprintf("%s OK DELETE completed\r\n", parms[0]);
        } else {
                cprintf("%s NO Can't delete this folder.\r\n", parms[0]);
@@ -1228,7 +1227,7 @@ void imap_delete(int num_parms, char *parms[])
         * our happy day without violent explosions.
         */
        if (IMAP->selected) {
-               usergoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
        }
 }
 
@@ -1333,7 +1332,7 @@ void imap_rename(int num_parms, char *parms[])
         * (already did that) and create a new inbox.
         */
        if (!strcasecmp(parms[2], "INBOX")) {
-               create_room(MAILROOM, 4, "", 0, 1, 0, VIEW_MAILBOX);
+               CtdlCreateRoom(MAILROOM, 4, "", 0, 1, 0, VIEW_MAILBOX);
        }
 
        /* Otherwise, do the subfolders.  Build a list of rooms to rename... */
@@ -1341,7 +1340,7 @@ void imap_rename(int num_parms, char *parms[])
                irlparms.oldname = parms[2];
                irlparms.newname = parms[3];
                irlparms.irl = &irl;
-               ForEachRoom(imap_rename_backend, (void *) &irlparms);
+               CtdlForEachRoom(imap_rename_backend, (void *) &irlparms);
 
                /* ... and now rename them. */
                while (irl != NULL) {
index 49c401d1b1aa9fcadca1b1b693bab25d633d08b8..cfd72d64f3cb9ba55d03656bc731854475468f0f 100644 (file)
@@ -53,7 +53,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
@@ -178,7 +177,7 @@ void spamstrings_init_backend(long msgnum, void *userdata) {
 
 
 void inetcfg_init(void) {
-       if (getroom(&CC->room, SYSCONFIGROOM) != 0) return;
+       if (CtdlGetRoom(&CC->room, SYSCONFIGROOM) != 0) return;
        CtdlForEachMessage(MSGS_LAST, 1, NULL, INTERNETCFG, NULL,
                inetcfg_init_backend, NULL);
 }
index fe7178db32fe32f813a61f5a15d9eba0da5f2ae5..a2532a3516e8c0a242664419d99508052bd2c3b2 100644 (file)
@@ -51,7 +51,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
index cf854789b0fb19e084c0805cae660f6ac41b88e9..6823260cdfa0856451863ddcf4718cc97266603a 100644 (file)
@@ -52,7 +52,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
@@ -106,7 +105,7 @@ void do_subscribe(char *room, char *email, char *subtype, char *webpage) {
        char scanemail[256];
        int found_sub = 0;
 
-       if (getroom(&qrbuf, room) != 0) {
+       if (CtdlGetRoom(&qrbuf, room) != 0) {
                cprintf("%d There is no list called '%s'\n", ERROR + ROOM_NOT_FOUND, room);
                return;
        }
@@ -246,7 +245,7 @@ void do_unsubscribe(char *room, char *email, char *webpage) {
        char scanemail[256];
        int found_sub = 0;
 
-       if (getroom(&qrbuf, room) != 0) {
+       if (CtdlGetRoom(&qrbuf, room) != 0) {
                cprintf("%d There is no list called '%s'\n",
                        ERROR + ROOM_NOT_FOUND, room);
                return;
@@ -395,7 +394,7 @@ void do_confirm(char *room, char *token) {
 
        strcpy(address_to_unsubscribe, "");
 
-       if (getroom(&qrbuf, room) != 0) {
+       if (CtdlGetRoom(&qrbuf, room) != 0) {
                cprintf("%d There is no list called '%s'\n",
                        ERROR + ROOM_NOT_FOUND, room);
                return;
index 8904ea1cfff53b34eae3f4882ff21d95a3177446..9c81c9093a4f3c7cb97a7230baf2b7586c6c4160 100644 (file)
@@ -61,7 +61,6 @@
 #include "support.h"
 #include "config.h"
 #include "control.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
index 07027db060f74c1f702e6682a251607f1f17bde0..7f855c5db7150ed1ae71622aeb958fc22b62fbd0 100644 (file)
@@ -57,7 +57,6 @@
 #include "database.h"
 #include "msgbase.h"
 #include "user_ops.h"
-#include "room_ops.h"
 #include "control.h"
 #include "euidindex.h"
 
@@ -159,7 +158,7 @@ void migr_export_rooms_backend(struct ctdlroom *buf, void *data) {
 
        /* message list goes inside this tag */
 
-       getroom(&CC->room, buf->QRname);
+       CtdlGetRoom(&CC->room, buf->QRname);
        client_write("<room_messages>", 15);
        client_write("<FRname>", 8);    xml_strout(CC->room.QRname);    client_write("</FRname>\n", 10);
        client_write("<FRmsglist>", 11);
@@ -175,7 +174,7 @@ void migr_export_rooms(void) {
        char cmd[SIZ];
        migr_global_message_list = fopen(migr_tempfilename1, "w");
        if (migr_global_message_list != NULL) {
-               ForEachRoom(migr_export_rooms_backend, NULL);
+               CtdlForEachRoom(migr_export_rooms_backend, NULL);
                fclose(migr_global_message_list);
        }
 
@@ -199,7 +198,7 @@ void migr_export_floors(void) {
         for (i=0; i < MAXFLOORS; ++i) {
                client_write("<floor>\n", 8);
                cprintf("<f_num>%d</f_num>\n", i);
-                getfloor(&qfbuf, i);
+                CtdlGetFloor(&qfbuf, i);
                buf = &qfbuf;
                cprintf("<f_flags>%u</f_flags>\n", buf->f_flags);
                client_write("<f_name>", 8); xml_strout(buf->f_name); client_write("</f_name>\n", 10);
@@ -761,7 +760,7 @@ void migr_xml_end(void *data, const char *el, const char **attr) {
        else if (!strcasecmp(el, "QRdefaultview"))              qrbuf.QRdefaultview = atoi(migr_chardata);
 
        else if (!strcasecmp(el, "room")) {
-               putroom(&qrbuf);
+               CtdlPutRoom(&qrbuf);
                CtdlLogPrintf(CTDL_INFO, "Imported room: %s\n", qrbuf.QRname);
        }
 
@@ -819,7 +818,7 @@ void migr_xml_end(void *data, const char *el, const char **attr) {
        else if (!strcasecmp(el, "f_ep_expire_value"))          flbuf.f_ep.expire_value = atoi(migr_chardata);
 
        else if (!strcasecmp(el, "floor")) {
-               putfloor(&flbuf, floornum);
+               CtdlPutFloor(&flbuf, floornum);
                CtdlLogPrintf(CTDL_INFO, "Imported floor #%d (%s)\n", floornum, flbuf.f_name);
        }
 
index 18d2cbc6a4867bef13149a3f1f64de477f925b5a..2ee6f4b23ee22812708d38add97789519aa15dd1 100644 (file)
@@ -55,7 +55,6 @@
 #include "support.h"
 #include "config.h"
 #include "control.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
index cf5e756a7baae7c8d0a9623191fc281e059e0120..19e8f845f56e2e4b795b859a9b3347f12c50d250 100644 (file)
@@ -51,7 +51,6 @@
 #include "support.h"
 #include "config.h"
 #include "control.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
index d8227a8815cb31f3530ec381fdfceef34db64731..bb1947354e207405de3ba35d01c384f319feb872 100644 (file)
@@ -67,7 +67,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
@@ -1142,7 +1141,7 @@ void network_spoolout_room(char *room_to_spool) {
         * Normally this should never happen, but once in a while maybe a room gets
         * queued for networking and then deleted before it can happen.
         */
-       if (getroom(&CC->room, room_to_spool) != 0) {
+       if (CtdlGetRoom(&CC->room, room_to_spool) != 0) {
                CtdlLogPrintf(CTDL_CRIT, "ERROR: cannot load <%s>\n", room_to_spool);
                return;
        }
@@ -2175,7 +2174,7 @@ void *network_do_queue(void *args) {
         */
        if (full_processing && !CtdlThreadCheckStop()) {
                CtdlLogPrintf(CTDL_DEBUG, "network: loading outbound queue\n");
-               ForEachRoom(network_queue_room, NULL);
+               CtdlForEachRoom(network_queue_room, NULL);
        }
 
        if (rplist != NULL) {
index 0e4b8bad9605dd77e37581efaeec94ed33d54905..dae9c40cfa89925cbe92bad3d0989a990f6c0b98 100644 (file)
@@ -56,7 +56,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
@@ -89,7 +88,7 @@ void CopyNewUserGreetings(void) {
        /* Go to the source room ... bail out silently if it's not there,
         * or if it's not private.
         */
-       if (getroom(&CC->room, NEWUSERGREETINGS) != 0) return;
+       if (CtdlGetRoom(&CC->room, NEWUSERGREETINGS) != 0) return;
        if (! CC->room.QRflags & QR_PRIVATE ) return;
 
        cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long));
index 0b3c3e38443254d4263f34a1c8a1d470523a230b..9da02a0dbe6963a51e88ccfb29702b72da49b67b 100644 (file)
@@ -50,7 +50,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
index baee5a2aafc6926e7687f76d7da763d6a188323f..c0db0ea86f22f37c86895aa518851914bedeceed 100644 (file)
@@ -61,7 +61,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
@@ -195,7 +194,7 @@ int pop3_grab_mailbox(void) {
         struct visit vbuf;
        int i;
 
-       if (getroom(&CC->room, MAILROOM) != 0) return(-1);
+       if (CtdlGetRoom(&CC->room, MAILROOM) != 0) return(-1);
 
        /* Load up the messages */
        CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, NULL,
index c7576146d70241effcb7757f571388cde1798d2e..de70ea86522769df4de7ba21469c8a141755a6d1 100644 (file)
@@ -46,7 +46,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "room_ops.h"
 #include "ctdl_module.h"
 #include "clientsocket.h"
 #include "msgbase.h"
@@ -323,7 +322,7 @@ void pop3client_scan(void) {
        doing_pop3client = 1;
 
        CtdlLogPrintf(CTDL_DEBUG, "pop3client started\n");
-       ForEachRoom(pop3client_scan_room, NULL);
+       CtdlForEachRoom(pop3client_scan_room, NULL);
 
        while (palist != NULL && !CtdlThreadCheckStop()) {
                if ((palist->interval && time(NULL) > (last_run + palist->interval))
index 47ef682073391851d5941330ac685298f0a58446..e60c5ad9448d39fe8437cf2813a24744000537a7 100644 (file)
@@ -49,7 +49,6 @@
 #include "support.h"
 #include "config.h"
 #include "threads.h"
-#include "room_ops.h"
 #include "ctdl_module.h"
 #include "clientsocket.h"
 #include "msgbase.h"
@@ -580,7 +579,7 @@ void *rssclient_scan(void *args) {
        doing_rssclient = 1;
 
        CtdlLogPrintf(CTDL_DEBUG, "rssclient started\n");
-       ForEachRoom(rssclient_scan_room, NULL);
+       CtdlForEachRoom(rssclient_scan_room, NULL);
 
        while (rnclist != NULL && !CtdlThreadCheckStop()) {
                rss_do_fetching(rnclist->url, rnclist->rooms);
index 3d60b1a5a4be4e341961eb587cd5f05b1dc174a9..9a1944061a9a7d806a8350822f55e1e4d3605b03 100644 (file)
@@ -52,7 +52,6 @@
 #include "support.h"
 #include "config.h"
 #include "control.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
index 85cd92a0c0d6bb365d4f6598768c250421e6f23d..960393d96dfcde2065b05959f794f63284996ec3 100644 (file)
@@ -51,7 +51,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "room_ops.h"
 #include "policy.h"
 #include "database.h"
 #include "msgbase.h"
@@ -178,12 +177,12 @@ int ctdl_fileinto(sieve2_context_t *s, void *my)
 
        /* First try a mailbox name match (check personal mail folders first) */
        snprintf(foldername, sizeof foldername, "%010ld.%s", cs->usernum, dest_folder);
-       c = getroom(&CC->room, foldername);
+       c = CtdlGetRoom(&CC->room, foldername);
 
        /* Then a regular room name match (public and private rooms) */
        if (c != 0) {
                safestrncpy(foldername, dest_folder, sizeof foldername);
-               c = getroom(&CC->room, foldername);
+               c = CtdlGetRoom(&CC->room, foldername);
        }
 
        if (c != 0) {
@@ -192,13 +191,13 @@ int ctdl_fileinto(sieve2_context_t *s, void *my)
        }
 
        /* Yes, we actually have to go there */
-       usergoto(NULL, 0, 0, NULL, NULL);
+       CtdlUserGoto(NULL, 0, 0, NULL, NULL);
 
        c = CtdlSaveMsgPointersInRoom(NULL, &cs->msgnum, 1, 0, NULL);
 
        /* Go back to the room we came from */
        if (strcasecmp(original_room_name, CC->room.QRname)) {
-               usergoto(original_room_name, 0, 0, NULL, NULL);
+               CtdlUserGoto(original_room_name, 0, 0, NULL, NULL);
        }
 
        if (c == 0) {
@@ -883,7 +882,7 @@ void sieve_do_room(char *roomname) {
         * require execution.
         */
        snprintf(u.config_roomname, sizeof u.config_roomname, "%010ld.%s", atol(roomname), USERCONFIGROOM);
-       if (getroom(&CC->room, u.config_roomname) != 0) {
+       if (CtdlGetRoom(&CC->room, u.config_roomname) != 0) {
                CtdlLogPrintf(CTDL_DEBUG, "<%s> does not exist.  No processing is required.\n", u.config_roomname);
                return;
        }
@@ -902,7 +901,7 @@ void sieve_do_room(char *roomname) {
 
        CtdlLogPrintf(CTDL_DEBUG, "Rules found.  Performing Sieve processing for <%s>\n", roomname);
 
-       if (getroom(&CC->room, roomname) != 0) {
+       if (CtdlGetRoom(&CC->room, roomname) != 0) {
                CtdlLogPrintf(CTDL_CRIT, "ERROR: cannot load <%s>\n", roomname);
                return;
        }
@@ -991,7 +990,7 @@ void msiv_load(struct sdm_userdata *u) {
        strcpy(hold_rm, CC->room.QRname);       /* save current room */
 
        /* Take a spin through the user's personal address book */
-       if (getroom(&CC->room, USERCONFIGROOM) == 0) {
+       if (CtdlGetRoom(&CC->room, USERCONFIGROOM) == 0) {
        
                u->config_msgnum = (-1);
                strcpy(u->config_roomname, CC->room.QRname);
@@ -1001,7 +1000,7 @@ void msiv_load(struct sdm_userdata *u) {
        }
 
        if (strcmp(CC->room.QRname, hold_rm)) {
-               getroom(&CC->room, hold_rm);    /* return to saved room */
+               CtdlGetRoom(&CC->room, hold_rm);    /* return to saved room */
        }
 }
 
index 2680d908cfdc2e681c0f14af8c9b17392bd144fc..11a53020d081ef65f60d9906dae35cabedde4aeb 100644 (file)
@@ -75,7 +75,6 @@
 #include "support.h"
 #include "config.h"
 #include "control.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
@@ -1740,7 +1739,7 @@ void smtp_do_queue(void) {
         */
        CtdlLogPrintf(CTDL_INFO, "SMTP client: processing outbound queue\n");
 
-       if (getroom(&CC->room, SMTP_SPOOLOUT_ROOM) != 0) {
+       if (CtdlGetRoom(&CC->room, SMTP_SPOOLOUT_ROOM) != 0) {
                CtdlLogPrintf(CTDL_ERR, "Cannot find room <%s>\n", SMTP_SPOOLOUT_ROOM);
                return;
        }
@@ -1804,15 +1803,15 @@ void smtp_init_spoolout(void) {
         * Create the room.  This will silently fail if the room already
         * exists, and that's perfectly ok, because we want it to exist.
         */
-       create_room(SMTP_SPOOLOUT_ROOM, 3, "", 0, 1, 0, VIEW_MAILBOX);
+       CtdlCreateRoom(SMTP_SPOOLOUT_ROOM, 3, "", 0, 1, 0, VIEW_MAILBOX);
 
        /*
         * Make sure it's set to be a "system room" so it doesn't show up
         * in the <K>nown rooms list for Aides.
         */
-       if (lgetroom(&qrbuf, SMTP_SPOOLOUT_ROOM) == 0) {
+       if (CtdlGetRoomLock(&qrbuf, SMTP_SPOOLOUT_ROOM) == 0) {
                qrbuf.QRflags2 |= QR2_SYSTEM;
-               lputroom(&qrbuf);
+               CtdlPutRoomLock(&qrbuf);
        }
 }
 
index 0744fe28333f7c5b0f3b6af7bfb32fe4a08bb540..7868545ad591194af0b996e1e0b68855f9d1b0a6 100644 (file)
@@ -57,7 +57,6 @@
 #include "support.h"
 #include "config.h"
 #include "control.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
index ae5c8da11b7b35ef806ea7ca6ba45f74467c49df..c7a7b7220c03b7e1d4a05e9bd47c64f6082a4fc7 100644 (file)
@@ -52,7 +52,6 @@
 #include "config.h"
 #include "control.h"
 #include "database.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "msgbase.h"
 #include "serv_upgrade.h"
@@ -114,7 +113,7 @@ void cmd_bmbx_backend(struct ctdlroom *qrbuf, void *data) {
        struct RoomProcList *ptr;
        struct ctdlroom qr;
 
-       /* Lazy programming here.  Call this function as a ForEachRoom backend
+       /* Lazy programming here.  Call this function as a CtdlForEachRoom backend
         * in order to queue up the room names, or call it with a null room
         * to make it do the processing.
         */
@@ -131,7 +130,7 @@ void cmd_bmbx_backend(struct ctdlroom *qrbuf, void *data) {
 
        while (rplist != NULL) {
 
-               if (lgetroom(&qr, rplist->name) == 0) {
+               if (CtdlGetRoomLock(&qr, rplist->name) == 0) {
                        CtdlLogPrintf(CTDL_DEBUG, "Processing <%s>...\n", rplist->name);
                        if ( (qr.QRflags & QR_MAILBOX) == 0) {
                                CtdlLogPrintf(CTDL_DEBUG, "  -- not a mailbox\n");
@@ -141,7 +140,7 @@ void cmd_bmbx_backend(struct ctdlroom *qrbuf, void *data) {
                                qr.QRgen = time(NULL);
                                CtdlLogPrintf(CTDL_DEBUG, "  -- fixed!\n");
                        }
-                       lputroom(&qr);
+                       CtdlPutRoomLock(&qr);
                }
 
                ptr = rplist;
@@ -155,7 +154,7 @@ void cmd_bmbx_backend(struct ctdlroom *qrbuf, void *data) {
  */
 void bump_mailbox_generation_numbers(void) {
        CtdlLogPrintf(CTDL_WARNING, "Applying security fix to mailbox rooms\n");
-       ForEachRoom(cmd_bmbx_backend, NULL);
+       CtdlForEachRoom(cmd_bmbx_backend, NULL);
        cmd_bmbx_backend(NULL, NULL);
        return;
 }
index f31b538b838aa197dfcc21c0bf98d08351a4084d..a4e92d234f352af62d0d6d51e1df5ca232ae2fe9 100644 (file)
@@ -68,7 +68,6 @@
 #include "support.h"
 #include "config.h"
 #include "control.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
@@ -191,8 +190,8 @@ void cmd_igab(char *argbuf) {
 
        strcpy(hold_rm, CC->room.QRname);       /* save current room */
 
-       if (getroom(&CC->room, ADDRESS_BOOK_ROOM) != 0) {
-               getroom(&CC->room, hold_rm);
+       if (CtdlGetRoom(&CC->room, ADDRESS_BOOK_ROOM) != 0) {
+               CtdlGetRoom(&CC->room, hold_rm);
                cprintf("%d cannot get address book room\n", ERROR + ROOM_NOT_FOUND);
                return;
        }
@@ -205,7 +204,7 @@ void cmd_igab(char *argbuf) {
        CtdlForEachMessage(MSGS_ALL, 0, NULL, "^[Tt][Ee][Xx][Tt]/.*[Vv][Cc][Aa][Rr][Dd]$",
                NULL, vcard_add_to_directory, NULL);
 
-       getroom(&CC->room, hold_rm);    /* return to saved room */
+       CtdlGetRoom(&CC->room, hold_rm);        /* return to saved room */
        cprintf("%d Directory has been rebuilt.\n", CIT_OK);
 }
 
@@ -604,8 +603,8 @@ struct vCard *vcard_get_user(struct ctdluser *u) {
        strcpy(hold_rm, CC->room.QRname);       /* save current room */
        MailboxName(config_rm, sizeof config_rm, u, USERCONFIGROOM);
 
-       if (getroom(&CC->room, config_rm) != 0) {
-               getroom(&CC->room, hold_rm);
+       if (CtdlGetRoom(&CC->room, config_rm) != 0) {
+               CtdlGetRoom(&CC->room, hold_rm);
                return vcard_new();
        }
 
@@ -613,7 +612,7 @@ struct vCard *vcard_get_user(struct ctdluser *u) {
        VCmsgnum = (-1);
        CtdlForEachMessage(MSGS_LAST, 1, NULL, "^[Tt][Ee][Xx][Tt]/.*[Vv][Cc][Aa][Rr][Dd]$",
                NULL, vcard_gu_backend, (void *)&VCmsgnum );
-       getroom(&CC->room, hold_rm);    /* return to saved room */
+       CtdlGetRoom(&CC->room, hold_rm);        /* return to saved room */
 
        if (VCmsgnum < 0L) return vcard_new();
 
@@ -1162,22 +1161,22 @@ void check_get_greeting(void) {
 /*
  * We don't know if the Contacts room exists so we just create it at login
  */
-void vcard_create_room(void)
+void vcard_CtdlCreateRoom(void)
 {
        struct ctdlroom qr;
        struct visit vbuf;
 
        /* Create the calendar room if it doesn't already exist */
-       create_room(USERCONTACTSROOM, 4, "", 0, 1, 0, VIEW_ADDRESSBOOK);
+       CtdlCreateRoom(USERCONTACTSROOM, 4, "", 0, 1, 0, VIEW_ADDRESSBOOK);
 
        /* Set expiration policy to manual; otherwise objects will be lost! */
-       if (lgetroom(&qr, USERCONTACTSROOM)) {
+       if (CtdlGetRoomLock(&qr, USERCONTACTSROOM)) {
                CtdlLogPrintf(CTDL_ERR, "Couldn't get the user CONTACTS room!\n");
                return;
        }
        qr.QRep.expire_mode = EXPIRE_MANUAL;
        qr.QRdefaultview = VIEW_ADDRESSBOOK;    /* 2 = address book view */
-       lputroom(&qr);
+       CtdlPutRoomLock(&qr);
 
        /* Set the view to a calendar view */
        CtdlGetRelationship(&vbuf, &CC->user, &qr);
@@ -1229,7 +1228,7 @@ void vcard_session_login_hook(void) {
        /*
         * Create the user's 'Contacts' room (personal address book) if it doesn't already exist.
         */
-       vcard_create_room();
+       vcard_CtdlCreateRoom();
 }
 
 
@@ -1318,7 +1317,7 @@ void store_this_ha(struct addresses_to_be_filed *aptr) {
        int i;
 
        /* First remove any addresses we already have in the address book */
-       usergoto(aptr->roomname, 0, 0, NULL, NULL);
+       CtdlUserGoto(aptr->roomname, 0, 0, NULL, NULL);
        CtdlForEachMessage(MSGS_ALL, 0, NULL, "^[Tt][Ee][Xx][Tt]/.*[Vv][Cc][Aa][Rr][Dd]$", NULL,
                strip_addresses_already_have, aptr->collected_addresses);
 
@@ -1437,13 +1436,13 @@ CTDL_MODULE_INIT(vcard)
                CtdlRegisterFixedOutputHook("text/vcard", vcard_fixed_output);
 
                /* Create the Global ADdress Book room if necessary */
-               create_room(ADDRESS_BOOK_ROOM, 3, "", 0, 1, 0, VIEW_ADDRESSBOOK);
+               CtdlCreateRoom(ADDRESS_BOOK_ROOM, 3, "", 0, 1, 0, VIEW_ADDRESSBOOK);
 
                /* Set expiration policy to manual; otherwise objects will be lost! */
-               if (!lgetroom(&qr, ADDRESS_BOOK_ROOM)) {
+               if (!CtdlGetRoomLock(&qr, ADDRESS_BOOK_ROOM)) {
                        qr.QRep.expire_mode = EXPIRE_MANUAL;
                        qr.QRdefaultview = VIEW_ADDRESSBOOK;    /* 2 = address book view */
-                       lputroom(&qr);
+                       CtdlPutRoomLock(&qr);
 
                        /*
                         * Also make sure it has a netconfig file, so the networker runs
index 2cab57586d9bcf5c99517b7fd410056557a33d65..c41fb12d073cfb993c005939ea883dd329847e3c 100644 (file)
@@ -52,7 +52,6 @@
 #include "support.h"
 #include "config.h"
 #include "control.h"
-#include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
 #include "database.h"
index d5be1bb33ff99ed7d997f2380a0316cff8df026b..d46ec6cf6814fbf7dd3c990eb160c0a5b33da733 100644 (file)
@@ -2310,7 +2310,7 @@ int CtdlSaveMsgPointersInRoom(char *roomname, long newmsgidlist[], int num_newms
        if (num_newmsgs > 1) supplied_msg = NULL;
 
        /* Now the regular stuff */
-       if (lgetroom(&CC->room,
+       if (CtdlGetRoomLock(&CC->room,
           ((roomname != NULL) ? roomname : CC->room.QRname) )
           != 0) {
                CtdlLogPrintf(CTDL_ERR, "No such room <%s>\n", roomname);
@@ -2377,7 +2377,7 @@ int CtdlSaveMsgPointersInRoom(char *roomname, long newmsgidlist[], int num_newms
 
        /* Update the highest-message pointer and unlock the room. */
        CC->room.QRhighest = highest_msg;
-       lputroom(&CC->room);
+       CtdlPutRoomLock(&CC->room);
 
        /* Perform replication checks if necessary */
        if ( (DoesThisRoomNeedEuidIndexing(&CC->room)) && (do_repl_check) ) {
@@ -2418,7 +2418,7 @@ int CtdlSaveMsgPointersInRoom(char *roomname, long newmsgidlist[], int num_newms
        PerformRoomHooks(&CC->room);
 
        /* Go back to the room we were in before we wandered here... */
-       getroom(&CC->room, hold_rm);
+       CtdlGetRoom(&CC->room, hold_rm);
 
        /* Bump the reference count for all messages which were merged */
        for (i=0; i<num_msgs_to_be_merged; ++i) {
@@ -2772,8 +2772,8 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,       /* message to save */
 
        CtdlLogPrintf(CTDL_DEBUG, "Final selection: %s\n", actual_rm);
        if (strcasecmp(actual_rm, CCC->room.QRname)) {
-               /* getroom(&CCC->room, actual_rm); */
-               usergoto(actual_rm, 0, 1, NULL, NULL);
+               /* CtdlGetRoom(&CCC->room, actual_rm); */
+               CtdlUserGoto(actual_rm, 0, 1, NULL, NULL);
        }
 
        /*
@@ -2977,7 +2977,7 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,       /* message to save */
        /* Go back to the room we started from */
        CtdlLogPrintf(CTDL_DEBUG, "Returning to original room %s\n", hold_rm);
        if (strcasecmp(hold_rm, CCC->room.QRname))
-               usergoto(hold_rm, 0, 1, NULL, NULL);
+               CtdlUserGoto(hold_rm, 0, 1, NULL, NULL);
 
        /* For internet mail, generate delivery instructions.
         * Yes, this is recursive.  Deal with it.  Infinite recursion does
@@ -3589,7 +3589,7 @@ struct recptypes *validate_recipients(char *supplied_recipients,
                                        strcat(ret->recp_room, this_recp);
                                }
                                else if ( (!strncasecmp(this_recp, "room_", 5))
-                                     && (!getroom(&tempQR, &this_recp_cooked[5])) ) {
+                                     && (!CtdlGetRoom(&tempQR, &this_recp_cooked[5])) ) {
 
                                        /* Save room so we can restore it later */
                                        tempQR2 = CC->room;
@@ -4079,7 +4079,7 @@ int CtdlDeleteMessages(char *room_name,           /* which room */
                room_name, num_dmsgnums, content_type);
 
        /* get room record, obtaining a lock... */
-       if (lgetroom(&qrbuf, room_name) != 0) {
+       if (CtdlGetRoomLock(&qrbuf, room_name) != 0) {
                CtdlLogPrintf(CTDL_ERR, "CtdlDeleteMessages(): Room <%s> not found\n",
                        room_name);
                if (need_to_free_re) regfree(&re);
@@ -4136,7 +4136,7 @@ int CtdlDeleteMessages(char *room_name,           /* which room */
 
                qrbuf.QRhighest = msglist[num_msgs - 1];
        }
-       lputroom(&qrbuf);
+       CtdlPutRoomLock(&qrbuf);
 
        /* Go through the messages we pulled out of the index, and decrement
         * their reference counts by 1.  If this is the only room the message
@@ -4253,7 +4253,7 @@ void cmd_move(char *args)
        targ[ROOMNAMELEN - 1] = 0;
        is_copy = extract_int(args, 2);
 
-       if (getroom(&qtemp, targ) != 0) {
+       if (CtdlGetRoom(&qtemp, targ) != 0) {
                cprintf("%d '%s' does not exist.\n", ERROR + ROOM_NOT_FOUND, targ);
                return;
        }
@@ -4607,8 +4607,8 @@ void CtdlWriteObject(char *req_room,                      /* Room to stuff it in */
        msg->cm_fields['M'] = encoded_message;
 
        /* Create the requested room if we have to. */
-       if (getroom(&qrbuf, roomname) != 0) {
-               create_room(roomname, 
+       if (CtdlGetRoom(&qrbuf, roomname) != 0) {
+               CtdlCreateRoom(roomname, 
                        ( (is_mailbox != NULL) ? 5 : 3 ),
                        "", 0, 1, 0, VIEW_BBS);
        }
@@ -4643,8 +4643,8 @@ char *CtdlGetSysConfig(char *sysconfname) {
        char buf[SIZ];
        
        strcpy(hold_rm, CC->room.QRname);
-       if (getroom(&CC->room, SYSCONFIGROOM) != 0) {
-               getroom(&CC->room, hold_rm);
+       if (CtdlGetRoom(&CC->room, SYSCONFIGROOM) != 0) {
+               CtdlGetRoom(&CC->room, hold_rm);
                return NULL;
        }
 
@@ -4671,7 +4671,7 @@ char *CtdlGetSysConfig(char *sysconfname) {
                }
        }
 
-       getroom(&CC->room, hold_rm);
+       CtdlGetRoom(&CC->room, hold_rm);
 
        if (conf != NULL) do {
                extract_token(buf, conf, 0, '\n', sizeof buf);
index dd1b7994b726508ec17f85208ee383e28d3b3e72..1c8ca4a2a32ef5fc0e1568c6588d8a85aa7066a0 100644 (file)
@@ -53,7 +53,7 @@ void GetExpirePolicy(struct ExpirePolicy *epbuf, struct ctdlroom *qrbuf) {
         * If the floor has its own policy, return it
         */
        if ( (qrbuf->QRflags & QR_MAILBOX) == 0) {
-               fl = cgetfloor(qrbuf->QRfloor);
+               fl = CtdlGetCachedFloor(qrbuf->QRfloor);
                if (fl->f_ep.expire_mode != 0) {
                        memcpy(epbuf, &fl->f_ep, sizeof(struct ExpirePolicy));
                        return;
@@ -89,7 +89,7 @@ void cmd_gpex(char *argbuf) {
                memcpy(&exp, &CC->room.QRep, sizeof(struct ExpirePolicy));
        }
        else if (!strcasecmp(which, "floor")) {
-               fl = cgetfloor(CC->room.QRfloor);
+               fl = CtdlGetCachedFloor(CC->room.QRfloor);
                memcpy(&exp, &fl->f_ep, sizeof(struct ExpirePolicy));
        }
        else if (!strcasecmp(which, "mailboxes")) {
@@ -131,9 +131,9 @@ void cmd_spex(char *argbuf) {
                                ERROR + HIGHER_ACCESS_REQUIRED);
                        return;
                }
-               lgetroom(&CC->room, CC->room.QRname);
+               CtdlGetRoomLock(&CC->room, CC->room.QRname);
                memcpy(&CC->room.QRep, &exp, sizeof(struct ExpirePolicy));
-               lputroom(&CC->room);
+               CtdlPutRoomLock(&CC->room);
                cprintf("%d Room expire policy has been updated.\n", CIT_OK);
                return;
        }
index 07ad2f5e061ab7e051f1f5388b82b933a06a3925..290190762835fb30b57845f82a6d2e887d1ec332 100644 (file)
@@ -222,9 +222,9 @@ void room_sanity_check(struct ctdlroom *qrbuf)
 
 
 /*
- * getroom()  -  retrieve room data from disk
+ * CtdlGetRoom()  -  retrieve room data from disk
  */
-int getroom(struct ctdlroom *qrbuf, char *room_name)
+int CtdlGetRoom(struct ctdlroom *qrbuf, char *room_name)
 {
        struct cdbdata *cdbqr;
        char lowercase_name[ROOMNAMELEN];
@@ -270,12 +270,12 @@ int getroom(struct ctdlroom *qrbuf, char *room_name)
 }
 
 /*
- * lgetroom()  -  same as getroom() but locks the record (if supported)
+ * CtdlGetRoomLock()  -  same as getroom() but locks the record (if supported)
  */
-int lgetroom(struct ctdlroom *qrbuf, char *room_name)
+int CtdlGetRoomLock(struct ctdlroom *qrbuf, char *room_name)
 {
        register int retval;
-       retval = getroom(qrbuf, room_name);
+       retval = CtdlGetRoom(qrbuf, room_name);
        if (retval == 0) begin_critical_section(S_ROOMS);
        return(retval);
 }
@@ -315,9 +315,9 @@ void b_putroom(struct ctdlroom *qrbuf, char *room_name)
 
 
 /* 
- * putroom()  -  store room data to disk
+ * CtdlPutRoom()  -  store room data to disk
  */
-void putroom(struct ctdlroom *qrbuf) {
+void CtdlPutRoom(struct ctdlroom *qrbuf) {
        b_putroom(qrbuf, qrbuf->QRname);
 }
 
@@ -332,12 +332,12 @@ void b_deleteroom(char *room_name) {
 
 
 /*
- * lputroom()  -  same as putroom() but unlocks the record (if supported)
+ * CtdlPutRoomLock()  -  same as CtdlPutRoom() but unlocks the record (if supported)
  */
-void lputroom(struct ctdlroom *qrbuf)
+void CtdlPutRoomLock(struct ctdlroom *qrbuf)
 {
 
-       putroom(qrbuf);
+       CtdlPutRoom(qrbuf);
        end_critical_section(S_ROOMS);
 
 }
@@ -345,9 +345,9 @@ void lputroom(struct ctdlroom *qrbuf)
 /****************************************************************************/
 
 /*
- * getfloor()  -  retrieve floor data from disk
+ * CtdlGetFloor()  -  retrieve floor data from disk
  */
-void getfloor(struct floor *flbuf, int floor_num)
+void CtdlGetFloor(struct floor *flbuf, int floor_num)
 {
        struct cdbdata *cdbfl;
 
@@ -370,22 +370,22 @@ void getfloor(struct floor *flbuf, int floor_num)
 }
 
 /*
- * lgetfloor()  -  same as getfloor() but locks the record (if supported)
+ * lgetfloor()  -  same as CtdlGetFloor() but locks the record (if supported)
  */
 void lgetfloor(struct floor *flbuf, int floor_num)
 {
 
        begin_critical_section(S_FLOORTAB);
-       getfloor(flbuf, floor_num);
+       CtdlGetFloor(flbuf, floor_num);
 }
 
 
 /*
- * cgetfloor()  -  Get floor record from *cache* (loads from disk if needed)
+ * CtdlGetCachedFloor()  -  Get floor record from *cache* (loads from disk if needed)
  *    
  * This is strictly a performance hack.
  */
-struct floor *cgetfloor(int floor_num) {
+struct floor *CtdlGetCachedFloor(int floor_num) {
        static int initialized = 0;
        int i;
        int fetch_new = 0;
@@ -405,7 +405,7 @@ struct floor *cgetfloor(int floor_num) {
 
        if (fetch_new) {
                fl = malloc(sizeof(struct floor));
-               getfloor(fl, floor_num);
+               CtdlGetFloor(fl, floor_num);
                begin_critical_section(S_FLOORCACHE);
                if (floorcache[floor_num] != NULL) {
                        free(floorcache[floor_num]);
@@ -420,9 +420,9 @@ struct floor *cgetfloor(int floor_num) {
 
 
 /*
- * putfloor()  -  store floor data on disk
+ * CtdlPutFloor()  -  store floor data on disk
  */
-void putfloor(struct floor *flbuf, int floor_num)
+void CtdlPutFloor(struct floor *flbuf, int floor_num)
 {
        /* If we've cached this, clear it out, 'cuz it's WRONG now! */
        begin_critical_section(S_FLOORCACHE);
@@ -439,12 +439,12 @@ void putfloor(struct floor *flbuf, int floor_num)
 
 
 /*
- * lputfloor()  -  same as putfloor() but unlocks the record (if supported)
+ * lputfloor()  -  same as CtdlPutFloor() but unlocks the record (if supported)
  */
 void lputfloor(struct floor *flbuf, int floor_num)
 {
 
-       putfloor(flbuf, floor_num);
+       CtdlPutFloor(flbuf, floor_num);
        end_critical_section(S_FLOORTAB);
 
 }
@@ -453,7 +453,7 @@ void lputfloor(struct floor *flbuf, int floor_num)
 /* 
  *  Traverse the room file...
  */
-void ForEachRoom(void (*CallBack) (struct ctdlroom *EachRoom, void *out_data),
+void CtdlForEachRoom(void (*CallBack) (struct ctdlroom *EachRoom, void *out_data),
                void *in_data)
 {
        struct ctdlroom qrbuf;
@@ -535,7 +535,7 @@ int sort_msglist(long listptrs[], int oldcount)
 /*
  * Determine whether a given room is non-editable.
  */
-int is_noneditable(struct ctdlroom *qrbuf)
+int CtdlIsNonEditable(struct ctdlroom *qrbuf)
 {
 
        /* Mail> rooms are non-editable */
@@ -614,7 +614,7 @@ void cmd_lrms(char *argbuf)
        }
        cprintf("%d Accessible rooms:\n", LISTING_FOLLOWS);
 
-       ForEachRoom(cmd_lrms_backend, &FloorBeingSearched);
+       CtdlForEachRoom(cmd_lrms_backend, &FloorBeingSearched);
        cprintf("000\n");
 }
 
@@ -652,7 +652,7 @@ void cmd_lkra(char *argbuf)
        }
        cprintf("%d Known rooms:\n", LISTING_FOLLOWS);
 
-       ForEachRoom(cmd_lkra_backend, &FloorBeingSearched);
+       CtdlForEachRoom(cmd_lkra_backend, &FloorBeingSearched);
        cprintf("000\n");
 }
 
@@ -682,7 +682,7 @@ void cmd_lprm(char *argbuf)
 
        cprintf("%d Publiic rooms:\n", LISTING_FOLLOWS);
 
-       ForEachRoom(cmd_lprm_backend, &FloorBeingSearched);
+       CtdlForEachRoom(cmd_lprm_backend, &FloorBeingSearched);
        cprintf("000\n");
 }
 
@@ -721,7 +721,7 @@ void cmd_lkrn(char *argbuf)
        }
        cprintf("%d Rooms w/ new msgs:\n", LISTING_FOLLOWS);
 
-       ForEachRoom(cmd_lkrn_backend, &FloorBeingSearched);
+       CtdlForEachRoom(cmd_lkrn_backend, &FloorBeingSearched);
        cprintf("000\n");
 }
 
@@ -760,7 +760,7 @@ void cmd_lkro(char *argbuf)
        }
        cprintf("%d Rooms w/o new msgs:\n", LISTING_FOLLOWS);
 
-       ForEachRoom(cmd_lkro_backend, &FloorBeingSearched);
+       CtdlForEachRoom(cmd_lkro_backend, &FloorBeingSearched);
        cprintf("000\n");
 }
 
@@ -799,7 +799,7 @@ void cmd_lzrm(char *argbuf)
        }
        cprintf("%d Zapped rooms:\n", LISTING_FOLLOWS);
 
-       ForEachRoom(cmd_lzrm_backend, &FloorBeingSearched);
+       CtdlForEachRoom(cmd_lzrm_backend, &FloorBeingSearched);
        cprintf("000\n");
 }
 
@@ -809,7 +809,7 @@ void cmd_lzrm(char *argbuf)
  * or access control is done here -- the caller should make sure that the
  * specified room exists and is ok to access.
  */
-void usergoto(char *where, int display_result, int transiently,
+void CtdlUserGoto(char *where, int display_result, int transiently,
                int *retmsgs, int *retnew)
 {
        int a;
@@ -838,7 +838,7 @@ void usergoto(char *where, int display_result, int transiently,
         */
        if (where != NULL) {
                safestrncpy(CC->room.QRname, where, sizeof CC->room.QRname);
-               getroom(&CC->room, where);
+               CtdlGetRoom(&CC->room, where);
        }
 
        /* Take care of all the formalities. */
@@ -873,7 +873,7 @@ void usergoto(char *where, int display_result, int transiently,
         cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long));
         if (cdbfr != NULL) {
                msglist = (long *) cdbfr->ptr;
-               cdbfr->ptr = NULL;      /* usergoto() now owns this memory */
+               cdbfr->ptr = NULL;      /* CtdlUserGoto() now owns this memory */
                num_msgs = cdbfr->len / sizeof(long);
                cdb_free(cdbfr);
        }
@@ -1026,13 +1026,13 @@ void cmd_goto(char *gargs)
        convert_room_name_macros(towhere, sizeof towhere);
 
        /* First try a regular match */
-       c = getroom(&QRscratch, towhere);
+       c = CtdlGetRoom(&QRscratch, towhere);
 
        /* Then try a mailbox name match */
        if (c != 0) {
                MailboxName(augmented_roomname, sizeof augmented_roomname,
                            &CC->user, towhere);
-               c = getroom(&QRscratch, augmented_roomname);
+               c = CtdlGetRoom(&QRscratch, augmented_roomname);
                if (c == 0)
                        safestrncpy(towhere, augmented_roomname, sizeof towhere);
        }
@@ -1044,7 +1044,7 @@ void cmd_goto(char *gargs)
                if (CC->internal_pgm) {
                        memcpy(&CC->room, &QRscratch,
                                sizeof(struct ctdlroom));
-                       usergoto(NULL, 1, transiently, NULL, NULL);
+                       CtdlUserGoto(NULL, 1, transiently, NULL, NULL);
                        return;
                }
 
@@ -1061,7 +1061,7 @@ void cmd_goto(char *gargs)
                            ((ra & UA_GOTOALLOWED))) {
                                memcpy(&CC->room, &QRscratch,
                                        sizeof(struct ctdlroom));
-                               usergoto(NULL, 1, transiently, NULL, NULL);
+                               CtdlUserGoto(NULL, 1, transiently, NULL, NULL);
                                return;
                        } else if ((QRscratch.QRflags & QR_PASSWORDED) &&
                            ((ra & UA_KNOWN) == 0) &&
@@ -1081,7 +1081,7 @@ void cmd_goto(char *gargs)
                        } else {
                                memcpy(&CC->room, &QRscratch,
                                        sizeof(struct ctdlroom));
-                               usergoto(NULL, 1, transiently, NULL, NULL);
+                               CtdlUserGoto(NULL, 1, transiently, NULL, NULL);
                                return;
                        }
                }
@@ -1132,7 +1132,7 @@ void cmd_rdir(char *cmdbuf)
        
        if (CtdlAccessCheck(ac_logged_in)) return;
        
-       getroom(&CC->room, CC->room.QRname);
+       CtdlGetRoom(&CC->room, CC->room.QRname);
        getuser(&CC->user, CC->curr_user);
 
        if ((CC->room.QRflags & QR_DIRECTORY) == 0) {
@@ -1214,7 +1214,7 @@ void cmd_getr(char *cmdbuf)
 {
        if (CtdlAccessCheck(ac_room_aide)) return;
 
-       getroom(&CC->room, CC->room.QRname);
+       CtdlGetRoom(&CC->room, CC->room.QRname);
        cprintf("%d%c%s|%s|%s|%d|%d|%d|%d|%d|\n",
                CIT_OK,
                CtdlCheckExpress(),
@@ -1260,7 +1260,7 @@ int CtdlRenameRoom(char *old_name, char *new_name, int new_floor) {
                old_name, new_name, new_floor);
 
        if (new_floor >= 0) {
-               fl = cgetfloor(new_floor);
+               fl = CtdlGetCachedFloor(new_floor);
                if ((fl->f_flags & F_INUSE) == 0) {
                        return(crr_invalid_floor);
                }
@@ -1268,12 +1268,12 @@ int CtdlRenameRoom(char *old_name, char *new_name, int new_floor) {
 
        begin_critical_section(S_ROOMS);
 
-       if ( (getroom(&qrtmp, new_name) == 0) 
+       if ( (CtdlGetRoom(&qrtmp, new_name) == 0) 
           && (strcasecmp(new_name, old_name)) ) {
                ret = crr_already_exists;
        }
 
-       else if (getroom(&qrbuf, old_name) != 0) {
+       else if (CtdlGetRoom(&qrbuf, old_name) != 0) {
                ret = crr_room_not_found;
        }
 
@@ -1283,7 +1283,7 @@ int CtdlRenameRoom(char *old_name, char *new_name, int new_floor) {
                ret = crr_access_denied;
        }
 
-       else if (is_noneditable(&qrbuf)) {
+       else if (CtdlIsNonEditable(&qrbuf)) {
                ret = crr_noneditable;
        }
 
@@ -1314,7 +1314,7 @@ int CtdlRenameRoom(char *old_name, char *new_name, int new_floor) {
                        new_floor = old_floor;
                }
                qrbuf.QRfloor = new_floor;
-               putroom(&qrbuf);
+               CtdlPutRoom(&qrbuf);
 
                begin_critical_section(S_CONFIG);
        
@@ -1413,7 +1413,7 @@ void cmd_setr(char *args)
                return;
        }
 
-       getroom(&CC->room, new_name);
+       CtdlGetRoom(&CC->room, new_name);
 
        /* Now we have to do a bunch of other stuff */
 
@@ -1425,7 +1425,7 @@ void cmd_setr(char *args)
                        new_order = 127;
        }
 
-       lgetroom(&CC->room, CC->room.QRname);
+       CtdlGetRoomLock(&CC->room, CC->room.QRname);
 
        /* Directory room */
        extract_token(buf, args, 2, '|', sizeof buf);
@@ -1486,7 +1486,7 @@ void cmd_setr(char *args)
        }
 
        /* Write the room record back to disk */
-       lputroom(&CC->room);
+       CtdlPutRoomLock(&CC->room);
 
        /* Create a room directory if necessary */
        if (CC->room.QRflags & QR_DIRECTORY) {
@@ -1538,13 +1538,13 @@ void cmd_seta(char *new_ra)
                newu = usbuf.usernum;
        }
 
-       lgetroom(&CC->room, CC->room.QRname);
+       CtdlGetRoomLock(&CC->room, CC->room.QRname);
        post_notice = 0;
        if (CC->room.QRroomaide != newu) {
                post_notice = 1;
        }
        CC->room.QRroomaide = newu;
-       lputroom(&CC->room);
+       CtdlPutRoomLock(&CC->room);
 
        /*
         * We have to post the change notice _after_ writing changes to 
@@ -1595,7 +1595,7 @@ void cmd_rinf(char *gargs)
  * deleted to the user(s), but it won't actually get purged from the
  * database until THE DREADED AUTO-PURGER makes its next run.
  */
-void schedule_room_for_deletion(struct ctdlroom *qrbuf)
+void CtdlScheduleRoomForDeletion(struct ctdlroom *qrbuf)
 {
        char old_name[ROOMNAMELEN];
        static int seq = 0;
@@ -1605,7 +1605,7 @@ void schedule_room_for_deletion(struct ctdlroom *qrbuf)
 
        safestrncpy(old_name, qrbuf->QRname, sizeof old_name);
 
-       getroom(qrbuf, qrbuf->QRname);
+       CtdlGetRoom(qrbuf, qrbuf->QRname);
 
        /* Turn the room into a private mailbox owned by a user who doesn't
         * exist.  This will immediately make the room invisible to everyone,
@@ -1619,7 +1619,7 @@ void schedule_room_for_deletion(struct ctdlroom *qrbuf)
        qrbuf->QRflags |= QR_MAILBOX;
        time(&qrbuf->QRgen);    /* Use a timestamp as the new generation number  */
 
-       putroom(qrbuf);
+       CtdlPutRoom(qrbuf);
 
        b_deleteroom(old_name);
 }
@@ -1632,7 +1632,7 @@ void schedule_room_for_deletion(struct ctdlroom *qrbuf)
  * AUTO-PURGER in serv_expire.c.  All user-facing code should call
  * the asynchronous schedule_room_for_deletion() instead.)
  */
-void delete_room(struct ctdlroom *qrbuf)
+void CtdlDeleteRoom(struct ctdlroom *qrbuf)
 {
        struct floor flbuf;
        char filename[100];
@@ -1658,9 +1658,9 @@ void delete_room(struct ctdlroom *qrbuf)
        CtdlDeleteMessages(qrbuf->QRname, NULL, 0, "");
 
        /* Flag the room record as not in use */
-       lgetroom(qrbuf, qrbuf->QRname);
+       CtdlGetRoomLock(qrbuf, qrbuf->QRname);
        qrbuf->QRflags = 0;
-       lputroom(qrbuf);
+       CtdlPutRoomLock(qrbuf);
 
        /* then decrement the reference count for the floor */
        lgetfloor(&flbuf, (int) (qrbuf->QRfloor));
@@ -1682,7 +1682,7 @@ int CtdlDoIHavePermissionToDeleteThisRoom(struct ctdlroom *qr) {
                return(0);
        }
 
-       if (is_noneditable(qr)) {
+       if (CtdlIsNonEditable(qr)) {
                return(0);
        }
 
@@ -1734,10 +1734,10 @@ void cmd_kill(char *argbuf)
                }
 
                /* Do the dirty work */
-               schedule_room_for_deletion(&CC->room);
+               CtdlScheduleRoomForDeletion(&CC->room);
 
                /* Return to the Lobby */
-               usergoto(config.c_baseroom, 0, 0, NULL, NULL);
+               CtdlUserGoto(config.c_baseroom, 0, 0, NULL, NULL);
 
                /* tell the world what we did */
                snprintf(msg, sizeof msg, "The room \"%s\" has been deleted by %s.\n",
@@ -1756,7 +1756,7 @@ void cmd_kill(char *argbuf)
  * Room types:  0=public, 1=guessname, 2=passworded, 3=inv-only,
  *              4=mailbox, 5=mailbox, but caller supplies namespace
  */
-unsigned create_room(char *new_room_name,
+unsigned CtdlCreateRoom(char *new_room_name,
                     int new_room_type,
                     char *new_room_pass,
                     int new_room_floor,
@@ -1769,10 +1769,10 @@ unsigned create_room(char *new_room_name,
        struct floor flbuf;
        struct visit vbuf;
 
-       CtdlLogPrintf(CTDL_DEBUG, "create_room(name=%s, type=%d, view=%d)\n",
+       CtdlLogPrintf(CTDL_DEBUG, "CtdlCreateRoom(name=%s, type=%d, view=%d)\n",
                new_room_name, new_room_type, new_room_view);
 
-       if (getroom(&qrbuf, new_room_name) == 0) {
+       if (CtdlGetRoom(&qrbuf, new_room_name) == 0) {
                CtdlLogPrintf(CTDL_DEBUG, "%s already exists.\n", new_room_name);
                return(0);
        }
@@ -1824,7 +1824,7 @@ unsigned create_room(char *new_room_name,
        qrbuf.QRdefaultview = new_room_view;
 
        /* save what we just did... */
-       putroom(&qrbuf);
+       CtdlPutRoom(&qrbuf);
 
        /* bump the reference count on whatever floor the room is on */
        lgetfloor(&flbuf, (int) qrbuf.QRfloor);
@@ -1884,7 +1884,7 @@ void cmd_cre8(char *args)
        }
 
        if (num_parms(args) >= 5) {
-               fl = cgetfloor(extract_int(args, 4));
+               fl = CtdlGetCachedFloor(extract_int(args, 4));
                if (fl == NULL) {
                        cprintf("%d Invalid floor number.\n",
                                ERROR + INVALID_FLOOR_OPERATION);
@@ -1926,7 +1926,7 @@ void cmd_cre8(char *args)
        }
 
        /* Check to make sure the requested room name doesn't already exist */
-       newflags = create_room(new_room_name,
+       newflags = CtdlCreateRoom(new_room_name,
                                new_room_type, new_room_pass, new_room_floor,
                                0, avoid_access, new_room_view);
        if (newflags == 0) {
@@ -1942,7 +1942,7 @@ void cmd_cre8(char *args)
 
        /* If we reach this point, the room needs to be created. */
 
-       newflags = create_room(new_room_name,
+       newflags = CtdlCreateRoom(new_room_name,
                           new_room_type, new_room_pass, new_room_floor, 1, 0,
                           new_room_view);
 
@@ -1999,9 +1999,9 @@ void cmd_einf(char *ok)
        fclose(fp);
 
        /* now update the room index so people will see our new info */
-       lgetroom(&CC->room, CC->room.QRname);           /* lock so no one steps on us */
+       CtdlGetRoomLock(&CC->room, CC->room.QRname);            /* lock so no one steps on us */
        CC->room.QRinfo = CC->room.QRhighest + 1L;
-       lputroom(&CC->room);
+       CtdlPutRoomLock(&CC->room);
 }
 
 
@@ -2018,7 +2018,7 @@ void cmd_lflr(char *gargs)
        cprintf("%d Known floors:\n", LISTING_FOLLOWS);
 
        for (a = 0; a < MAXFLOORS; ++a) {
-               getfloor(&flbuf, a);
+               CtdlGetFloor(&flbuf, a);
                if (flbuf.f_flags & F_INUSE) {
                        cprintf("%d|%s|%d\n",
                                a,
@@ -2054,7 +2054,7 @@ void cmd_cflr(char *argbuf)
        }
 
        for (a = 0; a < MAXFLOORS; ++a) {
-               getfloor(&flbuf, a);
+               CtdlGetFloor(&flbuf, a);
 
                /* note any free slots while we're scanning... */
                if (((flbuf.f_flags & F_INUSE) == 0)
index d099459c108d521cbe414066de7ceab84a57f093..880ff8219c4d30a85e4457f7b00b17d257e8be3d 100644 (file)
@@ -5,49 +5,13 @@ int has_newmsgs (struct ctdlroom *roombuf, int roomnum,
                 struct ctdluser *userbuf);
 int is_zapped (struct ctdlroom *roombuf, int roomnum,
               struct ctdluser *userbuf);
-int getroom(struct ctdlroom *qrbuf, char *room_name);
 void b_putroom(struct ctdlroom *qrbuf, char *room_name);
-void putroom(struct ctdlroom *);
 void b_deleteroom(char *);
-int lgetroom(struct ctdlroom *qrbuf, char *room_name);
-void lputroom(struct ctdlroom *qrbuf);
-void getfloor (struct floor *flbuf, int floor_num);
-struct floor *cgetfloor(int floor_num);
 void lgetfloor (struct floor *flbuf, int floor_num);
-void putfloor (struct floor *flbuf, int floor_num);
 void lputfloor (struct floor *flbuf, int floor_num);
 int sort_msglist (long int *listptrs, int oldcount);
-void usergoto (char *where, int display_result, int transiently,
-                       int *msgs, int *new);
-unsigned create_room(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);
-void ForEachRoom(void (*CallBack)(struct ctdlroom *EachRoom, void *out_data),
-       void *in_data);
-void schedule_room_for_deletion(struct ctdlroom *qrbuf);
-void delete_room(struct ctdlroom *qrbuf);
 void list_roomname(struct ctdlroom *qrbuf, int ra, int current_view, int default_view);
-int is_noneditable(struct ctdlroom *qrbuf);
-void CtdlRoomAccess(struct ctdlroom *roombuf, struct ctdluser *userbuf,
-               int *result, int *view);
-int CtdlDoIHavePermissionToDeleteThisRoom(struct ctdlroom *qr);
 
-int CtdlRenameRoom(char *old_name, char *new_name, int new_floor);
 void convert_room_name_macros(char *towhere, size_t maxlen);
-/*
- * 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 */
-};
 
 
index a4bb7eab40f4bb1ada0ac703ea029800298e46f0..9f867f9711059d67521badb68b483140ba355f66 100644 (file)
@@ -692,16 +692,16 @@ void do_login(void)
        /* Create any personal rooms required by the system.
         * (Technically, MAILROOM should be there already, but just in case...)
         */
-       create_room(MAILROOM, 4, "", 0, 1, 0, VIEW_MAILBOX);
-       create_room(SENTITEMS, 4, "", 0, 1, 0, VIEW_MAILBOX);
-       create_room(USERTRASHROOM, 4, "", 0, 1, 0, VIEW_MAILBOX);
-       /* create_room(USERDRAFTROOM, 4, "", 0, 1, 0, VIEW_MAILBOX); temporarily disabled for 7.60 */
+       CtdlCreateRoom(MAILROOM, 4, "", 0, 1, 0, VIEW_MAILBOX);
+       CtdlCreateRoom(SENTITEMS, 4, "", 0, 1, 0, VIEW_MAILBOX);
+       CtdlCreateRoom(USERTRASHROOM, 4, "", 0, 1, 0, VIEW_MAILBOX);
+       /* CtdlCreateRoom(USERDRAFTROOM, 4, "", 0, 1, 0, VIEW_MAILBOX); temporarily disabled for 7.60 */
 
        /* Run any startup routines registered by loadable modules */
        PerformSessionHooks(EVT_LOGIN);
 
        /* Enter the lobby */
-       usergoto(config.c_baseroom, 0, 0, NULL, NULL);
+       CtdlUserGoto(config.c_baseroom, 0, 0, NULL, NULL);
 }
 
 
@@ -1135,13 +1135,13 @@ int create_user(char *newusername, int become_user)
         * Make the latter an invisible system room.
         */
        MailboxName(mailboxname, sizeof mailboxname, &usbuf, MAILROOM);
-       create_room(mailboxname, 5, "", 0, 1, 1, VIEW_MAILBOX);
+       CtdlCreateRoom(mailboxname, 5, "", 0, 1, 1, VIEW_MAILBOX);
 
        MailboxName(mailboxname, sizeof mailboxname, &usbuf, USERCONFIGROOM);
-       create_room(mailboxname, 5, "", 0, 1, 1, VIEW_BBS);
-       if (lgetroom(&qrbuf, mailboxname) == 0) {
+       CtdlCreateRoom(mailboxname, 5, "", 0, 1, 1, VIEW_BBS);
+       if (CtdlGetRoomLock(&qrbuf, mailboxname) == 0) {
                qrbuf.QRflags2 |= QR2_SYSTEM;
-               lputroom(&qrbuf);
+               CtdlPutRoomLock(&qrbuf);
        }
 
        /* Perform any create functions registered by server extensions */
@@ -1557,7 +1557,7 @@ int CtdlForgetThisRoom(void) {
        lputuser(&CC->user);
 
        /* Return to the Lobby, so we don't end up in an undefined room */
-       usergoto(config.c_baseroom, 0, 0, NULL, NULL);
+       CtdlUserGoto(config.c_baseroom, 0, 0, NULL, NULL);
        return(0);
 
 }
@@ -1923,7 +1923,7 @@ int InitialMailCheck()
        int num_msgs = 0;
 
        MailboxName(mailboxname, sizeof mailboxname, &CC->user, MAILROOM);
-       if (getroom(&mailbox, mailboxname) != 0)
+       if (CtdlGetRoom(&mailbox, mailboxname) != 0)
                return (0);
        CtdlGetRelationship(&vbuf, &CC->user, &mailbox);