#include "ace/ACE.h"#include "ace/OS_NS_string.h"#include "ace/OS_NS_stdio.h"#include "ace/OS_NS_stdlib.h"#include "ace/OS_NS_string.inl"

Go to the source code of this file.
Functions | |
| ACE_RCSID (ace, OS_NS_string,"$Id: OS_NS_string.cpp 87239 2009-10-27 10:02:16Z olli $") 1char *ACE_OS | |
| ACE_RCSID | ( | ace | , | |
| OS_NS_string | , | |||
| "$Id: OS_NS_string.cpp 87239 2009-10-27 10:02:16Z olli $" | ||||
| ) |
Definition at line 8 of file OS_NS_string.cpp.
00010 : OS_NS_string.cpp 87239 2009-10-27 10:02:16Z olli $") 00011 00012 #if !defined (ACE_HAS_INLINED_OSCALLS) 00013 # include "ace/OS_NS_string.inl" 00014 #endif /* ACE_HAS_INLINED_OSCALLS */ 00015 00016 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00017 00018 #if defined (ACE_LACKS_MEMCHR) 00019 const void * 00020 ACE_OS::memchr_emulation (const void *s, int c, size_t len) 00021 { 00022 const unsigned char *t = (const unsigned char *) s; 00023 const unsigned char *e = (const unsigned char *) s + len; 00024 00025 while (t < e) 00026 if (((int) *t) == c) 00027 return t; 00028 else 00029 ++t; 00030 00031 return 0; 00032 } 00033 #endif /* ACE_LACKS_MEMCHR */ 00034 00035 #if (defined (ACE_LACKS_STRDUP) && !defined (ACE_STRDUP_EQUIVALENT)) \ 00036 || defined (ACE_HAS_STRDUP_EMULATION) 00037 char * 00038 ACE_OS::strdup_emulation (const char *s) 00039 { 00040 char *t = (char *) ACE_OS::malloc (ACE_OS::strlen (s) + 1); 00041 if (t == 0) 00042 return 0; 00043 00044 return ACE_OS::strcpy (t, s); 00045 } 00046 #endif /* (ACE_LACKS_STRDUP && !ACE_STRDUP_EQUIVALENT) || ... */ 00047 00048 #if defined (ACE_HAS_WCHAR) 00049 #if (defined (ACE_LACKS_WCSDUP) && !defined (ACE_WCSDUP_EQUIVALENT)) \ 00050 || defined (ACE_HAS_WCSDUP_EMULATION) 00051 wchar_t * 00052 ACE_OS::strdup_emulation (const wchar_t *s) 00053 { 00054 wchar_t *buffer = 00055 (wchar_t *) ACE_OS::malloc ((ACE_OS::strlen (s) + 1) 00056 * sizeof (wchar_t)); 00057 if (buffer == 0) 00058 return 0; 00059 00060 return ACE_OS::strcpy (buffer, s); 00061 } 00062 #endif /* (ACE_LACKS_WCSDUP && !ACE_WCSDUP_EQUIVALENT) || ... */ 00063 #endif /* ACE_HAS_WCHAR */ 00064 00065 char * 00066 ACE_OS::strecpy (char *s, const char *t) 00067 { 00068 register char *dscan = s; 00069 register const char *sscan = t; 00070 00071 while ((*dscan++ = *sscan++) != '\0') 00072 continue; 00073 00074 return dscan; 00075 }
1.6.1