workbench/locale/languages: Use AROS_LDn macro to get prototype of AROS_LHn defined...
[AROS.git] / workbench / locale / languages / shqipja.c
blobddb92e99e8812abf2fe3db8a1c0c676e38ab95bb
1 /*
2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: shqipja.language description file.
6 Lang: english
7 */
9 /* Language file for the Albanian 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 "shqipja" /* 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 (14.08.2010)"
28 AROS_LD1(STRPTR, getlangstring,
29 AROS_LDA(ULONG, id, D0),
30 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 Italian character type/conversion */
39 extern const STRPTR __shqipja_strings[];
41 /* -------------------------------------------------------------------------
42 Library definition, you should not need to change any of this.
43 ------------------------------------------------------------------------- */
45 struct Language
47 struct Library library;
48 struct ExecBase *sysbase;
49 BPTR seglist;
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,0)();
57 AROS_LD1(struct Language *, open,
58 AROS_LDA(ULONG, version, D0),
59 struct Language *, language, 1, language
61 AROS_LD0(BPTR, close, struct Language *, language, 2, language);
62 AROS_LD0(BPTR, expunge, struct Language *, language, 3, language);
63 AROS_LD0I(int, null, struct Language *, language, 0, language);
64 AROS_LD0(ULONG, mask, struct Language *, language, 5, language);
65 extern const char end;
67 int entry(void)
69 return -1;
72 const struct Resident languageTag =
74 RTC_MATCHWORD,
75 (struct Resident *)&languageTag,
76 (APTR)&end,
77 RTF_AUTOINIT,
78 LANGVER,
79 NT_LIBRARY,
80 -120,
81 (STRPTR)name,
82 (STRPTR)&version[7],
83 (ULONG *)inittabl
86 const UBYTE name[]=LANGSTR ".language";
87 const UBYTE version[]=LANGTAG;
89 const ULONG datatable = 0;
91 const APTR inittabl[4] =
93 (APTR)sizeof(struct Language),
94 (APTR)functable,
95 (APTR)&datatable,
96 &AROS_SLIB_ENTRY(init,language,0)
99 struct ExecBase *mySysBase;
101 AROS_UFH3(struct Language *, AROS_SLIB_ENTRY(init,language,0),
102 AROS_UFHA(struct Language *, language, D0),
103 AROS_UFHA(BPTR, segList, A0),
104 AROS_UFHA(struct ExecBase *, SysBase, A6)
107 AROS_USERFUNC_INIT
110 You could just as easily do this bit as the InitResident()
111 datatable, however this works just as well.
113 language->library.lib_Node.ln_Type = NT_LIBRARY;
114 language->library.lib_Node.ln_Pri = -120;
115 language->library.lib_Node.ln_Name = (char *)name;
116 language->library.lib_Flags = LIBF_SUMUSED | LIBF_CHANGED;
117 language->library.lib_Version = LANGVER;
118 language->library.lib_Revision = LANGREV;
119 language->library.lib_IdString = (APTR)&version[7];
121 language->seglist = segList;
122 language->sysbase = SysBase;
123 mySysBase = SysBase;
126 Although it is unlikely, you would return NULL if you for some
127 unknown reason couldn't open.
129 bug("GetLangStr: Loaded at address %p\n", &AROS_SLIB_ENTRY(getlangstring,language,9));
130 return language;
132 AROS_USERFUNC_EXIT
135 #define SysBase language->sysbase
137 AROS_LH1(struct Language *, open,
138 AROS_LHA(ULONG, version, D0),
139 struct Language *, language, 1, language)
141 AROS_LIBFUNC_INIT
142 language->library.lib_OpenCnt++;
143 language->library.lib_Flags &= ~LIBF_DELEXP;
145 /* Again return NULL if you could not open */
146 return language;
148 AROS_LIBFUNC_EXIT
151 AROS_LH0(BPTR, close, struct Language *, language, 2, language)
153 AROS_LIBFUNC_INIT
155 if(! --language->library.lib_OpenCnt)
157 /* Delayed expunge pending? */
158 if(language->library.lib_Flags & LIBF_DELEXP)
160 /* Yes, expunge the library */
161 return AROS_LC0(BPTR, expunge, struct Language *, language, 3, language);
164 return BNULL;
165 AROS_LIBFUNC_EXIT
168 AROS_LH0(BPTR, expunge, struct Language *, language, 3, language)
170 AROS_LIBFUNC_INIT
172 BPTR ret;
173 if(language->library.lib_OpenCnt)
175 /* Can't expunge, we are still open */
176 language->library.lib_Flags |= LIBF_DELEXP;
177 return 0;
180 Remove(&language->library.lib_Node);
181 ret = language->seglist;
183 FreeMem((UBYTE *)language - language->library.lib_NegSize,
184 language->library.lib_PosSize + language->library.lib_NegSize);
186 return ret;
188 AROS_LIBFUNC_EXIT
191 AROS_LH0I(int, null, struct Language *, language, 0, language)
193 AROS_LIBFUNC_INIT
195 return 0;
197 AROS_LIBFUNC_EXIT
200 /* ------------------------------------------------------------------------
201 Language specific functions
202 ------------------------------------------------------------------------ */
204 #undef SysBase
205 #define SysBase mySysBase
207 /* ULONG LanguageMask():
208 This function is to inform locale.library what functions it should
209 use from this library. This is done by returning a bitmask containing
210 1's for functions to use, and 0's for functions to ignore.
212 Unused bits MUST be 0 for future compatibility.
214 AROS_LH0(ULONG, mask, struct Language *, language, 5, language)
216 AROS_LIBFUNC_INIT
218 return ( LF_GetLangStr );
220 AROS_LIBFUNC_EXIT
223 /* STRPTR GetLangString(ULONG num): Language function 3
224 This function is called by GetLocaleStr() and should return
225 the string matching the string id passed in as num.
227 AROS_LH1(STRPTR, getlangstring,
228 AROS_LHA(ULONG, id, D0),
229 struct LocaleBase *, LocaleBase, 9, language)
231 AROS_LIBFUNC_INIT
233 //kprintf("\nWe have got to getlangstring\n");
235 if(id < MAXSTRMSG)
236 return __shqipja_strings[id];
237 else
238 return NULL;
240 AROS_LIBFUNC_EXIT
243 /* -----------------------------------------------------------------------
244 Library function table - you will need to alter this
245 I have this right here at the end of the library so that I do not
246 have to have prototypes for the functions. Although you could do that.
247 ----------------------------------------------------------------------- */
249 void *const functable[] =
251 &AROS_SLIB_ENTRY(open,language,1),
252 &AROS_SLIB_ENTRY(close,language,2),
253 &AROS_SLIB_ENTRY(expunge,language,3),
254 &AROS_SLIB_ENTRY(null,language,0),
255 &AROS_SLIB_ENTRY(mask,language,5),
257 /* Note, shorter function table, as only getlangstring is used */
259 /* 0 - 3 */
260 &AROS_SLIB_ENTRY(null, language, 0),
261 &AROS_SLIB_ENTRY(null, language, 0),
262 &AROS_SLIB_ENTRY(null, language, 0),
263 &AROS_SLIB_ENTRY(getlangstring, language, 9),
264 (void *)-1
268 Note how only the required data structures are kept...
270 This is the list of strings. It is an array of pointers to strings,
271 although how it is laid out is implementation dependant.
273 const STRPTR __shqipja_strings[] =
275 /* A blank string */
278 /* The days of the week. Starts with the first day of the week.
279 In English this would be Sunday, this depends upon the settings
280 of Locale->CalendarType.
283 // NOTICE: stegerg: I think this must always start with Sunday and not what comment above says
285 "e diel", "e hënë", "e martë", "e mërkurë", "e enjte",
286 "e premte", "e shtunë",
288 /* Abbreviated days of the week */
289 "Die", "Hën", "Mar", "Mër", "Enj", "Pre", "Sht",
291 /* Months of the year */
292 "janar", "shkurt", "mars",
293 "prill", "maj", "qershor",
294 "korrik", "gusht", "shtator",
295 "tetor", "nëntor", "dhjetor",
297 /* Abbreviated months of the year */
298 "Jan", "Shk", "Mar", "Pri", "Maj", "Qer",
299 "Kor", "Gus", "Sht", "Tet", "Nën", "Dhj",
301 "Po", /* Yes, affirmative response */
302 "Jo", /* No/negative response */
304 /* AM/PM strings AM 0000 -> 1159, PM 1200 -> 2359 */
305 "PD", "MD",
307 /* Soft and hard hyphens */
308 "\xAD", "-",
310 /* Open and close quotes */
311 "\"", "\"",
313 /* Days: But not actual day names
314 Yesterday - the day before the current
315 Today - the current day
316 Tomorrow - the next day
317 Future.
319 "Dje", "Sot", "Nesër", "Ardhmen"
322 /* This is the end of ROMtag marker. */
323 const char end=0;