diff options
Diffstat (limited to 'ace/OS_String.inl')
-rw-r--r-- | ace/OS_String.inl | 166 |
1 files changed, 18 insertions, 148 deletions
diff --git a/ace/OS_String.inl b/ace/OS_String.inl index d81ae33e17f..8462d624a6c 100644 --- a/ace/OS_String.inl +++ b/ace/OS_String.inl @@ -1,14 +1,6 @@ -// -*- C++ -*- // $Id$ // Matthew Stevens 7-10-95 Fix GNU GCC 2.7 for memchr() problem. - -#if defined (ACE_HAS_PACE) -# include "pace/string.h" -# include "pace/ctype.h" -# include "pace/stdlib.h" -#endif /* ACE_HAS_PACE */ - #if defined (ACE_HAS_GNU_CSTRING_H) // Define this file to keep /usr/include/memory.h from being included. # include /**/ <cstring> @@ -34,19 +26,13 @@ ACE_INLINE int ACE_OS_String::memcmp (const void *t, const void *s, size_t len) { -#if defined (ACE_HAS_PACE) - return pace_memcmp (t, s, len); -#else return ::memcmp (t, s, len); -#endif /* ACE_HAS_PACE */ } ACE_INLINE const void * ACE_OS_String::memchr (const void *s, int c, size_t len) { -#if defined (ACE_HAS_PACE) - return pace_memchr (s, c, len); -#elif defined (ACE_HAS_MEMCHR) +#if defined (ACE_HAS_MEMCHR) return ::memchr (s, c, len); #else /* ACE_HAS_MEMCHR */ return ACE_OS_String::memchr_emulation (s, c, len); @@ -56,41 +42,25 @@ ACE_OS_String::memchr (const void *s, int c, size_t len) ACE_INLINE void * ACE_OS_String::memcpy (void *t, const void *s, size_t len) { -#if defined (ACE_HAS_PACE) - return pace_memcpy (t, s, len); -#else return ::memcpy (t, s, len); -#endif /* ACE_HAS_PACE */ } ACE_INLINE void * ACE_OS_String::memmove (void *t, const void *s, size_t len) { -#if defined (ACE_HAS_PACE) - return pace_memmove (t, s, len); -#else return ::memmove (t, s, len); -#endif /* ACE_HAS_PACE */ } ACE_INLINE void * ACE_OS_String::memset (void *s, int c, size_t len) { -#if defined (ACE_HAS_PACE) - return pace_memset (s, c, len); -#else return ::memset (s, c, len); -#endif /* ACE_HAS_PACE */ } ACE_INLINE int ACE_OS_String::to_lower (int c) { -#if defined (ACE_HAS_PACE) - return pace_tolower (c); -#else return tolower (c); -#endif /* ACE_HAS_PACE */ } #if defined (ACE_HAS_WCHAR) @@ -104,11 +74,7 @@ ACE_OS_String::to_lower (wint_t c) ACE_INLINE char * ACE_OS_String::strcat (char *s, const char *t) { -#if defined (ACE_HAS_PACE) - return pace_strcat (s, t); -#else return ::strcat (s, t); -#endif /* ACE_HAS_PACE */ } #if defined (ACE_HAS_WCHAR) @@ -122,15 +88,13 @@ ACE_OS_String::strcat (wchar_t *s, const wchar_t *t) ACE_INLINE size_t ACE_OS_String::strspn (const char *s, const char *t) { -#if defined (ACE_HAS_PACE) - return pace_strspn (s, t); -#elif defined (ACE_HAS_WINCE) +#if defined (ACE_HAS_WINCE) ACE_UNUSED_ARG (s); ACE_UNUSED_ARG (t); ACE_NOTSUP_RETURN (-1); #else /* ! ACE_HAS_WINCE */ return ::strspn (s, t); -#endif /* ACE_HAS_PACE */ +#endif /* ! ACE_HAS_WINCE */ } #if defined (ACE_HAS_WCHAR) @@ -144,13 +108,11 @@ ACE_OS_String::strspn (const wchar_t*s, const wchar_t *t) ACE_INLINE char * ACE_OS_String::strchr (char *s, int c) { -#if defined (ACE_HAS_PACE) - return pace_strchr (s, c); -#elif defined (ACE_HAS_WINCE) +#if defined (ACE_HAS_WINCE) return ACE_OS_String::strchr_emulation (s, c); #else /* ! ACE_HAS_WINCE */ return ::strchr (s, c); -#endif /* ACE_HAS_PACE */ +#endif /* ! ACE_HAS_WINCE */ } #if defined (ACE_HAS_WCHAR) @@ -164,13 +126,11 @@ ACE_OS_String::strchr (wchar_t *s, wint_t c) ACE_INLINE const char * ACE_OS_String::strchr (const char *s, int c) { -#if defined (ACE_HAS_PACE) - return pace_strchr (s, c); -#elif defined (ACE_HAS_WINCE) +#if defined (ACE_HAS_WINCE) return ACE_OS_String::strchr_emulation (s, c); #else /* ! ACE_HAS_WINCE */ return (const char *) ::strchr (s, c); -#endif /* ACE_HAS_PACE */ +#endif /* ! ACE_HAS_WINCE */ } #if defined (ACE_HAS_WCHAR) @@ -208,11 +168,7 @@ ACE_OS_String::strnchr (wchar_t *s, wint_t c, size_t len) ACE_INLINE const char * ACE_OS_String::strstr (const char *s, const char *t) { -#if defined (ACE_HAS_PACE) - return pace_strstr (s, t); -#else return (const char *) ::strstr (s, t); -#endif /* ACE_HAS_PACE */ } #if defined (ACE_HAS_WCHAR) @@ -226,11 +182,7 @@ ACE_OS_String::strstr (const wchar_t *s, const wchar_t *t) ACE_INLINE char * ACE_OS_String::strstr (char *s, const char *t) { -#if defined (ACE_HAS_PACE) - return pace_strstr (s, t); -#else return ::strstr (s, t); -#endif /* ACE_HAS_PACE */ } #if defined (ACE_HAS_WCHAR) @@ -244,11 +196,7 @@ ACE_OS_String::strstr (wchar_t *s, const wchar_t *t) ACE_INLINE size_t ACE_OS_String::strlen (const char *s) { -#if defined (ACE_HAS_PACE) - return pace_strlen (s); -#else return ::strlen (s); -#endif /* ACE_HAS_PACE */ } #if defined (ACE_HAS_WCHAR) @@ -281,9 +229,7 @@ ACE_OS_String::strnstr (wchar_t *s, const wchar_t *t, size_t len) ACE_INLINE char * ACE_OS_String::strrchr (char *s, int c) { -#if defined (ACE_HAS_PACE) - return pace_strrchr (s, c); -#elif defined (ACE_LACKS_STRRCHR) +#if defined (ACE_LACKS_STRRCHR) return ACE_OS_String::strrchr_emulation (s, c); #else /* ! ACE_LACKS_STRRCHR */ return ::strrchr (s, c); @@ -305,9 +251,7 @@ ACE_OS_String::strrchr (const wchar_t *s, wint_t c) ACE_INLINE const char * ACE_OS_String::strrchr (const char *s, int c) { -#if defined (ACE_HAS_PACE) - return (const char*) pace_strrchr (s, c); -#elif defined (ACE_LACKS_STRRCHR) +#if defined (ACE_LACKS_STRRCHR) return ACE_OS_String::strrchr_emulation (s, c); #else /* ! ACE_LACKS_STRRCHR */ return (const char *) ::strrchr (s, c); @@ -329,11 +273,7 @@ ACE_OS_String::strrchr (wchar_t *s, wint_t c) ACE_INLINE int ACE_OS_String::strcmp (const char *s, const char *t) { -#if defined (ACE_HAS_PACE) - return pace_strcmp (s, t); -#else return ::strcmp (s, t); -#endif /* ACE_HAS_PACE */ } #if defined (ACE_HAS_WCHAR) @@ -347,11 +287,7 @@ ACE_OS_String::strcmp (const wchar_t *s, const wchar_t *t) ACE_INLINE char * ACE_OS_String::strcpy (char *s, const char *t) { -#if defined (ACE_HAS_PACE) - return pace_strcpy (s, t); -#else return ::strcpy (s, t); -#endif /* ACE_HAS_PACE */ } #if defined (ACE_HAS_WCHAR) @@ -365,9 +301,7 @@ ACE_OS_String::strcpy (wchar_t *s, const wchar_t *t) ACE_INLINE size_t ACE_OS_String::strcspn (const char *s, const char *reject) { -#if defined (ACE_HAS_PACE) - return pace_strcspn (s, reject); -#elif defined (ACE_HAS_WINCE) +#if defined (ACE_HAS_WINCE) return ACE_OS_String::strcspn_emulation (s, reject); #else /* ! ACE_HAS_WINCE */ return ::strcspn (s, reject); @@ -377,9 +311,7 @@ ACE_OS_String::strcspn (const char *s, const char *reject) ACE_INLINE char * ACE_OS_String::strpbrk (char *s1, const char *s2) { -#if defined (ACE_HAS_PACE) - return pace_strpbrk (s1, s2); -#elif defined (ACE_HAS_WINCE) +#if defined (ACE_HAS_WINCE) ACE_UNUSED_ARG (s1); ACE_UNUSED_ARG (s2); ACE_NOTSUP_RETURN (0); @@ -399,9 +331,7 @@ ACE_OS_String::strpbrk (wchar_t *s, const wchar_t *t) ACE_INLINE const char * ACE_OS_String::strpbrk (const char *s1, const char *s2) { -#if defined (ACE_HAS_PACE) - return (const char*) pace_strpbrk (s1, s2); -#elif defined (ACE_HAS_WINCE) +#if defined (ACE_HAS_WINCE) ACE_UNUSED_ARG (s1); ACE_UNUSED_ARG (s2); ACE_NOTSUP_RETURN (0); @@ -465,11 +395,7 @@ ACE_OS_String::strncasecmp (const wchar_t *s, const wchar_t *t, size_t len) ACE_INLINE int ACE_OS_String::strncmp (const char *s, const char *t, size_t len) { -#if defined (ACE_HAS_PACE) - return pace_strncmp (s, t, len); -#else return ::strncmp (s, t, len); -#endif /* ACE_HAS_PACE */ } #if defined (ACE_HAS_WCHAR) @@ -483,11 +409,7 @@ ACE_OS_String::strncmp (const wchar_t *s, const wchar_t *t, size_t len) ACE_INLINE char * ACE_OS_String::strncpy (char *s, const char *t, size_t len) { -#if defined (ACE_HAS_PACE) - return pace_strncpy (s, t, len); -#else return ::strncpy (s, t, len); -#endif /* ACE_HAS_PACE */ } #if defined (ACE_HAS_WCHAR) @@ -501,11 +423,7 @@ ACE_OS_String::strncpy (wchar_t *s, const wchar_t *t, size_t len) ACE_INLINE char * ACE_OS_String::strncat (char *s, const char *t, size_t len) { -#if defined (ACE_HAS_PACE) - return pace_strncat (s, t, len); -#else return ::strncat (s, t, len); -#endif /* ACE_HAS_PACE */ } #if defined (ACE_HAS_WCHAR) @@ -519,24 +437,14 @@ ACE_OS_String::strncat (wchar_t *s, const wchar_t *t, size_t len) ACE_INLINE char * ACE_OS_String::strtok (char *s, const char *tokens) { -#if defined (ACE_HAS_PACE) - return pace_strtok (s, tokens); -#else return ::strtok (s, tokens); -#endif /* ACE_HAS_PACE */ } #if defined (ACE_HAS_WCHAR) ACE_INLINE wchar_t * ACE_OS_String::strtok (wchar_t *s, const wchar_t *tokens) { -# if defined (ACE_HAS_SAFE_WCSTOK) - ACE_UNUSED_ARG(s); - ACE_UNUSED_ARG(tokens); - ACE_NOTSUP_RETURN (0); -# else return ::wcstok (s, tokens); -# endif /* ACE_HAS_SAFE_WCSTOK */ } #endif /* ACE_HAS_WCHAR */ @@ -544,9 +452,7 @@ ACE_OS_String::strtok (wchar_t *s, const wchar_t *tokens) ACE_INLINE char * ACE_OS_String::strtok_r (char *s, const char *tokens, char **lasts) { -#if defined (ACE_HAS_PACE) - return pace_strtok_r (s, tokens, lasts); -#elif defined (ACE_HAS_REENTRANT_FUNCTIONS) +#if defined (ACE_HAS_REENTRANT_FUNCTIONS) return ::strtok_r (s, tokens, lasts); #else return ACE_OS_String::strtok_r_emulation (s, tokens, lasts); @@ -556,11 +462,9 @@ ACE_OS_String::strtok_r (char *s, const char *tokens, char **lasts) ACE_INLINE long ACE_OS_String::strtol (const char *s, char **ptr, int base) { -#if defined (ACE_HAS_PACE) - return pace_strtol (s, ptr, base); // @@ We must implement this function for WinCE also. // Notice WinCE support wcstol. -#elif defined (ACE_HAS_WINCE) +#if defined (ACE_HAS_WINCE) ACE_UNUSED_ARG (s); ACE_UNUSED_ARG (ptr); ACE_UNUSED_ARG (base); @@ -581,11 +485,9 @@ ACE_OS_String::strtol (const wchar_t *s, wchar_t **ptr, int base) ACE_INLINE unsigned long ACE_OS_String::strtoul (const char *s, char **ptr, int base) { -#if defined (ACE_HAS_PACE) - return pace_strtoul (s, ptr, base); // @@ WINCE: We must implement this function for WinCE also. // Notice WinCE support wcstoul. -#elif defined (ACE_HAS_WINCE) +#if defined (ACE_HAS_WINCE) ACE_UNUSED_ARG (s); ACE_UNUSED_ARG (ptr); ACE_UNUSED_ARG (base); @@ -607,10 +509,8 @@ ACE_OS_String::strtoul (const wchar_t *s, wchar_t **ptr, int base) ACE_INLINE double ACE_OS_String::strtod (const char *s, char **endptr) { -#if defined (ACE_HAS_PACE) - return pace_strtod (s, endptr); // @@ WinCE only support wcstod -#elif defined (ACE_HAS_WINCE) +#if defined (ACE_HAS_WINCE) ACE_UNUSED_ARG (s); ACE_UNUSED_ARG (endptr); ACE_NOTSUP_RETURN (0); @@ -630,9 +530,7 @@ ACE_OS_String::strtod (const wchar_t *s, wchar_t **endptr) ACE_INLINE int ACE_OS_String::ace_isspace (const ACE_TCHAR s) { -#if defined (ACE_HAS_PACE) - return pace_isspace (s); -#elif defined (ACE_HAS_WINCE) +#if defined (ACE_HAS_WINCE) ACE_UNUSED_ARG (s); ACE_NOTSUP_RETURN (0); #elif defined (ACE_USES_WCHAR) @@ -645,9 +543,7 @@ ACE_OS_String::ace_isspace (const ACE_TCHAR s) ACE_INLINE int ACE_OS_String::ace_isprint (const ACE_TCHAR s) { -#if defined (ACE_HAS_PACE) - return pace_isprint (s); -#elif defined (ACE_HAS_WINCE) +#if defined (ACE_HAS_WINCE) ACE_UNUSED_ARG (s); ACE_NOTSUP_RETURN (0); #elif defined (ACE_USES_WCHAR) @@ -656,29 +552,3 @@ ACE_OS_String::ace_isprint (const ACE_TCHAR s) return isprint (s); #endif /* ACE_HAS_WINCE */ } - -ACE_INLINE char * -ACE_OS_String::itoa (int value, char *string, int radix) -{ -#if defined (ACE_HAS_ITOA) -#if defined (_MSC_VER) - return ::_itoa (value, string, radix); -#else - return ::itoa (value, string, radix); -#endif /* _MSC_VER */ -#else - return ACE_OS_String::itoa_emulation (value, string, radix); -#endif /* ACE_HAS_ITOA */ -} - -#if defined (ACE_HAS_WCHAR) -ACE_INLINE wchar_t * -ACE_OS_String::itoa (int value, wchar_t *string, int radix) -{ -#if defined (ACE_HAS_ITOA) - return ::_itow (value, string, radix); -#else - return ACE_OS_String::itoa_emulation (value, string, radix); -#endif /* ACE_HAS_ITOA */ -} -#endif /* ACE_HAS_WCHAR */ |