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