Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/msgc nuke msg_{, no}echo, add msg_prompt_noecho



details:   https://anonhg.NetBSD.org/src/rev/ffd2db5e1f5f
branches:  trunk
changeset: 474362:ffd2db5e1f5f
user:      cgd <cgd%NetBSD.org@localhost>
date:      Sun Jul 04 10:29:30 1999 +0000

description:
nuke msg_{,no}echo, add msg_prompt_noecho

diffstat:

 usr.bin/msgc/msg_sys.def |  44 ++++++++++++++++++++++++--------------------
 usr.bin/msgc/msgc.1      |   8 +++-----
 usr.bin/msgc/msgdb.c     |  14 +++++++-------
 3 files changed, 34 insertions(+), 32 deletions(-)

diffs (143 lines):

diff -r e0d3e79b59da -r ffd2db5e1f5f usr.bin/msgc/msg_sys.def
--- a/usr.bin/msgc/msg_sys.def  Sun Jul 04 10:29:29 1999 +0000
+++ b/usr.bin/msgc/msg_sys.def  Sun Jul 04 10:29:30 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_sys.def,v 1.12 1999/07/04 10:13:12 cgd Exp $       */
+/*     $NetBSD: msg_sys.def,v 1.13 1999/07/04 10:29:30 cgd Exp $       */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -39,14 +39,13 @@
 static WINDOW *msg_win = NULL;
 static char *cbuffer;
 static size_t cbuffersize;
-static int do_echo = 1;
 
 static int last_i_was_nl, last_i_was_space;
 static int last_o_was_punct, last_o_was_space;
 
 static int     _msg_vprintf(int auto_fill, char *fmt, va_list ap);
-static void    _msg_vprompt(char *msg, char *def, char *val, int max_chars,
-                   va_list ap);
+static void    _msg_vprompt(char *msg, int do_echo, char *def, char *val,
+                   int max_chars, va_list ap);
 
 /* Routines */
 
@@ -270,7 +269,8 @@
 
 
 static void
-_msg_vprompt(char *msg, char *def, char *val, int max_chars, va_list ap)
+_msg_vprompt(char *msg, int do_echo, char *def, char *val, int max_chars,
+    va_list ap)
 {
        int ch;
        int count = 0;
@@ -357,34 +357,38 @@
        }
 }
 
-void msg_prompt_add (int msg_no, char *def, char *val, int max_chars, ...)
-{
-       va_list ap;
-
-       va_start (ap, max_chars);
-       _msg_vprompt(msg_list[msg_no], def, val, max_chars, ap);
-       va_end(ap);
-}
-
-void msg_prompt (int msg_no, char *def, char *val, int max_chars, ...)
+void
+msg_prompt(int msg_no, char *def, char *val, int max_chars, ...)
 {
        va_list ap;
 
        msg_clear();
 
        va_start (ap, max_chars);
-       _msg_vprompt(msg_list[msg_no], def, val, max_chars, ap);
+       _msg_vprompt(msg_list[msg_no], 1, def, val, max_chars, ap);
        va_end (ap);
 }
 
-void msg_noecho()
+void
+msg_prompt_add(int msg_no, char *def, char *val, int max_chars, ...)
 {
-       do_echo = 0;
+       va_list ap;
+
+       va_start (ap, max_chars);
+       _msg_vprompt(msg_list[msg_no], 1, def, val, max_chars, ap);
+       va_end(ap);
 }
 
-void msg_echo()
+void
+msg_prompt_noecho(int msg_no, char *def, char *val, int max_chars, ...)
 {
-       do_echo = 1;
+       va_list ap;
+
+       msg_clear();
+
+       va_start (ap, max_chars);
+       _msg_vprompt(msg_list[msg_no], 0, def, val, max_chars, ap);
+       va_end (ap);
 }
 
 void msg_table_add(int msg_no, ...)
diff -r e0d3e79b59da -r ffd2db5e1f5f usr.bin/msgc/msgc.1
--- a/usr.bin/msgc/msgc.1       Sun Jul 04 10:29:29 1999 +0000
+++ b/usr.bin/msgc/msgc.1       Sun Jul 04 10:29:30 1999 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: msgc.1,v 1.6 1999/07/04 10:13:12 cgd Exp $
+.\"    $NetBSD: msgc.1,v 1.7 1999/07/04 10:29:30 cgd Exp $
 .\"
 .\" Copyright 1997 Piermont Information Systems Inc.
 .\" All rights reserved.
@@ -66,13 +66,11 @@
 .Ft int  
 .Fn msg_printf_add  "char *fmt" ...
 .Ft void 
-.Fn msg_prompt_add  "int msg_no" "char *def" "char *val" "int max_chars" ...
-.Ft void 
 .Fn msg_prompt  "int msg_no" "char *def" "char *val" "int max_chars" ...
 .Ft void 
-.Fn msg_echo  "void"
+.Fn msg_prompt_add  "int msg_no" "char *def" "char *val" "int max_chars" ...
 .Ft void 
-.Fn msg_noecho  "void"
+.Fn msg_prompt_noecho  "int msg_no" "char *def" "char *val" "int max_chars" ...
 .Ft void 
 .Fn msg_table_add "int msg_no" ...
 .Sh DESCRIPTION
diff -r e0d3e79b59da -r ffd2db5e1f5f usr.bin/msgc/msgdb.c
--- a/usr.bin/msgc/msgdb.c      Sun Jul 04 10:29:29 1999 +0000
+++ b/usr.bin/msgc/msgdb.c      Sun Jul 04 10:29:30 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msgdb.c,v 1.7 1999/07/04 10:13:12 cgd Exp $    */
+/*     $NetBSD: msgdb.c,v 1.8 1999/07/04 10:29:30 cgd Exp $    */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -152,12 +152,12 @@
                "void msg_display_add(int msg_no,...);\n"
                "int  msg_printf (char *fmt, ...);\n"
                "int  msg_printf_add (char *fmt, ...);\n"
-               "void msg_prompt (int msg_no, char *def, char *val,"
-                       " int max_chars, ...);\n"
-               "void msg_prompt_add (int msg_no, char *def, char *val,"
-                       " int max_chars, ...);\n"
-               "void msg_echo (void);\n"
-               "void msg_noecho (void);\n"
+               "void msg_prompt (int msg_no, char *def,"
+                       " char *val, int max_chars, ...);\n"
+               "void msg_prompt_add (int msg_no, char *def,"
+                       " char *val, int max_chars, ...);\n"
+               "void msg_prompt_noecho (int msg_no, char *def,"
+                       " char *val, int max_chars, ...);\n"
                "void msg_table_add(int msg_no,...);\n"
                "\n"
                "/* Message names */\n"



Home | Main Index | Thread Index | Old Index