locales, libconv: Sync with FreeBSD (extensive reach)
[dragonfly.git] / usr.bin / gencat / gencat.1
1 .\"     $OpenBSD: gencat.1,v 1.3 1997/06/11 15:39:54 kstailey Exp $
2 .\"
3 .\" Copyright (c) 1997 Ken Stailey
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\" 3. The name of the author may not be used to endorse or promote products
14 .\"    derived from this software without specific prior written permission
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 .\"
27 .\" $FreeBSD: head/usr.bin/gencat/gencat.1 213573 2010-10-08 12:40:16Z uqs $
28 .\"
29 .Dd June 11, 1997
30 .Dt GENCAT 1
31 .Os
32 .Sh NAME
33 .Nm gencat
34 .Nd NLS catalog compiler
35 .Sh SYNOPSIS
36 .Nm
37 .Ar "output-file"
38 .Ar "input-files..."
39 .Sh DESCRIPTION
40 The
41 .Nm
42 utility merges the text NLS input files
43 .Ar "input-files..."
44 into a formatted message catalog file
45 .Ar "output-file" .
46 The file
47 .Ar "output-file"
48 will be created if it does not already exist.
49 If
50 .Ar "output-file"
51 does exist, its messages will be included in the new
52 .Ar "output-file" .
53 If set and message numbers collide, the new message text defined in
54 .Ar "input-files..."
55 will replace the old message text currently contained in
56 .Ar "output-file" .
57 .Sh INPUT FILES
58 The format of a message text source file is defined below.
59 Note that
60 the fields of a message text source line are separated by a single space
61 character: any other space characters are considered to be part of the
62 field contents.
63 .Bl -tag -width 3n
64 .It Li $set Ar n comment
65 This line specifies the set identifier of the following messages until
66 the next
67 .Li $set
68 or end-of-file appears.
69 The argument
70 .Ar n
71 is the set identifier which is defined as a number in the range
72 [1, (NL_SETMAX)].
73 Set identifiers must occur in ascending order within
74 a single source file, but need not be contiguous.
75 Any string following
76 a space following the set identifier is treated as a comment.
77 If no
78 .Li $set
79 directive is specified in a given source file, all messages will
80 be located in the default message set NL_SETD.
81 .It Li $del Ar n comment
82 This line deletes messages from set
83 .Ar n
84 from a message catalog.
85 The
86 .Ar n
87 specifies a set number.
88 Any string following a space following the set
89 number is treated as a comment.
90 .It Li $ Ar comment
91 A line beginning with
92 .Li $
93 followed by a space is treated as a comment.
94 .It Ar m message-text
95 A message line consists of a message identifier
96 .Ar m
97 in the range [1, (NL_MSGMAX)].
98 The
99 .Ar message-text
100 is stored in the message catalog with the set identifier specified by
101 the last
102 .Li $set
103 directive, and the message identifier
104 .Ar m .
105 If the
106 .Ar message-text
107 is empty, and there is a space character following the message identifier,
108 an empty string is stored in the message catalog.
109 If the
110 .Ar message-text
111 is empty, and if there is no space character following the message
112 identifier, then the existing message in the current set with the
113 specified message identifier is deleted from the catalog.
114 Message
115 identifiers must be in ascending order within a single set, but
116 need not be contiguous.
117 The
118 .Ar message-text
119 length must be in the range [0, (NL_TEXTMAX)].
120 .It Li $quote Ar c
121 This line specifies an optional quote character
122 .Ar c
123 which can be used to surround
124 .Ar message-text
125 so that trailing space or empty messages are visible in message
126 source files.
127 By default, or if an empty
128 .Li $quote
129 directive is specified, no quoting of
130 .Ar message-text
131 will be recognized.
132 .El
133 .Pp
134 Empty lines in message source files are ignored.
135 The effect of lines
136 beginning with any character other than those described above is
137 undefined.
138 .Pp
139 Text strings can contain the following special characters and escape
140 sequences.
141 In addition, if a quote character is defined, it may be
142 escaped as well to embed a literal quote character.
143 .Pp
144 .Bl -tag -width "\eooo" -offset indent -compact
145 .It Li \en
146 line feed
147 .It Li \et
148 horizontal tab
149 .It Li \ev
150 vertical tab
151 .It Li \eb
152 backspace
153 .It Li \er
154 carriage return
155 .It Li \ef
156 form feed
157 .It Li \e\e
158 backslash
159 .It Li \eooo
160 octal number in the range [000, 377]
161 .El
162 .Pp
163 A backslash character immediately before the end of the line in a file
164 is used to continue the line onto the next line, e.g.:
165 .Pp
166 .Dl 1 This line is continued \e
167 .Dl on this line.
168 .Pp
169 If the character following the backslash is not one of those specified,
170 the backslash is ignored.
171 .Sh EXIT STATUS
172 .Ex -std
173 .Sh SEE ALSO
174 .Xr catclose 3 ,
175 .Xr catgets 3 ,
176 .Xr catopen 3
177 .Sh STANDARDS
178 The
179 .Nm
180 utility is compliant with the
181 .St -xpg4
182 standard.
183 .Sh AUTHORS
184 .An -nosplit
185 This manual page was originally written by
186 .An Ken Stailey
187 and later revised by
188 .An Terry Lambert .
189 .Sh BUGS
190 A message catalog file created from a blank input file cannot be revised;
191 it must be deleted and recreated.