HP-UX Reference (11i v3 07/02) - 1 User Commands A-M (vol 1)

m
mkcatdefs(1) mkcatdefs(1)
NAME
mkcatdefs - preprocess a message source file
SYNOPSIS
mkcatdefs [-h][-m
[-p prefix][-e extension]] catname source_file...
DESCRIPTION
The
mkcatdefs command preprocesses a message source file to do one or more of the following opera-
tions. These operations ease maintenance of compilable programs, scripts, or both:
Convert symbolic identifiers for message sets and messages into numeric constants required by the
gencat command. The gencat command creates the catname.cat file accessed by the
cato-
pen()
, catgets() , and catclose() functions and by the
dspmsg utility.
Create a catname_msg.h file that defines macros to map symbolic identifiers to corresponding numeric
constants in the .cat file. Program source code that specifies an include statement for catname_msg.h
can therefore use symbolic identifiers rather than numeric constants to identify the messages to be
retrieved from the message catalog.
If the
-m option is specified with -e h, the header file also contains macros that define symbolic
identifiers for default message strings. A call to the catgets() function or execution of the
dspmsg command in a program should include a default message string to be printed if a message
catalog cannot be found or opened for the locale in which the program is running. When the
catname_msg.h file includes macros for default message strings, program source code can include an
identifier for the default message string in the catgets() call or in an execution call for the
dspmsg utility. This practice helps prevent unintentional inconsistencies between a message string
in the message source file and the same string specified in program calls.
Create an include file, similar to catname_msg.h, but for use in scripts rather than programs. If
-e
sh
is specified, the include file is named catname_msg.sh and can be included in a script that executes
in the POSIX, Bourne, or Korn shell. If -e csh is specified, the include file is named
catname_msg.csh and can be included in a script that executes in the C shell.
Include files for scripts define variables only for the default message strings to be displayed when a
catalog is not found or cannot be opened.
See gencat(1) for a description of fundamental rules that govern the format of a message source file. The
only difference between gencat and mkcatdefs is that with gencat you must input a number to iden-
tify each message set and message, while mkcatdefs accepts either a number or a symbolic name.
Options
-e extension If the -m option is also specified, identifies the type of include file to contain the
default message strings and their symbolic identifiers. The value for extension can be
one of the following:
h Generate macros into a catname_msg.h file. (Default)
sh Generate variable assignments into a catname_msg.sh le. This file can be
included by POSIX, Bourne, and Korn shell scripts for use with the dspmsg
command.
csh Generate variable assignments into a catname_msg.csh file. This file can be
included by C shell scripts for use with the dspmsg command.
-h Suppresses the generation of the catname_msg.h file if -m is not specified or -m is
specified along with -e sh or -e csh.
Suppresses the macros that map symbolic identifiers for messages and sets to numeric
constants if -m is specified either without the -e option or with -e h. (The
catname_msg.h file is generated but contains only the macros that define symbolic
identifiers for default message strings.)
-m Causes the output header file or shell script include file to contain default message
strings and their symbolic identifiers.
-p prefix Specifies a prefix used in the identifier for a default message string. If the prefix is not
specified with the -p option, the string "DEF_" is prepended to the message identifier
to form the identifier for the default message string.
656 Hewlett-Packard Company 1 HP-UX 11i Version 3: February 2007