2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: magyar.language description file.
10 #include <exec/types.h>
11 #include <aros/system.h>
12 #include <exec/resident.h>
13 #include <exec/libraries.h>
14 #include <libraries/locale.h>
16 #include <proto/exec.h>
17 #include <aros/libcall.h>
18 #include <aros/asmcall.h>
20 #include <aros/debug.h>
22 #define LANGSTR "magyar" /* String version of above */
23 #define LANGVER 41 /* Version number of language */
24 #define LANGREV 0 /* Revision number of language */
25 #define LANGTAG "\0$VER: magyar.language 41.0 (25.07.1999)"
27 AROS_LD1(STRPTR
, getlangstring
,
28 AROS_LHA(ULONG
, id
, D0
),
29 struct LocaleBase
*, LocaleBase
, 9, language
);
31 /* ----------------------------------------------------------------------- */
33 /* Bit masks for locale .language functions. Only implement GetString() */
34 #define LF_GetLangStr (1L << 3)
36 /* Arrays for German character type/conversion */
37 extern const STRPTR __magyar_strings
[];
39 /* -------------------------------------------------------------------------
40 Library definition, you should not need to change any of this.
41 ------------------------------------------------------------------------- */
45 struct Library library
;
46 struct ExecBase
*sysbase
;
50 extern const UBYTE name
[];
51 extern const UBYTE version
[];
52 extern const APTR inittabl
[4];
53 extern void *const functable
[];
54 extern struct Language
*AROS_SLIB_ENTRY(init
,language
)();
55 AROS_LD1(struct Language
*, open
,
56 AROS_LHA(ULONG
, version
, D0
),
57 struct Language
*, language
, 1, language
);
58 AROS_LD0(BPTR
, close
, struct Language
*, language
, 2, language
);
59 AROS_LD0(BPTR
, expunge
, struct Language
*, language
, 3, language
);
60 AROS_LD0I(int, null
, struct Language
*, language
, 4, language
);
61 AROS_LD0(ULONG
, mask
, struct Language
*, language
, 5, language
);
62 extern const char end
;
69 const struct Resident languageTag
=
72 (struct Resident
*)&languageTag
,
83 const UBYTE name
[]=LANGSTR
".language";
84 const UBYTE version
[]=LANGTAG
;
86 const ULONG datatable
= 0;
88 const APTR inittabl
[4] =
90 (APTR
)sizeof(struct Language
),
93 &AROS_SLIB_ENTRY(init
,language
)
96 struct ExecBase
*mySysBase
;
98 AROS_UFH3(struct Language
*, AROS_SLIB_ENTRY(init
,language
),
99 AROS_UFHA(struct Language
*, language
, D0
),
100 AROS_UFHA(BPTR
, segList
, A0
),
101 AROS_UFHA(struct ExecBase
*, SysBase
, A6
)
107 You could just as easily do this bit as the InitResident()
108 datatable, however this works just as well.
110 language
->library
.lib_Node
.ln_Type
= NT_LIBRARY
;
111 language
->library
.lib_Node
.ln_Pri
= -120;
112 language
->library
.lib_Node
.ln_Name
= (char *)name
;
113 language
->library
.lib_Flags
= LIBF_SUMUSED
| LIBF_CHANGED
;
114 language
->library
.lib_Version
= LANGVER
;
115 language
->library
.lib_Revision
= LANGREV
;
116 language
->library
.lib_IdString
= (APTR
)&version
[7];
118 language
->seglist
= segList
;
119 language
->sysbase
= SysBase
;
123 Although it is unlikely, you would return NULL if you for some
124 unknown reason couldn't open.
126 bug("GetLangStr: Loaded at address %p\n", &AROS_SLIB_ENTRY(getlangstring
,language
));
132 #define SysBase language->sysbase
134 AROS_LH1(struct Language
*, open
,
135 AROS_LHA(ULONG
, version
, D0
),
136 struct Language
*, language
, 1, language
)
139 language
->library
.lib_OpenCnt
++;
140 language
->library
.lib_Flags
&= ~LIBF_DELEXP
;
142 /* Again return NULL if you could not open */
148 AROS_LH0(BPTR
, close
, struct Language
*, language
, 2, language
)
152 if(! --language
->library
.lib_OpenCnt
)
154 /* Delayed expunge pending? */
155 if(language
->library
.lib_Flags
& LIBF_DELEXP
)
157 /* Yes, expunge the library */
158 return AROS_LC0(BPTR
, expunge
, struct Language
*, language
, 3, language
);
165 AROS_LH0(BPTR
, expunge
, struct Language
*, language
, 3, language
)
170 if(language
->library
.lib_OpenCnt
)
172 /* Can't expunge, we are still open */
173 language
->library
.lib_Flags
|= LIBF_DELEXP
;
177 Remove(&language
->library
.lib_Node
);
178 ret
= language
->seglist
;
180 FreeMem((UBYTE
*)language
- language
->library
.lib_NegSize
,
181 language
->library
.lib_PosSize
+ language
->library
.lib_NegSize
);
188 AROS_LH0I(int, null
, struct Language
*, language
, 4, language
)
197 /* ------------------------------------------------------------------------
198 Language specific functions
199 ------------------------------------------------------------------------ */
202 #define SysBase mySysBase
204 /* ULONG LanguageMask():
205 This function is to inform locale.library what functions it should
206 use from this library. This is done by returning a bitmask containing
207 1's for functions to use, and 0's for functions to ignore.
209 Unused bits MUST be 0 for future compatibility.
211 AROS_LH0(ULONG
, mask
, struct Language
*, language
, 5, language
)
215 return ( LF_GetLangStr
);
220 /* STRPTR GetLangString(ULONG num): Language function 3
221 This function is called by GetLocaleStr() and should return
222 the string matching the string id passed in as num.
224 AROS_LH1(STRPTR
, getlangstring
,
225 AROS_LHA(ULONG
, id
, D0
),
226 struct LocaleBase
*, LocaleBase
, 9, language
)
230 //kprintf("\nWe have got to getlangstring\n");
233 return __magyar_strings
[id
];
240 /* -----------------------------------------------------------------------
241 Library function table - you will need to alter this
242 I have this right here at the end of the library so that I do not
243 have to have prototypes for the functions. Although you could do that.
244 ----------------------------------------------------------------------- */
246 void *const functable
[] =
248 &AROS_SLIB_ENTRY(open
,language
),
249 &AROS_SLIB_ENTRY(close
,language
),
250 &AROS_SLIB_ENTRY(expunge
,language
),
251 &AROS_SLIB_ENTRY(null
,language
),
252 &AROS_SLIB_ENTRY(mask
,language
),
254 /* Note, shorter function table, as only getlangstring is used */
257 &AROS_SLIB_ENTRY(null
, language
),
258 &AROS_SLIB_ENTRY(null
, language
),
259 &AROS_SLIB_ENTRY(null
, language
),
260 &AROS_SLIB_ENTRY(getlangstring
, language
),
265 Note how only the required data structures are kept...
267 This is the list of strings. It is an array of pointers to strings,
268 although how it is laid out is implementation dependant.
270 const STRPTR __magyar_strings
[] =
275 /* The days of the week. Starts with the first day of the week.
276 In English this would be Sunday, this depends upon the settings
277 of Locale->CalendarType.
279 "Hétfô", "Kedd", "Szerda", "Csütörtök", "Péntek",
280 "Szombat", "Vasárnap",
282 /* Abbreviated days of the week */
283 "H", "K", "Sz", "Cs", "P", "Szo", "V",
285 /* Months of the year */
286 "Január", "Február", "Március",
287 "Április", "Május", "Június",
288 "Julius", "Augusztus", "Szeptember",
289 "Október", "November", "December",
291 /* Abbreviated months of the year */
292 "I", "II", "III", "IV", "V", "VI",
293 "VII", "VIII", "IX", "X", "XI", "XII",
295 "Igen", /* Yes, affirmative response */
296 "Nem", /* No/negative response */
298 /* AM/PM strings AM 0000 -> 1159, PM 1200 -> 2359 */
299 "Délelôtt", "Délután",
301 /* Soft and hard hyphens */
304 /* Open and close quotes */
307 /* Days: But not actual day names
308 Yesterday - the day before the current
309 Today - the current day
310 Tomorrow - the next day
313 "Tegnap", "Ma", "Holnap", "Jövô"
316 /* This is the end of ROMtag marker. */