HUGE update to the way the paginator works. scr_putc() now keeps track of how many...
authorArt Cancro <ajc@citadel.org>
Thu, 2 Sep 2010 17:32:55 +0000 (13:32 -0400)
committerArt Cancro <ajc@citadel.org>
Thu, 2 Sep 2010 17:32:55 +0000 (13:32 -0400)
lines it has written, issuing the paginator prompt when it knows it needs to.  scr_getc() resets the
line count to zero.  This completely eliminates the need for individual functions to keep track of
their line count, simplifying a lot of code throughout the system.  Why didn't I do it this way 20
years ago?  TODO: use the server issued paginator prompt instead of a hardcoded string.

citadel/include/commands.h
citadel/textclient/citadel.c
citadel/textclient/commands.c
citadel/textclient/messages.c
citadel/textclient/rooms.c
citadel/textclient/rooms.h
citadel/textclient/routines.c
citadel/textclient/routines2.c
citadel/textclient/screen.c
citadel/textclient/screen.h
citadel/textclient/tuiconfig.c

index ba07aae54d1c0afb1daf8e68269148dc3013bb6b..f4541305db646affbdb4daf3d7229c30c814fc98 100644 (file)
@@ -49,8 +49,7 @@ void newprompt(char *prompt, char *str, int len);
 void strprompt(char *prompt, char *str, int len);
 int boolprompt(char *prompt, int prev_val);
 int intprompt(char *prompt, int ival, int imin, int imax);
-int fmout(int width, FILE *fpin, char *text, FILE *fpout, char pagin,
-               int height, int starting_lp, int subst);
+int fmout(int width, FILE *fpin, char *text, FILE *fpout, int subst);
 int getcmd(CtdlIPC *ipc, char *argbuf);
 void display_help(CtdlIPC *ipc, char *name);
 void color(int colornum);
index 2d42a33f298a494f841b70b1d28d8d70c3d79069..9cd482eea0ef3ec4c559a2f74f602dcd0882d6f7 100644 (file)
@@ -168,8 +168,6 @@ void ctdl_logoff(char *file, int line, CtdlIPC *ipc, int code)
 /*
  * now clean up various things
  */
-       screen_delete();
-
        unlink(temp);
        unlink(temp2);
        nukedir(tempdir);
@@ -230,9 +228,7 @@ void formout(CtdlIPC *ipc, char *name)
                return;
        }
        if (text) {
-               fmout(screenwidth, NULL, text, NULL,
-                     ((userflags & US_PAGINATOR) ? 1 : 0),
-                     screenheight, 1, 1);
+               fmout(screenwidth, NULL, text, NULL, 1);
                free(text);
        }
 }
@@ -249,12 +245,12 @@ void userlist(CtdlIPC *ipc, char *patn)
 
        r = CtdlIPCUserListing(ipc, patn, &listing, buf);
        if (r / 100 != 1) {
-               pprintf("%s\n", buf);
+               scr_printf("%s\n", buf);
                return;
        }
 
-       pprintf("       User Name           Num  L Last Visit Logins Messages\n");
-       pprintf("------------------------- ----- - ---------- ------ --------\n");
+       scr_printf("       User Name           Num  L Last Visit Logins Messages\n");
+       scr_printf("------------------------- ----- - ---------- ------ --------\n");
        if (listing != NULL) while (!IsEmptyStr(listing)) {
                extract_token(buf, listing, 0, '\n', sizeof buf);
                remove_token(listing, 0, '\n');
@@ -262,22 +258,22 @@ void userlist(CtdlIPC *ipc, char *patn)
                if (sigcaught == 0) {
                    extract_token(fl, buf, 0, '|', sizeof fl);
                    if (pattern(fl, patn) >= 0) {
-                       pprintf("%-25s ", fl);
-                       pprintf("%5ld %d ", extract_long(buf, 2),
+                       scr_printf("%-25s ", fl);
+                       scr_printf("%5ld %d ", extract_long(buf, 2),
                               extract_int(buf, 1));
                        lc = extract_long(buf, 3);
                        localtime_r(&lc, &tmbuf);
-                       pprintf("%02d/%02d/%04d ",
+                       scr_printf("%02d/%02d/%04d ",
                               (tmbuf.tm_mon + 1),
                               tmbuf.tm_mday,
                               (tmbuf.tm_year + 1900));
-                       pprintf("%6ld %8ld\n", extract_long(buf, 4), extract_long(buf, 5));
+                       scr_printf("%6ld %8ld\n", extract_long(buf, 4), extract_long(buf, 5));
                    }
 
                }
        }
        free(listing);
-       pprintf("\n");
+       scr_printf("\n");
 }
 
 
@@ -945,7 +941,7 @@ void read_config(CtdlIPC *ipc)
        /* get misc user info */   
        r = CtdlIPCGetBio(ipc, fullname, &resp, buf);
        if (r / 100 != 1) {
-               pprintf("%s\n", buf);
+               scr_printf("%s\n", buf);
                return;
        }
        extract_token(_fullname, buf, 1, '|', sizeof fullname);
@@ -1268,13 +1264,13 @@ void who_is_online(CtdlIPC *ipc, int longlist)
 
        if (!longlist) {
                color(BRIGHT_WHITE);
-               pprintf("           User Name               Room          ");
-               if (screenwidth >= 80) pprintf(" Idle        From host");
-               pprintf("\n");
+               scr_printf("           User Name               Room          ");
+               if (screenwidth >= 80) scr_printf(" Idle        From host");
+               scr_printf("\n");
                color(DIM_WHITE);
-               pprintf("   ------------------------- --------------------");
-               if (screenwidth >= 80) pprintf(" ---- ------------------------");
-               pprintf("\n");
+               scr_printf("   ------------------------- --------------------");
+               if (screenwidth >= 80) scr_printf(" ---- ------------------------");
+               scr_printf("\n");
        }
        r = CtdlIPCOnlineUsers(ipc, &listing, &timenow, buf);
        listing = SortOnlineUsers(listing);
@@ -1308,13 +1304,13 @@ void who_is_online(CtdlIPC *ipc, int longlist)
                                extract_token(actual_room, buf, 9, '|', sizeof actual_room);
                                extract_token(actual_host, buf, 10, '|', sizeof actual_host);
 
-                               pprintf("  Flags: %s\n", flags);
-                               pprintf("Session: %d\n", extract_int(buf, 0));
-                               pprintf("   Name: %s\n", username);
-                               pprintf("In room: %s\n", roomname);
-                               pprintf("   Host: %s\n", fromhost);
-                               pprintf(" Client: %s\n", clientsoft);
-                               pprintf("   Idle: %ld:%02ld:%02ld\n",
+                               scr_printf("  Flags: %s\n", flags);
+                               scr_printf("Session: %d\n", extract_int(buf, 0));
+                               scr_printf("   Name: %s\n", username);
+                               scr_printf("In room: %s\n", roomname);
+                               scr_printf("   Host: %s\n", fromhost);
+                               scr_printf(" Client: %s\n", clientsoft);
+                               scr_printf("   Idle: %ld:%02ld:%02ld\n",
                                        (long) idlehours,
                                        (long) idlemins,
                                        (long) idlesecs);
@@ -1322,59 +1318,59 @@ void who_is_online(CtdlIPC *ipc, int longlist)
                                if ( (!IsEmptyStr(actual_user)&&
                                      !IsEmptyStr(actual_room)&&
                                      !IsEmptyStr(actual_host))) {
-                                       pprintf("(really ");
-                                       if (!IsEmptyStr(actual_user)) pprintf("<%s> ", actual_user);
-                                       if (!IsEmptyStr(actual_room)) pprintf("in <%s> ", actual_room);
-                                       if (!IsEmptyStr(actual_host)) pprintf("from <%s> ", actual_host);
-                                       pprintf(")\n");
+                                       scr_printf("(really ");
+                                       if (!IsEmptyStr(actual_user)) scr_printf("<%s> ", actual_user);
+                                       if (!IsEmptyStr(actual_room)) scr_printf("in <%s> ", actual_room);
+                                       if (!IsEmptyStr(actual_host)) scr_printf("from <%s> ", actual_host);
+                                       scr_printf(")\n");
                                }
-                               pprintf("\n");
+                               scr_printf("\n");
 
                        } else {
                                if (isidle == 0) {
                                        if (extract_int(buf, 0) == last_session) {
-                                               pprintf("        ");
+                                               scr_printf("        ");
                                        }
                                        else {
                                                color(BRIGHT_MAGENTA);
-                                               pprintf("%-3s", flags);
+                                               scr_printf("%-3s", flags);
                                        }
                                        last_session = extract_int(buf, 0);
                                        color(BRIGHT_CYAN);
-                                       pprintf("%-25s ", username);
+                                       scr_printf("%-25s ", username);
                                        color(BRIGHT_MAGENTA);
                                        roomname[20] = 0;
-                                       pprintf("%-20s", roomname);
+                                       scr_printf("%-20s", roomname);
 
                                        if (screenwidth >= 80) {
-                                               pprintf(" ");
+                                               scr_printf(" ");
                                                if (idletime > rc_idle_threshold) {
                                                        /* over 1000d, must be gone fishing */
                                                        if (idlehours > 23999) {
-                                                               pprintf("fish");
+                                                               scr_printf("fish");
                                                        /* over 10 days */
                                                        } else if (idlehours > 239) {
-                                                               pprintf("%3ldd", idlehours / 24);
+                                                               scr_printf("%3ldd", idlehours / 24);
                                                        /* over 10 hours */
                                                        } else if (idlehours > 9) {
-                                                               pprintf("%1ldd%02ld",
+                                                               scr_printf("%1ldd%02ld",
                                                                        idlehours / 24,
                                                                        idlehours % 24);
                                                        /* less than 10 hours */
                                                        }
                                                        else {
-                                                               pprintf("%1ld:%02ld", idlehours, idlemins);
+                                                               scr_printf("%1ld:%02ld", idlehours, idlemins);
                                                        }
                                                }
                                                else {
-                                                       pprintf("    ");
+                                                       scr_printf("    ");
                                                }
-                                               pprintf(" ");
+                                               scr_printf(" ");
                                                color(BRIGHT_CYAN);
                                                fromhost[24] = '\0';
-                                               pprintf("%-24s", fromhost);
+                                               scr_printf("%-24s", fromhost);
                                        }
-                                       pprintf("\n");
+                                       scr_printf("\n");
                                        color(DIM_WHITE);
                                }
                        }
@@ -1455,7 +1451,6 @@ int main(int argc, char **argv)
 
        eCrash_Init(&params);
 #endif 
-       setIPCDeathHook(screen_delete);
        setIPCErrorPrintf(scr_printf);
        setCryptoStatusHook(statusHook);
        
@@ -1552,7 +1547,6 @@ int main(int argc, char **argv)
        scr_printf("Attaching to server...\n");
        ipc = CtdlIPC_new(argc, argv, hostbuf, portbuf);
        if (!ipc) {
-               screen_delete();
                error_printf("Can't connect: %s\n", strerror(errno));
                logoff(NULL, 3);
        }
@@ -2323,7 +2317,6 @@ TERMN8:   scr_printf("%s logged out.", fullname);
        }
        CtdlIPCLogout(ipc);
        if ((mcmd == 29) || (mcmd == 15)) {
-               screen_delete();
                stty_ctdl(SB_RESTORE);
                formout(ipc, "goodbye");
                logoff(ipc, 0);
index 9c3c56c01e2eb6c9d6b7e3f911a58ceb6435b552..6371cb46e800fdcee5e58f76f19e1f103f35d768 100644 (file)
@@ -2,21 +2,21 @@
  * This file contains functions which implement parts of the
  * text-mode user interface.
  *
- * Copyright (c) 1987-2009 by the citadel.org team
+ * Copyright (c) 1987-2010 by the citadel.org team
  *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
  *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 #include "sysdep.h"
@@ -100,7 +100,6 @@ char rc_gotmail_cmd[SIZ];
 char *gl_string;
 int next_lazy_cmd = 5;
 
-int lines_printed = 0;         /* line count for paginator */
 extern int screenwidth, screenheight;
 extern int termn8;
 extern CtdlIPC *ipc_for_signal_handlers;       /* KLUDGE cover your eyes */
@@ -151,69 +150,6 @@ char was_a_key_pressed(void) {
 
 
 
-/*
- * Check to see if we need to pause at the end of a screen.
- * If we do, we have to switch to half keepalives during the pause because
- * we are probably in the middle of a server operation and the NOOP command
- * would confuse everything.
- */
-int checkpagin(int lp, unsigned int pagin, unsigned int height)
-{
-       int thekey;
-
-       if (sigcaught) return(lp);
-       thekey = was_a_key_pressed();
-       if (thekey == 'q' || thekey == 'Q' || thekey == 's' || thekey == 'S')
-               thekey = STOP_KEY;
-       if (thekey == 'n' || thekey == 'N')
-               thekey = NEXT_KEY;
-       if ( (thekey == NEXT_KEY) || (thekey == STOP_KEY)) sigcaught = thekey;
-       if (sigcaught) return(lp);
-
-       if (!pagin) return(0);
-       if (lp>=(height-1)) {
-               set_keepalives(KA_HALF);
-               hit_any_key(ipc_for_signal_handlers);   /* Cheating -IO */
-               set_keepalives(KA_YES);
-               return(0);
-       }
-       return(lp);
-}
-
-
-
-
-/*
- * pprintf()  ...   paginated version of printf()
- */
-void pprintf(const char *format, ...) {   
-        va_list arg_ptr;
-       static char buf[4096];  /* static for performance, change if needed */
-       int i;
-
-       /* If sigcaught is nonzero, a keypress has interrupted this and we
-        * should just drain output.
-        */
-       if (sigcaught) return;
-       /* Otherwise, start spewing... */ 
-        va_start(arg_ptr, format);   
-        vsnprintf(buf, sizeof(buf), format, arg_ptr);   
-        va_end(arg_ptr);   
-
-       for (i=0; !IsEmptyStr(&buf[i]); ++i) {
-               scr_putc(buf[i]);
-               if (buf[i]==10) {
-                       ++lines_printed;
-                       lines_printed = checkpagin(lines_printed,
-                               (userflags & US_PAGINATOR),
-                               screenheight);
-               }
-       }
-}   
-
-
-
 /*
  * print_instant()  -  print instant messages if there are any
  */
@@ -297,7 +233,6 @@ void print_instant(void)
                }
                /* fall back to built-in instant message display */
                scr_printf("\n");
-               lines_printed++;
 
                /* Header derived from flags */
                if (flags & 2)
@@ -327,11 +262,9 @@ void print_instant(void)
                        scr_printf(" @%s", node);
        
                scr_printf(":\n");
-               lines_printed++;
-               fmout(screenwidth, NULL, listing, NULL, 1, screenheight, -1, 0);
+               fmout(screenwidth, NULL, listing, NULL, 0);
                free(listing);
 
-               lines_printed = 0;
        }
        scr_printf("\n---\n");
        color(BRIGHT_WHITE);
@@ -487,7 +420,6 @@ int inkey(void)
        time_t start_time;
 
        scr_flush();
-       lines_printed = 0;
        time(&start_time);
 
        do {
@@ -496,9 +428,7 @@ int inkey(void)
                 * necessary and then waits again.
                 */
                do {
-                       scr_set_windowsize(ipc_for_signal_handlers);
                        do_keepalive();
-                       scr_set_windowsize(ipc_for_signal_handlers);
 
                        FD_ZERO(&rfds);
                        FD_SET(0, &rfds);
@@ -518,15 +448,6 @@ int inkey(void)
                if (a == 13) {
                        a = 10;
                }
-/* not so fast there dude, we have to handle UTF-8 and ISO-8859-1...
-               if (a > 126) {
-                       a = 0;
-               }
-               if (((a != 23) && (a != 4) && (a != 10) && (a != 8) && (a != NEXT_KEY) && (a != STOP_KEY))
-                   && ((a < 32) || (a > 126))) {
-                       a = 0;
-               }
- */
        } while (a == 0);
        return (a);
 }
@@ -1184,24 +1105,24 @@ int getcmd(CtdlIPC *ipc, char *argbuf)
                }
 
                if (ch == '?') {
-                       pprintf("\rOne of ...                         \n");
+                       scr_printf("\rOne of ...                         \n");
                        for (cptr = cmdlist; cptr != NULL; cptr = cptr->next) {
                                if (cmdmatch(cmdbuf, cptr, cmdpos)) {
                                        for (a = 0; a < 5; ++a) {
                                           keyopt(cmd_expand(cptr->c_keys[a], 1));
-                                  pprintf(" ");
+                                  scr_printf(" ");
                                        }
-                                       pprintf("\n");
+                                       scr_printf("\n");
                                }
                        }
                sigcaught = 0;
 
-                       pprintf("\n%s%c ", room_name, room_prompt(room_flags));
+                       scr_printf("\n%s%c ", room_name, room_prompt(room_flags));
                        got = 0;
                        for (cptr = cmdlist; cptr != NULL; cptr = cptr->next) {
                                if ((got == 0) && (cmdmatch(cmdbuf, cptr, cmdpos))) {
                                        for (a = 0; a < cmdpos; ++a) {
-                                               pprintf("%s ",
+                                               scr_printf("%s ",
                                                       cmd_expand(cptr->c_keys[a], 0));
                                        }
                                        got = 1;
@@ -1316,9 +1237,6 @@ int fmout(
        FILE *fpin,     /* file to read from, or NULL to format given text */
        char *text,     /* text to be formatted (when fpin is NULL */
        FILE *fpout,    /* file to write to, or NULL to write to screen */
-       char pagin,     /* nonzero if we should use the paginator */
-       int height,     /* screen height to use */
-       int starting_lp,/* starting value for lines_printed, -1 for global */
        int subst)      /* nonzero if we should use hypertext mode */
 {
        char *buffer = NULL;    /* The current message */
@@ -1349,9 +1267,6 @@ int fmout(
        }
        e = buffer;
 
-       if (starting_lp >= 0)
-               lines_printed = starting_lp;
-
        /* Run the message body */
        while (*e) {
                /* Catch characters that shouldn't be there at all */
@@ -1367,8 +1282,6 @@ int fmout(
                                        fprintf(fpout, "\n");
                                } else {
                                        scr_printf("\n");
-                                       ++lines_printed;
-                                       lines_printed = checkpagin(lines_printed, pagin, height);
                                }
                                column = 0;
                        } else if (old != ' ') {/* Don't print two spaces */
@@ -1400,8 +1313,6 @@ int fmout(
                                        fprintf(fpout, "\n");
                                } else {
                                        scr_printf("\n");
-                                       ++lines_printed;
-                                       lines_printed = checkpagin(lines_printed, pagin, height);
                                }
                                column = 0;
                        } else if (!(column == 0 && old == ' ')) {
@@ -1447,8 +1358,6 @@ int fmout(
                                fprintf(fpout, "\n");
                        } else {
                                scr_printf("\n");
-                               ++lines_printed;
-                               lines_printed = checkpagin(lines_printed, pagin, height);
                        }
                        column = 0;
                }
@@ -1472,8 +1381,6 @@ int fmout(
                fprintf(fpout, "\n");
        } else {
                scr_printf("\n");
-               ++lines_printed;
-               lines_printed = checkpagin(lines_printed, pagin, height);
        }
 
        return sigcaught;
@@ -1594,13 +1501,13 @@ void keyopt(char *buf) {
        color(DIM_WHITE);
        for (i=0; !IsEmptyStr(&buf[i]); ++i) {
                if (buf[i]=='<') {
-                       pprintf("%c", buf[i]);
+                       scr_printf("%c", buf[i]);
                        color(BRIGHT_MAGENTA);
                } else {
                        if (buf[i]=='>'&& buf[i+1] != '>') {
                                color(DIM_WHITE);
                        }
-                       pprintf("%c", buf[i]);
+                       scr_printf("%c", buf[i]);
                }
        }
        color(DIM_WHITE);
index 0f0636d673ee3d1f6fd674678009da31415b02ca..111bac6c47b7cf51958a344909010ddf2412230e 100644 (file)
@@ -427,8 +427,6 @@ int read_message(CtdlIPC *ipc,
        r = CtdlIPCGetSingleMessage(ipc, num, (pagin == READ_HEADER ? 1 : 0), 4, &message, buf);
        if (r / 100 != 1) {
                scr_printf("*** msg #%ld: %d %s\n", num, r, buf);
-               ++lines_printed;
-               lines_printed = checkpagin(lines_printed, pagin, screenheight);
                stty_ctdl(0);
                free(message->text);
                free_parts(message->attachments);
@@ -440,8 +438,6 @@ int read_message(CtdlIPC *ipc,
                fprintf(dest, "\n ");
        } else {
                scr_printf("\n");
-               ++lines_printed;
-               lines_printed = checkpagin(lines_printed, pagin, screenheight);
                if (pagin != 2)
                        scr_printf(" ");
        }
@@ -451,34 +447,34 @@ int read_message(CtdlIPC *ipc,
 
        /* View headers only */
        if (pagin == 2) {
-               pprintf("nhdr=%s\nfrom=%s\ntype=%d\nmsgn=%s\n",
+               scr_printf("nhdr=%s\nfrom=%s\ntype=%d\nmsgn=%s\n",
                                message->nhdr ? "yes" : "no",
                                message->author, message->type,
                                message->msgid);
                if (!IsEmptyStr(message->subject)) {
-                       pprintf("subj=%s\n", message->subject);
+                       scr_printf("subj=%s\n", message->subject);
                }
                if (!IsEmptyStr(message->email)) {
-                       pprintf("rfca=%s\n", message->email);
+                       scr_printf("rfca=%s\n", message->email);
                }
-               pprintf("hnod=%s\nroom=%s\nnode=%s\ntime=%s",
+               scr_printf("hnod=%s\nroom=%s\nnode=%s\ntime=%s",
                                message->hnod, message->room,
                                message->node, 
                                asctime(localtime(&message->time)));
                if (!IsEmptyStr(message->recipient)) {
-                       pprintf("rcpt=%s\n", message->recipient);
+                       scr_printf("rcpt=%s\n", message->recipient);
                }
                if (message->attachments) {
                        struct parts *ptr;
 
                        for (ptr = message->attachments; ptr; ptr = ptr->next) {
-                               pprintf("part=%s|%s|%s|%s|%s|%ld\n",
+                               scr_printf("part=%s|%s|%s|%s|%s|%ld\n",
                                        ptr->name, ptr->filename, ptr->number,
                                        ptr->disposition, ptr->mimetype,
                                        ptr->length);
                        }
                }
-               pprintf("\n");
+               scr_printf("\n");
                stty_ctdl(0);
                free(message->text);
                free_parts(message->attachments);
@@ -602,12 +598,6 @@ int read_message(CtdlIPC *ipc,
                         message->author, message->node);
        }
 
-       if (!dest) {
-               ++lines_printed;
-               lines_printed = checkpagin(lines_printed, pagin, screenheight);
-       }
-
-
        if (message->msgid != NULL) {
                safestrncpy(reply_inreplyto, message->msgid, sizeof reply_inreplyto);
        }
@@ -627,9 +617,6 @@ int read_message(CtdlIPC *ipc,
                                scr_printf("Subject: ");
                                color(BRIGHT_CYAN);
                                scr_printf("%s\n", message->subject);
-                               ++lines_printed;
-                               lines_printed = checkpagin(lines_printed,
-                                               pagin, screenheight);
                        }
                }
        }
@@ -682,8 +669,7 @@ int read_message(CtdlIPC *ipc,
         * Here we go
         */
        if (format_type == 0) {
-               fr = fmout(screenwidth, NULL, message->text, dest,
-                          ((pagin == 1) ? 1 : 0), screenheight, (-1), 1);
+               fr = fmout(screenwidth, NULL, message->text, dest, 1);
        } else {
                /* renderer for text/plain */
 
@@ -706,11 +692,6 @@ int read_message(CtdlIPC *ipc,
                                        fprintf(dest, "%s\n", lineptr);
                                } else {
                                        scr_printf("%s\n", lineptr);
-                                       lines_printed = lines_printed + 1 +
-                                           (linelen / screenwidth);
-                                       lines_printed =
-                                           checkpagin(lines_printed, pagin,
-                                                      screenheight);
                                }
                        }
                        if (lineptr[0] == 0) final_line_is_blank = 1;
@@ -725,8 +706,6 @@ int read_message(CtdlIPC *ipc,
                }
                else {
                        scr_printf("\n");
-                       ++lines_printed;
-                       lines_printed = checkpagin(lines_printed, pagin, screenheight);
                        fr = sigcaught;         
                }
        }
@@ -744,15 +723,15 @@ int read_message(CtdlIPC *ipc,
                                   && (!IsEmptyStr(ptr->mimetype))
                                ) {
                                        color(DIM_WHITE);
-                                       pprintf("Part ");
+                                       scr_printf("Part ");
                                        color(BRIGHT_MAGENTA);
-                                       pprintf("%s", ptr->number);
+                                       scr_printf("%s", ptr->number);
                                        color(DIM_WHITE);
-                                       pprintf(": ");
+                                       scr_printf(": ");
                                        color(BRIGHT_CYAN);
-                                       pprintf("%s", ptr->filename);
+                                       scr_printf("%s", ptr->filename);
                                        color(DIM_WHITE);
-                                       pprintf(" (%s, %ld bytes)\n", ptr->mimetype, ptr->length);
+                                       scr_printf(" (%s, %ld bytes)\n", ptr->mimetype, ptr->length);
                                        if (!strncmp(ptr->mimetype, "image/", 6)) {
                                                has_images++;
                                        }
@@ -907,8 +886,7 @@ int client_make_message(CtdlIPC *ipc,
        if (mode == 0) {
                fp = fopen(filename, "r");
                if (fp != NULL) {
-                       fmout(screenwidth, fp, NULL, NULL, 0,
-                               screenheight, 0, 0);
+                       fmout(screenwidth, fp, NULL, NULL, 0);
                        beg = ftell(fp);
                        fclose(fp);
                } else {
@@ -964,7 +942,6 @@ ME1:        switch (mode) {
        case 2:
        default:        /* allow 2+ modes */
                e_ex_code = 1;  /* start with a failed exit code */
-               screen_reset();
                stty_ctdl(SB_RESTORE);
                editor_pid = fork();
                cksum = file_checksum(filename);
@@ -984,7 +961,6 @@ ME1:        switch (mode) {
                        } while ((b != editor_pid) && (b >= 0));
                editor_pid = (-1);
                stty_ctdl(0);
-               screen_set();
                break;
        }
 
@@ -1023,9 +999,7 @@ MECR:      if (mode >= 2) {
                }
                fp = fopen(filename, "r");
                if (fp != NULL) {
-                       fmout(screenwidth, fp, NULL, NULL,
-                             ((userflags & US_PAGINATOR) ? 1 : 0),
-                             screenheight, 0, 0);
+                       fmout(screenwidth, fp, NULL, NULL, 0);
                        beg = ftell(fp);
                        fclose(fp);
                }
@@ -1569,8 +1543,6 @@ void readmsgs(CtdlIPC *ipc,
                return;
        }
 
-       lines_printed = 0;
-
        /* this loop cycles through each message... */
        start = ((rdir == 1) ? 0 : (num_msgs - 1));
        for (a = start; ((a < num_msgs) && (a >= 0)); a = a + rdir) {
@@ -1628,11 +1600,9 @@ RMSGREAD:        scr_flush();
                                if (freopen(prtfile, "r", stdin) == NULL) {
                                        /* we probably should handle the error condition here */
                                }
-                               screen_reset();
                                stty_ctdl(SB_RESTORE);
                                ka_system(printcmd);
                                stty_ctdl(SB_NO_INTR);
-                               screen_set();
                                unlink(prtfile);
                                exit(0);
                        }
@@ -1669,7 +1639,6 @@ RMSGREAD: scr_flush();
                        keyopt("<?>help -> ");
 
                        do {
-                               lines_printed = 2;
                                e = (inkey() & 127);
                                e = tolower(e);
 /* return key same as <N> */ if (e == 10)
@@ -1968,10 +1937,9 @@ void check_message_base(CtdlIPC *ipc)
        }
 
        while (transcript && !IsEmptyStr(transcript)) {
-               lines_printed = 1;
                extract_token(buf, transcript, 0, '\n', sizeof buf);
                remove_token(transcript, 0, '\n');
-               pprintf("%s\n", buf);
+               scr_printf("%s\n", buf);
        }
        if (transcript) free(transcript);
        return;
index 34f1fea19a2f30029af5432af09d5be0d7955455..415d7c046da1c702f807e5b23f18167da01fc6d9 100644 (file)
@@ -121,7 +121,7 @@ void room_tree_list(struct ctdlroomlisting *rp)
                if ((c + strlen(rmname) + 4) > screenwidth) {
 
                        /* line break, check the paginator */
-                       pprintf("\n");
+                       scr_printf("\n");
                        c = 1;
                }
                if (f & QR_MAILBOX) {
@@ -131,15 +131,15 @@ void room_tree_list(struct ctdlroomlisting *rp)
                } else {
                        color(DIM_WHITE);
                }
-               pprintf("%s", rmname);
+               scr_printf("%s", rmname);
                if ((f & QR_DIRECTORY) && (f & QR_NETWORK))
-                       pprintf("}  ");
+                       scr_printf("}  ");
                else if (f & QR_DIRECTORY)
-                       pprintf("]  ");
+                       scr_printf("]  ");
                else if (f & QR_NETWORK)
-                       pprintf(")  ");
+                       scr_printf(")  ");
                else
-                       pprintf(">  ");
+                       scr_printf(">  ");
                c = c + strlen(rmname) + 3;
        }
 
@@ -254,10 +254,10 @@ void list_other_floors(void)
        for (a = 0; a < 128; ++a) {
                if ((strlen(floorlist[a]) > 0) && (a != curr_floor)) {
                        if ((c + strlen(floorlist[a]) + 4) > screenwidth) {
-                               pprintf("\n");
+                               scr_printf("\n");
                                c = 1;
                        }
-                       pprintf("%s:  ", floorlist[a]);
+                       scr_printf("%s:  ", floorlist[a]);
                        c = c + strlen(floorlist[a]) + 3;
                }
        }
@@ -288,37 +288,37 @@ void knrooms(CtdlIPC *ipc, int kn_floor_mode)
 
        if (kn_floor_mode == 0) {
                color(BRIGHT_CYAN);
-               pprintf("\n   Rooms with unread messages:\n");
+               scr_printf("\n   Rooms with unread messages:\n");
                listrms(listing, LISTRMS_NEW_ONLY, -1, 0, NULL);
                color(BRIGHT_CYAN);
-               pprintf("\n\n   No unseen messages in:\n");
+               scr_printf("\n\n   No unseen messages in:\n");
                listrms(listing, LISTRMS_OLD_ONLY, -1, 0, NULL);
-               pprintf("\n");
+               scr_printf("\n");
        }
 
        if (kn_floor_mode == 1) {
                color(BRIGHT_CYAN);
-               pprintf("\n   Rooms with unread messages on %s:\n",
+               scr_printf("\n   Rooms with unread messages on %s:\n",
                        floorlist[(int) curr_floor]);
                listrms(listing, LISTRMS_NEW_ONLY, curr_floor, 0, NULL);
                color(BRIGHT_CYAN);
-               pprintf("\n\n   Rooms with no new messages on %s:\n",
+               scr_printf("\n\n   Rooms with no new messages on %s:\n",
                        floorlist[(int) curr_floor]);
                listrms(listing, LISTRMS_OLD_ONLY, curr_floor, 0, NULL);
                color(BRIGHT_CYAN);
-               pprintf("\n\n   Other floors:\n");
+               scr_printf("\n\n   Other floors:\n");
                list_other_floors();
-               pprintf("\n");
+               scr_printf("\n");
        }
 
        if (kn_floor_mode == 2) {
                for (a = 0; a < 128; ++a) {
                        if (floorlist[a][0] != 0) {
                                color(BRIGHT_CYAN);
-                               pprintf("\n   Rooms on %s:\n",
+                               scr_printf("\n   Rooms on %s:\n",
                                        floorlist[a]);
                                listrms(listing, LISTRMS_ALL, a, 0, NULL);
-                               pprintf("\n");
+                               scr_printf("\n");
                        }
                }
        }
@@ -331,7 +331,6 @@ void knrooms(CtdlIPC *ipc, int kn_floor_mode)
        };
 
        color(DIM_WHITE);
-       IFNEXPERT hit_any_key(ipc);
 }
 
 
@@ -350,9 +349,9 @@ void listzrooms(CtdlIPC *ipc)
        }
 
        color(BRIGHT_CYAN);
-       pprintf("\n   Forgotten public rooms:\n");
+       scr_printf("\n   Forgotten public rooms:\n");
        listrms(listing, LISTRMS_ALL, -1, 0, NULL);
-       pprintf("\n");
+       scr_printf("\n");
 
        /* Free the room list */
        while (listing) {
@@ -362,7 +361,6 @@ void listzrooms(CtdlIPC *ipc)
        };
 
        color(DIM_WHITE);
-       IFNEXPERT hit_any_key(ipc);
 }
 
 void dotknown(CtdlIPC *ipc, int what, char *match)
@@ -382,39 +380,39 @@ void dotknown(CtdlIPC *ipc, int what, char *match)
 
        switch (what) {
     case 0:
-       pprintf("\n   Anonymous rooms:\n");
+       scr_printf("\n   Anonymous rooms:\n");
            listrms(listing, LISTRMS_ALL, -1, QR_ANONONLY|QR_ANONOPT, NULL);
-       pprintf("\n");
+       scr_printf("\n");
                break;
     case 1:
-       pprintf("\n   Directory rooms:\n");
+       scr_printf("\n   Directory rooms:\n");
            listrms(listing, LISTRMS_ALL, -1, QR_DIRECTORY, NULL);
-       pprintf("\n");
+       scr_printf("\n");
                break;
     case 2:
-       pprintf("\n   Matching \"%s\" rooms:\n", match);
+       scr_printf("\n   Matching \"%s\" rooms:\n", match);
            listrms(listing, LISTRMS_ALL, -1, 0, match);
-       pprintf("\n");
+       scr_printf("\n");
                break;
     case 3:
-       pprintf("\n   Preferred only rooms:\n");
+       scr_printf("\n   Preferred only rooms:\n");
            listrms(listing, LISTRMS_ALL, -1, QR_PREFONLY, NULL);
-       pprintf("\n");
+       scr_printf("\n");
                break;
     case 4:
-       pprintf("\n   Private rooms:\n");
+       scr_printf("\n   Private rooms:\n");
            listrms(listing, LISTRMS_ALL, -1, QR_PRIVATE, NULL);
-       pprintf("\n");
+       scr_printf("\n");
                break;
     case 5:
-       pprintf("\n   Read only rooms:\n");
+       scr_printf("\n   Read only rooms:\n");
            listrms(listing, LISTRMS_ALL, -1, QR_READONLY, NULL);
-       pprintf("\n");
+       scr_printf("\n");
                break;
     case 6:
-       pprintf("\n   Shared rooms:\n");
+       scr_printf("\n   Shared rooms:\n");
            listrms(listing, LISTRMS_ALL, -1, QR_NETWORK, NULL);
-       pprintf("\n");
+       scr_printf("\n");
                break;
        }
 
@@ -426,7 +424,6 @@ void dotknown(CtdlIPC *ipc, int what, char *match)
        };
 
        color(DIM_WHITE);
-       IFNEXPERT hit_any_key(ipc);
 }
 
 
@@ -916,11 +913,9 @@ void download(CtdlIPC *ipc, int proto)
                /* FIXME: display internally instead */
                snprintf(transmit_cmd, sizeof transmit_cmd, "exec cat %s", tempname);
 
-       screen_reset();
        stty_ctdl(SB_RESTORE);
        rv = system(transmit_cmd);
        stty_ctdl(SB_NO_INTR);
-       screen_set();
 
        /* clean up the temporary directory */
        nukedir(tempdir);
@@ -943,14 +938,14 @@ void roomdir(CtdlIPC *ipc)
 
        r = CtdlIPCReadDirectory(ipc, &listing, buf);
        if (r / 100 != 1) {
-               pprintf("%s\n", buf);
+               scr_printf("%s\n", buf);
                return;
        }
 
        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");
+       scr_printf("\nDirectory of %s on %s\n", flnm, comment);
+       scr_printf("-----------------------\n");
        while (listing && *listing && !IsEmptyStr(listing)) {
                extract_token(buf, listing, 0, '\n', sizeof buf);
                remove_token(listing, 0, '\n');
@@ -960,9 +955,9 @@ void roomdir(CtdlIPC *ipc)
                extract_token(mimetype, buf, 2, '|', sizeof mimetype);
                extract_token(comment, buf, 3, '|', sizeof comment);
                if (strlen(flnm) <= 14)
-                       pprintf("%-14s %8s %s [%s]\n", flnm, flsz, comment, mimetype);
+                       scr_printf("%-14s %8s %s [%s]\n", flnm, flsz, comment, mimetype);
                else
-                       pprintf("%s\n%14s %8s %s [%s]\n", flnm, "", flsz,
+                       scr_printf("%s\n%14s %8s %s [%s]\n", flnm, "", flsz,
                                comment, mimetype);
        }
        if (listing) free(listing);
@@ -1162,9 +1157,7 @@ void readinfo(CtdlIPC *ipc)
                return;
 
        if (text) {
-               fmout(screenwidth, NULL, text, NULL,
-                     ((userflags & US_PAGINATOR) ? 1 : 0), screenheight, 
-                     (*raide) ? 2 : 0, 1);
+               fmout(screenwidth, NULL, text, NULL, 1);
                free(text);
        }
 }
@@ -1181,14 +1174,14 @@ void whoknows(CtdlIPC *ipc)
 
        r = CtdlIPCWhoKnowsRoom(ipc, &listing, buf);
        if (r / 100 != 1) {
-               pprintf("%s\n", buf);
+               scr_printf("%s\n", buf);
                return;
        }
        while (!IsEmptyStr(listing)) {
                extract_token(buf, listing, 0, '\n', sizeof buf);
                remove_token(listing, 0, '\n');
                if (sigcaught == 0)
-                       pprintf("%s\n", buf);
+                       scr_printf("%s\n", buf);
        }
        free(listing);
 }
@@ -1236,7 +1229,6 @@ void do_edit(CtdlIPC *ipc,
 
                snprintf(tmp, sizeof tmp, "WINDOW_TITLE=%s", desc);
                putenv(tmp);
-               screen_reset();
                stty_ctdl(SB_RESTORE);
                editor_pid = fork();
                if (editor_pid == 0) {
@@ -1252,7 +1244,6 @@ void do_edit(CtdlIPC *ipc,
                editor_pid = (-1);
                scr_printf("Executed %s\n", editor_paths[0]);
                stty_ctdl(0);
-               screen_set();
        } else {
                scr_printf("Entering %s.  Press return twice when finished.\n", desc);
                fp = fopen(temp, "r+");
index d207853bf80dd558cdeab26adba985d4b81a960d..e3e046246760f669efe3494daeb099642a239747 100644 (file)
@@ -19,7 +19,6 @@ void create_floor(CtdlIPC *ipc);
 void edit_floor(CtdlIPC *ipc);
 void kill_floor(CtdlIPC *ipc);
 void enter_bio(CtdlIPC *ipc);
-void hit_any_key(CtdlIPC *ipc);
 int save_buffer(void *file, size_t filelen, const char *pathname);
 void destination_directory(char *dest, const char *supplied_filename);
 void do_edit(CtdlIPC *ipc,
index 0bed6b54668e4be7de791d39fb5a71d6362ab1ec..adca1fc1b5face6b1d2ad61b63c1ce78bab83087 100644 (file)
@@ -74,30 +74,6 @@ void back(int spaces) {
        }
 }
 
-void hit_any_key(CtdlIPC *ipc) {       /* hit any key to continue */
-       int a,b;
-
-       color(COLOR_PUSH);
-       color(DIM_RED);
-       scr_printf("%s\r", ipc->ServInfo.moreprompt);
-       color(COLOR_POP);
-       stty_ctdl(0);
-       b=inkey();
-       for (a=0; !IsEmptyStr(&ipc->ServInfo.moreprompt[a]); ++a)
-               scr_putc(' ');
-       scr_putc(13);
-       stty_ctdl(1);
-       if ( (rc_prompt_control == 1)
-          || ((rc_prompt_control == 3) && (userflags & US_PROMPTCTL)) ) {
-               if (b == 'q' || b == 'Q' || b == 's' || b == 'S')
-                       b = STOP_KEY;
-               if (b == 'n' || b == 'N')
-                       b = NEXT_KEY;
-       }
-       if (b==NEXT_KEY) sigcaught = SIGINT;
-       if (b==STOP_KEY) sigcaught = SIGQUIT;
-}
-
 /*
  * Edit or delete a user (cmd=25 to edit/create, 96 to delete)
  */
index 89c0acf927560eddaa4c0933c2cd4e999a983b5d..7282584f272c57f9d85ce8e4941d5d5d34dca5ef 100644 (file)
@@ -360,17 +360,14 @@ void upload(CtdlIPC *ipc, int c)
                        fclose(fp);
                        exit(0);
                case 1:
-                       screen_reset();
                        stty_ctdl(3);
                        execlp("rx", "rx", flnm, NULL);
                        exit(1);
                case 2:
-                       screen_reset();
                        stty_ctdl(3);
                        execlp("rb", "rb", NULL);
                        exit(1);
                case 3:
-                       screen_reset();
                        stty_ctdl(3);
                        execlp("rz", "rz", NULL);
                        exit(1);
@@ -380,7 +377,6 @@ void upload(CtdlIPC *ipc, int c)
                        b = ka_wait(&a);
                } while ((b != xfer_pid) && (b != (-1)));
        stty_ctdl(0);
-       screen_set();
 
        if (a != 0) {
                scr_printf("\r*** Transfer unsuccessful.\n");
@@ -515,7 +511,6 @@ void subshell(void)
 {
        int a, b;
 
-       screen_reset();
        stty_ctdl(SB_RESTORE);
        a = fork();
        if (a == 0) {
@@ -529,7 +524,6 @@ void subshell(void)
                b = ka_wait(NULL);
        } while ((a != b) && (a != (-1)));
        stty_ctdl(0);
-       screen_set();
 }
 
 /*
@@ -578,20 +572,20 @@ void list_bio(CtdlIPC *ipc)
 
        r = CtdlIPCListUsersWithBios(ipc, &resp, buf);
        if (r / 100 != 1) {
-               pprintf("%s\n", buf);
+               scr_printf("%s\n", buf);
                return;
        }
        while (resp && !IsEmptyStr(resp)) {
                extract_token(buf, resp, 0, '\n', sizeof buf);
                remove_token(resp, 0, '\n');
                if ((pos + strlen(buf) + 5) > screenwidth) {
-                       pprintf("\n");
+                       scr_printf("\n");
                        pos = 1;
                }
-               pprintf("%s, ", buf);
+               scr_printf("%s, ", buf);
                pos = pos + strlen(buf) + 2;
        }
-       pprintf("%c%c  \n\n", 8, 8);
+       scr_printf("%c%c  \n\n", 8, 8);
        if (resp) free(resp);
 }
 
@@ -608,20 +602,20 @@ void read_bio(CtdlIPC *ipc)
 
        do {
                newprompt("Read bio for who ('?' for list) : ", who, 25);
-               pprintf("\n");
+               scr_printf("\n");
                if (!strcmp(who, "?"))
                        list_bio(ipc);
        } while (!strcmp(who, "?"));
 
        r = CtdlIPCGetBio(ipc, who, &resp, buf);
        if (r / 100 != 1) {
-               pprintf("%s\n", buf);
+               scr_printf("%s\n", buf);
                return;
        }
        while (!IsEmptyStr(resp)) {
                extract_token(buf, resp, 0, '\n', sizeof buf);
                remove_token(resp, 0, '\n');
-               pprintf("%s\n", buf);
+               scr_printf("%s\n", buf);
        }
        if (resp) free(resp);
 }
index d20a0d170d5b758cdff054fefcbc6a1603f97cd0..b05b05447246ac4d59fcbab4cde4c1d5dd70a339 100644 (file)
@@ -24,12 +24,14 @@ char arg_screen;
 
 extern int screenheight;
 extern int screenwidth;
+int lines_printed = 0;
+int cols_printed = 0;
+
 extern int rc_ansi_color;
 extern void check_screen_dims(void);
 
 void do_keepalive(void);
 
-
 /*
  * Initialize the screen
  */
@@ -42,16 +44,6 @@ void screen_new(void)
 }
 
 
-/*
- * Kill the screen completely (used at exit).  It is safe to call this
- * function more than once.
- */
-void screen_delete(void)
-{
-       screen_reset();
-}
-
-
 
 /*
  * Beep.
@@ -62,24 +54,6 @@ void ctdl_beep(void) {
        
 
 
-/*
- * Set screen/IO parameters, e.g. at start of program or return from external
- * program run.
- */
-int screen_set(void)
-{
-       return 0;
-}
-
-
-/*
- * Reset screen/IO parameters, e.g. at exit or fork of external program.
- */
-int screen_reset(void)
-{
-       return 0;
-}
-
 
 /*
  * scr_printf() outputs to the terminal
@@ -115,17 +89,90 @@ int scr_getc(int delay)
        buf = '\0';
        if (!read (0, &buf, 1))
                logoff(NULL, 3);
+
+       lines_printed = 0;
        return buf;
 }
 
+/*
+ * Issue the paginator prompt (more / hit any key to continue)
+ */
+void hit_any_key(void) {
+       int b;
+
+       color(COLOR_PUSH);
+       color(DIM_RED);
+       /* scr_printf("%s\r", ipc->ServInfo.moreprompt); */
+       scr_printf("<<more>>\r");       // FIXME use the prompt given by the server
+       color(COLOR_POP);
+       stty_ctdl(0);
+       b=inkey();
+       /*
+       for (a=0; !IsEmptyStr(&ipc->ServInfo.moreprompt[a]); ++a)
+               scr_putc(' ');
+       */
+       scr_printf("        ");
+       scr_putc(13);
+       stty_ctdl(1);
+/*
+       if ( (rc_prompt_control == 1)
+          || ((rc_prompt_control == 3) && (userflags & US_PROMPTCTL)) ) {
+               if (b == 'q' || b == 'Q' || b == 's' || b == 'S')
+                       b = STOP_KEY;
+               if (b == 'n' || b == 'N')
+                       b = NEXT_KEY;
+       }
+*/
+       if (b==NEXT_KEY) sigcaught = SIGINT;
+       if (b==STOP_KEY) sigcaught = SIGQUIT;
+}
+
+
 /*
  * Output one character to the terminal
  */
 int scr_putc(int c)
 {
+       /* handle tabs normally */
+       if (c == '\t') {
+               do {
+                       scr_putc(' ');
+               } while ((cols_printed % 8) != 0);
+               return(c);
+       }
+
+       /* Output the character... */
        if (putc(c, stdout) == EOF) {
                logoff(NULL, 3);
        }
+
+       if (c == '\n') {
+               ++lines_printed;
+               cols_printed = 0;
+       }
+       else if (c == '\r') {
+               cols_printed = 0;
+       }
+       else if (isprint(c)) {
+               ++cols_printed;
+               if ((screenwidth > 0) && (cols_printed > screenwidth)) {
+                       ++lines_printed;
+                       cols_printed = 0;
+               }
+       }
+
+       //      if we want to do a top status line, this is a reasonable way to do it
+       //      printf("\033[s\033[0;70H");
+       //      printf("\033[K   %d/%d  %d/%d", cols_printed, screenwidth, lines_printed, screenheight);
+       //      printf("\033[u");
+
+       if ((screenheight > 0) && (lines_printed > (screenheight-2))) {
+               lines_printed = 0;
+               hit_any_key();
+               lines_printed = 0;
+               cols_printed = 0;
+       }
+
        return c;
 }
 
@@ -138,13 +185,6 @@ void scr_flush(void)
 
 static volatile int caught_sigwinch = 0;
 
-/*
- * this is not supposed to be called from a signal handler.
- */
-int scr_set_windowsize(CtdlIPC* ipc)
-{
-       return 0;
-}
 
 /*
  * scr_winch() handles window size changes from SIGWINCH
index 7b03798e1ed07d0a6721ec425164db317302ed0a..4599705f59b0d6036baa308d372103d16612da52 100644 (file)
@@ -2,11 +2,7 @@
 /* client code may need the ERR define: */
 
 void screen_new(void);
-void screen_delete(void);
-int screen_set(void);
-int screen_reset(void);
 int scr_printf(char *fmt, ...);
-int scr_set_windowsize(CtdlIPC* ipc);
 
 #define SCR_NOBLOCK 0
 #define SCR_BLOCK -1
index 093a5d3a5cb4790c66b1ae89cea767327ca1e7c6..415cd25dac6e27c286fc2c296a1948eaaa983c7c 100644 (file)
@@ -604,7 +604,6 @@ void network_config_management(CtdlIPC *ipc, char *entrytype, char *comment)
        fclose(tempfp);
 
        e_ex_code = 1;  /* start with a failed exit code */
-       screen_reset();
        stty_ctdl(SB_RESTORE);
        editor_pid = fork();
        cksum = file_checksum(filename);
@@ -621,7 +620,6 @@ void network_config_management(CtdlIPC *ipc, char *entrytype, char *comment)
                } while ((b != editor_pid) && (b >= 0));
        editor_pid = (-1);
        stty_ctdl(0);
-       screen_set();
        }
 
        if (file_checksum(filename) == cksum) {