d9d366161c0620cc67b9f9eb2fe94c33ac89cdea
[games.git] / usr.bin / gencat / gencat.1
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
18 The
19 .Nm
20 command reads one or more files containing message strings that will
21 be displayed using the
22 .Xr catgets 3
23 library call.
24 From these files it generates a message catalog which
25 is loaded dynamically by the Native Language Support (NLS) library at run time.
26 .Pp
27 The message description files are text files in the format described below.
28 .Pp
29 The message catalog file is a binary file.
30 If it already exists, it will be truncated when
31 .Nm
32 is run.
33 .Pp
34 Error messages are grouped into sets, and a program can load a
35 particular set depending on which type, or language, of messages
36 is desired.
37 .Sh MESSAGE FILE FORMAT
38 Empty lines and leading blanks are ignored.
39 .Bl -tag -width "NN message"
40 .It Em "$set NN"
41 Determines the set to be used for all subsequent messages.
42 .Ar "NN"
43 is an integer greater than 0.
44 .It Em "$delset NN"
45 Removes a set from the catalog.
46 .Ar "NN"
47 is an integer greater than 0.
48 .Pp
49 If a set was created earlier in the
50 current file, or in a file previously read by the
51 .Nm
52 command, this command will remove it.
53 .It Em "$quote C"
54 Sets a quote character to be used around the messages.
55 .Ar "C"
56 may be any character other than white space.
57 .Pp
58 If this is specified, then messages must begin and end with the
59 quote character.
60 By default no quote character is used.
61 If none is specified, then the current quote character is unset.
62 This is useful when messages must contain leading white space.
63 .It Em "NN message"
64 Defines a message.
65 .Ar "NN"
66 is an integer greater than 0.
67 .Pp
68 The message is read until the end of the line or a quote character (if one is
69 specified).
70 If no message is provided, the message with the number
71 .Ar "NN"
72 is removed from the catalog.
73 If no "set" has been created, this command generates an error.
74 .El
75 .Pp
76 Messages may contain any characters, however the "\\"
77 is special as an escape character, where the following instances
78 are 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
101 The Native Language Support (NLS) message catalog facility was
102 contributed by
103 .An J.T. Conklin
104 .Aq jtc@NetBSD.org .
105 This page was written by
106 .An Kee Hinckley
107 .Aq nazgul@somewhere.com .