2 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
5 Desc: Internal definitions for the locale.library.
9 #ifndef LOCALE_INTERN_H
10 #define LOCALE_INTERN_H
12 #ifndef EXEC_EXECBASE_H
13 #include <exec/execbase.h>
15 #ifndef EXEC_SEMAPHORES_H
16 #include <exec/semaphores.h>
18 #ifndef DOS_DOSEXTENS_H
19 #include <dos/dosextens.h>
21 #ifndef LIBRARIES_LOCALE_H
22 #include <libraries/locale.h>
24 #ifndef UTILITY_UTILITY_H
25 #include <utility/utility.h>
28 #include <aros/libcall.h>
31 /* aros_print_not_implemented() macro: */
32 #include <aros/debug.h>
33 #include <aros/asmcall.h>
34 /* Should the Loc???() replacement functions lock the default locale.
35 1 = yes. 0 = no. If you set this to 0, then you must make sure that
36 a Locale which was once set as default Locale never gets freed from
39 #define REPLACEMENTFUNCS_LOCK_LOCALE 0
41 /* [New]FormatString: Allow %width.limit formatting in all format
42 tokens not just s and b. 1 = yes. 0 = no. exec.doc/RawDoFmt autodoc
43 is wrong %d and %x do support this, too, so this should be set to 1. */
45 #define USE_GLOBALLIMIT 1
47 /* [New]FormatString: Should formatting routine support 64bit formatting
48 %L<type> and %ll<type>. 1 = yes. 0 = no. Current implementation use
49 QUAD and UQUAD types. */
59 struct LocaleBase lb_LocaleBase
;
61 struct IntLocale
*lb_DefaultLocale
;
62 struct IntLocale
*lb_CurrentLocale
;
63 struct SignalSemaphore lb_LocaleLock
;
64 struct SignalSemaphore lb_CatalogLock
;
65 struct MinList lb_CatalogList
;
70 struct Locale il_Locale
;
73 struct Library
*il_CurrentLanguage
;
74 struct Catalog
*il_DosCatalog
;
75 APTR il_LanguageFunctions
[32];
77 /* Need to put all sorts of crap here later. */
79 UBYTE LanguageName
[30];
81 UBYTE PreferredLanguages
[10][30];
84 ** Don't change the order of the following field,
85 ** It's based on CountryPrefs structure in
86 ** <prefs/locale.h> and InitLocale() relies on this
90 UBYTE DateTimeFormat
[80];
93 UBYTE ShortDateTimeFormat
[80];
94 UBYTE ShortDateFormat
[40];
95 UBYTE ShortTimeFormat
[40];
97 UBYTE DecimalPoint
[10];
98 UBYTE GroupSeparator
[10];
99 UBYTE FracGroupSeparator
[10];
101 UBYTE FracGrouping
[10];
102 UBYTE MonDecimalPoint
[10];
103 UBYTE MonGroupSeparator
[10];
104 UBYTE MonFracGroupSeparator
[10];
105 UBYTE MonGrouping
[10];
106 UBYTE MonFracGrouping
[10];
109 UBYTE MonSmallCS
[10];
111 UBYTE MonPositiveSign
[10];
113 UBYTE MonNegativeSign
[10];
119 ULONG cs_Id
; /* Really signed, but need it to be unsigned for ICF_INORDER */
122 /* see Amiga Developer CD 2.1:NDK/NDK_3.1/Examples1/locale/SelfLoad/catalog.c */
127 ULONG cs_Reserved
[7];
132 struct Catalog ic_Catalog
;
133 struct CodeSet ic_CodeSet
;
134 struct CatStr
*ic_CatStrings
;
135 UBYTE
*ic_StringChunk
;
140 UBYTE ic_LanguageName
[30];
141 UBYTE ic_Name
[0]; // name of the file as passed to OpenCatalogA
142 /* structure sizes depends on length of ic_Name string */
145 /* Catalog strings are in order, so we don't have to search them all */
146 #define ICF_INORDER (1L<<0)
148 /* Shortcuts to the internal structures */
149 #define IntLB(lb) ((struct IntLocaleBase *)(lb))
150 #define IntL(locale) ((struct IntLocale *)(locale))
151 #define IntCat(cat) ((struct IntCatalog *)(cat))
153 #if REPLACEMENTFUNCS_LOCK_LOCALE
154 #define REPLACEMENT_LOCK ObtainSemaphore(&IntLB(LocaleBase)->lb_LocaleLock)
155 #define REPLACEMENT_UNLOCK ReleaseSemaphore(&IntLB(LocaleBase)->lb_LocaleLock)
157 #define REPLACEMENT_LOCK
158 #define REPLACEMENT_UNLOCK
161 #define ID_CTLG MAKE_ID('C','T','L','G')
162 #define ID_FVER MAKE_ID('F','V','E','R')
163 #define ID_LANG MAKE_ID('L','A','N','G')
164 #define ID_CSET MAKE_ID('C','S','E','T')
165 #define ID_STRS MAKE_ID('S','T','R','S')
168 void dispose_catalog(struct IntCatalog
* cat
,
169 struct LocaleBase
* LocaleBase
);
171 void SetLocaleLanguage(struct IntLocale
*, struct LocaleBase
*);
173 void InstallPatches(void);
175 extern const struct Locale defLocale
;
177 #endif /* LOCALE_INTERN_H */