revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / reqtools / rtlocale.c
blob7f5a13612b214cbe87ea0ea6f34e9b157f475acf
1 /*********
2 * LOCALE *
3 *********/
5 #include "filereq.h"
7 #include <proto/locale.h>
8 #include <string.h>
10 #ifdef __AROS__
11 #include <aros/macros.h>
12 #endif
14 /****************************************************************************************/
16 char *REGARGS GetStr (struct Catalog *cat, char *idstr)
18 char *local;
19 UWORD id = *(UWORD *)idstr;
21 #ifdef __AROS__
22 #if !AROS_BIG_ENDIAN
23 id = AROS_BE2WORD(id);
24 #endif
25 #endif
26 local = idstr + 2;
27 if (LocaleBase) return ((char *)GetCatalogStr (cat, id, local));
28 return (local);
31 /****************************************************************************************/
33 #undef ThisProcess
34 #define ThisProcess() ((struct Process *)FindTask(NULL))
36 /****************************************************************************************/
38 struct Catalog *REGARGS RT_OpenCatalog (struct Locale *locale)
40 struct Process *proc;
41 struct Catalog *cat;
42 APTR oldwinptr;
44 if (!LocaleBase) return (NULL);
46 proc = ThisProcess();
48 if (proc->pr_Task.tc_Node.ln_Type != NT_PROCESS) return (NULL);
50 oldwinptr = proc->pr_WindowPtr;
51 proc->pr_WindowPtr = (APTR)-1;
52 cat = OpenCatalog (locale, "System/Libs/reqtools.catalog", OC_Version, 39, TAG_DONE);
53 proc->pr_WindowPtr = oldwinptr;
55 return (cat);
58 /****************************************************************************************/
60 void REGARGS RT_CloseCatalog (struct Catalog *cat)
62 if (LocaleBase) CloseCatalog (cat);
65 /****************************************************************************************/