Changeset 1008


Ignore:
Timestamp:
Jan 18, 2004, 10:49:32 PM (22 years ago)
Author:
bird
Message:

(ctype:) Review and fixup to meet standards. Added two more BSD calls.

Location:
trunk/src/emx/src/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/lib/libc.def

    • Property cvs2svn:cvs-rev changed from 1.34 to 1.35
    r1007 r1008  
    957957    "_regexec" @986
    958958    "_regfree" @987
     959    "_isblank" @988
     960    "_ishexnumber" @989
     961    "_isnumber" @990
     962    "___istype" @991
     963    "___tolower" @992
     964    "___toupper" @993
  • trunk/src/emx/src/lib/locale/isxxx.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1007 r1008  
    1010*/
    1111
     12#define _DONT_USE_CTYPE_INLINE_
    1213#include "libc-alias.h"
    1314#include <sys/locale.h>
     15#include <ctype.h>
    1416
    15 int     isalnum(int);
    16 int     isalpha(int);
    17 int     iscntrl(int);
    18 int     isdigit(int);
    19 int     isgraph(int);
    20 int     islower(int);
    21 int     isprint(int);
    22 int     ispunct(int);
    23 int     isspace(int);
    24 int     isupper(int);
    25 int     isxdigit(int);
    26 int     isascii(int);
    27 int     toascii(int);
    28 
    29 int isalnum (int _c)
     17#undef isalnum
     18int isalnum(int _c)
    3019{ return __locale_ctype.cflags [_c & 0xff] & (__UPPER|__LOWER|__DIGIT); }
    3120
    32 int isalpha (int _c)
     21#undef isalpha
     22int isalpha(int _c)
    3323{ return __locale_ctype.cflags [_c & 0xff] & (__UPPER|__LOWER); }
    3424
    35 int iscntrl (int _c)
     25#undef iscntrl
     26int iscntrl(int _c)
    3627{ return __locale_ctype.cflags [_c & 0xff] & (__CNTRL); }
    3728
    38 int isdigit (int _c)
     29#undef isdigit
     30int isdigit(int _c)
    3931{ return __locale_ctype.cflags [_c & 0xff] & (__DIGIT); }
    4032
    41 int isgraph (int _c)
     33#undef isgraph
     34int isgraph(int _c)
    4235{ return __locale_ctype.cflags [_c & 0xff] & (__PUNCT|__UPPER|__LOWER|__DIGIT); }
    4336
    44 int islower (int _c)
     37#undef islower
     38int islower(int _c)
    4539{ return __locale_ctype.cflags [_c & 0xff] & (__LOWER); }
    4640
    47 int isprint (int _c)
     41#undef isprint
     42int isprint(int _c)
    4843{ return __locale_ctype.cflags [_c & 0xff] & (__PRINT); }
    4944
    50 int ispunct (int _c)
     45#undef ispunct
     46int ispunct(int _c)
    5147{ return __locale_ctype.cflags [_c & 0xff] & (__PUNCT); }
    5248
    53 int isspace (int _c)
     49#undef isspace
     50int isspace(int _c)
    5451{ return __locale_ctype.cflags [_c & 0xff] & (__SPACE); }
    5552
    56 int isupper (int _c)
     53#undef isupper
     54int isupper(int _c)
    5755{ return __locale_ctype.cflags [_c & 0xff] & (__UPPER); }
    5856
    59 int isxdigit (int _c)
     57#undef isxdigit
     58int isxdigit(int _c)
    6059{ return __locale_ctype.cflags [_c & 0xff] & (__XDIGIT); }
    6160
    62 int toascii (int _c)
     61#undef isblank
     62int isblank(int _c)
     63{ return __locale_ctype.cflags [_c & 0xff] & (__BLANK); }
     64
     65#undef ishexnumber
     66int ishexnumber(int _c)
     67{ return __locale_ctype.cflags [_c & 0xff] & (__XDIGIT); }
     68
     69#undef isnumber
     70int isnumber(int _c)
     71{ return __locale_ctype.cflags [_c & 0xff] & (__DIGIT); }
     72
     73#undef toascii
     74int toascii(int _c)
    6375{ return _c & 0x7f; }
    6476
    65 int isascii (int _c)
     77#undef isascii
     78int isascii(int _c)
    6679{ return (_c & 0x80) != 0; }
     80
     81
  • trunk/src/emx/src/lib/locale/locale_ctype.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r1007 r1008  
    99
    1010#define __INTERNAL_DEFS
     11#define _DONT_USE_CTYPE_INLINE_
    1112#include "libc-alias.h"
    1213#include <sys/locale.h>
    13 #include <string.h>
     14#include <ctype.h>
    1415
    1516struct __locale_ctype __locale_ctype =
     
    8889};
    8990
    90 int tolower (int _c);
    91 int toupper (int _c);
    9291
    93 int tolower (int _c)
     92#undef tolower
     93int tolower(int _c)
     94{ return __locale_ctype.locase [_c & 0xff]; }
     95int __tolower(int _c)
    9496{ return __locale_ctype.locase [_c & 0xff]; }
    9597
    96 int toupper (int _c)
     98#undef toupper
     99int toupper(int _c)
    97100{ return __locale_ctype.upcase [_c & 0xff]; }
     101int __toupper(int _c)
     102{ return __locale_ctype.upcase [_c & 0xff]; }
     103
     104int __istype(int _c, unsigned _f)
     105{ return __locale_ctype.cflags [_c & 0xff] & (_f); }
     106
     107
    98108
    99109
     
    120130           "\n"
    121131           "#define __INTERNAL_DEFS\n"
     132           "#define _DONT_USE_CTYPE_INLINE_\n"
    122133           "#include \"libc-alias.h\"\n"
    123134           "#include <sys/locale.h>\n"
    124            "#include <string.h>\n"
     135           "#include <ctype.h>\n"
    125136           "\n"
    126137           "\n"
Note: See TracChangeset for help on using the changeset viewer.