home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / CBMDevKit5.dms / CBMDevKit5.adf / DOCS / tooldocs.lha / CatComp.doc next >
Encoding:
Text File  |  1993-11-04  |  33.5 KB  |  926 lines

  1.  
  2.                   $VER: CatComp_Documentation 40.4 (12.8.93)
  3.                   ==========================================
  4.  
  5. CatComp is a program to handle the creation and maintenance of the message
  6. catalogs used by locale.library. Message catalogs are IFF files read by
  7. locale.library that contain all the text strings used by an application. By
  8. providing several of these catalog files, an application can use
  9. locale.library and transparently adapt itself to the user's preferred language.
  10.  
  11. CatComp reads and processes two kinds of input files, and produces five types
  12. of output files.
  13.  
  14. The first kind of file read by CatComp is a catalog description file. That
  15. file describes all the strings used by an application. There is one such file
  16. per localized application. In this file, you assign numbers to all the
  17. application strings as well as specify their minimum and maximum lengths.
  18.  
  19. The second kind of file read by CatComp is a catalog translation file. That
  20. file contains all strings from the application translated to one language.
  21. There is one catalog translation file per language supported by a localized
  22. application.
  23.  
  24. CatComp can produce several different kinds of output files. The first is an IFF
  25. catalog. These are regular IFF files. There is one catalog produced for every
  26. catalog text file successfully processed. Catalogs are read directly by
  27. locale.library whenever the OpenCatalog() call is made.
  28.  
  29. The second type of file output by CatComp is an empty translation file. This
  30. is useful when starting a translation. It lets CatComp convert a catalog
  31. description file into a ready to fill-in translation file.
  32.  
  33. The third and fourth type of files output by CatComp are C and Assembly
  34. language programming source files. These are used by application writers to
  35. convert catalog description files into source files that can be directly used
  36. in their applications.
  37.  
  38. The fifth and sixth type of files output by CatComp are Modula-2 language
  39. definition and implementation source files, which are used by programmers
  40. in much the same way C and Assembly files are used.
  41.  
  42. Finally, the last type of file output by CatComp is an AmigaDOS load file.
  43. These load files are used by application writers to include a set of strings
  44. directly inside an application. This is normally used to encode the default
  45. strings that an application uses when there are no external catalogs available.
  46.  
  47.  
  48. Invoking CatComp
  49. ----------------
  50.  
  51. CatComp can only by run from the Shell under Kickstart V37 or beyond. Its
  52. template is:
  53.  
  54.   DESCRIPTOR/A,TRANSLATION,CATALOG/K,CTFILE/K,CFILE/K,ASMFILE/K,M2FILE/K,
  55.   OBJFILE/K,SYMBOLS/M/K,VB=VERBOSITY/N/K,NOOPTIM/S,NONUMBERS/S,NOSTRINGS/S,
  56.   NOARRAY/S,NOBLOCK/S,NOCODE/S
  57.  
  58.   DESCRIPTOR/A
  59.   Specifies the name of a catalog description file. Typically, the file
  60.   extension for catalog description files is .cd
  61.  
  62.   TRANSLATION
  63.   Specifies the name of a catalog translation file. Typically, the
  64.   file extension for catalog translation files is .ct
  65.  
  66.   CATALOG/K
  67.   Specifies the name of the IFF catalog file to produce. When this option
  68.   is specified, a translation file must have been given in the previous
  69.   argument.
  70.  
  71.   CTFILE/K
  72.   Specifies the name of the blank catalog translation file to produce. This
  73.   option only requires a catalog descriptor file be provided, there is no need
  74.   for a translation file.
  75.  
  76.   CFILE/K
  77.   Specifies the name of the C-language source file header to produce. This
  78.   option only requires a catalog descriptor file be provided, there is no need
  79.   for a translation file.
  80.  
  81.   ASMFILE/K
  82.   Specifies the name of the Assembly-language source file header to produce.
  83.   This option only requires a catalog descriptor file be provided, there is
  84.   no need for a translation file.
  85.  
  86.   N2FILE/K
  87.   Specifies the _base_ name of the Modula-2 source files to produce. Two
  88.   files are actually generated. The first file has the base name with the
  89.   extension .def, the second has the extension .mod added.
  90.  
  91.   OBJFILE/K
  92.   Specifies the name of the AmigaDOS binary object file to produce.
  93.   This option only requires a catalog descriptor file be provided, there is
  94.   no need for a translation file.
  95.  
  96.   SYMBOLS/M/K
  97.   Specifies any number of symbols that are used to determine which section
  98.   of the available strings get included within generated C, Assembly, and
  99.   object files.
  100.  
  101.   VERBOSITY/N/K
  102.   Specifies the amount of information CatComp should output while doing some
  103.   processing. The lower this number, the less CatComp will output messages.
  104.   Not providing this option causes CatComp to output every message it could.
  105.  
  106.   NOOPTIM/S
  107.   When generating a catalog file, CatComp normally skips strings that are
  108.   identical in the catalog descriptor file and in the catalog translation
  109.   file and does not include them in the generated catalog file. This
  110.   option disables this optimization.
  111.  
  112.   NONUMBERS/S
  113.   This option is only useful when generate C or Assembly-language header
  114.   files. It prevents the generation of the CATCOMP_NUMBERS section within
  115.   the header file.
  116.  
  117.   NOSTRINGS/S
  118.   This option is only useful when generate C or Assembly-language header
  119.   files. It prevents the generation of the CATCOMP_STRINGS section within
  120.   the header file.
  121.  
  122.   NOARRAY/S
  123.   This option is only useful when generate C or Assembly-language header
  124.   files. It prevents the generation of the CATCOMP_ARRAY section within
  125.   the header file.
  126.  
  127.   NOBLOCK/S
  128.   This option is only useful when generate C or Assembly-language header
  129.   files. It prevents the generation of the CATCOMP_BLOCK section within
  130.   the header file.
  131.  
  132.   NOCODE/S
  133.   This option is only useful when generate C or Assembly-language header
  134.   files. It prevents the generation of the CATCOMP_CODE section within
  135.   the header file.
  136.  
  137.  
  138. Catalog Description Files
  139. -------------------------
  140.  
  141. Catalog description files completely describe the strings used by an
  142. application. The format for these files is basically a series of two line
  143. entries separated by an arbitrary number of comment lines. The EBNF (Extended
  144. Backus Naur Formalism) specification for catalog description files is:
  145.  
  146. {# command}
  147. {; comment line}
  148. <string name> "(" [string id] "/" [min string len] "/" [max string len] ")"
  149. [string]
  150.  
  151. The first line indicates special commands that provide control over the
  152. generation of C, Assembly, and object files. See the section on C and Assembly
  153. source files below for further information.
  154.  
  155. <string name> is the symbolic name of the string. Following the name comes
  156. three optional numbers enclosed in parenthesis and separated with slashes. The
  157. first number specifies the string's ID value. This is the ID value used to
  158. request this string when using the GetCatalogStr() call in locale.library. The
  159. second number specifies the minimum length for the string, while the third
  160. number specifies the maximum string length.
  161.  
  162. The next line of an entry contains the actual string. Within the catalog
  163. description file, the strings are the same as the default strings built into
  164. the application. The strings can use standard C-language backslash ("\")
  165. escape sequences. If a string ends with a backslash character, this means
  166. that the next line in the file should be considered a continuation of the
  167. current line.
  168.  
  169. Finally, any string entry can be separated from other entries by comment
  170. lines. Comment lines start with a semicolon. There can be any number of
  171. comment lines between two entries. It is not allowed to put comment lines
  172. between the two lines of a same entry.
  173.  
  174. Here's an example of two strings in a catalog description file:
  175.  
  176. MSG_HELLO (0/4/50)
  177. This is a test string for the world to see
  178. ;
  179. MSG_BYE (1/14/47)
  180. This is another test string
  181.  
  182. The first string is called MSG_HELLO, has 0 as ID value, can be as short
  183. as 4 characters and as long as 50. The string actually associated with the
  184. name follows on the next line. Then comes a comment line. Following that is
  185. the definition of the second string called BYE_WORLD_STR that has 1 as ID
  186. value, can be as short as 14 characters and as long as 47.
  187.  
  188. As mentioned above, all three numbers in an entry are optional. If the string
  189. id number is not specified, then the same id as the previous string in the
  190. file plus one is used. If the first string defined has no id value, the
  191. starting id value is 0. If the minimum string length is not specified, it is
  192. assumed to be 0. And finally, if the maximum string length is not specified,
  193. it is assumed to be unlimited.
  194.  
  195. All three numbers can be provided in hexadecimal by preceeding themby
  196. a $. For string IDs, it is also possible to specify a relative value. That
  197. is, by providing an ID value of "+1", you are telling CatComp to add one
  198. to the ID number this string was going to receive. This is useful over
  199. the course of evolution of a program, when certain strings need to be removed.
  200. An example would be:
  201.  
  202. MSG_HELLO (0/4/50)
  203. This is a test string for the world to see
  204. ;
  205. MSG_BYE (+1/14/47)
  206. This is another test string
  207. ;
  208. MSG_WELCOME (//)
  209. This is still a test string!
  210.  
  211. In this case, MSG_HELLO would have the value 0, MSG_BYE the value 2,
  212. and MSG_WELCOME the value 3.
  213.  
  214. A note on style here. It is relatively important to choose descriptive
  215. symbolic names for the strings. These names will be viewed by the translators
  216. and should be as meaningful as possible. The following conventions are
  217. suggested:
  218.  
  219.   - List all names in capital letters. This will make it clear they are
  220.     constants as this is the convention used in all Amiga include files.
  221.  
  222.   - Prefix each name with the string MSG_. This will make it clear to the
  223.     programmer that a given constant is in fact a string ID value.
  224.  
  225.   - Append the string _GAD to strings that are used for gadget labels.
  226.  
  227.   - Append the string _MENU to strings that are used for menu titles. For
  228.     example, MSG_EDIT_MENU.
  229.  
  230.   - Expand the path leading to a menu item when specifying strings that are
  231.     used for menu items. For example, for the Cut item in the Edit menu
  232.     would be written as MSG_EDIT_CUT.
  233.  
  234.  
  235. Catalog Translation Files
  236. -------------------------
  237.  
  238. Catalog translation files contain all the strings of an application translated
  239. to a different language than the default. The files look very similar to
  240. catalog description files, except they do not include the string id, minimum
  241. string length and maximum string length specifications. The EBNF specification
  242. for catalog translation files is:
  243.  
  244. {# command}
  245. {; comment line}
  246. <string name>
  247. [string]
  248.  
  249. The first line indicates special commands that describe attributes of the
  250. catalog file. There are currently five supported commands. "version" lets you
  251. specify a 2.0-style version string for the catalog. "language" lets you list
  252. the language that this catalog is in. This string should itself be in the
  253. given language and not in English. "codeset" lets you specify which code set
  254. this catalog requires. This value should currently always be 0. "rcsid" lets
  255. you specify a version string using the standard RCS method. That way, versions
  256. of catalogs can get updated automatically by RCS. The format for the rcsid
  257. command is:
  258.  
  259.   ## rcsid $Date: 93/08/12 16:37:57 $ $Revision: 39.8 $
  260.  
  261. For example:
  262.  
  263.   ## rcsid $Date: 93/08/12 16:37:57 $ $Revision: 39.8 $
  264.  
  265. The last command supported is "name" which can be used in conjunction with the
  266. "rcsid" command to specify the name component of a 2.0 version string. That is:
  267.  
  268. ## rcsid $Date: 93/08/12 16:37:57 $ $Revision: 39.8 $
  269. ## name myprogram.catalog
  270.  
  271. The above will embed "$VER: myprogram.catalog 39.1 (31.7.92)" inside of the
  272. message catalog. Another example:
  273.  
  274. ## version $VER: myprogram.catalog 39.1 (31.7.92)
  275. ## codeset 0
  276. ## language francais
  277. ;
  278. MSG_HELLO
  279. Ceci est une chaine test pour ĂȘtre vue
  280. ;
  281. MSG_BYE
  282. Ceci est une autre chaine test
  283.  
  284. The first three lines are command lines. The following line is a comment line
  285. as it starts with a semicolon. The following line you list the symbolic name
  286. of the string, and on the second line the translated string. If a string ends
  287. with a backslash character, this means that the next line in the file should
  288. be considered a continuation of the current line.
  289.  
  290. The symbolic name is the same as the related entry in the catalog description
  291. file. CatComp uses this name to associate entries from translation files with
  292. entries in description files. It can then validate the strings in the
  293. translation files by ensuring they are of the correct length, etc.
  294.  
  295.  
  296. Escape Sequences Supported
  297. --------------------------
  298.  
  299. Regular C-language escape sequences can be specified in strings, along with a
  300. few additions:
  301.  
  302.   \a    inserts an audible bell character (ASCII 7)
  303.   \b    inserts a backspace character (ASCII 8)
  304.   \c    inserts a control sequence introducer (ASCII 155)
  305.   \e    inserts an escape character (ASCII 27)
  306.   \f    inserts a formfeed character (ASCII 12)
  307.   \n    inserts a newline character (ASCII 10)
  308.   \r    inserts a carriage return character (ASCII 13)
  309.   \t    inserts a tab character (ASCII 9)
  310.   \v    inserts a vertical tab character (ASCII 11)
  311.   \xNN  inserts NN, where NN specifies an ASCII code in hexadecimal
  312.   \NNN  inserts NNN, where NNN specifies an ASCII code in octal
  313.  
  314. As well, when any string line within a description or translation file ends
  315. with a backslash ("\"), it means that the following line within the file is
  316. to be considered a continuation of the current line.
  317.  
  318.  
  319. Formatted Output Commands
  320. -------------------------
  321.  
  322. CatComp parses strings for C-language formatting commands as used in the
  323. printf() function. It ensures that the number and type of such commands are
  324. the same in both the description file and the translation files. This
  325. guarantees that the application stack frame will not be misinterpreted due to
  326. incorrect translations of formatting commands.
  327.  
  328. CatComp warns you if you attempt to use any non-C formatting commands. The
  329. commands that CatComp does understand are:
  330.  
  331.     %b  %c  %d  %e  %E  %f  %g  %G  %i  %o  %p  %s  %u  %x  %X  %N  %T
  332.  
  333. CatComp also knows about the ordering formatting command supported by
  334. RawDoFmt() whenever locale.library runs in the system, or by locale's
  335. FormatString() routine. The ordering command lets you specify formatting
  336. commands within a formatting string in a different order than in the original
  337. string, while still accessing the stack frame correctly. CatComp validates the
  338. ordering information and ensures argument types match. See the documentation
  339. locale.library/FormatString().
  340.  
  341. Specifying the argument position lets the order of the % commands within your
  342. strings without affecting how the program performs. Given a string in a
  343. catalog description file such as:
  344.  
  345. MSG_AVAIL_MEM (//)
  346. FAST: %lU, GRAPHIC: %lU
  347.  
  348. This string could be translated in French as:
  349.  
  350. MSG_AVAIL_MEM (//)
  351. GRAPHIQUE: %2$lU, AUTRE %1$lU
  352.  
  353. Using the first string, the output of the program might look like:
  354.  
  355. FAST: 1234, GRAPHIC: 5678
  356.  
  357. while the translation would output:
  358.  
  359. GRAPHIQUE: 5678, AUTRE: 1234
  360.  
  361.  
  362. Validation
  363. ----------
  364.  
  365. CatComp enforces the syntax of catalog description files and catalog
  366. translation files very strongly. It also ensures that the same number of
  367. C-language % command appear in both the description and the translation file.
  368. This guarantees the integrity of the application stack-frame when using
  369. translated string in printf() statements.
  370.  
  371. Most errors detected by CatComp are fatal and cause the program to abort.
  372. Errors are reported to the console with a descriptive error message, a
  373. filename, and if needed a line and column number. Non-fatal errors (warnings)
  374. and also sent to the console, but they do not cause the program to abort. The
  375. printing of these warning messages can be suppressed using the VERBOSITY
  376. command-line option.
  377.  
  378.  
  379. Possible Errors
  380. ---------------
  381.  
  382. Here is a list of the errors and warnings that CatComp can produce, along with
  383. an explanation of what went wrong. Most errors indicate the file, line and
  384. column where the error occurred to help in solving the problem. Note that when
  385. using strings with the line continuation character ("\"), the line numbers
  386. printed will refer to the last line of the strings, even though the error
  387. may be in the first line.
  388.  
  389. ERROR: string line for token <name> not found
  390.   A given token was not followed by a string
  391.  
  392. ERROR: token not found
  393.   No token was found on a line in a catalog description file. Comment lines
  394.   must start with ";", any other line must have a valid token definition on
  395.   it.
  396.  
  397. ERROR: '(' expected
  398.   There was no number section after a token in a catalog description file.
  399.   The number section must start with a (, followed by three optional numbers
  400.   separated by slashes, and terminated by a ).
  401.  
  402. ERROR: ')' expected
  403.   There was no ) after a number section in a catalog description file.
  404.   The number section must start with a (, followed by three optional numbers
  405.   separated by slashes, and terminated by a ).
  406.  
  407. ERROR: '/' expected
  408.   There was no slash found within a number section after a token in a catalog
  409.   description file. The number section must start with a (, followed by three
  410.   optional numbers separated by slashes, and terminated by a ). So there
  411.   must always be two slashes specified.
  412.  
  413. ERROR: garbage characters after token <name>
  414.   There was no number section after a token in a catalog description file,
  415.   and garbage characters were found instead, The number section must start
  416.   with a (, followed by three optional numbers separated by slashes, and
  417.   terminated by a ).
  418.  
  419. ERROR: <name> is not a valid token
  420.   A token in a catalog description file was composed of invalid characters.
  421.   A token must start with a letter and can be followed by letters, numbers and
  422.   underscores.
  423.  
  424. ERROR: token <name> not found
  425.   A token specified in a catalog description file was not present in
  426.   a translation file
  427.  
  428. ERROR: string too short for token <name>
  429.   A string in a translation file is shorter than the minimum length
  430.   specified in the description file.
  431.  
  432. ERROR: string too long for token <name>
  433.   A string in a translation file is shorter than the minimum length
  434.   specified in the description file.
  435.  
  436. ERROR: negative value for minimum length
  437.   The minimum string length specified for a token must be positive.
  438.  
  439. ERROR: negative value for maximum length
  440.   The maximum string length specified for a token must be positive.
  441.  
  442. ERROR: non-positive value for % ordering
  443.   The position information for a % formatting command must be positive and
  444.   greater than 1.
  445.  
  446. ERROR: % ordering value too large
  447.   The position information for a % formatting command is greater than the
  448.   number of formatting commands provided
  449.  
  450. ERROR: % size incorrect
  451.   The size specifier for a % formatting command in a translation file does
  452.   not match the size in the description file.
  453.  
  454. ERROR: % command does not match
  455.   The type specifier for a % formatting command in a translation file does
  456.   not match the size in the description file.
  457.  
  458. ERROR: token <name> defined multiple times
  459.   A token was defined multiple times in either a description or a translation
  460.   file.
  461.  
  462. ERROR: id <number> already used for token <name>
  463.   An attempt was made to reuse an ID value twice within a description file
  464.  
  465. ERROR: no command found after '#'
  466.   Command lines start with # and are followed by a command.
  467.  
  468. ERROR: <name> is not a valid command after '#'
  469.   A command specified after # is invalid.
  470.  
  471. ERROR: <number> is not a valid codeset value
  472.   An incorrect codeset value was specified for a #codeset command.
  473.  
  474. ERROR: <string> is not a valid rcsid value
  475.   A string in an incorrect format was specified for an #rcsid command.
  476.   The format expected is
  477.   ## rcsid $Date: 93/08/12 16:37:57 $ $Revision: 39.8 $
  478.  
  479. ERROR: couldn't write catalog <name>
  480.   An error occurred while writing the catalog file
  481.  
  482. WARNING: <name> is an unknown formatting command
  483.   An unknown % formatting command was specified. CatComp knows only of
  484.   C-language formatting commands, anything else will be flagged
  485.   with this warning.
  486.  
  487. WARNING: string for token <name> matches string in descriptor
  488.   A string within a translation file matches exactly the original string
  489.   from the description file. This may mean that the string was not
  490.   translated. CatComp will not bother putting the string in any
  491.   generated catalog when this situation occurs, unless the NOOPTIM
  492.   command-line option is specified
  493.  
  494. WARNING: original string for token <name> had a trailing ellipsis (...)
  495.   The original string in the catalog descriptor file had a trailing
  496.   ellipsis (such as "Open..."), but the translation did not.
  497.  
  498.  
  499. C, Assembly, and Modula-2 Source Files
  500. --------------------------------------
  501.  
  502. CatComp has the ability to output C, Assembly and Modula-2 language source
  503. file. This lets application programmers manipulate a single catalog description
  504. file and have source files generated for them automatically so they can include
  505. the strings in their programs.
  506.  
  507. To generate these files, you need to give CatComp a descriptor file, and either
  508. a C, Assembly, or Modula-2 output file name using the CFILE/K, ASMFILE/K, and
  509. M2FILE/K command-line options. The resulting files will be standard C,
  510. Assembly, and/or Modula-2 source files that can be used from application code.
  511.  
  512. Both C and Assembly source files contain multiple sections. You can choose
  513. which sections of these files you want in your application by using standard
  514. conditional compilation symbol definitions. Here is a list of the various
  515. symbols and the type of data they hold:
  516.  
  517.   CATCOMP_NUMBERS
  518.   Defining this symbol causes the name of each string to be defined with the
  519.   value of its id, as listed in the catalog description file. So if the .cd
  520.   file contains a string such as:
  521.  
  522.       MSG_HELLO (141//)
  523.       Hello
  524.  
  525.   then the C file generated would have
  526.  
  527.       #define MSG_HELLO 141
  528.  
  529.   and for Assembly:
  530.  
  531.       MSG_HELLO EQU 141
  532.  
  533.   CATCOMP_STRINGS
  534.   Defining this symbol causes each string to be defined. Using the same
  535.   example as above, you would get the following for C:
  536.  
  537.       MSG_HELLO_STR "Hello"
  538.  
  539.   and for Assembly:
  540.  
  541.       MSG_HELLO_STR: DC.B 'Hello',$00
  542.  
  543.   CATCOMP_ARRAY
  544.   Causes a table of the following structures to become available:
  545.  
  546.       struct CatCompArrayType
  547.       {
  548.           LONG   cca_ID;
  549.           STRPTR cca_Str;
  550.       };
  551.  
  552.   cca_ID contains the id value of a string, and cca_Str points to the string
  553.   itself. By scanning this array, you can access all of the strings defined
  554.   for the application.
  555.  
  556.   CATCOMP_BLOCK
  557.   Causes a compact table of all the strings and their id values to be
  558.   generated. The format is:
  559.  
  560.       1 longword of string id
  561.       1 word of string length
  562.       string
  563.       ..etc...
  564.  
  565.   This type of table is difficult to parse in C, and generally better handled
  566.   in Assembly.
  567.  
  568.   CATCOMP_CODE
  569.   This causes the generation of source code for a function called GetString().
  570.   The function takes for argument an initialized LocaleInfo structure and a
  571.   string number. It returns a string pointer. The LocaleInfo structure is:
  572.  
  573.       struct LocaleInfo
  574.       {
  575.           APTR li_LocaleBase;
  576.           APTR li_Catalog;
  577.       }
  578.  
  579.   li_LocaleBase should be initialized to the return value of
  580.   OpenLibrary() of locale.library, or NULL if the library can't be opened.
  581.   li_Catalog should be initialized to the result of OpenCatalog() of the
  582.   application's catalog. This value can be NULL.
  583.  
  584. Command-line options are available to disable the generation of specific
  585. sections of header files. These are NONUMBERS/S, NOSTRINGS/S, NOARRAY/S,
  586. NOBLOCK/S, and NOCODE/S.
  587.  
  588. Special commands can be embedded in catalog description files to provide
  589. control over the generation of header files. These commands are introduced
  590. by a # symbol within the catalog description file. The supported commands
  591. are:
  592.  
  593.   #header <header name>
  594.   This lets you indicate the base name of the header files being produced.
  595.   The base name is then used as the top of header files. For example:
  596.  
  597.       #header TEXTTABLE
  598.  
  599.       would cause the following to be added at the start of the C header file:
  600.  
  601.       #ifndef TEXTTABLE_H
  602.       #define TEXTTABLE_H
  603.  
  604.   #array <array base name>
  605.   This lets you specify the base name of the arrays generated in the header
  606.   files being produced. The default is "CatCompArray"
  607.  
  608.   #block <block base name>
  609.   This lets you specify the base name of the data block generated in the header
  610.   files being produced. The default is "CatCompBlock"
  611.  
  612.   #arrayopts <compiler options>
  613.   This lets you specify which compiler option should be used when
  614.   generating arrays of data. The default is "static const".
  615.  
  616.   #function <function name>
  617.   This lets you specify the name of the function that is generated.
  618.   The default is "GetString"
  619.  
  620.   #prototype <function prototype line>
  621.   This lets you specify the function prototype to output in generated
  622.   C header files. By default, no prototype is generated. For SAS/C, you
  623.   can do something like:
  624.  
  625.     #prototype #include <dos.h>\n
  626.        STRPTR __asm GetString(register __a0 struct LocaleInfo *li,
  627.                               register __d0 ULONG id);
  628.  
  629.   Note that the above three lines actually have to appear on a single line in
  630.   a descriptor file. They are on separate lines here just so they fit
  631.   within an 80 column display. The main purpose for generating a prototype
  632.   is to allow interfacing to the code generated when using the OBJFILE
  633.   option. The prototype lets you define in which registers the parameters are
  634.   expected in by the object code. Since the register specification
  635.   mechanism is compiler-dependant, CatComp can't generate a standard
  636.   prototype that covers all cases, so it requires the explicit specification
  637.   of what the generated prototype should be.
  638.  
  639.   This command is also used when generating Modula-2 source files. It
  640.   specifies the function definition used when generating a .def file.
  641.  
  642.   #m2prolog
  643.   This is used when generating Modula-2 .mod files. It preceeds the
  644.   M2 code that is generated. You can put IMPORT statements and the
  645.   function definition in this command.
  646.  
  647.   #m2epilog
  648.   This is used when generating Modula-2 .mod files. It follows the
  649.   M2 code that is generated. This is normally used to include the
  650.   END <functionname> line after the generated code sequence.
  651.  
  652.   #ifdef <symbol name>
  653.   Causes CatComp to enclose the following identifiers within a conditional
  654.   compilation block.
  655.  
  656.   #endif <symbol name>
  657.   Causes CatComp to terminate the current conditional compilation block.
  658.  
  659.   #lengthbytes <number of bytes>
  660.   Causes CatComp to precede every following strings with 'n' bytes of length
  661.   information. The default number of bytes is 0. The
  662.   locale.library/GetCatalogStr() function will then return a pointer
  663.   to the length bytes, followed by the actual string. The length
  664.   indicated does NOT include the length bytes themselves.
  665.  
  666.  
  667. Object Files
  668. ------------
  669.  
  670. CatComp is capable of generating linkable Amiga load files directly. These
  671. load files contain all the strings for an application, and a very small and
  672. fast routine to return a string pointer given a string id value.
  673.  
  674. The OBJFILE/K option takes the name of an Amiga load file to generate. This
  675. file can then be linked directly with an application. A single function is
  676. available within this load file. It is the Assembly version of the GetString()
  677. function described in the previous section.
  678.  
  679.  
  680. Sample Use
  681. ----------
  682.  
  683. This section presents sample uses of CatComp with example command-lines.
  684.  
  685. Assume you have a catalog description file for an application called "app.cd".
  686.  
  687.  
  688. To test if this file is a valid .cd file, type:
  689.  
  690.   CatComp app.cd
  691.  
  692. and CatComp will respond with either some error messages, or with a message
  693. saying that 'app.cd' is a valid descriptor file.
  694.  
  695.  
  696. To do a translation of a .cd file, you need a .ct file. Such a file can be
  697. generated by doing:
  698.  
  699.   CatComp app.cd CTFILE app.ct
  700.  
  701. This will create a blank translation file called app.ct. You can then load
  702. app.ct in a standard text editor and proceed to translate the strings it
  703. contains.
  704.  
  705. Once a .ct file is done being translated, it must be converted in an IFF
  706. catalog file. This is done by doing:
  707.  
  708.   CatComp app.cd app.ct CATALOG app.catalog
  709.  
  710. This will create a file called app.catalog.
  711.  
  712.  
  713. See the accompanying HelloWorld program for a complete example of a localized
  714. program using the efficient CATCOMP_CODE approach.
  715.  
  716.  
  717. Revision Information
  718. --------------------
  719.  
  720. CatComp 38.2
  721.   - Initial release
  722.  
  723. CatComp 38.7
  724.  
  725.   - No longer complains that %N and %T are unknown formatting commands
  726.     (for support of BCPL strings)
  727.  
  728.   - Added documentation of the # commands for .cd and .ct files
  729.  
  730.   - Added new .cd file command: #header. Lets you specify the base name
  731.     of the header file being generated. The name is used in the #ifdef
  732.     statements at the start of generated C and Assembly header files.
  733.  
  734. CatComp 38.8
  735.  
  736.   - Added new .cd file command: #lengthbytes. Lets you specify the number
  737.     of length bytes to put in front of strings in locale catalogs. The
  738.     default number of bytes is 0. See doc file for more info. This is
  739.     needed for Installer localization.
  740.  
  741. CatComp 38.9
  742.  
  743.   - Now puts an #ifndef around the #include statements in the generated
  744.     C header files to avoid nested includes
  745.  
  746. CatComp 38.10
  747.  
  748.   - Fixed bug with not initializing a variable on the stack upon startup.
  749.     Worked fine under WShell since it allocates the stack as MEMF_CLEAR,
  750.     failed under AmigaShell.
  751.  
  752.   - Fixed bug with processing translation files with empty strings in them
  753.  
  754. CatComp 38.11
  755.  
  756.   - Now supports multi-line strings using standard C line continuation
  757.     notation (\ at EOL)
  758.  
  759. CatComp 38.15
  760.  
  761.   - Fixed assembly source file output. It was including an extraneous
  762.     character at the start of the header files
  763.  
  764. CatComp 38.16
  765.  
  766.   - Now reports a warning when an original string contains a trailing ...
  767.     and a translated one doesn't. Output of the warning can be controlled by
  768.     the VERBOSITY command-line option
  769.  
  770. CatComp 38.17
  771.  
  772.   - Added NOOPTIM command-line option to disable string optimization. This
  773.     is needed in certain cases.
  774.  
  775. CatComp 38.18
  776.  
  777.   - Typecast strings to (STRPTR) in the generated C headers in order to
  778.     keep folks compiling with strict ANSI and signed characters happy.
  779.  
  780. CatComp 38.19
  781.  
  782.   - Added the #array command that can be specified in .cd files. This is in
  783.     support of multi-catalog applications (specifically for AppShell). See
  784.     CatComp.doc for details.
  785.  
  786. CatComp 38.20
  787.  
  788.   - Fixed incorrect handling of return value for calls to StrToLong(). This
  789.     problem showed up with the latest DOS.
  790.  
  791. CatComp 38.21
  792.  
  793.   - Fixed another problem with the new behavior of StrToLong()
  794.  
  795. CatComp 38.22
  796.  
  797.   - The string ID, min length and max length values specified in .cd
  798.     files can now be in hex, by putting a $ in front of them.
  799.  
  800.   - A string ID can now be specified as relative to the previous strings ID
  801.     by putting a + in front of the number. So +1 as a string ID means to add
  802.     one of the string ID. This is useful when deleting obsolete strings
  803.  
  804. CatComp 38.23
  805.  
  806.   - Two new commands can now be specified in a .ct file:
  807.  
  808.     ##rcsid
  809.  
  810.     Lets you embed an RCS-style version string. As the catalog is processed,
  811.     the version string is converted to an AmigaDOS-style version string
  812.     and inserted into the generated catalog. This eliminates the need to
  813.     update version strings in catalogs by hand, since RCS can now do it for
  814.     you. All the V39 catalog files have been updated to use this new feature.
  815.  
  816.     ##name
  817.  
  818.     Lets you specify the name component of a version string, since this cannot
  819.     be done in the ##rcsid command. If the name component is not specified,
  820.     then the current output filename is used.
  821.  
  822. CatComp 38.25
  823.  
  824.   - After almost 3 whole days of looking for a bug which was causing
  825.     random memory to be trashed, the problem was found. Starting with
  826.     version 38.23, CatComp was being linked with the SAS version of the
  827.     sprintf() function. This function pokes random memory! DO NOT USE!
  828.     Switching to use the amiga.lib sprintf() cure everything.
  829.  
  830.   - Now uses SetVBuf() to speed up its IO.
  831.  
  832.   While looking for the above memory trash problem, a few other problems came
  833.   to light
  834.  
  835.   - Memory allocated for .ct files was not being freed if no .catalog was
  836.     being generated.
  837.  
  838.   - A small amount of memory was not being freed if there was a #ifdef
  839.     without a matching #endif in a .cd file
  840.  
  841.   - % commands were not processed in strings containing a NULL ( \0 ) in both
  842.     .cd and .ct files
  843.  
  844.   - Now handles the documented bug in FGets() under V37 by allocating a buffer
  845.     1 byte larger than it needs to be
  846.  
  847. CatComp 39.1
  848.  
  849.   - Added generation of the STRINGBLOCK sections in .h and .i files
  850.  
  851.   - Added generation of object files
  852.  
  853.   - Cleaned up source file generation. New consistent conditional statement
  854.     names allow full control of what does and does not get included for
  855.     both C and Assembly source files
  856.  
  857.   - Added #arrayopts command to define which compiler options are used when
  858.     declaring arrays
  859.  
  860.   - Added #block command to define the name of the data block generated
  861.     when CATCOMP_BLOCK is defined.
  862.  
  863.   - Added #function command to define the name of the function generated
  864.     when CATCOMP_CODE is defined.
  865.  
  866. CatComp 39.2
  867.  
  868.   - Made symbol names case-insensitive
  869.  
  870. CatComp 39.4
  871.  
  872.   - Fixed CATCOMP_ARRAY array name generation.
  873.  
  874.   - The SYMBOLS command-line option now also affects C and Assembly file
  875.     generation
  876.  
  877.   - Added more info to the docs in various places, fixed typos
  878.  
  879. CatComp 39.5
  880.  
  881.   - Added a new command to the .cd files. #prototype lets you specify the
  882.     function prototype to generate in .h files produced from a .cd file.
  883.  
  884. CatComp 39.6
  885.  
  886.   - Fixed bug with not allowing left justified % commands in .ct files
  887.     (%-10s for example)
  888.  
  889. CatComp 39.7
  890.  
  891.   - When reporting errors, it was getting the correct line numbers if any
  892.     of the strings in a .cd or .ct file used the line continuation character
  893.     to have a single string span multiple lines.
  894.  
  895. CatComp 40.1
  896.  
  897.   - When generating a blank .ct file from a .cd file, no longer puts a trailing
  898.     bogus semicolon at the end of comment lines it produces. It used to
  899.     generate:
  900.  
  901.     STRING_NAME
  902.  
  903.     ; this is a string;
  904.  
  905.     It now correctly generates:
  906.  
  907.     STRING NAME
  908.  
  909.     ; this is a string
  910.     ;
  911.  
  912. CatComp 40.2
  913.  
  914.   - Fixed hex number conversion code. Was converting A-F to 0-5 instead
  915.     of 10-15
  916.  
  917. CatComp 40.3
  918.  
  919.   - Added NONUMBERS/S, NOSTRINGS/S, NOARRAY/S, NOBLOCK/S and NOCODE/S as
  920.     command-line options
  921.  
  922. CatComp 40.4
  923.  
  924.   - Added Modula-2 support. This includes a M2FILE/K command-line option,
  925.     and #m2prolog and #m2epilog descriptor file commands.
  926.