]> code.citadel.org Git - citadel.git/blobdiff - citadel/rooms.c
* Variable names, comments, documentation, etc... removed the acronym 'BBS'
[citadel.git] / citadel / rooms.c
index 3125a0874fe4849ad2a7efbbd08f8f959094f4ea..4659176509c0e7c25629236e4345c307ac12402c 100644 (file)
@@ -34,7 +34,7 @@
 #define IFNEXPERT if ((userflags&US_EXPERT)==0)
 
 
-void sttybbs(int cmd);
+void stty_ctdl(int cmd);
 void dotgoto(CtdlIPC *ipc, char *towhere, int display_name, int fromungoto);
 void progress(CtdlIPC* ipc, unsigned long curr, unsigned long cmax);
 int pattern(char *search, char *patn);
@@ -79,9 +79,9 @@ void load_floorlist(CtdlIPC *ipc)
                return;
        }
        while (*listing && strlen(listing)) {
-               extract_token(buf, listing, 0, '\n');
+               extract_token(buf, listing, 0, '\n', sizeof buf);
                remove_token(listing, 0, '\n');
-               extract(floorlist[extract_int(buf, 0)], buf, 1);
+               extract_token(floorlist[extract_int(buf, 0)], buf, 1, '|', SIZ);
        }
        free(listing);
 }
@@ -701,7 +701,7 @@ int save_buffer(void *file, size_t filelen, const char *pathname)
                return 0;
        }
        do {
-               block = fwrite(file + bytes_written, 1,
+               block = fwrite((char *)file + bytes_written, 1,
                                filelen - bytes_written, fp);
                bytes_written += block;
        } while (errno == EINTR && bytes_written < filelen);
@@ -825,9 +825,9 @@ void download(CtdlIPC *ipc, int proto)
                snprintf(transmit_cmd, sizeof transmit_cmd, "exec cat %s", tempname);
 
        screen_reset();
-       sttybbs(SB_RESTORE);
+       stty_ctdl(SB_RESTORE);
        system(transmit_cmd);
-       sttybbs(SB_NO_INTR);
+       stty_ctdl(SB_NO_INTR);
        screen_set();
 
        /* clean up the temporary directory */
@@ -841,10 +841,10 @@ void download(CtdlIPC *ipc, int proto)
  */
 void roomdir(CtdlIPC *ipc)
 {
-       char flnm[SIZ];
+       char flnm[256];
        char flsz[32];
-       char comment[SIZ];
-       char buf[SIZ];
+       char comment[256];
+       char buf[256];
        char *listing = NULL;   /* Returned directory listing */
        int r;
 
@@ -854,17 +854,17 @@ void roomdir(CtdlIPC *ipc)
                return;
        }
 
-       extract(comment, buf, 0);
-       extract(flnm, buf, 1);
+       extract_token(comment, buf, 0, '|', sizeof comment);
+       extract_token(flnm, buf, 1, '|', sizeof flnm);
        pprintf("\nDirectory of %s on %s\n", flnm, comment);
        pprintf("-----------------------\n");
        while (*listing && strlen(listing)) {
-               extract_token(buf, listing, 0, '\n');
+               extract_token(buf, listing, 0, '\n', sizeof buf);
                remove_token(listing, 0, '\n');
 
-               extract(flnm, buf, 0);
-               extract(flsz, buf, 1);
-               extract(comment, buf, 2);
+               extract_token(flnm, buf, 0, '|', sizeof flnm);
+               extract_token(flsz, buf, 1, '|', sizeof flsz);
+               extract_token(comment, buf, 2, '|', sizeof comment);
                if (strlen(flnm) <= 14)
                        pprintf("%-14s %8s %s\n", flnm, flsz, comment);
                else
@@ -1076,7 +1076,7 @@ void readinfo(CtdlIPC *ipc)
  */
 void whoknows(CtdlIPC *ipc)
 {
-       char buf[SIZ];
+       char buf[256];
        char *listing = NULL;
        int r;
 
@@ -1086,7 +1086,7 @@ void whoknows(CtdlIPC *ipc)
                return;
        }
        while (strlen(listing) > 0) {
-               extract_token(buf, listing, 0, '\n');
+               extract_token(buf, listing, 0, '\n', sizeof buf);
                remove_token(listing, 0, '\n');
                if (sigcaught == 0)
                        pprintf("%s\n", buf);
@@ -1138,7 +1138,7 @@ void do_edit(CtdlIPC *ipc,
                snprintf(tmp, sizeof tmp, "WINDOW_TITLE=%s", desc);
                putenv(tmp);
                screen_reset();
-               sttybbs(SB_RESTORE);
+               stty_ctdl(SB_RESTORE);
                editor_pid = fork();
                if (editor_pid == 0) {
                        chmod(temp, 0600);
@@ -1152,7 +1152,7 @@ void do_edit(CtdlIPC *ipc,
                        } while ((b != editor_pid) && (b >= 0));
                editor_pid = (-1);
                scr_printf("Executed %s\n", editor_paths[0]);
-               sttybbs(0);
+               stty_ctdl(0);
                screen_set();
        } else {
                scr_printf("Entering %s.  "
@@ -1217,7 +1217,7 @@ void create_floor(CtdlIPC *ipc)
        }
 
        newprompt("Name for new floor: ", newfloorname, 255);
-       if (!*newprompt) return;
+       if (!*newfloorname) return;
        r = CtdlIPCCreateFloor(ipc, 1, newfloorname, buf);
        if (r / 100 == 2) {
                scr_printf("Floor has been created.\n");