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