Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / workbench / prefs / serial / locale.c
blob5ccb8adac4c1bd7d36bd7ac61d22360c45877a5c
1 /*
2 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <exec/types.h>
7 #include <proto/locale.h>
9 #define CATCOMP_ARRAY
10 #include "strings.h"
12 #include "global.h"
14 #define CATALOG_NAME "System/Prefs/Serial.catalog"
15 #define CATALOG_VERSION 0
17 struct Catalog *catalog;
19 /*********************************************************************************************/
21 VOID InitLocale(VOID)
23 if (LocaleBase != NULL)
25 catalog = OpenCatalog(NULL,
26 (STRPTR) CATALOG_NAME,
27 OC_Version, CATALOG_VERSION,
28 TAG_DONE);
30 else
32 catalog=NULL;
36 /*********************************************************************************************/
38 VOID CleanupLocale(VOID)
40 if (LocaleBase != NULL && catalog != NULL) CloseCatalog(catalog);
41 catalog=NULL;
44 /*********************************************************************************************/
46 CONST_STRPTR MSG(ULONG id)
48 if ( (catalog != NULL) && (LocaleBase != NULL) )
50 return GetCatalogStr(catalog, id, CatCompArray[id].cca_Str);
52 else
54 return CatCompArray[id].cca_Str;
58 /*********************************************************************************************/