home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
i18nv104.zip
/
DOC
/
MKCATDEF.DOC
< prev
next >
Wrap
Text File
|
1996-02-13
|
4KB
|
117 lines
mkcatdef Command
----------------
Purpose
-------
Preprocesses a message source file.
Syntax
------
mkcatdef 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.h file, containing
statements that equate symbolic identifiers with the set numbers
and message ID numbers assigned by the mkcatdef command.
The mkcatdef command creates two outputs. The first is a header
file called SymbolName.h. You must include this file in your
application program to associate the symbolic names to the set and
message numbers assigned by the mkcatdef command.
The mkcatdef 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
mkcatdef command output as input to the gencat command in the
following ways:
* Use the mkcatdef 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 mkcatdef command output file directly to the gencat
command.
* Use the runcat command rather than the mkcatdef command. The
runcat command automatically sends the message source file
through the mkcatdef command and then pipes the file to the gencat
command.
After running the mkcatdef command, you can use symbolic names
in an application to refer to messages.
Flags
-----
-h Suppresses the generation of a SymbolName.h file. This
flag must be the last argument to the mkcatdef command.
Examples
--------
To process the symb.msg message source file and redirect the out-
put to the symb.src file, enter:
mkcatdef symb symb.msg > symb.src
The generated symb.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 mkcatdef 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 ".h" file in your program
The assigned message numbers are noncontiguous because the source
file contained a specific number. The mkcatdef program always
assigns the previous number plus 1 to a symbolic identifier.
Note: The mkcatdef 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.