- Tabs to spaces.
[AROS.git] / workbench / libs / locale / strconvert.c
blobd5b91cf8ce89223b2bcf58f60b471973f938c2ca
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: StrConvert - Stub for the Locale StrConvert function.
6 Lang: english
7 */
8 #include <exec/types.h>
9 #include <proto/exec.h>
10 #include "locale_intern.h"
11 #include <aros/asmcall.h>
13 #define DEBUG_STRCONVERT(x) ;
15 /*****************************************************************************
17 NAME */
18 #include <proto/locale.h>
20 AROS_LH5(ULONG, StrConvert,
22 /* SYNOPSIS */
23 AROS_LHA(const struct Locale *, locale, A0),
24 AROS_LHA(CONST_STRPTR , string, A1),
25 AROS_LHA(APTR , buffer, A2),
26 AROS_LHA(ULONG , bufferSize, D0),
27 AROS_LHA(ULONG , type, D1),
29 /* LOCATION */
30 struct LocaleBase *, LocaleBase, 29, Locale)
32 /* FUNCTION
33 This function will transform the string given and place the
34 result in the supplied buffers, copying at most bufferSize
35 bytes.
37 The transformation is such that if the C strcmp() function
38 was called on two strings transformed by this function then
39 the result will be the same as calling the Locale StrnCmp()
40 function on the two strings.
42 INPUTS
43 locale - the Locale to use for the transformation.
44 string - the string to be transformed
45 buffer - the destination for the transformed string.
46 This buffer may need to be larger than the
47 untransformed string.
48 bufferSize - the maximum number of bytes to place in
49 buffer.
50 type - how to transform the string. See the
51 StrnCmp() function for possible values.
53 RESULT
54 Length of the number of BYTES placed in the buffer by
55 the transformation process minus 1 (for NULL termination).
57 NOTES
59 EXAMPLE
61 BUGS
63 SEE ALSO
64 StrnCmp()
66 INTERNALS
68 *****************************************************************************/
70 AROS_LIBFUNC_INIT
72 LONG result;
74 DEBUG_STRCONVERT(dprintf
75 ("StrConvert: locale 0x%lx <%s> buffer 0x%lx size %ld type 0x%lx\n",
76 locale, string, buffer, bufferSize, type));
78 DEBUG_STRCONVERT(dprintf("StrConvert: Function 0x%lx\n",
79 IntL(locale)->il_LanguageFunctions[15]));
81 #ifdef AROS_CALL4
82 result = AROS_CALL4(ULONG, IntL(locale)->il_LanguageFunctions[15],
83 AROS_LCA(CONST_STRPTR, string, A1),
84 AROS_LCA(APTR, buffer, A2),
85 AROS_LCA(ULONG, bufferSize, D0),
86 AROS_LCA(ULONG, type, D1), struct LocaleBase *, LocaleBase);
87 #else
88 result = AROS_UFC4(ULONG, IntL(locale)->il_LanguageFunctions[15],
89 AROS_UFCA(CONST_STRPTR, string, A1),
90 AROS_UFCA(APTR, buffer, A2),
91 AROS_UFCA(ULONG, bufferSize, D0), AROS_UFCA(ULONG, type, D1));
92 #endif
94 DEBUG_STRCONVERT(dprintf("StrConvert: retval %lu\n", result));
96 return result;
98 AROS_LIBFUNC_EXIT