1 .TH GENCAT 1 "15 August 1994"
3 gencat \- generate a message catalog from a set of message files
5 .B gencat [-new] [-lang C|C++|ANSIC] catfile msgfile [-h <header-file>]
8 is the software used to compile message files into message
9 catalogs. It can also be used to generate a header file from the message files
10 which can then be included in the original source code. The benefit of including this
12 generated header file is that it allows the programmer to use
13 descriptive names to refer to messages and message sets instead of hard to remember
14 integer numbers. However its chief purpose is in compiling message files into
15 message catalogs. The command line switches it understands are detailed below:
19 Erase the messageg catalog and start a new one.
20 The default behavior is to update the catalog with the
21 specified message file(s). This will instead cause the old
22 one to be deleted and a whole new one started.
25 This governs the form of the include file.
26 Currently supported is C, C++ and ANSIC. The latter two are
27 identical in output. This argument is position dependent,
28 you can switch the language back and forth in between
29 include files if you care to.
32 Output identifiers to the specified header files.
33 This creates a header file with all of the appropriate
34 #define's in it. Without this it would be up to you to
35 ensure that you keep your code in sync with the catalog file.
36 The header file is created from all of the previous message files
37 on the command line, so the order of the command line is
38 important. This means that if you just put it at the end of
39 the command line, all the defines will go in one file
41 .B gencat foo.m bar.m zap.m -h all.h
43 If you prefer to keep your dependencies down you can specify
44 one after each message file, and each .h file will receive
45 only the identifiers from the previous message file
47 .B gencat foo.m -h foo.h bar.m -h bar.h zap.m -h zap.h
49 As an added bonus, if you run the following sequence:
51 .B gencat foo.m -h foo.h
53 the file foo.h will NOT be modified the second time.
55 checks to see if the contents have changed before modifying
56 things. This means that you won't get spurious rebuilds of
57 your source every time you change a message. You can thus use
58 a Makefile rule such as:
63 MSGFILES = messages/English
65 $(MSGFILES): $(MSGSRC)
66 @for i in $?; do cmd="$(GENCAT) $(GENFLAGS) $@ $$i -h `basename $$i .m`.H"; echo $$cmd; $$cmd; done
70 The for-loop isn't too pretty, but it works. For each .m
71 file that has changed we run
73 on it. foo.o depends on
76 (foo.h) but foo.h won't actually
77 be modified unless we changed the order (or added new members)
84 software has two purposes and is usually used in 2 passes.
85 The first use is to generate the header files from the message files so
86 that the software can use descriptive names when referring to
89 The following command will accomplish this:
92 .B gencat -new /dev/null foobar.m -h foobar-nls.h
97 software will take the foobar.m message file and produce a
98 header file called foobar-nls.h which can the be included in the
99 software. The -new and /dev/null flags indicate that
102 generate a new message catalog but send the resultant catalog to the bit
105 software doesn't work without these two entries).
107 If you want to generate multiple header files for multiple message
108 files, you have to use the following command:
110 .B gencat -new /dev/null aaa.m -h aaa-nls.h bbb.m -h bbb-nls.m ....
112 This will generate a header file for each message file. For each
113 message set that your software accesses, you will need to include the
114 corresponding header file. If you would like to compile just one
115 solitary header file for all your message sets, the following command
118 .B gencat -new /dev/null aaa.m bbb.m ccc.m -h foobar-nls.m
120 The other use for the
122 software is in generating message catalogs
123 from the message files. To generate a new message catalog, the
124 following command can be used:
127 .B gencat -new foobar.cat foobar.m
130 This will take the foobar.m message file and compile it into a message
131 catalog called foobar.cat. To compile multiple message sets into one
132 catalog, the following command can be used:
134 .B gencat -new foobar.cat foobar1.m foobar2.m foobar3.m ...
136 The usual way for compiling message catalogs is via a Makefile. In this
137 case, it is often easier to define a variable (say, MESSAGEFILES) to
138 contain the list of message files which need to be compiled into a
139 catalog. eg, in the above example we would have a line within the
142 .B MESSAGEFILES = foobar1.m foobar2.m foobar3.m ....
144 Then to compile these files into a catalog, we use the following line
148 .B gencat -new foobar.cat $(MESSAGEFILES)