Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)
User Commands (m - o) mkcatdefs(1)
2. Assume that the preceding file is named symb.src. It can be processed with mkcatdefs
as follows:
$ mkcatdefs symb symb.src >symb.msg
The following source is created:
$quote "Use a double quotation mark to delimit message text
$delset 1
$set 1
1 "Symbolic identifiers can contain only letters \
and digits and the _ (underscore character)\n"
5 "You can mix symbolic identifiers and numbers \n"
$quote
6 Remember to include the "_msg.h" file in your program\n
Note that the assigned message numbers are noncontiguous because the source contained
a specific number. The mkcatdefs utility always assigns the previous number plus 1 to a
symbolic identifier.
The generated symb_msg.h file is:
#ifndef _H_SYMB_MSG
#define _H_SYMB_MSG
#include <limits.h>
#include <nl_types.h>
#define MF_SYMB "symb.cat"
/* The following was generated from symb.src. */
/* definitions for set MSFAC */
#define MSFAC 1
#define SYM_FORM 1
#define MSG_H 6
#endif
Note that mkcatdefs also created a symbol MF_SYMB by adding MF_ to the catname
using uppercase letters. In this example, mkcatdefs used the name of the generated cata-
log (symb.cat) and generated this symbol for use with catopen.
Because this file includes limits.h and nl_types.h, you do not need to include them in
your application program. (nl_types defines special data types required by the message
facility routines.)
NOTES
Symbolic references are not defined by XPG4, but are an OSS extension, allowing a convenient
input source for both the message catalog and the program’s header file.
DIAGNOSTICS
The mkcatdefs utility generates these error messages:
Usage: mkcatdefs catname msg_file [msg_file...] [-h]\n
The following message is displayed if catname is greater than FILENAME_MAX - 7 charac-
ters:
mkcatdefs: catname too long\n
527188-021 Hewlett-Packard Company 6−15