mkcatdefs.1 (2010 09)

m
mkcatdefs(1) mkcatdefs(1)
Note that mkcatdefs also created the symbol MF_SYMB by prepending MF_ to catname using upper-
case letters. The
mkcatdefs command assumes that the name of the generated catalog should be
catname .cat, and generates this symbol for your use with the
catopen function.
Because this include file contains include statements for limits.h and nl_types.h, you do not need to expli-
citly include these files in your application program. (The nl_types.h header file defines special data
types required by the message facility routines.)
The following set of examples shows how to enable and use symbolic identifiers for sets, messages, and
default message strings. The message source file PFF.src used for this set of examples contains the fol-
lowing lines:
$quote "
$set INFO
GREET "Welcome to the Fact Finder program!\n"
BYE "Good-bye. Please come again.\n"
ENTER "Please enter the type of product \
you are interested in: "
$set RESULTS
NADA "Sorry, we have no information on that \
kind of product.\n"
FOUND "The following products were found: "
$set PROBLEMS
SERVCONN "Cannot connect to server. Try again later.\n"
BUSYDAY "Still searching. Please wait...\n"
The following command creates a message catalog that includes a .sh file that can be executed in a
POSIX, Bourne, or Korn shell script to define symbolic identifiers for default message strings:
% mkcatdefs -h -m -e sh PFF PFF.src | gencat PFF.cat -
mkcatdefs: PFF_msg.h is created.
mkcatdefs: PFF_msg.sh is created.
The following command creates an include file for use in program source code, as well as a copy of the
preprocessed source code that was input directly to the
gencat command in the preceding example:
% mkcatdefs -m -e h PFF PFF.src > PFF.msg
mkcatdefs: PFF_msg.h is created
The following
cat and dspcat commands show what is included in the .sh, .h, and message catalog files
created from these commands:
% cat PFF_msg.sh
#
# Default messages generated from PFF.src
#
DEF_GREET=’Welcome to the Product Fact Finder program!\n’
DEF_BYE=’Good-bye. Please come again.\n’
DEF_ENTER=’Please enter the type of product you are interested in: ’
DEF_NADA=’Sorry, we have no information on that kind of product.\n’
DEF_FOUND=’The following products were found: ’
DEF_SERVCONN=’Cannot connect to server. Try again later.\n’
DEF_BUSYDAY=’Still searching. Please wait...\n’
% cat PFF_msg.h
#ifndef _H_PFF_MSG
#define _H_PFF_MSG
#include <limits.h>
#include <nl_types.h>
#define MF_PFF "PFF"
/* The following was generated from PFF.src. */
/* definitions for set INFO */
#define INFO 1
4 Hewlett-Packard Company 4 HP-UX 11i Version 3: September 2010