Merge commit '008b34be09d7b9c3e7a18d3ce9ef8b5c4f4ff8b8'
[unleashed.git] / share / man / man1 / gencat.1
blob5796f44080fe78f7c6d32f5fefd41b2d221b7091
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright 1989 AT&T
44 .\" Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
45 .\" Copyright (c) 1995, Sun Microsystems, Inc.  All Rights Reserved.
46 .\"
47 .TH GENCAT 1 "Feb 1, 1995"
48 .SH NAME
49 gencat \- generate a formatted message catalog
50 .SH SYNOPSIS
51 .LP
52 .nf
53 \fBgencat\fR \fIcatfile\fR \fImsgfile\fR...
54 .fi
56 .SH DESCRIPTION
57 .sp
58 .LP
59 The \fBgencat\fR command merges the message text source file(s) \fImsgfile\fR
60 into a formatted message database \fIcatfile\fR. The database \fIcatfile\fR is
61 created if it does not already exist.  If \fIcatfile\fR does exist, its
62 messages are included in the new \fIcatfile\fR. If set and message numbers
63 collide, the new message-text defined in \fImsgfile\fR replaces the old message
64 text currently contained in \fIcatfile\fR. The message text source file (or set
65 of files) input to \fBgencat\fR can contain either set and message numbers or
66 simply message numbers, in which case the set \fBNL_SETD\fR (see
67 \fBnl_types.h\fR(3HEAD)) is assumed.
68 .SS "Message Text Source File Format"
69 .sp
70 .LP
71 The format of a message text source file is defined as follows. Note that the
72 fields of a message text source line are separated by a single \fBASCII\fR
73 space or tab character. Any other \fBASCII\fR spaces or tabs are considered as
74 part of the subsequent field.
75 .sp
76 .ne 2
77 .na
78 \fB\fB$set\fR \fIn comment\fR \fR
79 .ad
80 .RS 22n
81 Where \fIn\fR specifies the set identifier of the following messages until the
82 next \fB$set\fR, \fB$delset\fR, or end-of-file appears. \fIn\fR must be a
83 number in the range (\fB1\fR-{\fBNL_SETMAX\fR}). Set identifiers within a
84 single source file need not be contiguous. Any string following the set
85 identifier is treated as a comment.  If no \fB$set\fR directive is specified in
86 a message text source file, all messages are located in the default message set
87 \fBNL_SETD\fR.
88 .RE
90 .sp
91 .ne 2
92 .na
93 \fB\fB$delset\fR \fIn comment\fR \fR
94 .ad
95 .RS 22n
96 Deletes message set \fIn\fR from an existing message catalog. Any string
97 following the set number is treated as a comment. (\fBNote:\fR if  \fIn\fR is
98 not a valid set it is ignored.)
99 .RE
102 .ne 2
104 \fB\fB$\fR\fIcomment\fR \fR
106 .RS 22n
107 A line beginning with a dollar symbol  \fB$\fR followed by an \fBASCII\fR space
108 or tab character is treated as a comment.
112 .ne 2
114 \fB\fIm\fR \fImessage-text\fR \fR
116 .RS 22n
117 The \fIm\fR denotes the message identifier, a number in the range
118 (\fB1\fR-{\fBNL_MSGMAX\fR}).  The \fImessage-text\fR is stored in the message
119 catalog with the set identifier specified by the last \fB$set\fR directive, and
120 with message identifier \fIm\fR. If the \fImessage-text\fR is empty, and an
121 \fBASCII\fR space or tab field separator is present, an empty string is stored
122 in the message catalog.  If a message source line has a message number, but
123 neither a field separator nor \fImessage-text\fR, the existing message with
124 that number (if any) is deleted from the catalog. Message identifiers need not
125 be contiguous.  The length of \fImessage-text\fR must be in the range
126 (\fB0\fR-{\fBNL_TEXTMAX\fR}).
130 .ne 2
132 \fB\fB$quote\fR \fIc\fR \fR
134 .RS 22n
135 This line specifies an optional quote character \fIc\fR, which can be used to
136 surround \fImessage-text\fR so that trailing spaces or null (empty) messages
137 are visible in a message source line.  By default, or if an empty \fB$quote\fR
138 directive is supplied, no quoting of \fImessage-text\fR will be recognized.
143 Empty lines in a message text source file are ignored.
146 Text strings can contain the special characters and escape sequences defined in
147 the following table:
152 box;
153 l l l
154 l l l .
155 Description     Symbol  Sequence
156 newline NL(LF)  \en
157 horizontal tab  HT      \et
158 vertical tab    VT      \ev
159 backspace       BS      \eb
160 carriage return CR      \er
161 form feed       FF      \ef
162 backslash       \e      \e\e
163 bit pattern     ddd     \eddd
168 The escape sequence \fB\e\fR\fIddd\fR consists of backslash followed by 1, 2 or
169 3 octal digits, which are taken to specify the value of the desired character.
170 If the character following a backslash is not one of those specified, the
171 backslash is ignored.
174 Backslash followed by an \fBASCII\fR newline character is also used to continue
175 a string on the following line. Thus, the following two lines describe a single
176 message string:
178 .in +2
180 1 This line continues \e
181 to the next line
183 .in -2
187 which is equivalent to:
189 .in +2
191     1 This line continues to the next line
193 .in -2
195 .SH OPERANDS
198 The following operands are supported:
200 .ne 2
202 \fB\fIcatfile\fR \fR
204 .RS 12n
205 A path name of the formatted message catalog. If \(mi is specified, standard
206 output is used.
210 .ne 2
212 \fB\fImsgfile\fR \fR
214 .RS 12n
215 A path name of a message text source file. If \(mi is specified for an instance
216 of \fImsgfile\fR, standard input is used. The format of message text source
217 files is defined in \fBMessage Text Source File Format\fR.
220 .SH ENVIRONMENT VARIABLES
223 See \fBenviron\fR(5) for descriptions of the following environment variables
224 that affect the execution of \fBgencat\fR: \fBLANG\fR, \fBLC_ALL\fR,
225 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
226 .SH EXIT STATUS
229 The following exit values are returned:
231 .ne 2
233 \fB\fB0\fR \fR
235 .RS 7n
236 Successful completion.
240 .ne 2
242 \fB\fB>0\fR \fR
244 .RS 7n
245 An error occurred.
248 .SH ATTRIBUTES
251 See \fBattributes\fR(5) for descriptions of the following attributes:
256 box;
257 c | c
258 l | l .
259 ATTRIBUTE TYPE  ATTRIBUTE VALUE
261 CSI     enabled
263 Interface Stability     Standard
266 .SH SEE ALSO
269 \fBmkmsgs\fR(1), \fBcatgets\fR(3C), \fBcatopen\fR(3C), \fBgettxt\fR(3C),
270 \fBnl_types.h\fR(3HEAD), \fBattributes\fR(5), \fBenviron\fR(5),
271 \fBstandards\fR(5)