* Threw in a few more #ifdef's so the client build doesn't barf on
authorArt Cancro <ajc@citadel.org>
Tue, 12 Feb 2002 20:15:25 +0000 (20:15 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 12 Feb 2002 20:15:25 +0000 (20:15 +0000)
  non-curses systems
* Added rc_prompt_control (<N>ext/<S>top active at paginator: on/off/user)

citadel/ChangeLog
citadel/citadel.c
citadel/citadel.rc
citadel/commands.c
citadel/ipcdef.h
citadel/routines.c

index dd4bee27827a9a367163853442fad5792985ef61..38fd64283e77e3c8df8bb8c5f7b35d3e33ce74cb 100644 (file)
@@ -1,4 +1,9 @@
  $Log$
+ Revision 590.109  2002/02/12 20:15:25  ajc
+ * Threw in a few more #ifdef's so the client build doesn't barf on
+   non-curses systems
+ * Added rc_prompt_control (<N>ext/<S>top active at paginator: on/off/user)
+
  Revision 590.108  2002/02/11 15:52:10  ajc
  * Don't crash when deleting "purge this vCard" messages
 
@@ -3326,4 +3331,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index e4b427f6e3e187e64baab310cdb6a5bd7199fd28..4826c247a738d9e1bc2ad15e8ba466f9fc3d9179 100644 (file)
@@ -915,7 +915,9 @@ int main(int argc, char **argv)
        signal(SIGCONT, catch_sigcont);         /* Catch SIGCONT so we can reset terminal */
 
        arg_encrypt = RC_DEFAULT;
+#ifdef HAVE_CURSES_H
        arg_screen = RC_DEFAULT;
+#endif
 
        /* 
         * Handle command line options as if we were called like /bin/login
@@ -935,11 +937,15 @@ int main(int argc, char **argv)
                        argc = shift(argc, argv, a, 1);
                }
                if (!strcmp(argv[a], "-s")) {
+#ifdef HAVE_CURSES_H
                        arg_screen = RC_NO;
+#endif
                        argc = shift(argc, argv, a, 1);
                }
                if (!strcmp(argv[a], "-S")) {
+#ifdef HAVE_CURSES_H
                        arg_screen = RC_YES;
+#endif
                        argc = shift(argc, argv, a, 1);
                }
                if (!strcmp(argv[a], "-p")) {
index 849b43b98fbf7bab732324a3f0f67da5a0867a8f..a7579dc7414e35f78b560540cca520c41a105a65 100644 (file)
@@ -5,8 +5,8 @@
 #
 # The standard client looks for this file in:
 # 1. $HOME/.citadelrc
-# 2. /usr/local/lib/citadel.rc
-# 3. <compiled BBSDIR>/citadel.rc
+# 2. <compiled BBSDIR>/citadel.rc
+# 3. /etc/citadel.rc
 # 4. <current directory>/citadel.rc
 
 # Set ENCRYPT to yes to force SSL/TLS encryption when connecting to a
@@ -16,7 +16,7 @@
 # systems on the same machine as the client.
 encrypt=default
 
-# Set FULLSCREN to yes to (attempt to) use full-screen curses mode.
+# Set FULLSCREEN to yes to (attempt to) use full-screen curses mode.
 # This mode presents a status line and a few other niceties.  Some
 # people might not like this, so you can turn it off here or with the
 # -s command line option.  The default is to use full screen if the
@@ -53,6 +53,12 @@ local_screen_dimensions=1
 #
 ansi_color=user
 
+# PROMPT_CONTROL should be set to on/off/user to control whether the <N>ext
+# and <S>top keys are active when displaying the paginator prompt.  If it
+# is set to "user" then it's a user-configurable option.
+#
+prompt_control=user
+
 # If DISPLAY_MESSAGE_NUMBERS is set to 1, then messages will be displayed
 # with their message numbers in the header.  This is ugly but some
 # people seem to like it anyway...
index 2f39edde726fe2568b91488d9fd4ea8ebfd95cb5..4ea818cead701ce3766f91c439ea93266086e5d6 100644 (file)
@@ -75,6 +75,7 @@ int rc_force_mail_prompts;
 int rc_remember_passwords;
 int rc_ansi_color;
 int num_urls = 0;
+int rc_prompt_control = 0;
 char urls[MAXURLS][SIZ];
 char rc_url_cmd[SIZ];
 
@@ -688,7 +689,9 @@ void load_command_set(void)
        rc_ansi_color = 0;
        strcpy(rc_url_cmd, "");
        rc_encrypt = RC_DEFAULT;
+#ifdef HAVE_CURSES_H
        rc_screen = RC_DEFAULT;
+#endif
        rc_alt_semantics = 0;
 
        /* now try to open the citadel.rc file */
@@ -698,13 +701,13 @@ void load_command_set(void)
                snprintf(buf, sizeof buf, "%s/.citadelrc", getenv("HOME"));
                ccfile = fopen(buf, "r");
        }
-       if (ccfile == NULL) {
-               ccfile = fopen("/usr/local/lib/citadel.rc", "r");
-       }
        if (ccfile == NULL) {
                snprintf(buf, sizeof buf, "%s/citadel.rc", BBSDIR);
                ccfile = fopen(buf, "r");
        }
+       if (ccfile == NULL) {
+               ccfile = fopen("/etc/citadel.rc", "r");
+       }
        if (ccfile == NULL) {
                ccfile = fopen("./citadel.rc", "r");
        }
@@ -725,12 +728,14 @@ void load_command_set(void)
                                rc_encrypt = RC_DEFAULT;
                }
 
+#ifdef HAVE_CURSES_H
                if (!strncasecmp(buf, "fullscreen=", 11)) {
                        if (!strcasecmp(&buf[11], "yes"))
                                rc_screen = RC_YES;
                        else if (!strcasecmp(&buf[11], "no"))
                                rc_screen = RC_NO;
                }
+#endif
 
                if (!strncasecmp(buf, "editor=", 7))
                        strcpy(editor_path, &buf[7]);
@@ -775,6 +780,12 @@ void load_command_set(void)
                        if (!strncasecmp(&buf[11], "user", 4))
                                rc_ansi_color = 3;      /* user config */
                }
+               if (!strncasecmp(buf, "prompt_control=", 15)) {
+                       if (!strncasecmp(&buf[15], "on", 2))
+                               rc_prompt_control = 1;
+                       if (!strncasecmp(&buf[15], "user", 4))
+                               rc_prompt_control = 3;  /* user config */
+               }
                if (!strncasecmp(buf, "username=", 9))
                        strcpy(rc_username, &buf[9]);
 
index 4e27f6e6b529e1b82744d48a841417f03f8aae80..60c22e632773123aa628be229e72ed6c361f1d2a 100644 (file)
@@ -69,6 +69,7 @@ struct CtdlServInfo {
 #define US_EXPERT      32              /* Experienced user                 */
 #define US_UNLISTED    64              /* Unlisted userlog entry           */
 #define US_NOPROMPT    128             /* Don't prompt after each message  */
+#define US_PROMPTCTL   256             /* <N>ext & <S>top work at prompt   */
 #define US_DISAPPEAR   512             /* Use "disappearing msg prompts"   */
 #define US_REGIS       1024            /* Registered user                  */
 #define US_PAGINATOR   2048            /* Pause after each screen of text  */
@@ -77,7 +78,7 @@ struct CtdlServInfo {
 #define US_COLOR       16384           /* User wants ANSI color support    */
 #define US_USER_SET    (US_LASTOLD | US_EXPERT | US_UNLISTED | \
                        US_NOPROMPT | US_DISAPPEAR | US_PAGINATOR | \
-                       US_FLOORS | US_COLOR )
+                       US_FLOORS | US_COLOR | US_PROMPTCTL )
 
 void serv_puts(char *buf);
 void serv_gets(char *buf);
index f3066596fb3cdb545a0553443ea6aef9cad8cc05..cfe19729f62b745cf64a026ea77f62b2e004a975 100644 (file)
@@ -70,6 +70,7 @@ extern char sigcaught;
 extern struct CtdlServInfo serv_info;
 extern char rc_floor_mode;
 extern int rc_ansi_color;
+extern int rc_prompt_control;
 
 void back(int spaces) /* Destructive backspace */
             {
@@ -92,10 +93,13 @@ void hit_any_key(void) {            /* hit any key to continue */
                scr_putc(' ');
        scr_putc(13);
        sttybbs(1);
-       if (b == 'q' || b == 'Q' || b == 's' || b == 'S')
-               b = STOP_KEY;
-       if (b == 'n' || b == 'N')
-               b = NEXT_KEY;
+       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;
 }
@@ -222,6 +226,10 @@ void enter_config(int mode)
            flags = set_attr(flags,"Use 'disappearing' prompts",US_DISAPPEAR);
         flags = set_attr(flags,
                "Pause after each screenful of text",US_PAGINATOR);
+        if ( (rc_prompt_control == 3) && (flags & US_PAGINATOR) ) {
+               flags = set_attr(flags,
+               "<N>ext and <S>top work at paginator prompt", US_PROMPTCTL);
+        }
         if (rc_floor_mode == RC_DEFAULT) {
          flags = set_attr(flags,
                "View rooms by floor",US_FLOORS);