home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / i18nv104.zip / DOC / MKCATDEF.DOC < prev    next >
Text File  |  1996-02-13  |  4KB  |  117 lines

  1.   mkcatdef Command
  2.   ----------------
  3.  
  4.  
  5.   Purpose
  6.   -------
  7.  
  8.   Preprocesses a message source file.
  9.  
  10.  
  11.   Syntax
  12.   ------
  13.  
  14.   mkcatdef SymbolName SourceFile ...  [  -h ]
  15.  
  16.  
  17.   Description
  18.   -----------
  19.  
  20.   The mkcatdefs command preprocesses a message source file for in-
  21.   put to the gencat command.
  22.  
  23.   The SourceFile message file contains symbolic identifiers.  The
  24.   mkcatdefs command produces the SymbolName.h file, containing
  25.   statements that equate  symbolic identifiers with the set numbers
  26.   and message ID numbers assigned by the mkcatdef command.
  27.  
  28.   The mkcatdef command creates two outputs.  The first is a header
  29.   file called SymbolName.h.  You must include this file in your
  30.   application program to associate the symbolic names to the set and
  31.   message numbers assigned by the mkcatdef command.
  32.  
  33.   The mkcatdef command sends message source data, with numbers in-
  34.   stead of symbolic identifiers, to standard output.  This output
  35.   is suitable as input to the gencat command.  You can use the
  36.   mkcatdef command output as input to the gencat command in the
  37.   following ways:
  38.  
  39.   *     Use the mkcatdef command with a > (redirection symbol) to
  40.   write the new message source to a file.  Use this file as input
  41.   to the gencat command.
  42.  
  43.   *     Pipe the mkcatdef command output file directly to the gencat
  44.   command.
  45.  
  46.   *     Use the runcat command rather than the mkcatdef command.  The
  47.   runcat command automatically sends the message source file
  48.   through the mkcatdef command and then pipes the file to the gencat
  49.   command.
  50.  
  51.   After running the mkcatdef command, you can use symbolic names
  52.   in an application to refer to messages.
  53.  
  54.  
  55.   Flags
  56.   -----
  57.  
  58.   -h    Suppresses the generation of a SymbolName.h file.  This
  59.         flag must be the last argument to the mkcatdef command.
  60.  
  61.  
  62.   Examples
  63.   --------
  64.  
  65.   To process the symb.msg message source file and redirect the out-
  66.   put to the symb.src file, enter:
  67.  
  68.   mkcatdef symb symb.msg > symb.src
  69.  
  70.   The generated symb.h file looks similar to the following:
  71.  
  72.   #ifdef        _H_SYMB_MSG
  73.   #define       _H_SYMB_MSG
  74.   #include <limits.h>
  75.   #include <nl_types.h>
  76.   #define       MF_SYMB "symb.cat"
  77.   /* The following was generated from symb.src. */
  78.   /* definitions for set MSFAC */
  79.   #define       SYM_FORM        1
  80.   #define       SYM_LEN 2
  81.   #define       MSG_H   6
  82.   #endif
  83.  
  84.   The mkcatdef command also creates the symb.src message catalog
  85.   source file for the gencat command with numbers assigned to the
  86.   symbolic identifiers:
  87.  
  88.   $quote " Use double quotation marks to delimit message text
  89.   $delset 1
  90.   $set 1
  91.   1     "Symbolic identifiers can only contain alphanumeric \
  92.   characters or the _ (underscore character)\n"
  93.   2     "Symbolic identifiers cannot be more than 65 \
  94.   characters long\n"
  95.   5     "You can mix symbolic identifiers and numbers\n"
  96.   $quote
  97.   6     remember to include the ".h" file in your program
  98.  
  99.   The assigned message numbers are noncontiguous because the source
  100.   file contained a specific number.  The mkcatdef program always
  101.   assigns the previous number plus 1 to a symbolic identifier.
  102.  
  103.   Note: The mkcatdef command inserts a $delset command before a
  104.   $set command in the output message source file. This means you
  105.   cannot add, delete, or replace single messages in an existing ca-
  106.   talog when piping to the gencat command.  You must enter all mes-
  107.   sages in the set.
  108.  
  109.  
  110.   Related Information
  111.   -------------------
  112.  
  113.   The gencat command,  runcat command.
  114.  
  115.   The  catclose subroutine,  catgets subroutine,  catopen subrou-
  116.   tine.
  117.