New bitmap method SetRGBConversionFunction which can be used to
[tangerine.git] / workbench / locale / languages / suomi.c
blobcbc6c5f076f254eaec0b0def48ea8076c9533c03
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: suomi.language description file.
6 Lang: English
7 */
9 /* Language file for the suomi 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 "suomi" /* 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: suomi.language 41.0 (03.02.2001)"
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 Swedish character type/conversion */
36 extern const STRPTR __suomi_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
130 #define SysBase language->sysbase
132 AROS_LH1(struct Language *, open,
133 AROS_LHA(ULONG, version, D0),
134 struct Language *, language, 1, language)
136 AROS_LIBFUNC_INIT
137 language->library.lib_OpenCnt++;
138 language->library.lib_Flags &= ~LIBF_DELEXP;
140 /* Again return NULL if you could not open */
141 return language;
143 AROS_LIBFUNC_EXIT
147 AROS_LH0(BPTR, close, struct Language *, language, 2, language)
149 AROS_LIBFUNC_INIT
151 if(! --language->library.lib_OpenCnt)
153 /* Delayed expunge pending? */
154 if(language->library.lib_Flags & LIBF_DELEXP)
156 /* Yes, expunge the library */
157 return AROS_LC0(BPTR, expunge, struct Language *, language, 3, language);
160 return NULL;
161 AROS_LIBFUNC_EXIT
165 AROS_LH0(BPTR, expunge, struct Language *, language, 3, language)
167 AROS_LIBFUNC_INIT
169 BPTR ret;
170 if(language->library.lib_OpenCnt)
172 /* Can't expunge, we are still open */
173 language->library.lib_Flags |= LIBF_DELEXP;
174 return 0;
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);
183 return ret;
185 AROS_LIBFUNC_EXIT
189 AROS_LH0I(int, null, struct Language *, language, 4, language)
191 AROS_LIBFUNC_INIT
193 return 0;
195 AROS_LIBFUNC_EXIT
198 /* ------------------------------------------------------------------------
199 Language specific functions
200 ------------------------------------------------------------------------ */
202 #undef SysBase
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)
214 AROS_LIBFUNC_INIT
216 return ( LF_GetLangStr );
218 AROS_LIBFUNC_EXIT
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)
229 AROS_LIBFUNC_INIT
231 //kprintf("\nWe have got to getlangstring\n");
233 if(id < MAXSTRMSG)
234 return __suomi_strings[id];
235 else
236 return NULL;
238 AROS_LIBFUNC_EXIT
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 */
257 /* 0 - 3 */
258 &AROS_SLIB_ENTRY(null, language),
259 &AROS_SLIB_ENTRY(null, language),
260 &AROS_SLIB_ENTRY(null, language),
261 &AROS_SLIB_ENTRY(getlangstring, language),
262 (void *)-1
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 __suomi_strings[] =
273 /* A blank string */
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 "Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai",
284 "Perjantai", "Lauantai",
286 /* Abbreviated days of the week */
287 "Su", "Ma", "Ti", "Ke", "To", "Pe", "La",
289 /* Months of the year */
290 "Tammikuu", "Helmikuu", "Maaliskuu",
291 "Huhtikuu", "Toukokuu", "Kesäkuu",
292 "Heinäkuu", "Elokuu", "Syyskuu",
293 "Lokakuu", "Marraskuu", "Joulukuu",
295 /* Abbreviated months of the year */
296 "Tam", "Hel", "Maa", "Huh", "Tou", "Kes",
297 "Hei", "Elo", "Syy", "Lok", "Mar", "Jou",
299 "Kyllä", /* Yes, affirmative response */
300 "Ei", /* No/negative response */
302 /* AM/PM strings AM 0000 -> 1159, PM 1200 -> 2359 */
303 "ap", "ip",
305 /* Soft and hard hyphens */
306 "-", "-",
308 /* Open and close quotes */
309 "\"", "\"",
311 /* Days: But not actual day names
312 Yesterday - the day before the current
313 Today - the current day
314 Tomorrow - the next day
315 Future.
317 "Eilen", "Tänään", "Huomenna", "Tulevaisuudessa"
320 /* This is the end of ROMtag marker. */
321 const char end = 0;