1 .\" $NetBSD: msgc.1,v 1.20 2003/10/15 20:02:10 wiz Exp $
3 .\" Copyright 1997 Piermont Information Systems Inc.
4 .\" All rights reserved.
6 .\" Written by Philip A. Nelson for Piermont Information Systems Inc.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
16 .\" 3. All advertising materials mentioning features or use of this software
17 .\" must display the following acknowledgement:
18 .\" This product includes software developed for the NetBSD Project by
19 .\" Piermont Information Systems Inc.
20 .\" 4. The name of Piermont Information Systems Inc. may not be used to endorse
21 .\" or promote products derived from this software without specific prior
22 .\" written permission.
24 .\" THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
25 .\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 .\" ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
28 .\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
34 .\" THE POSSIBILITY OF SUCH DAMAGE.
36 .Dd September 25, 2003
51 .Nm msg_prompt_noecho ,
54 .Nd simple message list compiler
60 .Fd #include \b'"'msg_defs.h\b'"'
62 .Fn msg_window "WINDOW *window"
64 .Fn msg_string "msg msg_no"
68 .Fn msg_standout "void"
70 .Fn msg_standend "void"
72 .Fn msg_display "msg msg_no" ...
74 .Fn msg_display_add "msg msg_no" ...
76 .Fn msg_prompt "msg msg_no" "const char *def" "char *val" "int max_chars" ...
78 .Fn msg_prompt_add "msg msg_no" "const char *def" "char *val" "int max_chars" ...
80 .Fn msg_prompt_win "msg msg_no" "WINDOW *win" "const char *def" "char *val" "int max_chars" ...
82 .Fn msg_prompt_noecho "msg msg_no" "const char *def" "char *val" "int max_chars" ...
86 .Fn msg_table_add "msg msg_no" ...
88 This implements a curses based message display system.
89 A source file that lists messages with associated names is given to
91 and produces both a .c and a .h file that implement the menu system.
92 The standard root name of the files is
96 can be used to specify a different root name.
98 .Bl -tag -width MSGDEF
100 Can be set to point to a different set of
103 The current location defaults to
104 .Pa /usr/share/misc .
107 .Bl -item -width /usr/share/misc/msg_sys.def
109 .Pa /usr/share/misc/msg_sys.def
111 .Sh SOURCE DESCRIPTION
112 The format is very simple.
113 Each message is started with the word
115 followed by the name of the message.
116 The body of the message is next and is started by a { and closed by a }.
117 The braces are not part of the message.
118 Everything, including newlines between the braces are part of the message.
119 .Sh MESSAGE FUNCTIONS
120 The defined messages are used through calls routines that manipulate
122 You first need to set the
124 environment up and then tell the message system which window to use
125 for displaying message by calling the function
128 All variable argument lists in the functions are used as
131 The messages may have
133 conversions in them and the corresponding parameters should match.
134 Messages are identified by name using the notation
138 is the name in the message source file.
139 (The definitions are accessed by including the generated .h file into a
140 source file wanting to use the message routines.)
144 just returns a pointer to the actual message string.
150 respectively clear the message window, set standout mode and clear standout
157 cause a defined message to be displayed in the message window and does
158 the requested conversions before printing.
159 The difference is that
161 clears the window before displaying the message.
162 These functions fill paragraphs for readability.
165 function behaves like
167 but does not fill text.
169 The remaining functions deal with a prompt facility.
170 A prompt message is either taken from the message directory or from a
172 The message is processed with
179 and not a string of zero length, a default value is printed
181 The user is allowed to type in a response.
182 If the user types just the newline character, the default is returned
186 is the length of the parameter
188 where the results are stored.
193 may point to the same character array.
194 If the default is chosen, the character array is not changed.
199 control whether the prompt routine echo or don't echo the input that
200 is typed by the user.
203 uses the specified curses window instead of the default one.
206 return the current row - i.e.: getcury(msg_win) + getbegy(msg_win).
208 Philip A. Nelson for Piermont Information Systems Inc.