Bringing flexcat 2.15 into the main branch
[AROS.git] / tools / flexcat / src / sd / Cat2h.readme
blob9dc304fd3eb26bf30c75891469482fa360f7403d
2 The files "Cat2h_c.sd" and "Cat2h_h.sd" contains source descriptors that
3 generates code similar to the one generated by Cat2h by Nico François (and
4 also Cat2Inc by Magnus Holmgren ;). It uses a somewhat different approach
5 to string handling, that is small and fast.
7 Rather than storing all string in an array, and scan that one each time
8 (like CatComp normally does; there are ways around that though), the first
9 two bytes of a string contains the ID. The "GetString" function, which
10 takes a string as argument, then only reads these two bytes into a long
11 word, and the string ID and default string is then known.
13 As of version 1.9, FlexCat is capable of generating that kind of output,
14 using the %a command. The included files actually use %2a, and thus, only
15 two ID bytes per string are generated (like Cat2h does). This should be
16 enough for most applications. If you change the length, remember that the
17 GetString() function need to be changed accordingly.
19 The generated header file defines all strings, and the source file contains
20 code to open/close the catalog (with autoinit code for SAS/C and DICE), and
21 a suitable GetString function. A quick look at the generated code should be
22 enough to gather all the details, I think.
24 The code does currently not support multiple catalogs, nor change of
25 version number and builtin language.  Easy to add though (e.g.  by using
26 %b for all names (and references) needed to be unique e.g. Get%bString() etc),
27 should the need arise.
30 Magnus Holmgren <cmh@lls.se>
32 $Id: Cat2h.readme 253 2014-02-18 11:15:58Z damato $