xref: /dragonfly/usr.bin/gencat/gencat.1 (revision c3b249e6)
1.\" $NetBSD: src/usr.bin/gencat/gencat.1,v 1.8 2003/05/02 08:35:42 gmcgarry Exp $
2.\" $DragonFly: src/usr.bin/gencat/gencat.1,v 1.6 2008/05/02 02:05:07 swildner Exp $
3.\"
4.\" Written by Kee Hinckley <nazgul@somewhere.com>
5.\"
6.Dd April 29, 1999
7.Os
8.Dt GENCAT 1
9.Sh NAME
10.Nm gencat
11.Nd generates a Native Language Support (NLS) message catalog file
12.Sh SYNOPSIS
13.Nm
14.Ar catalog-file
15.Ar message-file
16.Op Ar message-file ...
17.Sh DESCRIPTION
18The
19.Nm
20command reads one or more files containing message strings that will
21be displayed using the
22.Xr catgets 3
23library call.
24From these files it generates a message catalog which
25is loaded dynamically by the Native Language Support (NLS) library at run time.
26.Pp
27The message description files are text files in the format described below.
28.Pp
29The message catalog file is a binary file.
30If it already exists, it will be truncated when
31.Nm
32is run.
33.Pp
34Error messages are grouped into sets, and a program can load a
35particular set depending on which type, or language, of messages
36is desired.
37.Sh MESSAGE FILE FORMAT
38Empty lines and leading blanks are ignored.
39.Bl -tag -width "NN message"
40.It Em "$set NN"
41Determines the set to be used for all subsequent messages.
42.Ar "NN"
43is an integer greater than 0.
44.It Em "$delset NN"
45Removes a set from the catalog.
46.Ar "NN"
47is an integer greater than 0.
48.Pp
49If a set was created earlier in the
50current file, or in a file previously read by the
51.Nm
52command, this command will remove it.
53.It Em "$quote C"
54Sets a quote character to be used around the messages.
55.Ar "C"
56may be any character other than white space.
57.Pp
58If this is specified, then messages must begin and end with the
59quote character.
60By default no quote character is used.
61If none is specified, then the current quote character is unset.
62This is useful when messages must contain leading white space.
63.It Em "NN message"
64Defines a message.
65.Ar "NN"
66is an integer greater than 0.
67.Pp
68The message is read until the end of the line or a quote character (if one is
69specified).
70If no message is provided, the message with the number
71.Ar "NN"
72is removed from the catalog.
73If no "set" has been created, this command generates an error.
74.El
75.Pp
76Messages may contain any characters, however the "\\"
77is special as an escape character, where the following instances
78are allowed:
79.Bd -literal -offset indent
80\&\\\\	Generates a single backslash.
81\&\\n	Generates a newline (as defined by the C compiler).
82\&\\t	Generates a tab (as defined by the C compiler).
83\&\\v	Generates a vertical tab (as defined by the C compiler).
84\&\\b	Generates a backspace (as defined by the C compiler).
85\&\\r	Generates a carriage return (as defined by the C compiler).
86\&\\f	Generates a form feed (as defined by the C compiler).
87\&\\NNN	Generates the character corresponding to the specified
88	octal number.
89\&\\EOL	A backslash at the end of line continues the message onto
90	the next line.
91\&\\quote	A backslash preceding the current quote character generates
92	the quote character.
93.Ed
94.Sh SEE ALSO
95.Xr catclose 3 ,
96.Xr catgets 3 ,
97.Xr catopen 3 ,
98.Xr nls 7
99.Sh AUTHORS
100.An -nosplit
101The Native Language Support (NLS) message catalog facility was
102contributed by
103.An J.T. Conklin
104.Aq jtc@NetBSD.org .
105This page was written by
106.An Kee Hinckley
107.Aq nazgul@somewhere.com .
108