Merge from vendor branch GCC:
[dragonfly.git] / lib / libc / gen / ctype.c
1 /*      $NetBSD: src/lib/libc/gen/ctype_.c,v 1.16 2003/08/07 16:42:46 agc Exp $ */
2 /*      $DragonFly: src/lib/libc/gen/ctype.c,v 1.4 2005/05/09 16:05:54 joerg Exp $ */
3
4 /*
5  * Copyright (c) 1989 The Regents of the University of California.
6  * All rights reserved.
7  * (c) UNIX System Laboratories, Inc.
8  * All or some portions of this file are derived from material licensed
9  * to the University of California by American Telephone and Telegraph
10  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
11  * the permission of UNIX System Laboratories, Inc.
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 1. Redistributions of source code must retain the above copyright
17  *    notice, this list of conditions and the following disclaimer.
18  * 2. Redistributions in binary form must reproduce the above copyright
19  *    notice, this list of conditions and the following disclaimer in the
20  *    documentation and/or other materials provided with the distribution.
21  * 3. Neither the name of the University nor the names of its contributors
22  *    may be used to endorse or promote products derived from this software
23  *    without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35  * SUCH DAMAGE.
36  */
37
38 #define _CTYPE_PRIVATE
39
40 #include <sys/types.h>
41 #include <ctype.h>
42 #include <limits.h>
43
44 const uint16_t __libc_C_ctype_[1 + _CTYPE_NUM_CHARS] = {
45         0,
46 /*00*/  _C,             _C,             _C,             _C,
47         _C,             _C,             _C,             _C,
48         _C,             _C|_S|_B,       _C|_S,          _C|_S,
49         _C|_S,          _C|_S,          _C,             _C,
50 /*10*/  _C,             _C,             _C,             _C,
51         _C,             _C,             _C,             _C,
52         _C,             _C,             _C,             _C,
53         _C,             _C,             _C,             _C,
54 /*20*/  _S|_B|_R,       _P|_R|_G,       _P|_R|_G,       _P|_R|_G,
55         _P|_R|_G,       _P|_R|_G,       _P|_R|_G,       _P|_R|_G,
56         _P|_R|_G,       _P|_R|_G,       _P|_R|_G,       _P|_R|_G,
57         _P|_R|_G,       _P|_R|_G,       _P|_R|_G,       _P|_R|_G,
58 /*30*/  _D|_R|_G|_X,    _D|_R|_G|_X,    _D|_R|_G|_X,    _D|_R|_G|_X,
59         _D|_R|_G|_X,    _D|_R|_G|_X,    _D|_R|_G|_X,    _D|_R|_G|_X,
60         _D|_R|_G|_X,    _D|_R|_G|_X,    _P|_R|_G,       _P|_R|_G,
61         _P|_R|_G,       _P|_R|_G,       _P|_R|_G,       _P|_R|_G,
62 /*40*/  _P|_R|_G,       _U|_X|_R|_G|_A, _U|_X|_R|_G|_A, _U|_X|_R|_G|_A,
63         _U|_X|_R|_G|_A, _U|_X|_R|_G|_A, _U|_X|_R|_G|_A, _U|_R|_G|_A,
64         _U|_R|_G|_A,    _U|_R|_G|_A,    _U|_R|_G|_A,    _U|_R|_G|_A,
65         _U|_R|_G|_A,    _U|_R|_G|_A,    _U|_R|_G|_A,    _U|_R|_G|_A,
66 /*50*/  _U|_R|_G|_A,    _U|_R|_G|_A,    _U|_R|_G|_A,    _U|_R|_G|_A,
67         _U|_R|_G|_A,    _U|_R|_G|_A,    _U|_R|_G|_A,    _U|_R|_G|_A,
68         _U|_R|_G|_A,    _U|_R|_G|_A,    _U|_R|_G|_A,    _P|_R|_G,
69         _P|_R|_G,       _P|_R|_G,       _P|_R|_G,       _P|_R|_G,
70 /*60*/  _P|_R|_G,       _L|_X|_R|_G|_A, _L|_X|_R|_G|_A, _L|_X|_R|_G|_A,
71         _L|_X|_R|_G|_A, _L|_X|_R|_G|_A, _L|_X|_R|_G|_A, _L|_R|_G|_A,
72         _L|_R|_G|_A,    _L|_R|_G|_A,    _L|_R|_G|_A,    _L|_R|_G|_A,
73         _L|_R|_G|_A,    _L|_R|_G|_A,    _L|_R|_G|_A,    _L|_R|_G|_A,
74 /*70*/  _L|_R|_G|_A,    _L|_R|_G|_A,    _L|_R|_G|_A,    _L|_R|_G|_A,
75         _L|_R|_G|_A,    _L|_R|_G|_A,    _L|_R|_G|_A,    _L|_R|_G|_A,
76         _L|_R|_G|_A,    _L|_R|_G|_A,    _L|_R|_G|_A,    _P|_R|_G,
77         _P|_R|_G,       _P|_R|_G,       _P|_R|_G,       _C
78 };
79
80 const uint16_t *__libc_ctype_ = __libc_C_ctype_;