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