2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: StrConvert - Stub for the Locale StrConvert function.
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 /*****************************************************************************
18 #include <proto/locale.h>
20 AROS_LH5(ULONG
, StrConvert
,
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
),
30 struct LocaleBase
*, LocaleBase
, 29, Locale
)
33 This function will transform the string given and place the
34 result in the supplied buffers, copying at most bufferSize
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.
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
48 bufferSize - the maximum number of bytes to place in
50 type - how to transform the string. See the
51 StrnCmp() function for possible values.
54 Length of the number of BYTES placed in the buffer by
55 the transformation process minus 1 (for NULL termination).
68 *****************************************************************************/
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]));
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
);
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
));
94 DEBUG_STRCONVERT(dprintf("StrConvert: retval %lu\n", result
));