1 #include "ace/OS_NS_strings.h"
4 #if !defined (ACE_HAS_INLINED_OSCALLS)
5 # include "ace/OS_NS_strings.inl"
6 #endif /* ACE_HAS_INLINED_OSCALLS */
8 #if defined (ACE_LACKS_STRCASECMP)
9 # include "ace/OS_NS_ctype.h"
10 #endif /* ACE_LACKS_STRCASECMP */
12 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
14 #if defined (ACE_LACKS_STRCASECMP)
16 ACE_OS::strcasecmp_emulation (const char *s
, const char *t
)
18 const char *scan1
= s
;
19 const char *scan2
= t
;
22 && ACE_OS::ace_tolower (*scan1
)
23 == ACE_OS::ace_tolower (*scan2
))
29 // The following case analysis is necessary so that characters which
30 // look negative collate low against normal characters but high
31 // against the end-of-string NUL.
33 if (*scan1
== '\0' && *scan2
== '\0')
35 else if (*scan1
== '\0')
37 else if (*scan2
== '\0')
40 return ACE_OS::ace_tolower (*scan1
) - ACE_OS::ace_tolower (*scan2
);
42 #endif /* ACE_LACKS_STRCASECMP */
44 #if defined (ACE_LACKS_STRCASECMP)
46 ACE_OS::strncasecmp_emulation (const char *s
,
50 const char *scan1
= s
;
51 const char *scan2
= t
;
56 && ACE_OS::ace_tolower (*scan1
)
57 == ACE_OS::ace_tolower (*scan2
))
66 // The following case analysis is necessary so that characters which
67 // look negative collate low against normal characters but high
68 // against the end-of-string NUL.
70 if (*scan1
== '\0' && *scan2
== '\0')
72 else if (*scan1
== '\0')
74 else if (*scan2
== '\0')
77 return ACE_OS::ace_tolower (*scan1
) - ACE_OS::ace_tolower (*scan2
);
79 #endif /* ACE_LACKS_STRCASECMP */
81 ACE_END_VERSIONED_NAMESPACE_DECL