gencat merges the message text source file(s)
msgfile into a formatted message catalogue catfile.
catfile will be created if it does not already exist.
If catfile does already exist its messages will
be included in the new catfile.
If set and message numbers collide, the new message-text
defined in msgfile will replace the old message
text currently contained in catfile.
gencat will complain about formats not defined
in the X/Open Portability Guide.
The following options are recognized by gencat:
-
Use standard output or standard input in the place of
(respectively) catfile or msgfile.
-X
Inhibits the check for portability to X/Open.
The format of a message text source file is defined as follows.
Note that the fields of a message text source line are separated
by a single ASCII space or tab character.
Any other ASCII spaces or tabs are considered as being part
of the subsequent field.
$setn comment
n specifies the set identifier of the
following messages until the next
$set,
$delset,
or end-of-file appears.
n must be a number in the range 1 through {NL_SETMAX}.
Set identifiers
within a single source file need not be contiguous.
Any string following the set identifier is treated as a comment.
If no $set
directive is specified in a message text source file, all messages
will be located in
the default message set
NL_SETD.
$delsetn comment
Delete message set
n
from an
existing message catalog.
Any string following the set number is treated as a comment.
(If n is not a valid set it is ignored.)
$comment
A line beginning with a dollar symbol ``$'' followed by an
ASCII space or
tab character is treated as a comment.
m message-text
The
m
denotes the message identifier,
which is a number in the range 1 through {NL_MSGMAX}.
The
message-text
is stored in the message catalog
with the set identifier
specified by the last
$set
directive, and with message identifier
m.
If the
message-text
is empty,
and an ASCII space or tab field separator is present, an empty string
is
stored in the message catalog.
If a message source line has a
message number, but neither a field separator nor
message-text,
the existing message with that number (if any) is deleted from the
catalog.
Message identifiers
need not be contiguous.
The length of
message-text
must be in the range 0 through {NL_TEXTMAX}.
$quotec
This line specifies an optional quote character
c,
which can be used to surround
message-text
so that trailing spaces or null (empty) messages are visible in a
message source line.
By default, or if an empty
$quote
directive is supplied, no quoting of
message-text
will be recognized.
Empty lines in a message text source file are ignored.
Text strings can contain the special characters and
escape sequences defined in the following table:
newline
NL(LF)
\n
horizontal tab
HT
\t
vertical tab
VT
\v
backspace
BS
\b
carriage return
CR
\r
form feed
FF
\f
backslash
\
\\
bit pattern
ddd
\ddd
The escape sequence
\ddd
consists of backslash followed by 1, 2 or 3 octal digits,
which are taken to specify the value of the desired character.
If the character following a backslash is not one of those specified,
the backslash is ignored.
Backslash followed by an ASCII newline character is also used
to continue a string on the following line.
Thus, the following two lines describe a single message string:
1 This line continues \
to the next line
which is equivalent to:
1 This line continues to the next line
Exit values
gencat returns ``0'' on success or ``1'' on failure.
Notes
Message catalogues produced by gencat are
binary encoded, meaning that their portability cannot
be guaranteed between different types of machines.
Therefore, just as C programs need to be recompiled for
each type of machine, message catalogues must be
recreated via gencat.
gencat and dumpmsg are capable of
handling message catalogs with variable-length filenames
in their file headers.
To convert old message catalogs to this format, use the following
example as a model: