revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / locale / convtolower.c
blob66932a2b981707a5bd84c7f554ab8ca471baf302
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: ConvToLower() - Stub for the Language tolower() function.
6 Lang: english
7 */
8 #include <exec/types.h>
9 #include "locale_intern.h"
10 #include <aros/asmcall.h>
12 #define DEBUG_CONVTOLOWER(x) ;
14 /*****************************************************************************
16 NAME */
17 #include <proto/locale.h>
19 AROS_LH2(ULONG, ConvToLower,
21 /* SYNOPSIS */
22 AROS_LHA(const struct Locale *, locale, A0),
23 AROS_LHA(ULONG , character, D0),
25 /* LOCATION */
26 struct LocaleBase *, LocaleBase, 8, Locale)
28 /* FUNCTION
29 This function determine if the character supplied is upper case,
30 and if it is, the character will be converted to lower case.
31 Otherwise, the original character will be returned.
33 INPUTS
34 locale - The Locale to use for this conversion or NULL for
35 the system default locale.
36 character - The character to convert to lower case.
38 RESULT
39 The possibly converted character.
41 NOTES
42 This function requires a full 32-bit character in order to
43 support future multi-byte character sets.
45 EXAMPLE
47 BUGS
49 SEE ALSO
51 INTERNALS
53 *****************************************************************************/
55 AROS_LIBFUNC_INIT
57 ULONG retval;
58 struct Locale *def_locale = NULL;
60 if (locale == NULL)
62 locale = OpenLocale(NULL);
63 def_locale = (struct Locale *)locale;
66 DEBUG_CONVTOLOWER(dprintf("ConvToLower: locale 0x%lx char 0x%lx\n",
67 locale, character));
69 DEBUG_CONVTOLOWER(dprintf("ConvToLower: func 0x%lx\n",
70 IntL(locale)->il_LanguageFunctions[0]));
72 #ifdef AROS_CALL1
73 retval = AROS_CALL1(ULONG, IntL(locale)->il_LanguageFunctions[0],
74 AROS_LCA(ULONG, character, D0), struct LocaleBase *, LocaleBase);
75 #else
76 retval = AROS_UFC2(ULONG, IntL(locale)->il_LanguageFunctions[0],
77 AROS_UFCA(ULONG, character, D0),
78 AROS_UFCA(struct LocaleBase *, LocaleBase, A6));
79 #endif
81 DEBUG_CONVTOLOWER(dprintf("ConvToLower: retval 0x%lx\n", retval));
83 CloseLocale(def_locale);
85 return retval;
87 AROS_LIBFUNC_EXIT