2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Espanol.language description file.
9 /* Language file for the Spanish language. */
11 #include <exec/types.h>
12 #include <aros/system.h>
13 #include <exec/resident.h>
14 #include <exec/libraries.h>
15 #include <libraries/locale.h>
17 #include <proto/exec.h>
18 #include <aros/libcall.h>
19 #include <aros/asmcall.h>
21 #include <aros/debug.h>
23 #define LANGSTR "español" /* String version of above */
24 #define LANGVER 41 /* Version number of language */
25 #define LANGREV 0 /* Revision number of language */
26 #define LANGTAG "\0$VER: español.language 41.0 (08.01.1998)"
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 __spanish_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
)();
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
, 4, 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 version
[]=LANGTAG
;
87 const ULONG datatable
= 0;
89 const APTR inittabl
[4] =
91 (APTR
)sizeof(struct Language
),
94 &AROS_SLIB_ENTRY(init
,language
)
97 struct ExecBase
*mySysBase
;
99 AROS_UFH3(struct Language
*, AROS_SLIB_ENTRY(init
,language
),
100 AROS_UFHA(struct Language
*, language
, D0
),
101 AROS_UFHA(BPTR
, segList
, A0
),
102 AROS_UFHA(struct ExecBase
*, SysBase
, A6
)
108 You could just as easily do this bit as the InitResident()
109 datatable, however this works just as well.
111 language
->library
.lib_Node
.ln_Type
= NT_LIBRARY
;
112 language
->library
.lib_Node
.ln_Pri
= -120;
113 language
->library
.lib_Node
.ln_Name
= (char *)name
;
114 language
->library
.lib_Flags
= LIBF_SUMUSED
| LIBF_CHANGED
;
115 language
->library
.lib_Version
= LANGVER
;
116 language
->library
.lib_Revision
= LANGREV
;
117 language
->library
.lib_IdString
= (APTR
)&version
[7];
119 language
->seglist
= segList
;
120 language
->sysbase
= SysBase
;
124 Although it is unlikely, you would return NULL if you for some
125 unknown reason couldn't open.
127 bug("GetLangStr: Loaded at address %p\n", &AROS_SLIB_ENTRY(getlangstring
,language
));
133 #define SysBase language->sysbase
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
, 4, language
)
198 /* ------------------------------------------------------------------------
199 Language specific functions
200 ------------------------------------------------------------------------ */
203 #define SysBase mySysBase
205 /* ULONG LanguageMask():
206 This function is to inform locale.library what functions it should
207 use from this library. This is done by returning a bitmask containing
208 1's for functions to use, and 0's for functions to ignore.
210 Unused bits MUST be 0 for future compatibility.
212 AROS_LH0(ULONG
, mask
, struct Language
*, language
, 5, language
)
216 return ( LF_GetLangStr
);
221 /* STRPTR GetLangString(ULONG num): Language function 3
222 This function is called by GetLocaleStr() and should return
223 the string matching the string id passed in as num.
225 AROS_LH1(STRPTR
, getlangstring
,
226 AROS_LHA(ULONG
, id
, D0
),
227 struct LocaleBase
*, LocaleBase
, 9, language
)
231 //kprintf("\nWe have got to getlangstring\n");
234 return __spanish_strings
[id
];
241 /* -----------------------------------------------------------------------
242 Library function table - you will need to alter this
243 I have this right here at the end of the library so that I do not
244 have to have prototypes for the functions. Although you could do that.
245 ----------------------------------------------------------------------- */
247 void *const functable
[] =
249 &AROS_SLIB_ENTRY(open
,language
),
250 &AROS_SLIB_ENTRY(close
,language
),
251 &AROS_SLIB_ENTRY(expunge
,language
),
252 &AROS_SLIB_ENTRY(null
,language
),
253 &AROS_SLIB_ENTRY(mask
,language
),
255 /* Note, shorter function table, as only getlangstring is used */
258 &AROS_SLIB_ENTRY(null
, language
),
259 &AROS_SLIB_ENTRY(null
, language
),
260 &AROS_SLIB_ENTRY(null
, language
),
261 &AROS_SLIB_ENTRY(getlangstring
, language
),
266 Note how only the required data structures are kept...
268 This is the list of strings. It is an array of pointers to strings,
269 although how it is laid out is implementation dependant.
271 const STRPTR __spanish_strings
[] =
276 /* The days of the week. Starts with the first day of the week.
277 In English this would be Sunday, this depends upon the settings
278 of Locale->CalendarType.
281 #warning: stegerg: I think this must always start with Sunday and not what comment above says
283 "domingo", "lunes", "martes", "miércoles", "jueves",
286 /* Abbreviated days of the week */
287 "dom", "lun", "mar", "mie", "jue", "vie", "sab",
289 /* Months of the year */
290 "enero", "febrero", "marzo",
291 "abril", "mayo", "junio",
292 "julio", "agosto", "septiembre",
293 "octubre", "noviembre", "diciembre",
295 /* Abbreviated months of the year */
296 "ene", "feb", "mar", "abr", "may", "jun",
297 "jul", "ago", "sep", "oct", "nov", "dic",
299 "Sí", /* Yes, affirmative response */
300 "No", /* No/negative response */
302 /* AM/PM strings AM 0000 -> 1159, PM 1200 -> 2359 */
305 /* Soft and hard hyphens */
308 /* Open and close quotes */
311 /* Days: But not actual day names
312 Yesterday - the day before the current
313 Today - the current day
314 Tomorrow - the next day
317 "Ayer", "Hoy", "Mañana", "Futuro"
320 /* This is the end of ROMtag marker. */