use the new flexcat's source description file
[AROS.git] / tools / flexcat / C_c_orig.sd
blob99ee669980c27124585b1aa53f86ddc6bb82ba81
1 ##rem $Id$
2 ##stringtype C
3 ##shortstrings
5 #include <exec/types.h>
6 #include <exec/libraries.h>
7 #include <proto/locale.h>
8 #include <libraries/locale.h>
10 #define CATCOMP_NUMBERS 1
12 #include "%b_strings.h"
14 struct StringCollection
16   LONG    id;
17   STRPTR  string;
20 static struct StringCollection _sc[] =
22   {%i, %s},
23   {-1,(STRPTR)NULL}
27 char * GetString(struct LocaleInfo * li,
28                  LONG stringNum)
30   char *builtIn = NULL;
31   char *string;
33   struct Library * LocaleBase = (struct Library *)li->li_LocaleBase;
34     
35   struct StringCollection * sc = _sc;
36   while (NULL != sc->string)
37   {
38     if (sc->id == stringNum)
39     {
40       builtIn = sc->string;
41       break;
42     }
43     sc = &sc[1];
44   }
46   if (NULL != li->li_Catalog)
47     string = (char *)GetCatalogStr((struct Catalog *)li->li_Catalog,
48                            stringNum,
49                            builtIn);
50   else
51     string = builtIn;
53   return string;