mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
Applied dep and realm updates
This commit is contained in:
parent
12257a5bc2
commit
5260602e28
2020 changed files with 39571 additions and 173090 deletions
84
dep/acelite/ace/OS_NS_strings.cpp
Normal file
84
dep/acelite/ace/OS_NS_strings.cpp
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
// $Id: OS_NS_strings.cpp 91286 2010-08-05 09:04:31Z johnnyw $
|
||||
|
||||
#include "ace/OS_NS_strings.h"
|
||||
|
||||
|
||||
|
||||
#if !defined (ACE_HAS_INLINED_OSCALLS)
|
||||
# include "ace/OS_NS_strings.inl"
|
||||
#endif /* ACE_HAS_INLINED_OSCALLS */
|
||||
|
||||
#if defined (ACE_LACKS_STRCASECMP)
|
||||
# include "ace/OS_NS_ctype.h"
|
||||
#endif /* ACE_LACKS_STRCASECMP */
|
||||
|
||||
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
|
||||
|
||||
#if defined (ACE_LACKS_STRCASECMP)
|
||||
int
|
||||
ACE_OS::strcasecmp_emulation (const char *s, const char *t)
|
||||
{
|
||||
const char *scan1 = s;
|
||||
const char *scan2 = t;
|
||||
|
||||
while (*scan1 != 0
|
||||
&& ACE_OS::ace_tolower (*scan1)
|
||||
== ACE_OS::ace_tolower (*scan2))
|
||||
{
|
||||
++scan1;
|
||||
++scan2;
|
||||
}
|
||||
|
||||
// The following case analysis is necessary so that characters which
|
||||
// look negative collate low against normal characters but high
|
||||
// against the end-of-string NUL.
|
||||
|
||||
if (*scan1 == '\0' && *scan2 == '\0')
|
||||
return 0;
|
||||
else if (*scan1 == '\0')
|
||||
return -1;
|
||||
else if (*scan2 == '\0')
|
||||
return 1;
|
||||
else
|
||||
return ACE_OS::ace_tolower (*scan1) - ACE_OS::ace_tolower (*scan2);
|
||||
}
|
||||
#endif /* ACE_LACKS_STRCASECMP */
|
||||
|
||||
#if defined (ACE_LACKS_STRCASECMP)
|
||||
int
|
||||
ACE_OS::strncasecmp_emulation (const char *s,
|
||||
const char *t,
|
||||
size_t len)
|
||||
{
|
||||
const char *scan1 = s;
|
||||
const char *scan2 = t;
|
||||
size_t count = 0;
|
||||
|
||||
while (count++ < len
|
||||
&& *scan1 != 0
|
||||
&& ACE_OS::ace_tolower (*scan1)
|
||||
== ACE_OS::ace_tolower (*scan2))
|
||||
{
|
||||
++scan1;
|
||||
++scan2;
|
||||
}
|
||||
|
||||
if (count > len)
|
||||
return 0;
|
||||
|
||||
// The following case analysis is necessary so that characters which
|
||||
// look negative collate low against normal characters but high
|
||||
// against the end-of-string NUL.
|
||||
|
||||
if (*scan1 == '\0' && *scan2 == '\0')
|
||||
return 0;
|
||||
else if (*scan1 == '\0')
|
||||
return -1;
|
||||
else if (*scan2 == '\0')
|
||||
return 1;
|
||||
else
|
||||
return ACE_OS::ace_tolower (*scan1) - ACE_OS::ace_tolower (*scan2);
|
||||
}
|
||||
#endif /* ACE_LACKS_STRCASECMP */
|
||||
|
||||
ACE_END_VERSIONED_NAMESPACE_DECL
|
||||
Loading…
Add table
Add a link
Reference in a new issue