1254225Speter/* $NetBSD: cclass.h,v 1.2 2008/12/05 22:51:42 christos Exp $ */ 2254225Speter 3254225Speter/*- 4254225Speter * Copyright (c) 1992, 1993, 1994 Henry Spencer. 5254225Speter * Copyright (c) 1992, 1993, 1994 6254225Speter * The Regents of the University of California. All rights reserved. 7254225Speter * 8254225Speter * This code is derived from software contributed to Berkeley by 9254225Speter * Henry Spencer of the University of Toronto. 10254225Speter * 11254225Speter * Redistribution and use in source and binary forms, with or without 12254225Speter * modification, are permitted provided that the following conditions 13254225Speter * are met: 14254225Speter * 1. Redistributions of source code must retain the above copyright 15254225Speter * notice, this list of conditions and the following disclaimer. 16254225Speter * 2. Redistributions in binary form must reproduce the above copyright 17254225Speter * notice, this list of conditions and the following disclaimer in the 18254225Speter * documentation and/or other materials provided with the distribution. 19254225Speter * 3. All advertising materials mentioning features or use of this software 20254225Speter * must display the following acknowledgement: 21254225Speter * This product includes software developed by the University of 22254225Speter * California, Berkeley and its contributors. 23254225Speter * 4. Neither the name of the University nor the names of its contributors 24254225Speter * may be used to endorse or promote products derived from this software 25254225Speter * without specific prior written permission. 26254225Speter * 27254225Speter * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 28254225Speter * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 29254225Speter * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 30254225Speter * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 31254225Speter * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 32254225Speter * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 33254225Speter * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34254225Speter * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35254225Speter * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36254225Speter * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37254225Speter * SUCH DAMAGE. 38254225Speter * 39254225Speter * @(#)cclass.h 8.2 (Berkeley) 3/16/94 40254225Speter */ 41254225Speter 42254225SpeterRCHAR_T ALNUM[] = {'a','l','n','u','m',0}; 43254225SpeterRCHAR_T ALPHA[] = {'a','l','p','h','a',0}; 44254225SpeterRCHAR_T BLANK[] = {'b','l','a','n','k',0}; 45254225SpeterRCHAR_T CNTRL[] = {'c','n','t','r','l',0}; 46254225SpeterRCHAR_T DIGIT[] = {'d','i','g','i','t',0}; 47254225SpeterRCHAR_T GRAPH[] = {'g','r','a','p','h',0}; 48254225SpeterRCHAR_T LOWER[] = {'l','o','w','e','r',0}; 49254225SpeterRCHAR_T PRINT[] = {'p','r','i','n','t',0}; 50254225SpeterRCHAR_T PUNCT[] = {'p','u','n','c','t',0}; 51254225SpeterRCHAR_T SPACE[] = {'s','p','a','c','e',0}; 52254225SpeterRCHAR_T UPPER[] = {'u','p','p','e','r',0}; 53254225SpeterRCHAR_T XDIGIT[] = {'x','d','i','g','i','t',0}; 54254225Speter 55254225Speter/* character-class table */ 56254225Speterstatic struct cclass { 57254225Speter RCHAR_T *name; 58254225Speter const char *chars; 59254225Speter const char *multis; 60254225Speter} cclasses[] = { 61254225Speter { ALNUM, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ 62254225Speter0123456789", "" }, 63254225Speter { ALPHA, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", 64254225Speter "" }, 65254225Speter { BLANK, " \t", "" }, 66254225Speter { CNTRL, "\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\ 67254225Speter\25\26\27\30\31\32\33\34\35\36\37\177", "" }, 68254225Speter { DIGIT, "0123456789", "" }, 69254225Speter { GRAPH, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ 70254225Speter0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", 71254225Speter "" }, 72254225Speter { LOWER, "abcdefghijklmnopqrstuvwxyz", 73254225Speter "" }, 74254225Speter { PRINT, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ 75254225Speter0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ", 76254225Speter "" }, 77254225Speter { PUNCT, "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", 78254225Speter "" }, 79254225Speter { SPACE, "\t\n\v\f\r ", "" }, 80254225Speter { UPPER, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 81254225Speter "" }, 82254225Speter { XDIGIT, "0123456789ABCDEFabcdef", 83254225Speter "" }, 84254225Speter { NULL, 0, "" }, 85254225Speter}; 86