home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
i18nv102.zip
/
DOC
/
MKCATDEF.DOC
< prev
next >
Wrap
Text File
|
1995-08-28
|
4KB
|
118 lines
mkcatdefs Command
-----------------
Purpose
-------
Preprocesses a message source file.
Syntax
------
mkcatdefs SymbolName SourceFile ... [ -h ]
Description
-----------
The mkcatdefs command preprocesses a message source file for in-
put to the gencat command.
The SourceFile message file contains symbolic identifiers. The
mkcatdefs command produces the SymbolName_msg.h file, containing
statements that equate symbolic identifiers with the set numbers
and message ID numbers assigned by the mkcatdefs command.
The mkcatdefs command creates two outputs. The first is a header
file called SymbolName_msg.h. You must include this
SymbolName_msg.h file in your application program to associate
the symbolic names to the set and message numbers assigned by the
mkcatdefs command.
The mkcatdefs command sends message source data, with numbers in-
stead of symbolic identifiers, to standard output. This output
is suitable as input to the gencat command. You can use the
mkcatdefs command output as input to the gencat command in the
following ways:
* Use the mkcatdefs command with a > (redirection symbol) to
write the new message source to a file. Use this file as input
to the gencat command.
* Pipe the mkcatdefs command output file directly to the gencat
command.
* Use the runcat command rather than the mkcatdefs command. The
runcat command automatically sends the message source file
through the mkcatdefs command and then pipes the file to the gen-
cat command.
After running the mkcatdefs command, you can use symbolic names
in an application to refer to messages.
Flags
-----
-h Suppresses the generation of a SymbolName_msg.h file. This
flag must be the last argument to the mkcatdefs command.
Examples
--------
To process the symb.msg message source file and redirect the out-
put to the symb.src file, enter:
mkcatdefs symb symb.msg > symb.src
The generated symb_msg.h file looks similar to the following:
#ifdef _H_SYMB_MSG
#define _H_SYMB_MSG
#include <limits.h>
#include <nl_types.h>
#define MF_SYMB "symb.cat"
/* The following was generated from symb.src. */
/* definitions for set MSFAC */
#define SYM_FORM 1
#define SYM_LEN 2
#define MSG_H 6
#endif
The mkcatdefs command also creates the symb.src message catalog
source file for the gencat command with numbers assigned to the
symbolic identifiers:
$quote " Use double quotation marks to delimit message text
$delset 1
$set 1
1 "Symbolic identifiers can only contain alphanumeric \
characters or the _ (underscore character)\n"
2 "Symbolic identifiers cannot be more than 65 \
characters long\n"
5 "You can mix symbolic identifiers and numbers\n"
$quote
6 remember to include the "msg_h" file in your program
The assigned message numbers are noncontiguous because the source
file contained a specific number. The mkcatdefs program always
assigns the previous number plus 1 to a symbolic identifier.
Note: The mkcatdefs command inserts a $delset command before a
$set command in the output message source file. This means you
cannot add, delete, or replace single messages in an existing ca-
talog when piping to the gencat command. You must enter all mes-
sages in the set.
Related Information
-------------------
The gencat command, runcat command.
The catclose subroutine, catgets subroutine, catopen subrou-
tine.