fix properties
[AROS.git] / workbench / locale / languages / català.c
blobe387fcf8c596855a1cdd5af3a4f0f6192d2fd6f9
1 /*
2 Copyright © 1995-1998, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: català.language description file.
6 Lang: English
7 */
9 /* Language file for the Catalan 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 "català" /* 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: "LANGSTR".language 41.0 (08.01.1998)"
28 STRPTR AROS_SLIB_ENTRY(getlangstring,language)();
30 /* ----------------------------------------------------------------------- */
32 /* Bit masks for locale .language functions. Only implement GetString() */
33 #define LF_GetLangStr (1L << 3)
35 /* Arrays for Catalan character type/conversion */
36 extern const STRPTR __catalan_strings[];
38 /* -------------------------------------------------------------------------
39 Library definition, you should not need to change any of this.
40 ------------------------------------------------------------------------- */
42 struct Language
44 struct Library library;
45 struct ExecBase *sysbase;
46 BPTR seglist;
49 extern const UBYTE name[];
50 extern const UBYTE version[];
51 extern const APTR inittabl[4];
52 extern void *const functable[];
53 extern struct Language *AROS_SLIB_ENTRY(init,language)();
54 extern struct Language *AROS_SLIB_ENTRY(open,language)();
55 extern BPTR AROS_SLIB_ENTRY(close,language)();
56 extern BPTR AROS_SLIB_ENTRY(expunge,language)();
57 extern int AROS_SLIB_ENTRY(null,language)();
58 extern ULONG AROS_SLIB_ENTRY(mask,language)();
59 extern const char end;
61 int entry(void)
63 return -1;
66 const struct Resident languageTag =
68 RTC_MATCHWORD,
69 (struct Resident *)&languageTag,
70 (APTR)&end,
71 RTF_AUTOINIT,
72 LANGVER,
73 NT_LIBRARY,
74 -120,
75 (STRPTR)name,
76 (STRPTR)&version[7],
77 (ULONG *)inittabl
80 const UBYTE name[]=LANGSTR ".language";
81 const UBYTE version[]=LANGTAG;
83 const ULONG datatable = 0;
85 const APTR inittabl[4] =
87 (APTR)sizeof(struct Language),
88 (APTR)functable,
89 (APTR)&datatable,
90 &AROS_SLIB_ENTRY(init,language)
93 struct ExecBase *mySysBase;
95 AROS_UFH3(struct Language *, AROS_SLIB_ENTRY(init,language),
96 AROS_UFHA(struct Language *, language, D0),
97 AROS_UFHA(BPTR, segList, A0),
98 AROS_UFHA(struct ExecBase *, SysBase, A6)
101 AROS_USERFUNC_INIT
104 You could just as easily do this bit as the InitResident()
105 datatable, however this works just as well.
107 language->library.lib_Node.ln_Type = NT_LIBRARY;
108 language->library.lib_Node.ln_Pri = -120;
109 language->library.lib_Node.ln_Name = (char *)name;
110 language->library.lib_Flags = LIBF_SUMUSED | LIBF_CHANGED;
111 language->library.lib_Version = LANGVER;
112 language->library.lib_Revision = LANGREV;
113 language->library.lib_IdString = (APTR)&version[7];
115 language->seglist = segList;
116 language->sysbase = SysBase;
117 mySysBase = SysBase;
120 Although it is unlikely, you would return NULL if you for some
121 unknown reason couldn't open.
123 bug("GetLangStr: Loaded at address %p\n", &AROS_SLIB_ENTRY(getlangstring,language));
124 return language;
126 AROS_USERFUNC_EXIT
129 #define SysBase language->sysbase
131 AROS_LH1(struct Language *, open,
132 AROS_LHA(ULONG, version, D0),
133 struct Language *, language, 1, language)
135 AROS_LIBFUNC_INIT
136 language->library.lib_OpenCnt++;
137 language->library.lib_Flags &= ~LIBF_DELEXP;
139 /* Again return NULL if you could not open */
140 return language;
142 AROS_LIBFUNC_EXIT
145 AROS_LH0(BPTR, close, struct Language *, language, 2, language)
147 AROS_LIBFUNC_INIT
149 if(! --language->library.lib_OpenCnt)
151 /* Delayed expunge pending? */
152 if(language->library.lib_Flags & LIBF_DELEXP)
154 /* Yes, expunge the library */
155 return AROS_LC0(BPTR, expunge, struct Language *, language, 3, language);
158 return NULL;
159 AROS_LIBFUNC_EXIT
162 AROS_LH0(BPTR, expunge, struct Language *, language, 3, language)
164 AROS_LIBFUNC_INIT
166 BPTR ret;
167 if(language->library.lib_OpenCnt)
169 /* Can't expunge, we are still open */
170 language->library.lib_Flags |= LIBF_DELEXP;
171 return 0;
174 Remove(&language->library.lib_Node);
175 ret = language->seglist;
177 FreeMem((UBYTE *)language - language->library.lib_NegSize,
178 language->library.lib_PosSize + language->library.lib_NegSize);
180 return ret;
182 AROS_LIBFUNC_EXIT
185 AROS_LH0I(int, null, struct Language *, language, 4, language)
187 AROS_LIBFUNC_INIT
189 return 0;
191 AROS_LIBFUNC_EXIT
194 /* ------------------------------------------------------------------------
195 Language specific functions
196 ------------------------------------------------------------------------ */
198 #undef SysBase
199 #define SysBase mySysBase
201 /* ULONG LanguageMask():
202 This function is to inform locale.library what functions it should
203 use from this library. This is done by returning a bitmask containing
204 1's for functions to use, and 0's for functions to ignore.
206 Unused bits MUST be 0 for future compatibility.
208 AROS_LH0(ULONG, mask, struct Language *, language, 5, language)
210 AROS_LIBFUNC_INIT
212 return ( LF_GetLangStr );
214 AROS_LIBFUNC_EXIT
217 /* STRPTR GetLangString(ULONG num): Language function 3
218 This function is called by GetLocaleStr() and should return
219 the string matching the string id passed in as num.
221 AROS_LH1(STRPTR, getlangstring,
222 AROS_LHA(ULONG, id, D0),
223 struct LocaleBase *, LocaleBase, 9, language)
225 AROS_LIBFUNC_INIT
227 //kprintf("\nWe have got to getlangstring\n");
229 if(id < MAXSTRMSG)
230 return __catalan_strings[id];
231 else
232 return NULL;
234 AROS_LIBFUNC_EXIT
237 /* -----------------------------------------------------------------------
238 Library function table - you will need to alter this
239 I have this right here at the end of the library so that I do not
240 have to have prototypes for the functions. Although you could do that.
241 ----------------------------------------------------------------------- */
243 void *const functable[] =
245 &AROS_SLIB_ENTRY(open,language),
246 &AROS_SLIB_ENTRY(close,language),
247 &AROS_SLIB_ENTRY(expunge,language),
248 &AROS_SLIB_ENTRY(null,language),
249 &AROS_SLIB_ENTRY(mask,language),
251 /* Note, shorter function table, as only getlangstring is used */
253 /* 0 - 3 */
254 &AROS_SLIB_ENTRY(null, language),
255 &AROS_SLIB_ENTRY(null, language),
256 &AROS_SLIB_ENTRY(null, language),
257 &AROS_SLIB_ENTRY(getlangstring, language),
258 (void *)-1
262 Note how only the required data structures are kept...
264 This is the list of strings. It is an array of pointers to strings,
265 although how it is laid out is implementation dependant.
267 const STRPTR __catalan_strings[] =
269 /* A blank string */
272 /* The days of the week. Starts with the first day of the week.
273 In English this would be Sunday, this depends upon the settings
274 of Locale->CalendarType.
277 #warning: stegerg: I think this must always start with Sunday and not what comment above says
279 "Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous",
280 "Divendres", "Dissabte",
282 /* Abbreviated days of the week */
283 "Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds",
285 /* Months of the year */
286 "Gener", "Febrer", "Març",
287 "Abril", "Maig", "Juny",
288 "Juliol", "Agost", "Setembre",
289 "Octubre", "Novembre", "Desembre",
291 /* Abbreviated months of the year */
292 "Gn", "Fb", "Mç", "Ab", "Mg", "Jn",
293 "Jl", "Ag", "St", "Oc", "Nv", "Ds",
295 "Sí", /* Yes, affirmative response */
296 "No", /* No/negative response */
298 /* AM/PM strings AM 0000 -> 1159, PM 1200 -> 2359 */
299 "AM", "PM",
301 /* Soft and hard hyphens */
302 "\xAD", "-",
304 /* Open and close quotes */
305 "\"", "\"",
307 /* Days: But not actual day names
308 Yesterday - the day before the current
309 Today - the current day
310 Tomorrow - the next day
311 Future.
313 "Ahir", "Avui", "Demà", "Futur"
316 /* This is the end of ROMtag marker. */
317 const char end=0;