diff options
author | Christopher Faylor <me@cgf.cx> | 2005-03-23 20:11:24 +0300 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-03-23 20:11:24 +0300 |
commit | 6d89e9dd43b4c3878007d9857ea1e55b19aa0c77 (patch) | |
tree | 7ddeba711e7b9d5347ae3f987b42e9e9f9302cd9 /winsup/cygwin/ctype.cc | |
parent | e633fde1baed0151958929cb630311a22df54cad (diff) |
* include/ctype.h: New file.
* ctype.cc: Ditto.
* Makefile.in: Add ctype.o to DLL_OFILES.
* cygwin.din: Remove _ctype_ptr (for now?).
Diffstat (limited to 'winsup/cygwin/ctype.cc')
-rw-r--r-- | winsup/cygwin/ctype.cc | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/winsup/cygwin/ctype.cc b/winsup/cygwin/ctype.cc new file mode 100644 index 000000000..b656d3e08 --- /dev/null +++ b/winsup/cygwin/ctype.cc @@ -0,0 +1,112 @@ +#include "winsup.h" +extern "C" { +#include <ctype.h> + +#define _CTYPE_DATA_0_127 \ + _C, _C, _C, _C, _C, _C, _C, _C, \ + _C, _C|_S, _C|_S, _C|_S, _C|_S, _C|_S, _C, _C, \ + _C, _C, _C, _C, _C, _C, _C, _C, \ + _C, _C, _C, _C, _C, _C, _C, _C, \ + _S|_B, _P, _P, _P, _P, _P, _P, _P, \ + _P, _P, _P, _P, _P, _P, _P, _P, \ + _N, _N, _N, _N, _N, _N, _N, _N, \ + _N, _N, _P, _P, _P, _P, _P, _P, \ + _P, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U, \ + _U, _U, _U, _U, _U, _U, _U, _U, \ + _U, _U, _U, _U, _U, _U, _U, _U, \ + _U, _U, _U, _P, _P, _P, _P, _P, \ + _P, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L, \ + _L, _L, _L, _L, _L, _L, _L, _L, \ + _L, _L, _L, _L, _L, _L, _L, _L, \ + _L, _L, _L, _P, _P, _P, _P, _C + +#define _CTYPE_DATA_128_256 \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0 + +char ctype_b[128 + 256] = { + _CTYPE_DATA_128_256, + _CTYPE_DATA_0_127, + _CTYPE_DATA_128_256 +}; + +__asm__ (" \n\ + .data \n\ + .globl __ctype_ \n\ + .set __ctype_,_ctype_b+127 \n\ + .text \n\ +"); + +#define makefunc(x) \ + static int __cdecl \ + c_##x (int c) \ + { \ + return x (c); \ + } \ + EXPORT_ALIAS(c_##x, x) + +makefunc(isalnum) +makefunc(isalpha) +makefunc(iscntrl) +makefunc(isdigit) +makefunc(isgraph) +makefunc(islower) +makefunc(isprint) +makefunc(ispunct) +makefunc(isspace) +makefunc(isupper) +makefunc(isxdigit) +makefunc(tolower) +makefunc(toupper) +makefunc(isblank) +makefunc(isascii) +makefunc(toascii) +} + +/* + * Copyright (c) 1989 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + |