Changeset 571


Ignore:
Timestamp:
Aug 10, 2003, 11:50:17 PM (22 years ago)
Author:
bird
Message:

Put back the new version.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/ctype.h

    • Property cvs2svn:cvs-rev changed from 1.9 to 1.10
    r570 r571  
    1 /* ctype.h (emx+gcc) */
     1/*
     2    Locale support implementation through OS/2 Unicode API.
     3    Copyright (c) 2003 InnoTek Systemberatung GmbH
     4
     5    For conditions of distribution and use, see the file COPYING.
     6
     7    Character type querying.
     8*/
    29
    310#ifndef _CTYPE_H
     
    815#endif
    916
    10 extern unsigned char _ctype[];
     17#include <sys/locale.h>
    1118
    12 #define _UPPER  0x01
    13 #define _LOWER  0x02
    14 #define _DIGIT  0x04
    15 #define _XDIGIT 0x08
    16 #define _CNTRL  0x10
    17 #define _SPACE  0x20
    18 #define _PUNCT  0x40
    19 #define _PRINT  0x80
     19static inline int isalnum (int _c)
     20{ return __locale_ctype.cflags [_c & 0xff] & (__UPPER|__LOWER|__DIGIT); }
    2021
    21 extern inline int isalnum (int _c)
    22   { return (_ctype+1)[_c] & (_UPPER|_LOWER|_DIGIT); }
    23 extern inline int isalpha (int _c)
    24   { return (_ctype+1)[_c] & (_UPPER|_LOWER); }
    25 extern inline int iscntrl (int _c)
    26   { return (_ctype+1)[_c] & (_CNTRL); }
    27 extern inline int isdigit (int _c)
    28   { return (_ctype+1)[_c] & (_DIGIT); }
    29 extern inline int isgraph (int _c)
    30   { return (_ctype+1)[_c] & (_PUNCT|_UPPER|_LOWER|_DIGIT); }
    31 extern inline int islower (int _c)
    32   { return (_ctype+1)[_c] & (_LOWER); }
    33 extern inline int isprint (int _c)
    34   { return (_ctype+1)[_c] & (_PRINT); }
    35 extern inline int ispunct (int _c)
    36   { return (_ctype+1)[_c] & (_PUNCT); }
    37 extern inline int isspace (int _c)
    38   { return (_ctype+1)[_c] & (_SPACE); }
    39 extern inline int isupper (int _c)
    40   { return (_ctype+1)[_c] & (_UPPER); }
    41 extern inline int isxdigit (int _c)
    42   { return (_ctype+1)[_c] & (_XDIGIT); }
     22static inline int isalpha (int _c)
     23{ return __locale_ctype.cflags [_c & 0xff] & (__UPPER|__LOWER); }
    4324
    44 #if !defined (_CTYPE_FUN)
    45 extern __inline__ int _toupper (int _c) { return (_c-'a'+'A'); }
    46 extern __inline__ int _tolower (int _c) { return (_c-'A'+'a'); }
    47 extern __inline__ int toupper(int _c)
    48   {return (islower(_c) ? _toupper(_c) : _c);}
    49 extern __inline__ int tolower(int _c)
    50   {return (isupper(_c) ? _tolower(_c) : _c);}
     25static inline int iscntrl (int _c)
     26{ return __locale_ctype.cflags [_c & 0xff] & (__CNTRL); }
     27
     28static inline int isdigit (int _c)
     29{ return __locale_ctype.cflags [_c & 0xff] & (__DIGIT); }
     30
     31static inline int isgraph (int _c)
     32{ return __locale_ctype.cflags [_c & 0xff] & (__PUNCT|__UPPER|__LOWER|__DIGIT); }
     33
     34static inline int islower (int _c)
     35{ return __locale_ctype.cflags [_c & 0xff] & (__LOWER); }
     36
     37static inline int isprint (int _c)
     38{ return __locale_ctype.cflags [_c & 0xff] & (__PRINT); }
     39
     40static inline int ispunct (int _c)
     41{ return __locale_ctype.cflags [_c & 0xff] & (__PUNCT); }
     42
     43static inline int isspace (int _c)
     44{ return __locale_ctype.cflags [_c & 0xff] & (__SPACE); }
     45
     46static inline int isupper (int _c)
     47{ return __locale_ctype.cflags [_c & 0xff] & (__UPPER); }
     48
     49static inline int isxdigit (int _c)
     50{ return __locale_ctype.cflags [_c & 0xff] & (__XDIGIT); }
     51
     52static inline int toupper (int _c)
     53{ return __locale_ctype.upcase [_c & 0xff]; }
     54
     55static inline int tolower (int _c)
     56{ return __locale_ctype.locase [_c & 0xff]; }
     57
     58#if !defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE)
     59
     60#define isascii(c) (!((c) & 0x80))
     61#define toascii(c) ((c) & 0x7f)
     62
    5163#endif
    5264
Note: See TracChangeset for help on using the changeset viewer.