mkcatdefs.1 (2010 09)

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
catopen(), 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 mes-
sage 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 mes-
sage 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
identify 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 file. 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 sym-
bolic 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.
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (6 pages)