added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / workbench / locale / languages / deutsch.c
blob7ea81c2e9894ea8ac1d1c646b76c898f4674f945
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: deutsch.language description file.
6 Lang: english
7 */
9 /* Language file for the German 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 "deutsch" /* 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: deutsch.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 German character type/conversion */
38 extern const STRPTR __german_strings[];
40 /* -------------------------------------------------------------------------
41 Library definition, you should not need to change any of this.
42 ------------------------------------------------------------------------- */
44 struct Language
46 struct Library library;
47 struct ExecBase *sysbase;
48 BPTR seglist;
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;
65 int entry(void)
67 return -1;
70 const struct Resident languageTag =
72 RTC_MATCHWORD,
73 (struct Resident *)&languageTag,
74 (APTR)&end,
75 RTF_AUTOINIT,
76 LANGVER,
77 NT_LIBRARY,
78 -120,
79 (STRPTR)name,
80 (STRPTR)&version[7],
81 (ULONG *)inittabl
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),
92 (APTR)functable,
93 (APTR)&datatable,
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)
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 mySysBase = 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));
128 return language;
130 AROS_USERFUNC_EXIT
133 #define SysBase language->sysbase
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
149 AROS_LH0(BPTR, close, struct Language *, language, 2, language)
151 AROS_LIBFUNC_INIT
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);
162 return NULL;
163 AROS_LIBFUNC_EXIT
166 AROS_LH0(BPTR, expunge, struct Language *, language, 3, language)
168 AROS_LIBFUNC_INIT
170 BPTR ret;
171 if(language->library.lib_OpenCnt)
173 /* Can't expunge, we are still open */
174 language->library.lib_Flags |= LIBF_DELEXP;
175 return 0;
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);
184 return ret;
186 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 __german_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 __german_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 "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag",
284 "Freitag", "Samstag",
286 /* Abbreviated days of the week */
287 "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa",
289 /* Months of the year */
290 "Januar", "Februar", "März",
291 "April", "Mai", "Juni",
292 "Juli", "August", "September",
293 "Oktober", "November", "Dezember",
295 /* Abbreviated months of the year */
296 "Jan", "Feb", "Mär", "Apr", "Mai", "Jun",
297 "Jul", "Aug", "Sep", "Okt", "Nov", "Dez",
299 "Ja", /* Yes, affirmative response */
300 "Nein", /* No/negative response */
302 /* AM/PM strings AM 0000 -> 1159, PM 1200 -> 2359 */
303 "Vorm.", "Nachm.",
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 "Gestern", "Heute", "Morgen", "Zukunft"
320 /* This is the end of ROMtag marker. */
321 const char end=0;