2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: polski.language description file.
10 /* Language file for the Polish language. Collation tables need to be implemented */
12 #include <exec/types.h>
13 #include <aros/system.h>
14 #include <exec/resident.h>
15 #include <exec/libraries.h>
16 #include <libraries/locale.h>
18 #include <proto/exec.h>
19 #include <aros/libcall.h>
20 #include <aros/asmcall.h>
22 #include <aros/debug.h>
24 #define LANGSTR "polski" /* String version of above */
25 #define LANGVER 41 /* Version number of language */
26 #define LANGREV 0 /* Revision number of language */
27 #define LANGTAG "\0$VER: polski.language 41.0 (25.07.1999)"
29 AROS_LD1(STRPTR
, getlangstring
,
30 AROS_LHA(ULONG
, id
, D0
),
31 struct LocaleBase
*, LocaleBase
, 9, language
);
33 /* ----------------------------------------------------------------------- */
35 /* Bit masks for locale .language functions. Only implement GetString() */
36 #define LF_GetLangStr (1L << 3)
38 /* Arrays for German character type/conversion */
39 extern const STRPTR __polish_strings
[];
41 /* -------------------------------------------------------------------------
42 Library definition, you should not need to change any of this.
43 ------------------------------------------------------------------------- */
47 struct Library library
;
48 struct ExecBase
*sysbase
;
52 extern const UBYTE name
[];
53 extern const UBYTE version
[];
54 extern const APTR inittabl
[4];
55 extern void *const functable
[];
56 extern struct Language
*AROS_SLIB_ENTRY(init
,language
)();
57 AROS_LD1(struct Language
*, open
,
58 AROS_LHA(ULONG
, version
, D0
),
59 struct Language
*, language
, 1, language
);
60 AROS_LD0(BPTR
, close
, struct Language
*, language
, 2, language
);
61 AROS_LD0(BPTR
, expunge
, struct Language
*, language
, 3, language
);
62 AROS_LD0I(int, null
, struct Language
*, language
, 4, language
);
63 AROS_LD0(ULONG
, mask
, struct Language
*, language
, 5, language
);
64 extern const char end
;
71 const struct Resident languageTag
=
74 (struct Resident
*)&languageTag
,
85 const UBYTE name
[]=LANGSTR
".language";
86 const UBYTE version
[]=LANGTAG
;
88 const ULONG datatable
= 0;
90 const APTR inittabl
[4] =
92 (APTR
)sizeof(struct Language
),
95 &AROS_SLIB_ENTRY(init
,language
)
98 struct ExecBase
*mySysBase
;
100 AROS_UFH3(struct Language
*, AROS_SLIB_ENTRY(init
,language
),
101 AROS_UFHA(struct Language
*, language
, D0
),
102 AROS_UFHA(BPTR
, segList
, A0
),
103 AROS_UFHA(struct ExecBase
*, SysBase
, A6
)
109 You could just as easily do this bit as the InitResident()
110 datatable, however this works just as well.
112 language
->library
.lib_Node
.ln_Type
= NT_LIBRARY
;
113 language
->library
.lib_Node
.ln_Pri
= -120;
114 language
->library
.lib_Node
.ln_Name
= (char *)name
;
115 language
->library
.lib_Flags
= LIBF_SUMUSED
| LIBF_CHANGED
;
116 language
->library
.lib_Version
= LANGVER
;
117 language
->library
.lib_Revision
= LANGREV
;
118 language
->library
.lib_IdString
= (APTR
)&version
[7];
120 language
->seglist
= segList
;
121 language
->sysbase
= SysBase
;
125 Although it is unlikely, you would return NULL if you for some
126 unknown reason couldn't open.
128 bug("GetLangStr: Loaded at address %p\n", &AROS_SLIB_ENTRY(getlangstring
,language
));
134 #define SysBase language->sysbase
136 AROS_LH1(struct Language
*, open
,
137 AROS_LHA(ULONG
, version
, D0
),
138 struct Language
*, language
, 1, language
)
141 language
->library
.lib_OpenCnt
++;
142 language
->library
.lib_Flags
&= ~LIBF_DELEXP
;
144 /* Again return NULL if you could not open */
150 AROS_LH0(BPTR
, close
, struct Language
*, language
, 2, language
)
154 if(! --language
->library
.lib_OpenCnt
)
156 /* Delayed expunge pending? */
157 if(language
->library
.lib_Flags
& LIBF_DELEXP
)
159 /* Yes, expunge the library */
160 return AROS_LC0(BPTR
, expunge
, struct Language
*, language
, 3, language
);
167 AROS_LH0(BPTR
, expunge
, struct Language
*, language
, 3, language
)
172 if(language
->library
.lib_OpenCnt
)
174 /* Can't expunge, we are still open */
175 language
->library
.lib_Flags
|= LIBF_DELEXP
;
179 Remove(&language
->library
.lib_Node
);
180 ret
= language
->seglist
;
182 FreeMem((UBYTE
*)language
- language
->library
.lib_NegSize
,
183 language
->library
.lib_PosSize
+ language
->library
.lib_NegSize
);
190 AROS_LH0I(int, null
, struct Language
*, language
, 4, language
)
199 /* ------------------------------------------------------------------------
200 Language specific functions
201 ------------------------------------------------------------------------ */
204 #define SysBase mySysBase
206 /* ULONG LanguageMask():
207 This function is to inform locale.library what functions it should
208 use from this library. This is done by returning a bitmask containing
209 1's for functions to use, and 0's for functions to ignore.
211 Unused bits MUST be 0 for future compatibility.
213 AROS_LH0(ULONG
, mask
, struct Language
*, language
, 5, language
)
217 return ( LF_GetLangStr
);
222 /* STRPTR GetLangString(ULONG num): Language function 3
223 This function is called by GetLocaleStr() and should return
224 the string matching the string id passed in as num.
226 AROS_LH1(STRPTR
, getlangstring
,
227 AROS_LHA(ULONG
, id
, D0
),
228 struct LocaleBase
*, LocaleBase
, 9, language
)
232 //kprintf("\nWe have got to getlangstring\n");
235 return __polish_strings
[id
];
242 /* -----------------------------------------------------------------------
243 Library function table - you will need to alter this
244 I have this right here at the end of the library so that I do not
245 have to have prototypes for the functions. Although you could do that.
246 ----------------------------------------------------------------------- */
248 void *const functable
[] =
250 &AROS_SLIB_ENTRY(open
,language
),
251 &AROS_SLIB_ENTRY(close
,language
),
252 &AROS_SLIB_ENTRY(expunge
,language
),
253 &AROS_SLIB_ENTRY(null
,language
),
254 &AROS_SLIB_ENTRY(mask
,language
),
256 /* Note, shorter function table, as only getlangstring is used */
259 &AROS_SLIB_ENTRY(null
, language
),
260 &AROS_SLIB_ENTRY(null
, language
),
261 &AROS_SLIB_ENTRY(null
, language
),
262 &AROS_SLIB_ENTRY(getlangstring
, language
),
267 Note how only the required data structures are kept...
269 This is the list of strings. It is an array of pointers to strings,
270 although how it is laid out is implementation dependant.
272 const STRPTR __polish_strings
[] =
277 /* The days of the week. Starts with the first day of the week.
278 In English this would be Sunday, this depends upon the settings
279 of Locale->CalendarType.
281 "Poniedzia³ek", "Wtorek", "¦roda", "Czwartek", "Pi±tek",
282 "Sobota", "Niedziala",
284 /* Abbreviated days of the week */
285 "Po", "Wt", "¦r", "Cz", "Pi", "So", "Ni",
287 /* Months of the year */
288 "Styczeñ", "Luty", "Marzec",
289 "Kwiecieñ", "Maj", "Czerwiec",
290 "Lipiec", "Sierpieñ", "Wrzesieñ",
291 "Pa¼dziernik", "Listopad", "Grudzieñ",
293 /* Abbreviated months of the year */
294 "I", "II", "III", "IV", "V", "VI",
295 "VII", "VIII", "IX", "X", "XI", "XII",
297 "Tak", /* Yes, affirmative response */
298 "Nie", /* No/negative response */
300 /* AM/PM strings AM 0000 -> 1159, PM 1200 -> 2359 */
303 /* Soft and hard hyphens */
306 /* Open and close quotes */
309 /* Days: But not actual day names
310 Yesterday - the day before the current
311 Today - the current day
312 Tomorrow - the next day
315 "Wczoraj", "Dzi¶", "Jutro", "Przysz³o¶æ"
318 /* This is the end of ROMtag marker. */