xref: /netbsd/usr.bin/gencat/gencat.1 (revision bf9ec67e)
1.\" $NetBSD: gencat.1,v 1.5 2002/02/03 09:31:36 fair Exp $
2.\"
3.\" Written by Kee Hinckley <nazgul@somewhere.com>
4.\"
5.Dd April 29, 1999
6.Os
7.Dt GENCAT 1
8.Sh NAME
9.Nm gencat
10.Nd generates a Native Language Support (NLS) message catalog file
11.Sh SYNOPSIS
12.Nm
13.Op Fl \&?
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.Pp
38The
39.Fl \&?
40option flag prints the usage message.
41.Sh MESSAGE FILE FORMAT
42Empty lines and leading blanks are ignored.
43.Bl -tag -width "NN message"
44.It Em "$set NN"
45Determines the set to be used for all subsequent messages.
46.Ar "NN"
47is an integer greater than 0.
48.It Em "$delset NN"
49Removes a set from the catalog.
50.Ar "NN"
51is an integer greater than 0.
52.Pp
53If a set was created earlier in the
54current file, or in a file previously read by the
55.Nm
56command, this command will remove it.
57.It Em "$quote C"
58Sets a quote character to be used around the messages.
59.Ar "C"
60may be any character other than white space.
61.Pp
62If this is specified, then messages must begin and end with the
63quote character.
64By default no quote character is used.
65If none is specified, then the current quote character is unset.
66This is useful when messages must contain leading white space.
67.It Em "NN message"
68Defines a message.
69.Ar "NN"
70is an integer greater than 0.
71.Pp
72The message is read until the end of the line or a quote character (if one is
73specified).
74If no message is provided, the message with the number
75.Ar "NN"
76is removed from the catalog.
77If no "set" has been created, this command generates an error.
78.El
79.Pp
80Messages may contain any characters, however the "\\"
81is special as an escape character, where the following instances
82are allowed:
83.Pp
84.Bd -literal -offset indent
85\&\\\\	Generates a single backslash.
86\&\\n	Generates a newline (as defined by the C compiler).
87\&\\t	Generates a tab (as defined by the C compiler).
88\&\\v	Generates a vertical tab (as defined by the C compiler).
89\&\\b	Generates a backspace (as defined by the C compiler).
90\&\\r	Generates a carriage return (as defined by the C compiler).
91\&\\f	Generates a form feed (as defined by the C compiler).
92\&\\NNN	Generates the character corresponding to the specified
93	octal number.
94\&\\EOL	A backslash at the end of line continues the message onto
95	the next line.
96\&\\quote	A backslash preceding the current quote character generates
97	the quote character.
98.Ed
99.Sh SEE ALSO
100.Xr catgets 3
101.Sh AUTHORS
102Kee Hinckley
103.Aq nazgul@somewhere.com
104