add casts to zune macros to silence some warnings
[tangerine.git] / workbench / libs / locale / locstrnicmp.c
blobe961f8f270de0c053c9bbe5066739507b3adb596
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: LocStrnicmp - locale.library's private replacement
6 of utility.library/Strnicmp function. IPrefs will install
7 the patch.
9 Lang: english
12 #include <exec/types.h>
13 #include <proto/exec.h>
14 #include <proto/locale.h>
15 #include "locale_intern.h"
16 #include <aros/asmcall.h>
19 #define DEBUG_STRNCMP(x) ;
21 /*****************************************************************************
23 NAME */
24 #include <proto/locale.h>
26 AROS_PLH3(LONG, LocStrnicmp,
28 /* SYNOPSIS */
29 AROS_LHA(CONST_STRPTR, string1, A0),
30 AROS_LHA(CONST_STRPTR, string2, A1),
31 AROS_LHA(LONG , length , D0),
33 /* LOCATION */
34 struct UtilityBase *, UtilityBase, 32, Locale)
36 /* FUNCTION
37 See utility.library/Strnicmp
39 INPUTS
40 See utility.library/Strnicmp
42 RESULT
44 NOTES
45 NOTES
46 This function is not called by apps directly. Instead dos.library/DosGet-
47 LocalizedString is patched to use this function. This means, that the
48 LocaleBase parameter above actually points to UtilityBase, so we make use of
49 the global LocaleBase variable. This function is marked as private,
50 thus the headers generator won't mind the different basename in the header.
52 EXAMPLE
54 BUGS
56 SEE ALSO
57 utility.library/Strnicmp(), locale.library/StrnCmp().
59 INTERNALS
61 HISTORY
63 *****************************************************************************/
65 AROS_LIBFUNC_INIT
67 LONG retval;
69 REPLACEMENT_LOCK;
71 DEBUG_STRNCMP(dprintf("locStrnCmp: <%s> <%s> len %ld\n",
72 string1,
73 string2,
74 length));
76 DEBUG_STRNCMP(dprintf("locStrnCmp: CurrentLocale 0x%lx\n",
77 (struct Locale *)IntLB(LocaleBase)->lb_CurrentLocale));
79 retval = StrnCmp((struct Locale *)IntLB(LocaleBase)->lb_CurrentLocale,
80 (STRPTR)string1,
81 (STRPTR)string2,
82 length,
83 SC_ASCII);
85 DEBUG_STRNCMP(dprintf("StrnCmp: retval 0x%lx\n",
86 retval));
88 REPLACEMENT_UNLOCK;
90 return retval;
92 AROS_LIBFUNC_EXIT
94 } /* LocStrnicmp */