mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Fixed ctype table and functions.
svn path=/trunk/; revision=918
This commit is contained in:
parent
57919a833e
commit
453f513ed3
6 changed files with 304 additions and 303 deletions
|
@ -18,9 +18,9 @@
|
|||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Revision: 1.4 $
|
||||
* $Author: ariadne $
|
||||
* $Date: 1999/04/14 07:10:15 $
|
||||
* $Revision: 1.5 $
|
||||
* $Author: ekohl $
|
||||
* $Date: 2000/01/05 19:42:56 $
|
||||
*
|
||||
*/
|
||||
#ifndef _LINUX_CTYPE_H
|
||||
|
@ -46,9 +46,8 @@
|
|||
#define _CONTROL 0x0020
|
||||
#define _BLANK 0x0040
|
||||
#define _HEX 0x0080
|
||||
|
||||
#define _ALPHA 0x0103
|
||||
#define _GRAPH 0x0200 // added
|
||||
#define _PRINT 0x0400 // added
|
||||
#define _LEADBYTE 0x8000
|
||||
|
||||
|
||||
|
|
|
@ -1,150 +1,136 @@
|
|||
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
|
||||
#include <crtdll/ctype.h>
|
||||
|
||||
|
||||
#define __dj_ISUPPER _UPPER
|
||||
#define __dj_ISLOWER _LOWER
|
||||
#define __dj_ISDIGIT _DIGIT
|
||||
#define __dj_ISSPACE _SPACE
|
||||
#define __dj_ISPUNCT _PUNCT
|
||||
#define __dj_ISCNTRL _CONTROL
|
||||
#define __dj_ISBLANK _BLANK
|
||||
#define __dj_ISXDIGIT _HEX
|
||||
#define __dj_ISALPHA _ALPHA
|
||||
#define __dj_ISPRINT _PRINT
|
||||
#define __dj_ISGRAPH _GRAPH
|
||||
|
||||
// removed the first value
|
||||
|
||||
unsigned short _pctype_dll[] = {
|
||||
__dj_ISCNTRL, /* CTRL+@, 0x00 */
|
||||
__dj_ISCNTRL, /* CTRL+A, 0x01 */
|
||||
__dj_ISCNTRL, /* CTRL+B, 0x02 */
|
||||
__dj_ISCNTRL, /* CTRL+C, 0x03 */
|
||||
__dj_ISCNTRL, /* CTRL+D, 0x04 */
|
||||
__dj_ISCNTRL, /* CTRL+E, 0x05 */
|
||||
__dj_ISCNTRL, /* CTRL+F, 0x06 */
|
||||
__dj_ISCNTRL, /* CTRL+G, 0x07 */
|
||||
__dj_ISCNTRL, /* CTRL+H, 0x08 */
|
||||
__dj_ISCNTRL | __dj_ISSPACE, /* CTRL+I, 0x09 */
|
||||
__dj_ISCNTRL | __dj_ISSPACE, /* CTRL+J, 0x0a */
|
||||
__dj_ISCNTRL | __dj_ISSPACE, /* CTRL+K, 0x0b */
|
||||
__dj_ISCNTRL | __dj_ISSPACE, /* CTRL+L, 0x0c */
|
||||
__dj_ISCNTRL | __dj_ISSPACE, /* CTRL+M, 0x0d */
|
||||
__dj_ISCNTRL, /* CTRL+N, 0x0e */
|
||||
__dj_ISCNTRL, /* CTRL+O, 0x0f */
|
||||
__dj_ISCNTRL, /* CTRL+P, 0x10 */
|
||||
__dj_ISCNTRL, /* CTRL+Q, 0x11 */
|
||||
__dj_ISCNTRL, /* CTRL+R, 0x12 */
|
||||
__dj_ISCNTRL, /* CTRL+S, 0x13 */
|
||||
__dj_ISCNTRL, /* CTRL+T, 0x14 */
|
||||
__dj_ISCNTRL, /* CTRL+U, 0x15 */
|
||||
__dj_ISCNTRL, /* CTRL+V, 0x16 */
|
||||
__dj_ISCNTRL, /* CTRL+W, 0x17 */
|
||||
__dj_ISCNTRL, /* CTRL+X, 0x18 */
|
||||
__dj_ISCNTRL, /* CTRL+Y, 0x19 */
|
||||
__dj_ISCNTRL, /* CTRL+Z, 0x1a */
|
||||
__dj_ISCNTRL, /* CTRL+[, 0x1b */
|
||||
__dj_ISCNTRL, /* CTRL+\, 0x1c */
|
||||
__dj_ISCNTRL, /* CTRL+], 0x1d */
|
||||
__dj_ISCNTRL, /* CTRL+^, 0x1e */
|
||||
__dj_ISCNTRL, /* CTRL+_, 0x1f */
|
||||
__dj_ISPRINT | __dj_ISSPACE, /* ` ', 0x20 */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `!', 0x21 */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* 0x22 */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `#', 0x23 */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `$', 0x24 */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `%', 0x25 */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `&', 0x26 */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* 0x27 */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `(', 0x28 */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `)', 0x29 */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `*', 0x2a */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `+', 0x2b */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `,', 0x2c */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `-', 0x2d */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `.', 0x2e */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `/', 0x2f */
|
||||
__dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT, /* `0', 0x30 */
|
||||
__dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT, /* `1', 0x31 */
|
||||
__dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT, /* `2', 0x32 */
|
||||
__dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT, /* `3', 0x33 */
|
||||
__dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT, /* `4', 0x34 */
|
||||
__dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT, /* `5', 0x35 */
|
||||
__dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT, /* `6', 0x36 */
|
||||
__dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT, /* `7', 0x37 */
|
||||
__dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT, /* `8', 0x38 */
|
||||
__dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT, /* `9', 0x39 */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `:', 0x3a */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `;', 0x3b */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `<', 0x3c */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `=', 0x3d */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `>', 0x3e */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `?', 0x3f */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `@', 0x40 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER | __dj_ISXDIGIT, /* `A', 0x41 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER | __dj_ISXDIGIT, /* `B', 0x42 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER | __dj_ISXDIGIT, /* `C', 0x43 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER | __dj_ISXDIGIT, /* `D', 0x44 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER | __dj_ISXDIGIT, /* `E', 0x45 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER | __dj_ISXDIGIT, /* `F', 0x46 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `G', 0x47 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `H', 0x48 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `I', 0x49 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `J', 0x4a */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `K', 0x4b */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `L', 0x4c */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `M', 0x4d */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `N', 0x4e */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `O', 0x4f */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `P', 0x50 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `Q', 0x51 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `R', 0x52 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `S', 0x53 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `T', 0x54 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `U', 0x55 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `V', 0x56 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `W', 0x57 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `X', 0x58 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `Y', 0x59 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER, /* `Z', 0x5a */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `[', 0x5b */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* 0x5c */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `]', 0x5d */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `^', 0x5e */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `_', 0x5f */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* 0x60 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT | __dj_ISXDIGIT, /* `a', 0x61 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT | __dj_ISXDIGIT, /* `b', 0x62 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT | __dj_ISXDIGIT, /* `c', 0x63 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT | __dj_ISXDIGIT, /* `d', 0x64 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT | __dj_ISXDIGIT, /* `e', 0x65 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT | __dj_ISXDIGIT, /* `f', 0x66 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `g', 0x67 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `h', 0x68 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `i', 0x69 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `j', 0x6a */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `k', 0x6b */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `l', 0x6c */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `m', 0x6d */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `n', 0x6e */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `o', 0x6f */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `p', 0x70 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `q', 0x71 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `r', 0x72 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `s', 0x73 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `t', 0x74 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `u', 0x75 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `v', 0x76 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `w', 0x77 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `x', 0x78 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `y', 0x79 */
|
||||
__dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT, /* `z', 0x7a */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `{', 0x7b */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `|', 0x7c */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `}', 0x7d */
|
||||
__dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT, /* `~', 0x7e */
|
||||
__dj_ISCNTRL, /* 0x7f */
|
||||
unsigned short _ctype[] = {
|
||||
0, /* <EOF>, 0xFFFF */
|
||||
_CONTROL, /* CTRL+@, 0x00 */
|
||||
_CONTROL, /* CTRL+A, 0x01 */
|
||||
_CONTROL, /* CTRL+B, 0x02 */
|
||||
_CONTROL, /* CTRL+C, 0x03 */
|
||||
_CONTROL, /* CTRL+D, 0x04 */
|
||||
_CONTROL, /* CTRL+E, 0x05 */
|
||||
_CONTROL, /* CTRL+F, 0x06 */
|
||||
_CONTROL, /* CTRL+G, 0x07 */
|
||||
_CONTROL, /* CTRL+H, 0x08 */
|
||||
_CONTROL | _SPACE, /* CTRL+I, 0x09 */
|
||||
_CONTROL | _SPACE, /* CTRL+J, 0x0a */
|
||||
_CONTROL | _SPACE, /* CTRL+K, 0x0b */
|
||||
_CONTROL | _SPACE, /* CTRL+L, 0x0c */
|
||||
_CONTROL | _SPACE, /* CTRL+M, 0x0d */
|
||||
_CONTROL, /* CTRL+N, 0x0e */
|
||||
_CONTROL, /* CTRL+O, 0x0f */
|
||||
_CONTROL, /* CTRL+P, 0x10 */
|
||||
_CONTROL, /* CTRL+Q, 0x11 */
|
||||
_CONTROL, /* CTRL+R, 0x12 */
|
||||
_CONTROL, /* CTRL+S, 0x13 */
|
||||
_CONTROL, /* CTRL+T, 0x14 */
|
||||
_CONTROL, /* CTRL+U, 0x15 */
|
||||
_CONTROL, /* CTRL+V, 0x16 */
|
||||
_CONTROL, /* CTRL+W, 0x17 */
|
||||
_CONTROL, /* CTRL+X, 0x18 */
|
||||
_CONTROL, /* CTRL+Y, 0x19 */
|
||||
_CONTROL, /* CTRL+Z, 0x1a */
|
||||
_CONTROL, /* CTRL+[, 0x1b */
|
||||
_CONTROL, /* CTRL+\, 0x1c */
|
||||
_CONTROL, /* CTRL+], 0x1d */
|
||||
_CONTROL, /* CTRL+^, 0x1e */
|
||||
_CONTROL, /* CTRL+_, 0x1f */
|
||||
_SPACE | _BLANK, /* ` ', 0x20 */
|
||||
_PUNCT, /* `!', 0x21 */
|
||||
_PUNCT, /* 0x22 */
|
||||
_PUNCT, /* `#', 0x23 */
|
||||
_PUNCT, /* `$', 0x24 */
|
||||
_PUNCT, /* `%', 0x25 */
|
||||
_PUNCT, /* `&', 0x26 */
|
||||
_PUNCT, /* 0x27 */
|
||||
_PUNCT, /* `(', 0x28 */
|
||||
_PUNCT, /* `)', 0x29 */
|
||||
_PUNCT, /* `*', 0x2a */
|
||||
_PUNCT, /* `+', 0x2b */
|
||||
_PUNCT, /* `,', 0x2c */
|
||||
_PUNCT, /* `-', 0x2d */
|
||||
_PUNCT, /* `.', 0x2e */
|
||||
_PUNCT, /* `/', 0x2f */
|
||||
_DIGIT | _HEX, /* `0', 0x30 */
|
||||
_DIGIT | _HEX, /* `1', 0x31 */
|
||||
_DIGIT | _HEX, /* `2', 0x32 */
|
||||
_DIGIT | _HEX, /* `3', 0x33 */
|
||||
_DIGIT | _HEX, /* `4', 0x34 */
|
||||
_DIGIT | _HEX, /* `5', 0x35 */
|
||||
_DIGIT | _HEX, /* `6', 0x36 */
|
||||
_DIGIT | _HEX, /* `7', 0x37 */
|
||||
_DIGIT | _HEX, /* `8', 0x38 */
|
||||
_DIGIT | _HEX, /* `9', 0x39 */
|
||||
_PUNCT, /* `:', 0x3a */
|
||||
_PUNCT, /* `;', 0x3b */
|
||||
_PUNCT, /* `<', 0x3c */
|
||||
_PUNCT, /* `=', 0x3d */
|
||||
_PUNCT, /* `>', 0x3e */
|
||||
_PUNCT, /* `?', 0x3f */
|
||||
_PUNCT, /* `@', 0x40 */
|
||||
_UPPER | _HEX, /* `A', 0x41 */
|
||||
_UPPER | _HEX, /* `B', 0x42 */
|
||||
_UPPER | _HEX, /* `C', 0x43 */
|
||||
_UPPER | _HEX, /* `D', 0x44 */
|
||||
_UPPER | _HEX, /* `E', 0x45 */
|
||||
_UPPER | _HEX, /* `F', 0x46 */
|
||||
_UPPER, /* `G', 0x47 */
|
||||
_UPPER, /* `H', 0x48 */
|
||||
_UPPER, /* `I', 0x49 */
|
||||
_UPPER, /* `J', 0x4a */
|
||||
_UPPER, /* `K', 0x4b */
|
||||
_UPPER, /* `L', 0x4c */
|
||||
_UPPER, /* `M', 0x4d */
|
||||
_UPPER, /* `N', 0x4e */
|
||||
_UPPER, /* `O', 0x4f */
|
||||
_UPPER, /* `P', 0x50 */
|
||||
_UPPER, /* `Q', 0x51 */
|
||||
_UPPER, /* `R', 0x52 */
|
||||
_UPPER, /* `S', 0x53 */
|
||||
_UPPER, /* `T', 0x54 */
|
||||
_UPPER, /* `U', 0x55 */
|
||||
_UPPER, /* `V', 0x56 */
|
||||
_UPPER, /* `W', 0x57 */
|
||||
_UPPER, /* `X', 0x58 */
|
||||
_UPPER, /* `Y', 0x59 */
|
||||
_UPPER, /* `Z', 0x5a */
|
||||
_PUNCT, /* `[', 0x5b */
|
||||
_PUNCT, /* 0x5c */
|
||||
_PUNCT, /* `]', 0x5d */
|
||||
_PUNCT, /* `^', 0x5e */
|
||||
_PUNCT, /* `_', 0x5f */
|
||||
_PUNCT, /* 0x60 */
|
||||
_LOWER | _HEX, /* `a', 0x61 */
|
||||
_LOWER | _HEX, /* `b', 0x62 */
|
||||
_LOWER | _HEX, /* `c', 0x63 */
|
||||
_LOWER | _HEX, /* `d', 0x64 */
|
||||
_LOWER | _HEX, /* `e', 0x65 */
|
||||
_LOWER | _HEX, /* `f', 0x66 */
|
||||
_LOWER, /* `g', 0x67 */
|
||||
_LOWER, /* `h', 0x68 */
|
||||
_LOWER, /* `i', 0x69 */
|
||||
_LOWER, /* `j', 0x6a */
|
||||
_LOWER, /* `k', 0x6b */
|
||||
_LOWER, /* `l', 0x6c */
|
||||
_LOWER, /* `m', 0x6d */
|
||||
_LOWER, /* `n', 0x6e */
|
||||
_LOWER, /* `o', 0x6f */
|
||||
_LOWER, /* `p', 0x70 */
|
||||
_LOWER, /* `q', 0x71 */
|
||||
_LOWER, /* `r', 0x72 */
|
||||
_LOWER, /* `s', 0x73 */
|
||||
_LOWER, /* `t', 0x74 */
|
||||
_LOWER, /* `u', 0x75 */
|
||||
_LOWER, /* `v', 0x76 */
|
||||
_LOWER, /* `w', 0x77 */
|
||||
_LOWER, /* `x', 0x78 */
|
||||
_LOWER, /* `y', 0x79 */
|
||||
_LOWER, /* `z', 0x7a */
|
||||
_PUNCT, /* `{', 0x7b */
|
||||
_PUNCT, /* `|', 0x7c */
|
||||
_PUNCT, /* `}', 0x7d */
|
||||
_PUNCT, /* `~', 0x7e */
|
||||
_CONTROL, /* 0x7f */
|
||||
0, /* 0x80 */
|
||||
0, /* 0x81 */
|
||||
0, /* 0x82 */
|
||||
|
@ -272,29 +258,26 @@ unsigned short _pctype_dll[] = {
|
|||
0, /* 0xfc */
|
||||
0, /* 0xfd */
|
||||
0, /* 0xfe */
|
||||
0, /* 0xff */
|
||||
0 /* 0xff */
|
||||
};
|
||||
|
||||
unsigned short *_ctype = _pctype_dll -1; // unused
|
||||
unsigned short *_pwctype_dll = _pctype_dll;
|
||||
unsigned short *_pctype_dll = _ctype + 1;
|
||||
unsigned short *_pwctype_dll = _ctype + 1;
|
||||
|
||||
int _isctype (unsigned int c, int ctypeFlags)
|
||||
{
|
||||
|
||||
return ((_pctype_dll[(unsigned char)(c & 0xFF)]&ctypeFlags) == ctypeFlags );
|
||||
return (_pctype_dll[(unsigned char)(c & 0xFF)] & ctypeFlags);
|
||||
}
|
||||
|
||||
|
||||
int iswctype(wint_t wc, wctype_t wctypeFlags)
|
||||
{
|
||||
|
||||
return ((_pwctype_dll[(unsigned char)(wc & 0xFF)]&wctypeFlags) == wctypeFlags );
|
||||
return (_pwctype_dll[(unsigned char)(wc & 0xFF)] & wctypeFlags);
|
||||
}
|
||||
|
||||
// obsolete
|
||||
int is_wctype(wint_t wc, wctype_t wctypeFlags)
|
||||
{
|
||||
|
||||
return ((_pwctype_dll[(unsigned char)(wc & 0xFF)]&wctypeFlags) == wctypeFlags );
|
||||
return (_pwctype_dll[(unsigned char)(wc & 0xFF)] & wctypeFlags);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
#undef isgraph
|
||||
int isgraph(int c)
|
||||
{
|
||||
return _isctype(c,_GRAPH);
|
||||
return _isctype(c,_PUNCT | _ALPHA | _DIGIT);
|
||||
}
|
||||
|
||||
#undef iswgraph
|
||||
int iswgraph(wint_t c)
|
||||
{
|
||||
return iswctype(c,_GRAPH);
|
||||
return iswctype(c,_PUNCT | _ALPHA | _DIGIT);
|
||||
}
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
#undef isprint
|
||||
int isprint(int c)
|
||||
{
|
||||
return _isctype(c,_PRINT);
|
||||
return _isctype(c,_BLANK | _PUNCT | _ALPHA | _DIGIT);
|
||||
}
|
||||
|
||||
int iswprint(wint_t c)
|
||||
{
|
||||
return iswctype((unsigned short)c,_PRINT);
|
||||
return iswctype((unsigned short)c,_BLANK | _PUNCT | _ALPHA | _DIGIT);
|
||||
}
|
||||
|
|
|
@ -1,24 +1,34 @@
|
|||
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
|
||||
#include <crtdll/ctype.h>
|
||||
|
||||
#undef tolower
|
||||
int tolower(int c)
|
||||
{
|
||||
return (c >= 'A' && c <= 'Z') ? c - ( 'A' - 'a' ) : c;
|
||||
if (_isctype (c, _UPPER))
|
||||
return (c - ('A' - 'a'));
|
||||
return(c);
|
||||
}
|
||||
|
||||
#undef towlower
|
||||
wchar_t towlower(wchar_t c)
|
||||
{
|
||||
return (c >= 'A' && c <= 'Z') ? c - ( 'A' - 'a' ) : c;
|
||||
if (iswctype (c, _UPPER))
|
||||
return (c - (L'A' - L'a'));
|
||||
return(c);
|
||||
}
|
||||
|
||||
int _tolower(int c)
|
||||
{
|
||||
return (c >= 'A' && c <= 'Z') ? c - ( 'A' - 'a' ) : c;
|
||||
if (_isctype (c, _UPPER))
|
||||
return (c - ('A' - 'a'));
|
||||
return(c);
|
||||
}
|
||||
|
||||
wchar_t _towlower(wchar_t c)
|
||||
{
|
||||
return (c >= 'A' && c <= 'Z') ? c - ( 'A' - 'a' ) : c;
|
||||
if (iswctype (c, _UPPER))
|
||||
return (c - (L'A' - L'a'));
|
||||
return(c);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -5,20 +5,29 @@
|
|||
#undef toupper
|
||||
int toupper(int c)
|
||||
{
|
||||
return (c >= 'a' && c <= 'z') ? c + 'A' - 'a' : c;
|
||||
if (_isctype (c, _LOWER))
|
||||
return (c + ('A' - 'a'));
|
||||
return(c);
|
||||
}
|
||||
|
||||
#undef towupper
|
||||
wchar_t towupper(wchar_t c)
|
||||
{
|
||||
return (c >= 'a' && c <= 'z') ? c + 'A' - 'a' : c;
|
||||
if (iswctype (c, _LOWER))
|
||||
return (c + (L'A' - L'a'));
|
||||
return(c);
|
||||
}
|
||||
|
||||
int _toupper(int c)
|
||||
{
|
||||
return (c >= 'a' && c <= 'z') ? c + 'A' - 'a' : c;
|
||||
if (_isctype (c, _LOWER))
|
||||
return (c + ('A' - 'a'));
|
||||
return(c);
|
||||
}
|
||||
|
||||
wchar_t _towupper(wchar_t c)
|
||||
{
|
||||
return (c >= 'a' && c <= 'z') ? c + 'A' - 'a' : c;
|
||||
if (iswctype (c, _LOWER))
|
||||
return (c + (L'A' - L'a'));
|
||||
return(c);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue