Compiling and Linking
There are no special requirements for compiling and linking. All messaging
routines are in standard libraries and will be linked with the usual compile/link
commands.
Creating a New Message Catalog
Creating a message catalog is a two step process:
1. Create the message text source file.
2. Use gencat to generate a message catalog from the message text source file.
gencat( )
Message
Source File
(Text )
Q
Message
Catalog
(Binary )
Figure 7-3. Using gencat () to Generate Message Catalog
The Message Text Source File
A message text source file contains the messages from the source program.
Each message is numbered with the message number used in the corresponding
catgets call.
A simple message catalog text file might be:
$ Comment:
a simple message text source file
1 text. for message 1
2 text for message 2
A message consists of a message number followed by a single space or tab
followed by the message text and terminated by a new-line. The message text
is a
C
string, including spaces, tabs and \ (backslash) escapes, but without
surrounding quotes. Message numbers are unsigned integers and must be in
ascending order but need not be consecutive. A line beginning with $ followed
by a single space or tab is treated as a comment. Note that comments in
the message text source file are not saved in the message catalog created by
gencat.
The Message Catalog System 7-9
7