Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / utilities / More / locale.c
blob450b30e4d15228bf0ce76f2c188980ec2e93bd79
1 /*
2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define CATCOMP_ARRAY
7 #include "strings.h"
9 #include <libraries/locale.h>
10 #include <proto/locale.h>
11 #include <proto/exec.h>
12 #include <proto/alib.h>
14 #define DEBUG 0
15 #include <aros/debug.h>
17 /*********************************************************************************************/
19 #ifdef __MORPHOS__
20 struct Library *LocaleBase;
21 #else
22 struct LocaleBase *LocaleBase;
23 #endif
24 struct Catalog *catalog;
26 /*********************************************************************************************/
28 void InitLocale(STRPTR catname, ULONG version)
30 LocaleBase = (struct LocaleBase *)OpenLibrary("locale.library", 39);
31 if (LocaleBase)
33 catalog = OpenCatalog(NULL, catname, OC_Version, version,
34 TAG_DONE);
38 /*********************************************************************************************/
40 void CleanupLocale(void)
42 if (catalog) CloseCatalog(catalog);
43 if (LocaleBase) CloseLibrary((struct Library *)LocaleBase);
46 /*********************************************************************************************/
48 CONST_STRPTR MSG(ULONG id)
50 if (catalog)
52 return GetCatalogStr(catalog, id, CatCompArray[id].cca_Str);
53 } else {
54 return CatCompArray[id].cca_Str;
58 /*********************************************************************************************/