CVS commit: src/usr.bin/msgc
Module Name:src Committed By: rillig Date: Mon Oct 11 18:08:12 UTC 2021 Modified Files: src/usr.bin/msgc: msgc.1 Log Message: msgc.1: fix typos To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/usr.bin/msgc/msgc.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/msgc/msgc.1 diff -u src/usr.bin/msgc/msgc.1:1.26 src/usr.bin/msgc/msgc.1:1.27 --- src/usr.bin/msgc/msgc.1:1.26 Tue Mar 6 16:26:01 2012 +++ src/usr.bin/msgc/msgc.1 Mon Oct 11 18:08:12 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: msgc.1,v 1.26 2012/03/06 16:26:01 mbalmer Exp $ +.\" $NetBSD: msgc.1,v 1.27 2021/10/11 18:08:12 rillig Exp $ .\" .\" Copyright 1997 Piermont Information Systems Inc. .\" All rights reserved. @@ -29,7 +29,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF .\" THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd March 3, 2012 +.Dd October 11, 2021 .Dt MSGC 1 .Os .Sh NAME @@ -114,18 +114,17 @@ Each message is started with the word followed by the name of the message. The body of the message is next and is started by a { and closed by a }. The braces are not part of the message. -Everything, including newlines between the braces are part of the message. +Everything, including newlines between the braces, is part of the message. .Sh MESSAGE FUNCTIONS -The defined messages are used through calls routines that manipulate +The defined messages are used through calls to routines that manipulate the messages. You first need to set the .Xr curses 3 environment up and then tell the message system which window to use -for displaying message by calling the function +for displaying the messages by calling the function .Fn msg_window . .Pp -All variable argument lists in the functions are used as -are arguments to +All variable argument lists in the functions are used as arguments to .Xr sprintf 3 . The messages may have .Xr sprintf 3 @@ -135,7 +134,7 @@ Messages are identified by name using th where .Dq name is the name in the message source file. -(The definitions are accessed by including the generated .h file into a +(The definitions are accessed by including the generated .h file into each source file wanting to use the message routines.) .Pp The function @@ -153,7 +152,7 @@ The functions .Fn msg_display and .Fn msg_display_add -cause a defined message to be displayed in the message window and does +cause the given message to be displayed in the message window and do the requested conversions before printing. The difference is that .Fn msg_display @@ -199,7 +198,7 @@ The functions .Fn msg_echo and .Fn msg_noecho -control whether the prompt routine echo or don't echo the input that +control whether the prompt routines echo or don't echo the input that is typed by the user. .Pp .Fn msg_prompt_win
CVS commit: src/usr.bin/msgc
Module Name:src Committed By: rillig Date: Mon Oct 11 18:08:12 UTC 2021 Modified Files: src/usr.bin/msgc: msgc.1 Log Message: msgc.1: fix typos To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/usr.bin/msgc/msgc.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/msgc
Module Name:src Committed By: martin Date: Sat Nov 16 17:38:09 UTC 2019 Modified Files: src/usr.bin/msgc: msg_sys.def Log Message: msg_table_add(): fix mishap in the format safety changes in r1.45 To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/usr.bin/msgc/msg_sys.def Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/msgc/msg_sys.def diff -u src/usr.bin/msgc/msg_sys.def:1.47 src/usr.bin/msgc/msg_sys.def:1.48 --- src/usr.bin/msgc/msg_sys.def:1.47 Tue Jun 25 21:09:33 2019 +++ src/usr.bin/msgc/msg_sys.def Sat Nov 16 17:38:09 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: msg_sys.def,v 1.47 2019/06/25 21:09:33 joerg Exp $ */ +/* $NetBSD: msg_sys.def,v 1.48 2019/11/16 17:38:09 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -653,7 +653,7 @@ void msg_table_add(msg msg_no) { - msg_printf("%s", msg_string(msg_no)); + msg_fmt_table_add(msg_no, ""); } void __printflike(2, 3)
CVS commit: src/usr.bin/msgc
Module Name:src Committed By: martin Date: Sat Nov 16 17:38:09 UTC 2019 Modified Files: src/usr.bin/msgc: msg_sys.def Log Message: msg_table_add(): fix mishap in the format safety changes in r1.45 To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/usr.bin/msgc/msg_sys.def Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/msgc
Module Name:src Committed By: joerg Date: Tue Jun 25 21:09:33 UTC 2019 Modified Files: src/usr.bin/msgc: msg_sys.def Log Message: Do the fmtcheck for both message lookups to satisfy format string literal checks. To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/usr.bin/msgc/msg_sys.def Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/msgc/msg_sys.def diff -u src/usr.bin/msgc/msg_sys.def:1.46 src/usr.bin/msgc/msg_sys.def:1.47 --- src/usr.bin/msgc/msg_sys.def:1.46 Thu Jun 20 11:31:12 2019 +++ src/usr.bin/msgc/msg_sys.def Tue Jun 25 21:09:33 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: msg_sys.def,v 1.46 2019/06/20 11:31:12 martin Exp $ */ +/* $NetBSD: msg_sys.def,v 1.47 2019/06/25 21:09:33 joerg Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -592,7 +592,8 @@ msg_fmt_prompt_win(msg msg_no, int x, in } va_start(ap, fmt); - _msg_vprompt(msg_string(msg_no), msg_flags, def, val, val_buf_len, ap); + _msg_vprompt(fmtcheck(msg_string(msg_no), fmt), msg_flags, def, val, + val_buf_len, ap); va_end(ap); if (win != NULL) {
CVS commit: src/usr.bin/msgc
Module Name:src Committed By: joerg Date: Tue Jun 25 21:09:33 UTC 2019 Modified Files: src/usr.bin/msgc: msg_sys.def Log Message: Do the fmtcheck for both message lookups to satisfy format string literal checks. To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/usr.bin/msgc/msg_sys.def Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/msgc
Module Name:src Committed By: martin Date: Thu Jun 20 11:31:13 UTC 2019 Modified Files: src/usr.bin/msgc: msg_sys.def Log Message: Re-add msg_clear() accidently dropped in previous. To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/usr.bin/msgc/msg_sys.def Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/msgc
Module Name:src Committed By: martin Date: Thu Jun 20 11:31:13 UTC 2019 Modified Files: src/usr.bin/msgc: msg_sys.def Log Message: Re-add msg_clear() accidently dropped in previous. To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/usr.bin/msgc/msg_sys.def Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/msgc/msg_sys.def diff -u src/usr.bin/msgc/msg_sys.def:1.45 src/usr.bin/msgc/msg_sys.def:1.46 --- src/usr.bin/msgc/msg_sys.def:1.45 Thu Jun 20 00:45:18 2019 +++ src/usr.bin/msgc/msg_sys.def Thu Jun 20 11:31:12 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: msg_sys.def,v 1.45 2019/06/20 00:45:18 christos Exp $ */ +/* $NetBSD: msg_sys.def,v 1.46 2019/06/20 11:31:12 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -288,6 +288,7 @@ void msg_display(msg msg_no) { + msg_clear(); msg_printf("%s", msg_string(msg_no)); }
CVS commit: src/usr.bin/msgc
Module Name:src Committed By: christos Date: Thu Jun 20 00:45:18 UTC 2019 Modified Files: src/usr.bin/msgc: msg_sys.def msgdb.c Log Message: Introduce _fmt_ flavors of the menu functions that take a formatting string so we can use fmtcheck(3) to check the formats of the messages strings. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/usr.bin/msgc/msg_sys.def cvs rdiff -u -r1.23 -r1.24 src/usr.bin/msgc/msgdb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/msgc
Module Name:src Committed By: christos Date: Thu Jun 20 00:45:18 UTC 2019 Modified Files: src/usr.bin/msgc: msg_sys.def msgdb.c Log Message: Introduce _fmt_ flavors of the menu functions that take a formatting string so we can use fmtcheck(3) to check the formats of the messages strings. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/usr.bin/msgc/msg_sys.def cvs rdiff -u -r1.23 -r1.24 src/usr.bin/msgc/msgdb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/msgc/msg_sys.def diff -u src/usr.bin/msgc/msg_sys.def:1.44 src/usr.bin/msgc/msg_sys.def:1.45 --- src/usr.bin/msgc/msg_sys.def:1.44 Fri Mar 1 12:02:21 2019 +++ src/usr.bin/msgc/msg_sys.def Wed Jun 19 20:45:18 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: msg_sys.def,v 1.44 2019/03/01 17:02:21 martin Exp $ */ +/* $NetBSD: msg_sys.def,v 1.45 2019/06/20 00:45:18 christos Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -158,7 +158,7 @@ msg_standend(void) wstandend(msg_win); } -static int +static int __printflike(2, 0) _msg_vprintf(int auto_fill, const char *fmt, va_list ap) { const char *wstart, *afterw; @@ -285,28 +285,42 @@ out: } void -msg_display(msg msg_no, ...) +msg_display(msg msg_no) +{ + + msg_printf("%s", msg_string(msg_no)); +} + +void __printflike(2, 3) +msg_fmt_display(msg msg_no, const char *fmt, ...) { va_list ap; msg_clear(); - va_start(ap, msg_no); - (void)_msg_vprintf(1, msg_string(msg_no), ap); + va_start(ap, fmt); + (void)_msg_vprintf(1, fmtcheck(msg_string(msg_no), fmt), ap); va_end(ap); } void -msg_display_add(msg msg_no, ...) +msg_display_add(msg msg_no) +{ + + msg_printf("%s", msg_string(msg_no)); +} + +void __printflike(2, 3) +msg_fmt_display_add(msg msg_no, const char *fmt, ...) { va_list ap; - va_start(ap, msg_no); - (void)_msg_vprintf(1, msg_string(msg_no), ap); + va_start(ap, fmt); + (void)_msg_vprintf(1, fmtcheck(msg_string(msg_no), fmt), ap); va_end(ap); } -void +void __printflike(1, 2) msg_printf(const char *fmt, ...) { va_list ap; @@ -316,7 +330,7 @@ msg_printf(const char *fmt, ...) va_end(ap); } -static void +static void __printflike(1, 0) _msg_vprompt(const char *fmt, int flags, const char *def, char *val, size_t val_buf_len, va_list ap) { @@ -469,21 +483,36 @@ _msg_vprompt(const char *fmt, int flags, } void -msg_prompt(msg msg_no, const char *def, char *val, size_t val_buf_len, ...) +msg_prompt(msg msg_no, const char *def, char *val, size_t val_buf_len) +{ + + msg_fmt_prompt(msg_no, def, val, val_buf_len, ""); +} + +void __printflike(5, 6) +msg_fmt_prompt(msg msg_no, const char *def, char *val, size_t val_buf_len, +const char *fmt, ...) { va_list ap; msg_clear(); - va_start(ap, val_buf_len); - _msg_vprompt(msg_string(msg_no), MSG_PROMPT_ECHO, + va_start(ap, fmt); + _msg_vprompt(fmtcheck(msg_string(msg_no), fmt), MSG_PROMPT_ECHO, def, val, val_buf_len, ap); va_end(ap); } void msg_prompt_win(msg msg_no, int x, int y, int w, int h, - const char *def, char *val, size_t val_buf_len, ...) +const char *def, char *val, size_t val_buf_len) +{ +msg_fmt_prompt_win(msg_no, x, y, w, h, def, val, val_buf_len, ""); +} + +void __printflike(9, 10) +msg_fmt_prompt_win(msg msg_no, int x, int y, int w, int h, +const char *def, char *val, size_t val_buf_len, const char *fmt, ...) { va_list ap; WINDOW *win; @@ -495,10 +524,10 @@ msg_prompt_win(msg msg_no, int x, int y, maxx = getmaxx(msg_win); maxy = getmaxy(msg_win); if (w == 0) { - va_start(ap, val_buf_len); - w = vsnprintf(NULL, 0, msg_string(msg_no), ap); + va_start(ap, fmt); + w = vsnprintf(NULL, 0, fmtcheck(msg_string(msg_no), fmt), ap); va_end(ap); - if (def != NULL && *def != 0 && w + (int)val_buf_len * 2 < maxx) { + if (def != NULL && *def != 0 && w + (int)val_buf_len * 2 < maxx) { w += 2 + strlen(def) + 1; msg_flags &= ~MSG_PROMPT_HIDE_DFLT; } @@ -561,7 +590,7 @@ msg_prompt_win(msg msg_no, int x, int y, msg_clear(); } - va_start(ap, val_buf_len); + va_start(ap, fmt); _msg_vprompt(msg_string(msg_no), msg_flags, def, val, val_buf_len, ap); va_end(ap); @@ -579,35 +608,59 @@ msg_prompt_win(msg msg_no, int x, int y, } } -void -msg_prompt_add(msg msg_no, const char *def, char *val, size_t val_buf_len, ...) +void +msg_prompt_add(msg msg_no, const char *def, char *val, size_t val_buf_len) +{ + + msg_fmt_prompt_add(msg_no, def, val, val_buf_len, ""); +} + +void __printflike(5, 6) +msg_fmt_prompt_add(msg msg_no, const char *def, char *val, size_t val_buf_len, +const char *fmt, ...) { va_list ap; - va_start(ap, val_buf_len); - _msg_vprompt(msg_string(msg_no), MSG_PROMPT_ECHO, def, val, val_buf_len, ap); + va_start(ap, fmt); + _msg_vprompt(fmtcheck(msg_string(msg_no), fmt), MSG_PROMPT_ECHO, def, + val, val_buf_len, ap); va_end(ap); } void -msg_prompt_noecho(msg msg_no, const char
CVS commit: src/usr.bin/msgc
Module Name:src Committed By: dsl Date: Sat Jan 2 16:08:20 UTC 2010 Modified Files: src/usr.bin/msgc: msg_sys.def Log Message: Remove some sign compare warnings. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/usr.bin/msgc/msg_sys.def Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.