Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ gencat(1) — OSF/1 SILVER Baselevel 4 rev36

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

dspcat(1)

dspmsg(1)

mkcatdefs(1)

catclose(3)

catgets(3)

catopen(3)

gencat(1)  —  Commands

OSF

NAME

gencat − Creates and modifies a message catalog

SYNOPSIS

gencat catalog-file [source-file ...]

DESCRIPTION

The gencat command, part of the OSF/1 Message Facility, can be used to create a message catalog (usually ∗.cat) from a message text source file (usually ∗.msg). 

A message text source file is a text file that you create to enter messages into. You can use any text editor to enter the messages.  You can assign message set numbers and message ID numbers to each message by using the commands described in this section. 

If a message catalog with the name catalog_file exists, the gencat command modifies it according to the statements in the message source files. If it does not exist, the gencat command creates a catalog file with the name catalog_file. 

You can specify any number of message text source files. The gencat command processes multiple source files one after the other in the sequence that you specify them. Each successive source file modifies the catalog. If you do not specify a source file, the gencat command accepts message source data from standard input. 

The gencat command does not accept symbolic identifiers.  You must run the mkcatdefs command if you want to use symbolic identifiers. 

The Escape character \ (backslash) can be used to include the following special characters in the message text:

\nPerforms a newline function. 

\tInserts a horizontal tab character. 

\vInserts a vertical tab. 

\bPerforms a backspace function. 

\rInserts a carriage-return character. 

\fInserts a formfeed character. 

\\Displays the \ (backslash) character in the message. 

\dddDisplays the single-byte character associated with the octal value represented by the valid octal digits ddd.  One, two, or three octal digits can be specified; however, you must include leading zeros if the characters following the octal digits are also valid octal digits. For example, the octal value for $ is 44. To display $5.00, use \0445.00, not \445.00, or the 5 will be parsed as part of the octal value. 

\xddddDisplays the single-byte or double-byte character associated with the hexadecimal value represented by the four valid hexadecimal digits dddd. You can specify one, two, three, or four digits, but you must include leading zeros to avoid parsing errors (see \ddd). 

You can also include printf() conversion specifications in messages that are displayed by applications using printf().  If you display a message from a shell script with dspmsg, the message can contain the %s or %n$s conversion specifications. 

You can use the $quote command in a message source file to define a character for delimiting message text. The format for this command is as follows:

$quote [char] [comment]

Use the specified character before and after the message text as shown in the following example source file:

$quote "Use a double quote to delimit message text
$set 10Message Facility - Quote command messages
1"Use the $quote command to define a character \
\n for delimiting message text" \n
2"You can include the \"quote\" character in a message \n \
by placing a \ in front of it" \n
3You can include the "quote" character in a message \n \
by having another character as the first nonspace \
\n character after the message ID number \n
$quote
4You can disable the quote mechanism by \n \
using the $quote command without \n a character \
after it \n

In this example, the $quote" command defines the " (double quote) as the quote character. The quote character must be the first nonspace character following the message number. Any text following the next occurrence of the quote character is ignored. 

The example also shows two ways the quote character can be included in the message text:

       •Place a \ in front of the quote character. 

       •Use some other character as the first nonspace character following the message number. This disables the quote character only for that message. 

The example also shows the following:

       •A \ is still required to split a quoted message across lines. 

       •To display a \ in a message, you must place another \ in front of it. 

       •You can format your message with a newline character by using \n. 

       •If you use the $quote command with no character argument, you disable the quote mechanism. 

After entering your messages into a source file, you must use the message facility program gencat to process the source file to create a message catalog. 

EXAMPLES

     1.To use the $set command in a source file to give a group of messages a set number, enter:

$set 10 Communication Error Messages

The message set number is 10.  All messages following the $set command are assigned that set number, up until the next occurrence of a $set command.  (Set numbers must be assigned in ascending order, but need not be contiguous.  Large gaps in the number sequence are discouraged in order to increase efficiency and performance.  There is no performance advantage to using more than one set number in a catalog.)  You can include a comment in the $set command, but it is not required. 

     2.To use the $delset command to remove all of the messages belonging to the specified set from a catalog, enter:

$delset 10 Communication Error Messages

The message set is specified by n. The $delset command must be placed in the proper set number order with respect to any $set commands in the same source file.  You can include a comment in the $delset command also. 

     3.You can include a comment line anywhere in the source file, except within message text.  Indicate comments as follows:

$ [comment]

You must leave at least one space after the $ character. 

     4.Enter the message text and assign message ID numbers as follows:

12 "file removed"

This assigns the message ID number 12 to the text that follows it.  You must leave at least one space or tab character between the message ID number and the message text, but you can include more spaces or tabs if you prefer.  Message numbers must be in ascending order within a single message set, but need not be contiguous. All text following the message number is included as message text, up to the end of the line.  Use the Escape character \ (backslash) to continue message text on the following line.  The \ must be the last character on the line.  Consider the following example:

This is the text associated with \
message number 5.

The preceding two lines define the single-line message:

This is the text associated with message number 5.

RELATED INFORMATION

Commands:  dspcat(1), dspmsg(1), mkcatdefs(1). 

Functions:  catclose(3), catgets(3), catopen(3). 

Compatibility Notes

The gencat command conforms to X/Open specifications.  The highest set number in an X/Open conforming application is 65535.  In an X/Open conforming application, message numbers must be in the range of 1 to 65535. 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026