Ignore:
Timestamp:
Jul 30, 2002, 2:55:06 PM (23 years ago)
Author:
sandervl
Message:

PF: Unicode update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/win/wine/unicode.h

    r8585 r8938  
    7777extern int utf8_mbstowcs( int flags, const char *src, int srclen, WCHAR *dst, int dstlen );
    7878
    79 extern WCHAR WINAPI tolowerW( WCHAR ch );
    80 extern WCHAR WINAPI toupperW( WCHAR ch );
    81 
    82 extern unsigned short get_char_typeW( WCHAR ch );
     79extern int strcmpiW( const WCHAR *str1, const WCHAR *str2 );
     80extern int strncmpiW( const WCHAR *str1, const WCHAR *str2, int n );
     81extern WCHAR *strstrW( const WCHAR *str, const WCHAR *sub );
     82extern long int strtolW( const WCHAR *nptr, WCHAR **endptr, int base );
     83extern unsigned long int strtoulW( const WCHAR *nptr, WCHAR **endptr, int base );
    8384
    8485static inline int is_dbcs_leadbyte( const union cptable *table, unsigned char ch )
     
    8788}
    8889
     90static inline WCHAR tolowerW( WCHAR ch )
     91{
     92    extern const WCHAR casemap_lower[];
     93    return ch + casemap_lower[casemap_lower[ch >> 8] + (ch & 0xff)];
     94}
     95
     96static inline WCHAR toupperW( WCHAR ch )
     97{
     98    extern const WCHAR casemap_upper[];
     99    return ch + casemap_upper[casemap_upper[ch >> 8] + (ch & 0xff)];
     100}
     101
     102/* the character type contains the C1_* flags in the low 12 bits */
     103/* and the C2_* type in the high 4 bits */
     104static inline unsigned short get_char_typeW( WCHAR ch )
     105{
     106    extern const unsigned short wctype_table[];
     107    return wctype_table[wctype_table[ch >> 8] + (ch & 0xff)];
     108}
     109
     110inline static int iscntrlW( WCHAR wc )
     111{
     112    return get_char_typeW(wc) & C1_CNTRL;
     113}
     114
     115inline static int ispunctW( WCHAR wc )
     116{
     117    return get_char_typeW(wc) & C1_PUNCT;
     118}
     119
     120inline static int isspaceW( WCHAR wc )
     121{
     122    return get_char_typeW(wc) & C1_SPACE;
     123}
     124
    89125inline static int isdigitW( WCHAR wc )
    90126{
     
    97133}
    98134
    99 inline static int isspaceW( WCHAR wc )
    100 {
    101     return get_char_typeW(wc) & C1_SPACE;
    102 }
    103 
    104 #define  islowerW(a)    IsCharLowerW(a)
    105 #define  isupperW(a)    IsCharUpperW(a)
    106 #define  isalnumW(a)    IsCharAlphaNumericW(a)
    107 #define  isalphaW(a)    IsCharAlphaW(a)
     135inline static int islowerW( WCHAR wc )
     136{
     137    return get_char_typeW(wc) & C1_LOWER;
     138}
     139
     140inline static int isupperW( WCHAR wc )
     141{
     142    return get_char_typeW(wc) & C1_UPPER;
     143}
     144
     145inline static int isalnumW( WCHAR wc )
     146{
     147    return get_char_typeW(wc) & (C1_ALPHA|C1_DIGIT|C1_LOWER|C1_UPPER);
     148}
     149
     150inline static int isalphaW( WCHAR wc )
     151{
     152    return get_char_typeW(wc) & (C1_ALPHA|C1_LOWER|C1_UPPER);
     153}
     154
     155inline static int isgraphW( WCHAR wc )
     156{
     157    return get_char_typeW(wc) & (C1_ALPHA|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER);
     158}
     159
     160inline static int isprintW( WCHAR wc )
     161{
     162    return get_char_typeW(wc) & (C1_ALPHA|C1_BLANK|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER);
     163}
    108164
    109165
     
    214270}
    215271
    216 extern int strcmpiW( const WCHAR *str1, const WCHAR *str2 );
    217 extern int strncmpiW( const WCHAR *str1, const WCHAR *str2, int n );
    218 extern WCHAR *strstrW( const WCHAR *str, const WCHAR *sub );
    219 
    220272
    221273#if defined(__IBMC__) || defined(__IBMCPP__) || defined(__WATCOMC__) || defined(__WATCOM_CPLUSPLUS__)
Note: See TracChangeset for help on using the changeset viewer.