use the new flexcat's source description file
[AROS.git] / tools / flexcat / src / sd / Cat2h_c.sd
blob8f9dff180ecc2dec70cf3c9a41f11a5273c08883
1 ##rem $Id: Cat2h_c.sd 253 2014-02-18 11:15:58Z damato $
2 ##stringtype C
4 /****************************************************************
6    This file was created automatically by `%fv'
7    from "%f0"
9    using Cat2h_c.sd 1.0 (23.05.97)
11    Do NOT edit by hand!
13 ****************************************************************/
15 #ifdef __SASC
16 #define __USE_SYSBASE 1
17 #include <proto/exec.h>
18 #include <proto/locale.h>
19 #else
20 #include <clib/exec_protos.h>
21 #include <clib/locale_protos.h>
22 #endif
25 struct Library          *LocaleBase;
26 static struct Catalog   *Catalog;
29 /* No support for version number or other built-in language for now.
30  * Not often used (in my experience), and easy to add if you should
31  * need it.
32  *
33  * We open it at a high priority during autoinit (for SAS/C), to allow
34  * the use of GetString() in lower priority autoinit code.
35  */
37 #ifdef _DCC
38 __autoinit
39 #endif
40 VOID
41 #ifdef __GNUC__
42 __attribute__ ((constructor))
43 #endif
44 #ifdef __SASC
45 _STI_19000_GetCatalog( VOID )
46 #else
47 GetCatalog( VOID )
48 #endif
50         if( LocaleBase = OpenLibrary( "locale.library", 0 ) )
51         {
52                 Catalog = OpenCatalogA( NULL, "%b.catalog", NULL );
53         }
57 #ifdef _DCC
58 __autoexit
59 #endif
60 VOID
61 #ifdef __GNUC__
62 __attribute__ ((destructor))
63 #endif
64 #ifdef __SASC
65 _STD_19000_FreeCatalog( VOID )
66 #else
67 FreeCatalog( VOID )
68 #endif
70         if( LocaleBase )
71         {
72                 CloseCatalog( Catalog );
73                 CloseLibrary( LocaleBase );
74         }
76         Catalog = NULL;
77         LocaleBase = NULL;
81 STRPTR
82 GetString( STRPTR str )
84         ULONG   id;
86         if( !str )
87         {
88                 /* Avoid Enforcer hits... */
89                 return( NULL );
90         }
92         /* Avoid any problems regarding char not being unsigned */
93         id = ( ( ( UBYTE ) *str++ ) << 8 ) | ( ( UBYTE ) *str++ );
95         if( Catalog )
96         {
97                 str = GetCatalogStr( Catalog, id, str );
98         }
100         return( str );