cleanup composer/compositing/composition -> compositor
[AROS.git] / workbench / locale / languages / swedish.c
blob4b106e321509cdbce94cde6ca98a52770450128a
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: swedish.language description file.
6 */
8 #include <exec/types.h>
9 #include <aros/system.h>
10 #include <exec/resident.h>
11 #include <exec/libraries.h>
12 #include <libraries/locale.h>
14 #include <proto/exec.h>
15 #include <aros/libcall.h>
16 #include <aros/asmcall.h>
18 #include <aros/debug.h>
20 #define LANGSTR "swedish" /* String version of above */
21 #define NLANGSTR "Svenska" /* Native version of LANGSTR */
22 #define LANGVER 41 /* Version number of language */
23 #define LANGREV 2 /* Revision number of language */
24 #define LANGTAG "\0$VER: " LANGSTR ".language 41.2 (14.04.2013)"
25 #define NLANGTAG "$NLANG:" NLANGSTR
27 AROS_LD1(STRPTR, getlangstring,
28 AROS_LHA(ULONG, id, D0),
29 struct LocaleBase *, LocaleBase, 9, language);
31 /* ----------------------------------------------------------------------- */
33 /* Bit masks for locale .language functions. Only implement GetString() */
34 #define LF_GetLangStr (1L << 3)
36 /* Arrays for Swedish character type/conversion */
37 extern const STRPTR __svenska_strings[];
39 /* -------------------------------------------------------------------------
40 Library definition, you should not need to change any of this.
41 ------------------------------------------------------------------------- */
43 struct Language
45 struct Library library;
46 struct ExecBase *sysbase;
47 BPTR seglist;
50 extern const UBYTE name[];
51 extern const UBYTE version[];
52 extern const APTR inittabl[4];
53 extern void *const functable[];
54 extern struct Language *AROS_SLIB_ENTRY(init,language,0)();
55 AROS_LD1(struct Language *, open,
56 AROS_LHA(ULONG, version, D0),
57 struct Language *, language, 1, language);
58 AROS_LD0(BPTR, close, struct Language *, language, 2, language);
59 AROS_LD0(BPTR, expunge, struct Language *, language, 3, language);
60 AROS_LD0I(int, null, struct Language *, language, 0, language);
61 AROS_LD0(ULONG, mask, struct Language *, language, 5, language);
62 extern const char end;
64 int entry(void)
66 return -1;
69 const struct Resident languageTag =
71 RTC_MATCHWORD,
72 (struct Resident *)&languageTag,
73 (APTR)&end,
74 RTF_AUTOINIT,
75 LANGVER,
76 NT_LIBRARY,
77 -120,
78 (STRPTR)name,
79 (STRPTR)&version[7],
80 (ULONG *)inittabl
83 const UBYTE name[]=LANGSTR ".language";
84 const UBYTE nativelang[]=NLANGTAG; /* N.B - MUST come before $VER: */
85 const UBYTE version[]=LANGTAG;
87 const ULONG datatable = 0;
89 const APTR inittabl[4] =
91 (APTR)sizeof(struct Language),
92 (APTR)functable,
93 (APTR)&datatable,
94 &AROS_SLIB_ENTRY(init,language,0)
97 struct ExecBase *SysBase;
99 AROS_UFH3(struct Language *, AROS_SLIB_ENTRY(init,language,0),
100 AROS_UFHA(struct Language *, language, D0),
101 AROS_UFHA(BPTR, segList, A0),
102 AROS_UFHA(struct ExecBase *, _SysBase, A6)
105 AROS_USERFUNC_INIT
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;
121 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,9));
128 return language;
130 AROS_USERFUNC_EXIT
135 AROS_LH1(struct Language *, open,
136 AROS_LHA(ULONG, version, D0),
137 struct Language *, language, 1, language)
139 AROS_LIBFUNC_INIT
140 language->library.lib_OpenCnt++;
141 language->library.lib_Flags &= ~LIBF_DELEXP;
143 /* Again return NULL if you could not open */
144 return language;
146 AROS_LIBFUNC_EXIT
150 AROS_LH0(BPTR, close, struct Language *, language, 2, language)
152 AROS_LIBFUNC_INIT
154 if(! --language->library.lib_OpenCnt)
156 /* Delayed expunge pending? */
157 if(language->library.lib_Flags & LIBF_DELEXP)
159 /* Yes, expunge the library */
160 return AROS_LC0(BPTR, expunge, struct Language *, language, 3, language);
163 return BNULL;
164 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
192 AROS_LH0I(int, null, struct Language *, language, 0, language)
194 AROS_LIBFUNC_INIT
196 return 0;
198 AROS_LIBFUNC_EXIT
201 /* ------------------------------------------------------------------------
202 Language specific functions
203 ------------------------------------------------------------------------ */
206 /* ULONG LanguageMask():
207 This function is to inform locale.library what functions it should
208 use from this library. This is done by returning a bitmask containing
209 1's for functions to use, and 0's for functions to ignore.
211 Unused bits MUST be 0 for future compatibility.
213 AROS_LH0(ULONG, mask, struct Language *, language, 5, language)
215 AROS_LIBFUNC_INIT
217 return ( LF_GetLangStr );
219 AROS_LIBFUNC_EXIT
222 /* STRPTR GetLangString(ULONG num): Language function 3
223 This function is called by GetLocaleStr() and should return
224 the string matching the string id passed in as num.
226 AROS_LH1(STRPTR, getlangstring,
227 AROS_LHA(ULONG, id, D0),
228 struct LocaleBase *, LocaleBase, 9, language)
230 AROS_LIBFUNC_INIT
232 //kprintf("\nWe have got to getlangstring\n");
234 if(id < MAXSTRMSG)
235 return __svenska_strings[id];
236 else
237 return NULL;
239 AROS_LIBFUNC_EXIT
242 /* -----------------------------------------------------------------------
243 Library function table - you will need to alter this
244 I have this right here at the end of the library so that I do not
245 have to have prototypes for the functions. Although you could do that.
246 ----------------------------------------------------------------------- */
248 void *const functable[] =
250 &AROS_SLIB_ENTRY(open,language,1),
251 &AROS_SLIB_ENTRY(close,language,2),
252 &AROS_SLIB_ENTRY(expunge,language,3),
253 &AROS_SLIB_ENTRY(null,language,0),
254 &AROS_SLIB_ENTRY(mask,language,5),
256 /* Note, shorter function table, as only getlangstring is used */
258 /* 0 - 3 */
259 &AROS_SLIB_ENTRY(null, language, 0),
260 &AROS_SLIB_ENTRY(null, language, 0),
261 &AROS_SLIB_ENTRY(null, language, 0),
262 &AROS_SLIB_ENTRY(getlangstring, language, 9),
263 (void *)-1
267 Note how only the required data structures are kept...
269 This is the list of strings. It is an array of pointers to strings,
270 although how it is laid out is implementation dependant.
272 const STRPTR __svenska_strings[] =
274 /* A blank string */
277 /* The days of the week. Starts with the first day of the week.
278 In English this would be Sunday, this depends upon the settings
279 of Locale->CalendarType.
282 // NOTICE: stegerg: I think this must always start with Sunday and not what comment above says
284 "Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag",
285 "Fredag", "Lördag",
287 /* Abbreviated days of the week */
288 "Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör",
290 /* Months of the year */
291 "Januari", "Februari", "Mars",
292 "April", "Maj", "Juni",
293 "Juli", "Augusti", "September",
294 "Oktober", "November", "December",
296 /* Abbreviated months of the year */
297 "Jan", "Feb", "Mar", "Apr", "Maj", "Jun",
298 "Jul", "Aug", "Sep", "Okt", "Nov", "Dec",
300 "Ja", /* Yes, affirmative response */
301 "Nej", /* No/negative response */
303 /* AM/PM strings AM 0000 -> 1159, PM 1200 -> 2359 */
304 "fm", "em",
306 /* Soft and hard hyphens */
307 "­", "-",
309 /* Open and close quotes */
310 "»", "»",
312 /* Days: But not actual day names
313 Yesterday - the day before the current
314 Today - the current day
315 Tomorrow - the next day
316 Future.
318 "Igår", "Idag", "Imorgon", "Framtid"
321 /* This is the end of ROMtag marker. */
322 const char end = 0;