cclass.h revision 1.1 1 1.1 christos /*-
2 1.1 christos * Copyright (c) 1992, 1993, 1994 Henry Spencer.
3 1.1 christos * Copyright (c) 1992, 1993, 1994
4 1.1 christos * The Regents of the University of California. All rights reserved.
5 1.1 christos *
6 1.1 christos * This code is derived from software contributed to Berkeley by
7 1.1 christos * Henry Spencer of the University of Toronto.
8 1.1 christos *
9 1.1 christos * Redistribution and use in source and binary forms, with or without
10 1.1 christos * modification, are permitted provided that the following conditions
11 1.1 christos * are met:
12 1.1 christos * 1. Redistributions of source code must retain the above copyright
13 1.1 christos * notice, this list of conditions and the following disclaimer.
14 1.1 christos * 2. Redistributions in binary form must reproduce the above copyright
15 1.1 christos * notice, this list of conditions and the following disclaimer in the
16 1.1 christos * documentation and/or other materials provided with the distribution.
17 1.1 christos * 3. All advertising materials mentioning features or use of this software
18 1.1 christos * must display the following acknowledgement:
19 1.1 christos * This product includes software developed by the University of
20 1.1 christos * California, Berkeley and its contributors.
21 1.1 christos * 4. Neither the name of the University nor the names of its contributors
22 1.1 christos * may be used to endorse or promote products derived from this software
23 1.1 christos * without specific prior written permission.
24 1.1 christos *
25 1.1 christos * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 1.1 christos * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 1.1 christos * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 1.1 christos * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 1.1 christos * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 1.1 christos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 1.1 christos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 1.1 christos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 1.1 christos * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 1.1 christos * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 1.1 christos * SUCH DAMAGE.
36 1.1 christos *
37 1.1 christos * @(#)cclass.h 8.2 (Berkeley) 3/16/94
38 1.1 christos */
39 1.1 christos
40 1.1 christos RCHAR_T ALNUM[] = {'a','l','n','u','m',0};
41 1.1 christos RCHAR_T ALPHA[] = {'a','l','p','h','a',0};
42 1.1 christos RCHAR_T BLANK[] = {'b','l','a','n','k',0};
43 1.1 christos RCHAR_T CNTRL[] = {'c','n','t','r','l',0};
44 1.1 christos RCHAR_T DIGIT[] = {'d','i','g','i','t',0};
45 1.1 christos RCHAR_T GRAPH[] = {'g','r','a','p','h',0};
46 1.1 christos RCHAR_T LOWER[] = {'l','o','w','e','r',0};
47 1.1 christos RCHAR_T PRINT[] = {'p','r','i','n','t',0};
48 1.1 christos RCHAR_T PUNCT[] = {'p','u','n','c','t',0};
49 1.1 christos RCHAR_T SPACE[] = {'s','p','a','c','e',0};
50 1.1 christos RCHAR_T UPPER[] = {'u','p','p','e','r',0};
51 1.1 christos RCHAR_T XDIGIT[] = {'x','d','i','g','i','t',0};
52 1.1 christos
53 1.1 christos /* character-class table */
54 1.1 christos static struct cclass {
55 1.1 christos RCHAR_T *name;
56 1.1 christos char *chars;
57 1.1 christos char *multis;
58 1.1 christos } cclasses[] = {
59 1.1 christos ALNUM, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
60 1.1 christos 0123456789", "",
61 1.1 christos ALPHA, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
62 1.1 christos "",
63 1.1 christos BLANK, " \t", "",
64 1.1 christos CNTRL, "\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\
65 1.1 christos \25\26\27\30\31\32\33\34\35\36\37\177", "",
66 1.1 christos DIGIT, "0123456789", "",
67 1.1 christos GRAPH, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
68 1.1 christos 0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
69 1.1 christos "",
70 1.1 christos LOWER, "abcdefghijklmnopqrstuvwxyz",
71 1.1 christos "",
72 1.1 christos PRINT, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
73 1.1 christos 0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ",
74 1.1 christos "",
75 1.1 christos PUNCT, "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
76 1.1 christos "",
77 1.1 christos SPACE, "\t\n\v\f\r ", "",
78 1.1 christos UPPER, "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
79 1.1 christos "",
80 1.1 christos XDIGIT, "0123456789ABCDEFabcdef",
81 1.1 christos "",
82 1.1 christos NULL, 0, ""
83 1.1 christos };
84