2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
5 Desc: french.language description file.
9 #include <exec/types.h>
10 #include <aros/system.h>
11 #include <exec/resident.h>
12 #include <exec/libraries.h>
13 #include <libraries/locale.h>
15 #include <proto/exec.h>
16 #include <aros/libcall.h>
17 #include <aros/asmcall.h>
19 #include <aros/debug.h>
21 #define LANGSTR "french" /* String version of above */
22 #define NLANGSTR "français" /* Native version of LANGSTR */
23 #define LANGVER 41 /* Version number of language */
24 #define LANGREV 2 /* Revision number of language */
25 #define LANGTAG "\0$VER: " LANGSTR ".language 41.2 (30.09.2014)"
26 #define NLANGTAG "$NLANG:" NLANGSTR
28 AROS_LD1(STRPTR
, getlangstring
,
29 AROS_LHA(ULONG
, id
, D0
),
30 struct LocaleBase
*, LocaleBase
, 9, language
);
32 /* ----------------------------------------------------------------------- */
34 /* Bit masks for locale .language functions. Only implement GetString() */
35 #define LF_GetLangStr (1L << 3)
37 /* Arrays for French character type/conversion */
38 extern const STRPTR __french_strings
[];
40 /* -------------------------------------------------------------------------
41 Library definition, you should not need to change any of this.
42 ------------------------------------------------------------------------- */
46 struct Library library
;
47 struct ExecBase
*sysbase
;
51 extern const UBYTE name
[];
52 extern const UBYTE version
[];
53 extern const APTR inittabl
[4];
54 extern void *const functable
[];
55 extern struct Language
*AROS_SLIB_ENTRY(init
,language
,0)();
56 AROS_LD1(struct Language
*, open
,
57 AROS_LHA(ULONG
, version
, D0
),
58 struct Language
*, language
, 1, language
);
59 AROS_LD0(BPTR
, close
, struct Language
*, language
, 2, language
);
60 AROS_LD0(BPTR
, expunge
, struct Language
*, language
, 3, language
);
61 AROS_LD0I(int, null
, struct Language
*, language
, 0, language
);
62 AROS_LD0(ULONG
, mask
, struct Language
*, language
, 5, language
);
63 extern const char end
;
70 const struct Resident languageTag
=
73 (struct Resident
*)&languageTag
,
84 const UBYTE name
[]=LANGSTR
".language";
85 const UBYTE nativelang
[]=NLANGTAG
; /* N.B - MUST come before $VER: */
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
,0)
98 struct ExecBase
*SysBase
;
100 AROS_UFH3(struct Language
*, AROS_SLIB_ENTRY(init
,language
,0),
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
,9));
135 AROS_LH1(struct Language
*, open
,
136 AROS_LHA(ULONG
, version
, D0
),
137 struct Language
*, language
, 1, language
)
140 language
->library
.lib_OpenCnt
++;
141 language
->library
.lib_Flags
&= ~LIBF_DELEXP
;
143 /* Again return NULL if you could not open */
149 AROS_LH0(BPTR
, close
, struct Language
*, language
, 2, language
)
153 if(! --language
->library
.lib_OpenCnt
)
155 /* Delayed expunge pending? */
156 if(language
->library
.lib_Flags
& LIBF_DELEXP
)
158 /* Yes, expunge the library */
159 return AROS_LC0(BPTR
, expunge
, struct Language
*, language
, 3, language
);
166 AROS_LH0(BPTR
, expunge
, struct Language
*, language
, 3, language
)
171 if(language
->library
.lib_OpenCnt
)
173 /* Can't expunge, we are still open */
174 language
->library
.lib_Flags
|= LIBF_DELEXP
;
178 Remove(&language
->library
.lib_Node
);
179 ret
= language
->seglist
;
181 FreeMem((UBYTE
*)language
- language
->library
.lib_NegSize
,
182 language
->library
.lib_PosSize
+ language
->library
.lib_NegSize
);
189 AROS_LH0I(int, null
, struct Language
*, language
, 0, language
)
198 /* ------------------------------------------------------------------------
199 Language specific functions
200 ------------------------------------------------------------------------ */
203 /* ULONG LanguageMask():
204 This function is to inform locale.library what functions it should
205 use from this library. This is done by returning a bitmask containing
206 1's for functions to use, and 0's for functions to ignore.
208 Unused bits MUST be 0 for future compatibility.
210 AROS_LH0(ULONG
, mask
, struct Language
*, language
, 5, language
)
214 return ( LF_GetLangStr
);
219 /* STRPTR GetLangString(ULONG num): Language function 3
220 This function is called by GetLocaleStr() and should return
221 the string matching the string id passed in as num.
223 AROS_LH1(STRPTR
, getlangstring
,
224 AROS_LHA(ULONG
, id
, D0
),
225 struct LocaleBase
*, LocaleBase
, 9, language
)
229 //kprintf("\nWe have got to getlangstring\n");
232 return __french_strings
[id
];
239 /* -----------------------------------------------------------------------
240 Library function table - you will need to alter this
241 I have this right here at the end of the library so that I do not
242 have to have prototypes for the functions. Although you could do that.
243 ----------------------------------------------------------------------- */
245 void *const functable
[] =
247 &AROS_SLIB_ENTRY(open
,language
,1),
248 &AROS_SLIB_ENTRY(close
,language
,2),
249 &AROS_SLIB_ENTRY(expunge
,language
,3),
250 &AROS_SLIB_ENTRY(null
,language
,0),
251 &AROS_SLIB_ENTRY(mask
,language
,5),
253 /* Note, shorter function table, as only getlangstring is used */
256 &AROS_SLIB_ENTRY(null
, language
, 0),
257 &AROS_SLIB_ENTRY(null
, language
, 0),
258 &AROS_SLIB_ENTRY(null
, language
, 0),
259 &AROS_SLIB_ENTRY(getlangstring
, language
, 9),
264 Note how only the required data structures are kept...
266 This is the list of strings. It is an array of pointers to strings,
267 although how it is laid out is implementation dependant.
269 const STRPTR __french_strings
[] =
274 /* The days of the week. Starts with the first day of the week.
275 In English this would be Sunday, this depends upon the settings
276 of Locale->CalendarType.
279 // NOTICE: stegerg: I think this must always start with Sunday and not what comment above says
281 "Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi",
282 "Vendredi", "Samedi",
284 /* Abbreviated days of the week */
285 "Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam",
287 /* Months of the year */
288 "Janvier", "Février", "Mars",
289 "Avril", "Mai", "Juin",
290 "Juillet", "Août", "Septembre",
291 "Octobre", "Novembre", "Décembre",
293 /* Abbreviated months of the year */
294 "Jan", "Fév", "Mars", "Avr", "Mai", "Juin",
295 "Juil", "Août", "Sep", "Oct", "Nov", "Déc",
297 "Oui", /* Yes, affirmative response */
298 "Non", /* No/negative response */
300 /* AM/PM strings AM 0000 -> 1159, PM 1200 -> 2359 */
303 /* Soft and hard hyphens */
306 /* Open and close quotes */
307 "\xAB\xA0", "\xA0\xBB",
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 "Hier", "Aujourd'hui", "Demain", "Futur",
317 /* Native language name */
321 /* This is the end of ROMtag marker. */