1 .\" $NetBSD: msgc.1,v 1.26 2012/03/06 16:26:01 mbalmer 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. The name of Piermont Information Systems Inc. may not be used to endorse
17 .\" or promote products derived from this software without specific prior
18 .\" written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
21 .\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
24 .\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 .\" THE POSSIBILITY OF SUCH DAMAGE.
48 .Nm msg_prompt_noecho ,
51 .Nd simple message list compiler
57 .Fd #include \&"msg_defs.h"
59 .Fn msg_window "WINDOW *window"
61 .Fn msg_string "msg msg_no"
65 .Fn msg_standout "void"
67 .Fn msg_standend "void"
69 .Fn msg_display "msg msg_no" ...
71 .Fn msg_display_add "msg msg_no" ...
73 .Fn msg_printf "fmt" ...
75 .Fn msg_prompt "msg msg_no" "const char *def" "char *val" "int max_chars" ...
77 .Fn msg_prompt_add "msg msg_no" "const char *def" "char *val" "int max_chars" ...
79 .Fn msg_prompt_win "msg msg_no" "WINDOW *win" "const char *def" "char *val" "int max_chars" ...
81 .Fn msg_prompt_noecho "msg msg_no" "const char *def" "char *val" "int max_chars" ...
85 .Fn msg_table_add "msg msg_no" ...
87 This implements a curses based message display system.
88 A source file that lists messages with associated names is given to
90 and produces both a .c and a .h file that implement the menu system.
91 The standard root name of the files is
95 can be used to specify a different root name.
97 .Bl -tag -width MSGDEF
99 Can be set to point to a different set of
102 The current location defaults to
103 .Pa /usr/share/misc .
108 .Pa /usr/share/misc/msg_sys.def
110 .Sh SOURCE DESCRIPTION
111 The format is very simple.
112 Each message is started with the word
114 followed by the name of the message.
115 The body of the message is next and is started by a { and closed by a }.
116 The braces are not part of the message.
117 Everything, including newlines between the braces are part of the message.
118 .Sh MESSAGE FUNCTIONS
119 The defined messages are used through calls routines that manipulate
121 You first need to set the
123 environment up and then tell the message system which window to use
124 for displaying message by calling the function
127 All variable argument lists in the functions are used as
130 The messages may have
132 conversions in them and the corresponding parameters should match.
133 Messages are identified by name using the notation
137 is the name in the message source file.
138 (The definitions are accessed by including the generated .h file into a
139 source file wanting to use the message routines.)
143 just returns a pointer to the actual message string.
149 respectively clear the message window, set standout mode and clear standout
156 cause a defined message to be displayed in the message window and does
157 the requested conversions before printing.
158 The difference is that
160 clears the window before displaying the message.
161 These functions fill paragraphs for readability.
164 function behaves like
166 but does not fill text.
170 allows to display a raw message without going through the message catalog.
172 The remaining functions deal with a prompt facility.
173 A prompt message is either taken from the message directory or from a
175 The message is processed with
182 and not a string of zero length, a default value is printed
184 The user is allowed to type in a response.
185 If the user types just the newline character, the default is returned
189 is the length of the parameter
191 where the results are stored.
196 may point to the same character array.
197 If the default is chosen, the character array is not changed.
202 control whether the prompt routine echo or don't echo the input that
203 is typed by the user.
206 uses the specified curses window instead of the default one.
209 return the current row - i.e.: getcury(msg_win) + getbegy(msg_win).
211 Philip A. Nelson for Piermont Information Systems Inc.