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