- Tabs to spaces.
[AROS.git] / workbench / libs / locale / locstrnicmp.c
blob7f0a070143506b027ca4501136f9512f906d1031
1 /*
2 Copyright © 1995-2011, 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 *****************************************************************************/
63 AROS_LIBFUNC_INIT
65 LONG retval;
67 REPLACEMENT_LOCK;
69 DEBUG_STRNCMP(dprintf("locStrnCmp: <%s> <%s> len %ld\n",
70 string1, string2, length));
72 DEBUG_STRNCMP(dprintf("locStrnCmp: CurrentLocale 0x%lx\n",
73 (struct Locale *)IntLB(LocaleBase)->lb_CurrentLocale));
75 retval = StrnCmp((struct Locale *)IntLB(LocaleBase)->lb_CurrentLocale,
76 (STRPTR) string1, (STRPTR) string2, length, SC_ASCII);
78 DEBUG_STRNCMP(dprintf("StrnCmp: retval 0x%lx\n", retval));
80 REPLACEMENT_UNLOCK;
82 return retval;
84 AROS_LIBFUNC_EXIT