xref: /netbsd-src/usr.bin/gencat/gencat.1 (revision 9fbd88883c38d0c0fbfcbe66d76fe6b0fab3f9de)
1.\" $NetBSD: gencat.1,v 1.4 2001/06/05 11:46:20 wiz 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 an 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 NLS library at run time.
26The message description files are text files in the format described below.
27The message catalog file is a binary file.
28If it already exists, it will be truncated when
29.Nm
30is run.
31.Pp
32Error messages are grouped into sets, and a program can load a
33particular set depending on which type, or language, of messages
34is desired.
35.Pp
36The
37.Fl \&?
38option flag prints the usage message.
39.Sh MESSAGE FILE FORMAT
40Empty lines and leading blanks are ignored.
41.Bl -tag -width "NN message"
42.It Em "$set NN"
43Determines the set to be used for all subsequent messages.
44.Ar "NN"
45is an integer greater than 0.
46.It Em "$delset NN"
47Removes a set from the catalog.
48.Ar "NN"
49is an integer greater than 0.
50.Pp
51If a set was created earlier in the
52current file, or in a file previously read by the
53.Nm
54command, this command will remove it.
55.It Em "$quote C"
56Sets a quote character to be used around the messages.
57.Ar "C"
58may be any character other than white space.
59.Pp
60If this is specified, then messages must begin and end with the
61quote character.
62By default no quote character is used.
63If none is specified, then the current quote character is unset.
64This is useful when messages must contain leading white space.
65.It Em "NN message"
66Defines a message.
67.Ar "NN"
68is an integer greater than 0.
69.Pp
70The message is read until the end of the line or a quote character (if one is
71specified).
72If no message is provided, the message with the number
73.Ar "NN"
74is removed from the catalog.
75If no "set" has been created, this command generates an error.
76.El
77.Pp
78Messages may contain any characters, however the "\\"
79is special as an escape character, where the following instances
80are allowed:
81.Pp
82.Bd -literal -offset indent
83\&\\\\	Generates a single backslash.
84\&\\n	Generates a newline (as defined by the C compiler).
85\&\\t	Generates a tab (as defined by the C compiler).
86\&\\v	Generates a vertical tab (as defined by the C compiler).
87\&\\b	Generates a backspace (as defined by the C compiler).
88\&\\r	Generates a carriage return (as defined by the C compiler).
89\&\\f	Generates a form feed (as defined by the C compiler).
90\&\\NNN	Generates the character corresponding to the specified
91	octal number.
92\&\\EOL	A backslash at the end of line continues the message onto
93	the next line.
94\&\\quote	A backslash preceding the current quote character generates
95	the quote character.
96.Ed
97.Sh SEE ALSO
98.Xr catgets 3
99.Sh AUTHORS
100Kee Hinckley
101.Aq nazgul@somewhere.com
102