xref: /openbsd-src/usr.bin/gencat/gencat.1 (revision f2da64fbbbf1b03f09f390ab01267c93dfd77c4c)
1.\"	$OpenBSD: gencat.1,v 1.20 2015/11/01 21:26:48 jmc 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.\"	$Id: gencat.1,v 1.20 2015/11/01 21:26:48 jmc Exp $
28.\"
29.Dd $Mdocdate: November 1 2015 $
30.Dt GENCAT 1
31.Os
32.Sh NAME
33.Nm gencat
34.Nd NLS catalog compiler
35.Sh SYNOPSIS
36.Nm gencat
37.Ar catfile msgfile ...
38.Sh DESCRIPTION
39The
40.Nm
41utility merges the text NLS (National Language Support) in
42.Ar msgfile
43into a formatted message catalog file
44.Ar catfile .
45The file
46.Ar catfile
47will be created if it does not already exist.
48If
49.Ar catfile
50does exist, its messages will be included in the new
51.Ar catfile .
52If set and message numbers collide, the new message text defined in
53.Ar msgfile
54will replace the old message text currently contained in
55.Ar catfile .
56.Sh INPUT FILES
57The format of a message text source file is defined below.
58Note that the fields of a message text source line are separated by a
59single space character; any other space characters are considered to be
60part of the field contents.
61.Bl -tag -width Ds
62.It Li $set Ar n comment
63This line specifies the set identifier of the following messages until
64the next
65.Li $set
66or end-of-file appears.
67The argument
68.Ar n
69is the set identifier which is defined as a number in the range
70.Bo 1 ,
71.Dv NL_SETMAX Bc .
72Set identifiers must occur in ascending order within
73a single source file, but need not be contiguous.
74Any string following
75a space following the set identifier is treated as a comment.
76If no
77.Li $set
78directive is specified in a given source file, all messages will
79be located in the default message set
80.Dv NL_SETD .
81.It Li $delset Ar n comment
82This line deletes messages from set
83.Ar n
84from a message catalog.
85The
86.Ar n
87specifies a set number.
88Any string following a space following the set
89number is treated as a comment.
90.It Li $ Ar comment
91A line beginning with
92.Li $
93followed by a space is treated as a comment.
94.It Ar m message-text
95A message line consists of a message identifier
96.Ar m
97in the range
98.Bo 1 ,
99.Dv NL_MSGMAX Bc .
100The
101.Ar message-text
102is stored in the message catalog with the set identifier specified by
103the last
104.Li $set
105directive, and the message identifier
106.Ar m .
107If the
108.Ar message-text
109is empty, and there is a space character following the message identifier,
110an empty string is stored in the message catalog.
111If the
112.Ar message-text
113is empty, and if there is no space character following the message
114identifier, then the existing message in the current set with the
115specified message identifier is deleted from the catalog.
116Message identifiers must be in ascending order within a single set, but
117need not be contiguous.
118The
119.Ar message-text
120length must be in the range
121.Bo 0 ,
122.Dv NL_TEXTMAX Bc .
123.It Li $quote Ar c
124This line specifies an optional quote character
125.Ar c
126which can be used to surround
127.Ar message-text
128so that trailing space or empty messages are visible in message
129source files.
130By default, or if an empty
131.Li $quote
132directive is specified, no quoting of
133.Ar message-text
134will be recognized.
135.El
136.Pp
137Empty lines in message source files are ignored.
138The effect of lines beginning with any character other than those
139described above is undefined.
140.Pp
141Text strings can contain the following special characters and escape
142sequences.
143In addition, if a quote character is defined, it may be
144escaped as well to embed a literal quote character.
145.Pp
146.Bl -tag -width Ds -offset indent -compact
147.It Li \en
148line feed
149.It Li \et
150horizontal tab
151.It Li \ev
152vertical tab
153.It Li \eb
154backspace
155.It Li \er
156carriage return
157.It Li \ef
158form feed
159.It Li \e\e
160backslash
161.It Li \eooo
162octal number in the range [000, 377]
163.El
164.Pp
165A backslash character immediately before the end of the line in a file
166is used to continue the line onto the next line, e.g.,
167.Pp
168.Dl 1 This line is continued \e
169.Dl on this line.
170.Pp
171If the character following the backslash is not one of those specified,
172the backslash is ignored.
173.Sh EXIT STATUS
174.Ex -std gencat
175.Sh SEE ALSO
176.Xr catclose 3 ,
177.Xr catgets 3 ,
178.Xr catopen 3
179.Sh STANDARDS
180The
181.Nm
182utility is compliant with the
183.St -p1003.1-2008
184specification.
185.Sh AUTHORS
186.An -nosplit
187This manual page by
188.An Ken Stailey
189updated and revised by
190.An Terry Lambert .
191.Sh BUGS
192A message catalog file created from a blank input file cannot be revised;
193it must be deleted and recreated.
194