Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

cstring.h

Go to the documentation of this file.
00001 /*
00002 *******************************************************************************
00003 *
00004 *   Copyright (C) 1997-1999, International Business Machines
00005 *   Corporation and others.  All Rights Reserved.
00006 *
00007 *******************************************************************************
00008 *
00009 * File CSTRING.H
00010 *
00011 * Contains CString interface
00012 *
00013 * @author       Helena Shih
00014 *
00015 * Modification History:
00016 *
00017 *   Date        Name        Description
00018 *   6/17/98     hshih       Created.
00019 *  05/03/99     stephen     Changed from functions to macros.
00020 *  06/14/99     stephen     Added icu_strncat, icu_strncmp, icu_tolower
00021 *
00022 *******************************************************************************
00023 */
00024 
00025 #ifndef CSTRING_H
00026 #define CSTRING_H 1
00027 
00028 #include <string.h>
00029 #include <stdlib.h>
00030 #include <ctype.h>
00031 #include "unicode/utypes.h"
00032 
00033 /* Do this after utypes.h so that we have U_HAVE_WCHAR_H . */
00034 #if U_HAVE_WCHAR_H
00035 #   include <wchar.h>
00036 #endif
00037 
00038 #define uprv_strcpy(dst, src) strcpy(dst, src)
00039 #define uprv_strcpyWithSize(dst, src, size) strncpy(dst, src, size)
00040 #define uprv_strncpy(dst, src, size) strncpy(dst, src, size)
00041 #define uprv_strlen(str) strlen(str)
00042 #define uprv_strcmp(s1, s2) strcmp(s1, s2)
00043 #define uprv_strncmp(s1, s2, n) strncmp(s1, s2, n)
00044 #define uprv_strcat(dst, src) strcat(dst, src)
00045 #define uprv_strncat(dst, src, n) strncat(dst, src, n)
00046 #define uprv_strchr(s, c) strchr(s, c)
00047 #define uprv_strstr(s, c) strstr(s, c)
00048 #define uprv_strrchr(s, c) strrchr(s, c)
00049 #define uprv_toupper(c) toupper(c)
00050 #define uprv_tolower(c) tolower(c)
00051 #define uprv_strtoul(str, end, base) strtoul(str, end, base)
00052 #define uprv_strtol(str, end, base) strtol(str, end, base)
00053 #ifdef WIN32
00054 #   define uprv_stricmp(str1, str2) _stricmp(str1, str2)
00055 #   define uprv_strnicmp(str1, str2, n) _strnicmp(str1, str2, n)
00056 #elif defined(POSIX)
00057 #   define uprv_stricmp(str1, str2) strcasecmp(str1, str2)
00058 #   define uprv_strnicmp(str1, str2, n) strncasecmp(str1, str2, n)
00059 #else
00060 #   define uprv_stricmp(str1, str2) T_CString_stricmp(str1, str2)
00061 #   define uprv_strnicmp(str1, str2, n) T_CString_strnicmp(str1, str2, n)
00062 #endif
00063 U_CAPI char *uprv_strdup(const char *src);
00064 
00065 /*===========================================================================*/
00066 /* Wide-character functions                                                  */
00067 /*===========================================================================*/
00068 
00069 /* The following are not available on all systems, defined in wchar.h or string.h. */
00070 #if U_HAVE_WCSCPY
00071 #   define uprv_wcscpy wcscpy
00072 #   define uprv_wcscat wcscat
00073 #   define uprv_wcslen wcslen
00074 #else
00075 U_CAPI wchar_t *uprv_wcscpy(wchar_t *dst, const wchar_t *src);
00076 U_CAPI wchar_t *uprv_wcscat(wchar_t *dst, const wchar_t *src);
00077 U_CAPI size_t uprv_wcslen(const wchar_t *src);
00078 #endif
00079 
00080 /* The following are part of the ANSI C standard, defined in stdlib.h . */
00081 #define uprv_wcstombs(mbstr, wcstr, count) wcstombs(mbstr, wcstr, count)
00082 #define uprv_mbstowcs(wcstr, mbstr, count) mbstowcs(wcstr, mbstr, count)
00083 
00084 U_CAPI char* U_EXPORT2
00085 T_CString_toLowerCase(char* str);
00086 
00087 U_CAPI char* U_EXPORT2
00088 T_CString_toUpperCase(char* str);
00089 
00090 U_CAPI void U_EXPORT2
00091 T_CString_integerToString(char *buffer, int32_t n, int32_t radix);
00092 
00093 U_CAPI int32_t U_EXPORT2
00094 T_CString_stringToInteger(const char *integerString, int32_t radix);
00095 
00096 U_CAPI int U_EXPORT2
00097 T_CString_stricmp(const char *str1, const char *str2);
00098 
00099 U_CAPI int U_EXPORT2
00100 T_CString_strnicmp(const char *str1, const char *str2, uint32_t n);
00101 
00102 #endif /* ! CSTRING_H */

Generated at Tue Dec 5 17:55:26 2000 for ICU by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000