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