1 ##rem $Id: Cat2h_c.sd 253 2014-02-18 11:15:58Z damato $
4 /****************************************************************
6 This file was created automatically by `%fv'
9 using Cat2h_c.sd 1.0 (23.05.97)
13 ****************************************************************/
16 #define __USE_SYSBASE 1
17 #include <proto/exec.h>
18 #include <proto/locale.h>
20 #include <clib/exec_protos.h>
21 #include <clib/locale_protos.h>
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
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.
42 __attribute__ ((constructor))
45 _STI_19000_GetCatalog( VOID )
50 if( LocaleBase = OpenLibrary( "locale.library", 0 ) )
52 Catalog = OpenCatalogA( NULL, "%b.catalog", NULL );
62 __attribute__ ((destructor))
65 _STD_19000_FreeCatalog( VOID )
72 CloseCatalog( Catalog );
73 CloseLibrary( LocaleBase );
82 GetString( STRPTR str )
88 /* Avoid Enforcer hits... */
92 /* Avoid any problems regarding char not being unsigned */
93 id = ( ( ( UBYTE ) *str++ ) << 8 ) | ( ( UBYTE ) *str++ );
97 str = GetCatalogStr( Catalog, id, str );