1 .\" $NetBSD: gencat.1,v 1.11 2008/11/04 03:14:46 ginsbach Exp $
3 .\" Copyright (c) 2007 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Kee Hinckley and Brian Ginsbach.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
30 .\" Written by Kee Hinckley <nazgul@somewhere.com>
37 .Nd generates a Native Language Support (NLS) message catalog file
46 utility generates a formatted message catalog
48 from one or more message source text files
52 is created if it does not already exist.
55 does exist, its messages are included in the new
57 The new message text defined in
59 replaces the old message text currently in
61 when the set and message numbers match.
63 The generated message catalog contains message
64 strings that will be retrieved using the
67 These messages are dynamically loaded by the
68 Native Language Support (NLS) library at run time.
69 Error messages are grouped into sets, and a program can load a
70 particular set depending on which type, or language, of messages
72 .Ss Message Text Source File Format
73 The message text source files are text files in the format described below.
74 Note that the fields of a message text source line are separated by
75 space or tab characters.
76 .\" XXX Required by POSIX; the code must be fixed first. Above line should be
77 .\" a single space or tab character;
78 .\" any other space or tab characters are considered to be part of the
81 .It Li $set Ar n comment
82 Determines the set identifier to be used for all subsequent messages
88 is the set identifier which is defined as a number in the range
91 Set identifiers within a single source file need not be contiguous.
92 Any string following the set identifier is treated as a comment.
95 directive is specified in a message text source file,
96 all messages will be located in the default message set
98 .It Li $delset Ar n comment
104 is a set identifier in the range
107 If a message set was created earlier in the
108 current file, or in a file previously read by the
110 command, this directive will remove it.
111 Any string following the set identifier is treated as a comment.
113 A line beginning with
115 followed by a space or tab character is treated as a comment.
116 .It Ar m message-text
117 A message line consists of a message identifier
126 is read until the end of the line or a quote character
127 (if one is specified).
130 is stored in the message catalog with
131 the set identifier specified by the last
133 directive, and the message identifier
137 is empty and there is a space or tab character
138 following the message identifier,
139 an empty string is stored in the message catalog.
143 and if there is no space or tab character following the message
145 the message with the message identifier
147 in the current set is removed from the catalog.
148 Message identifiers need not be contiguous within a single set.
155 Sets an optional quote character to be used around the
159 may be any character other than white space.
160 If this is specified, then messages must begin and end with the
162 .\" XXX Remove next sentence when code is fixed for POSIX conformance.
163 This is useful when messages must contain leading white space.
164 .\" XXX Replacement when above is removed.
165 .\" This is useful to make leading and trailing spaces or empty
166 .\" messages visible.
167 By default no quote character is used.
170 directive is specified, then the current quote character is unset.
174 .\" XXX Remove next line when the code is fixed for POSIX conformance.
176 in a message text source file are ignored.
177 Any line beginning with any character other than those
178 described above is ignored as a syntax error.
180 Text message strings may contain any characters and
181 the following special characters and escape sequences.
183 .Bl -column -offset indent ".Sy carriage return" ".Sy Symbol" ".Sy Sequence"
184 .It Sy Description Ta Sy Symbol Ta Sy Sequence
185 .It newline Ta NL(LF) Ta Li \en
186 .It horizontal tab Ta HT Ta Li \et
187 .It vertical tab Ta VT Ta Li \ev
188 .It backspace Ta BS Ta Li \eb
189 .It carriage return Ta CR Ta Li \er
190 .It form feed Ta FF Ta Li \ef
191 .It backslash Ta \e Ta Li \e\e
192 .It bit pattern Ta ddd Ta Li \eddd
197 consists of a backslash followed by
198 one, two, or three octal digits representing the value of the character.
199 The current quote character, if defined, may be escaped with a backslash
200 to generate the quote character.
201 Any character following the backslash ('\e') other than those specified
204 A backslash at the end of the line continues the message onto the next line.
205 The following two lines are an example of such a message:
207 .Dl 1 This message continues \e
210 Producing the following message:
212 .Dl 1 This message continues on the next line
220 .\" XXX Close but not quite; add when code is fixed.
224 .\"utility is compliant with the
228 The Native Language Support (NLS) message catalog facility was
232 This page was originally written by
234 .Aq nazgul@somewhere.com .