diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 2006-12-27 21:34:10 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 2006-12-27 21:34:10 +0000 |
commit | eebd5827aad6628d2b1f47d1bd0b9995b5e939b1 (patch) | |
tree | 939643f4e6dfdd065c2d1aa9dfce682187d0b727 /ACE/ace/OS_NS_stdlib.inl | |
parent | 4c5219c5e4ef10c8758a9257292f4cf8d937e4e6 (diff) | |
download | ATCD-eebd5827aad6628d2b1f47d1bd0b9995b5e939b1.tar.gz |
ChangeLogTag:Wed
Diffstat (limited to 'ACE/ace/OS_NS_stdlib.inl')
-rw-r--r-- | ACE/ace/OS_NS_stdlib.inl | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/ACE/ace/OS_NS_stdlib.inl b/ACE/ace/OS_NS_stdlib.inl index 5ae2fe420e1..8a33ed3ae7f 100644 --- a/ACE/ace/OS_NS_stdlib.inl +++ b/ACE/ace/OS_NS_stdlib.inl @@ -6,7 +6,6 @@ #include "ace/Object_Manager_Base.h" #include "ace/OS_NS_string.h" #include "ace/Global_Macros.h" -#include "ace/Default_Constants.h" #include "ace/Basic_Types.h" /* intptr_t */ #include "ace/os_include/os_errno.h" #include "ace/os_include/os_search.h" @@ -410,75 +409,6 @@ ACE_OS::srand (u_int seed) ::srand (seed); } -// Return a dynamically allocated duplicate of <str>, substituting the -// environment variable if <str[0] == '$'>. Note that the pointer is -// allocated with <ACE_OS::malloc> and must be freed by -// <ACE_OS::free>. - -ACE_INLINE ACE_TCHAR * -ACE_OS::strenvdup (const ACE_TCHAR *str) -{ -#if defined (ACE_HAS_WINCE) - // WinCE doesn't have environment variables so we just skip it. - return ACE_OS::strdup (str); -#elif defined (ACE_LACKS_ENV) - ACE_UNUSED_ARG (str); - ACE_NOTSUP_RETURN (0); -#else - const ACE_TCHAR * start = ACE_OS::strchr (str, ACE_LIB_TEXT ('$')); - if (start != 0) - { - ACE_TCHAR buf[ACE_DEFAULT_ARGV_BUFSIZ]; - size_t var_len = ACE_OS::strcspn (&start[1], - ACE_LIB_TEXT ("$~!#%^&* ()-+=\\|/?,.;:'\"`[]{} \t\n\r")); - ACE_OS::strncpy (buf, &start[1], var_len); - buf[var_len++] = ACE_LIB_TEXT ('\0'); -# if defined (ACE_WIN32) - // Always use the ACE_TCHAR for Windows. - ACE_TCHAR *temp = ACE_OS::getenv (buf); -# else - // Use char * for environment on non-Windows. - char *temp = ACE_OS::getenv (ACE_TEXT_ALWAYS_CHAR (buf)); -# endif /* ACE_WIN32 */ - size_t buf_len = ACE_OS::strlen (str) + 1; - if (temp != 0) - buf_len += ACE_OS::strlen (temp) - var_len; - ACE_TCHAR * buf_p = buf; - if (buf_len > ACE_DEFAULT_ARGV_BUFSIZ) - { - buf_p = (ACE_TCHAR *) ACE_OS::malloc (buf_len * sizeof (ACE_TCHAR)); - if (buf_p == 0) - { - errno = ENOMEM; - return 0; - } - } - ACE_TCHAR *p = buf_p; - size_t len = start - str; - ACE_OS::strncpy (p, str, len); - p += len; - if (temp != 0) - { -# if defined (ACE_WIN32) - p = ACE_OS::strecpy (p, temp) - 1; -# else - p = ACE_OS::strecpy (p, ACE_TEXT_CHAR_TO_TCHAR (temp)) - 1; -# endif /* ACE_WIN32 */ - } - else - { - ACE_OS::strncpy (p, start, var_len); - p += var_len; - *p = ACE_LIB_TEXT ('\0'); - } - ACE_OS::strcpy (p, &start[var_len]); - return (buf_p == buf) ? ACE_OS::strdup (buf) : buf_p; - } - else - return ACE_OS::strdup (str); -#endif /* ACE_HAS_WINCE */ -} - #if !defined (ACE_LACKS_STRTOD) ACE_INLINE double ACE_OS::strtod (const char *s, char **endptr) |