1 #include "ace/OS_NS_strings.h"
5 #if !defined (ACE_HAS_INLINED_OSCALLS)
6 # include "ace/OS_NS_strings.inl"
7 #endif /* ACE_HAS_INLINED_OSCALLS */
9 #if defined (ACE_LACKS_STRCASECMP)
10 # include "ace/OS_NS_ctype.h"
11 #endif /* ACE_LACKS_STRCASECMP */
13 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
15 #if defined (ACE_LACKS_STRCASECMP)
17 ACE_OS::strcasecmp_emulation (const char *s
, const char *t
)
19 const char *scan1
= s
;
20 const char *scan2
= t
;
23 && ACE_OS::ace_tolower (*scan1
)
24 == ACE_OS::ace_tolower (*scan2
))
30 // The following case analysis is necessary so that characters which
31 // look negative collate low against normal characters but high
32 // against the end-of-string NUL.
34 if (*scan1
== '\0' && *scan2
== '\0')
36 else if (*scan1
== '\0')
38 else if (*scan2
== '\0')
41 return ACE_OS::ace_tolower (*scan1
) - ACE_OS::ace_tolower (*scan2
);
43 #endif /* ACE_LACKS_STRCASECMP */
45 #if defined (ACE_LACKS_STRCASECMP)
47 ACE_OS::strncasecmp_emulation (const char *s
,
51 const char *scan1
= s
;
52 const char *scan2
= t
;
57 && ACE_OS::ace_tolower (*scan1
)
58 == ACE_OS::ace_tolower (*scan2
))
67 // The following case analysis is necessary so that characters which
68 // look negative collate low against normal characters but high
69 // against the end-of-string NUL.
71 if (*scan1
== '\0' && *scan2
== '\0')
73 else if (*scan1
== '\0')
75 else if (*scan2
== '\0')
78 return ACE_OS::ace_tolower (*scan1
) - ACE_OS::ace_tolower (*scan2
);
80 #endif /* ACE_LACKS_STRCASECMP */
82 ACE_END_VERSIONED_NAMESPACE_DECL