Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/msgc Add msg_printf(fmt, ...), a function to display...
details: https://anonhg.NetBSD.org/src/rev/e176cf975b30
branches: trunk
changeset: 777714:e176cf975b30
user: mbalmer <mbalmer%NetBSD.org@localhost>
date: Fri Mar 02 14:27:48 2012 +0000
description:
Add msg_printf(fmt, ...), a function to display raw messages without
going through the message catalog.
diffstat:
usr.bin/msgc/msg_sys.def | 12 +++++++++++-
usr.bin/msgc/msgc.1 | 11 +++++++++--
usr.bin/msgc/msgdb.c | 5 +++--
3 files changed, 23 insertions(+), 5 deletions(-)
diffs (98 lines):
diff -r bf988f27fbcc -r e176cf975b30 usr.bin/msgc/msg_sys.def
--- a/usr.bin/msgc/msg_sys.def Fri Mar 02 13:20:57 2012 +0000
+++ b/usr.bin/msgc/msg_sys.def Fri Mar 02 14:27:48 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_sys.def,v 1.39 2012/03/02 13:11:57 mbalmer Exp $ */
+/* $NetBSD: msg_sys.def,v 1.40 2012/03/02 14:27:48 mbalmer Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -310,6 +310,16 @@
va_end(ap);
}
+void
+msg_printf(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ (void)_msg_vprintf(1, fmt, ap);
+ va_end(ap);
+}
+
static void
_msg_vprompt(const char *fmt, int flags, const char *def, char *val,
size_t val_buf_len, va_list ap)
diff -r bf988f27fbcc -r e176cf975b30 usr.bin/msgc/msgc.1
--- a/usr.bin/msgc/msgc.1 Fri Mar 02 13:20:57 2012 +0000
+++ b/usr.bin/msgc/msgc.1 Fri Mar 02 14:27:48 2012 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: msgc.1,v 1.23 2012/01/11 00:30:56 riz Exp $
+.\" $NetBSD: msgc.1,v 1.24 2012/03/02 14:27:48 mbalmer Exp $
.\"
.\" Copyright 1997 Piermont Information Systems Inc.
.\" All rights reserved.
@@ -33,7 +33,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
.\" THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd September 25, 2003
+.Dd March 3, 2012
.Dt MSGC 1
.Os
.Sh NAME
@@ -45,6 +45,7 @@
.Nm msg_standend ,
.Nm msg_display ,
.Nm msg_display_add ,
+.Nm msg_printf ,
.Nm msg_prompt ,
.Nm msg_prompt_add ,
.Nm msg_prompt_win ,
@@ -73,6 +74,8 @@
.Ft void
.Fn msg_display_add "msg msg_no" ...
.Ft void
+.Fn msg_printf "fmt" ...
+.Ft void
.Fn msg_prompt "msg msg_no" "const char *def" "char *val" "int max_chars" ...
.Ft void
.Fn msg_prompt_add "msg msg_no" "const char *def" "char *val" "int max_chars" ...
@@ -165,6 +168,10 @@
function behaves like
.Fn msg_display_add
but does not fill text.
+.PP
+The function
+.Fn msg_printf
+allows to display a raw message without going through the message catalog.
.Pp
The remaining functions deal with a prompt facility.
A prompt message is either taken from the message directory or from a
diff -r bf988f27fbcc -r e176cf975b30 usr.bin/msgc/msgdb.c
--- a/usr.bin/msgc/msgdb.c Fri Mar 02 13:20:57 2012 +0000
+++ b/usr.bin/msgc/msgdb.c Fri Mar 02 14:27:48 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msgdb.c,v 1.21 2012/03/02 13:11:57 mbalmer Exp $ */
+/* $NetBSD: msgdb.c,v 1.22 2012/03/02 14:27:48 mbalmer Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -45,7 +45,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: msgdb.c,v 1.21 2012/03/02 13:11:57 mbalmer Exp $");
+__RCSID("$NetBSD: msgdb.c,v 1.22 2012/03/02 14:27:48 mbalmer Exp $");
#endif
@@ -168,6 +168,7 @@
"void msg_standend(void);\n"
"void msg_display(msg msg_no,...);\n"
"void msg_display_add(msg msg_no,...);\n"
+ "void msg_printf(const char *fmt, ...) __printflike(1, 2);\n"
"void msg_prompt (msg msg_no, const char *def,"
" char *val, size_t max_chars, ...);\n"
"void msg_prompt_add (msg msg_no, const char *def,"
Home |
Main Index |
Thread Index |
Old Index