gencat(1)
NAME
gencat − generate a formatted message catalog file
SYNOPSIS
gencat [-l] catfile msgfile ...
DESCRIPTION
Message catalogs allow a program to process input and produce output according to local customs and languages. For details, see Native Language Support Users Guide.
gencat merges each message source msgfile into a formatted message catalog catfile that can be accessed by catgetmsg() or catgets() (see catgetmsg(3C) and catgets(3C)). If catfile does not exist, it is created. If catfile exists, its messages are included in the new catfile. If set and message numbers collide, the new message text in file replaces the old message text in catfile. A msgfile consists of message, directive and comment lines (all without leading spaces or tabs) described below. Except as noted, fields are separated by one or more space or tab characters.
$set s [comment] A $set directive specifies the set s, of the messages that follow until the next $set or end-of-file appears. The set number s is an unsigned integer in the range 1 through NL_SETMAX. Any string following the set number is treated as a comment. If a $set directive is not specified, messages are put in the default set NL_SETD.
Set numbers must be in ascending order within a msgfile but need not be contiguous.
$delset s [comment] A $delset directive deletes the message set identified by the set number s, from an existing message catalog. Any string following the set number is treated as a comment.
m message_text A message line specifies a message number m, and associated message text. The message number m is an unsigned integer in the range 1 through NL_MSGMAX. The message_text is a C string, including spaces, tabs and \ (backslash) escapes, but by default without surrounding quotes (see $quote directive below). The message number m is separated from the message_text by a single space or tab character. The message_text begins with the first character following the separator and ends at new-line. Extra spaces or tabs (including any trailing spaces or tabs) are considered part of the message_text.
The message_text of a message line is stored in catfile with message number m and set number s specified by the most recent $set directive.
Message numbers must be in ascending order within a set but need not be contiguous.
Note that the space or tab separator distinguishes insertion of a null message from deletion of a message. If a message line has a number and separator but no text, the message number and an associated null message string are stored in catfile. If a message line has a number but neither separator nor text, the message number and its associated message text are deleted from catfile.
-l If the -l option is specified, the length of message_text must be no more than MAX_BUFLEN − 1 bytes. If the -l option is not specified, the length of message_text must be no more than NL_TEXTMAX bytes. See catgetmsg(3C), catgets(3C), catread(3C), and getmsg(3C) for message length limits imposed by these routines.
$quote [q comment] A $quote directive specifies a quote character q, used to surround message_text and make leading and trailing space visible in a message line. Any string following the specified quote character q is treated as a comment. By default, or if a quote character q not is supplied, quoting of message_text is not recognized.
$ comment A $ followed by a space or tab is treated as a comment and can appear anywhere in a file. A line consisting of zero or more spaces or tabs is treated as a comment line.
NL_TEXTMAX, NL_SETMAX, and NL_MSGMAX are defined in <limits.h>. NL_SETD is defined in <nl_types.h>. MAX_BUFLEN is defined in <msgcat.h>.
EXTERNAL INFLUENCES
Environment Variables
LC_CTYPE determines the interpretation of messages as single- and/or multi-byte characters.
Messages are issued in LANG if it is set to a valid language and LANG messages are available. Otherwise "C" locale messages will be issued.
If LC_CTYPE is not specified in the environment or is set to the empty string, the value of LANG is used as a default for each unspecified or empty variable. If LANG is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of LANG. If any internationalization variable contains an invalid setting, gencat behaves as if all internationalization variables are set to "C". See environ(5).
International Code Set Support
Single- and multi-byte character code sets are supported.
WARNINGS
The $quote directive is not currently supported on the HP MPE and RTE operating systems.
AUTHOR
gencat was developed by HP and the X/Open Company, Ltd.
SEE ALSO
dumpmsg(1), findmsg(1), insertmsg(1), catgets(3C), catopen(3C).
Native Language Support Users Guide.
STANDARDS CONFORMANCE
gencat: XPG2, XPG3
Hewlett-Packard Company — HP-UX Release 9.0: August 1992