]> git.saurik.com Git - apple/libc.git/blobdiff - regex/cclass.h
Libc-498.1.1.tar.gz
[apple/libc.git] / regex / cclass.h
index 14f083a88c6cca46a0d91f64b4339bcad23755f7..956a655fa33634725328a200a6fa315b96e9dcc1 100644 (file)
@@ -1,28 +1,5 @@
-/*
- * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- * 
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- * 
- * @APPLE_LICENSE_HEADER_END@
- */
-/*
+/*-
+ * Copyright (c) 1992, 1993, 1994 Henry Spencer.
  * Copyright (c) 1992, 1993, 1994
  *     The Regents of the University of California.  All rights reserved.
  *
  * 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.
+ *
+ *     @(#)cclass.h    8.3 (Berkeley) 3/20/94
+ * $FreeBSD: src/lib/libc/regex/cclass.h,v 1.4 2002/03/22 23:41:56 obrien Exp $
  */
 
+
+typedef enum {CALNUM, CALPHA, CBLANK, CCNTRL, CDIGIT, CGRAPH,
+             CLOWER, CPRINT, CPUNCT, CSPACE, CUPPER, CXDIGIT} citype;
+
 /* character-class table */
 static struct cclass {
        char *name;
-       char *chars;
-       char *multis;
+       citype fidx;
 } cclasses[] = {
-       "alnum",        "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
-0123456789",                           "",
-       "alpha",        "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
-                                       "",
-       "blank",        " \t",          "",
-       "cntrl",        "\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\
-\25\26\27\30\31\32\33\34\35\36\37\177",        "",
-       "digit",        "0123456789",   "",
-       "graph",        "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
-0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
-                                       "",
-       "lower",        "abcdefghijklmnopqrstuvwxyz",
-                                       "",
-       "print",        "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
-0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ",
-                                       "",
-       "punct",        "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
-                                       "",
-       "space",        "\t\n\v\f\r ",  "",
-       "upper",        "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
-                                       "",
-       "xdigit",       "0123456789ABCDEFabcdef",
-                                       "",
-       NULL,           0,              ""
+       {"alnum",       CALNUM},
+       {"alpha",       CALPHA},
+       {"blank",       CBLANK},
+       {"cntrl",       CCNTRL},
+       {"digit",       CDIGIT},
+       {"graph",       CGRAPH},
+       {"lower",       CLOWER},
+       {"print",       CPRINT},
+       {"punct",       CPUNCT},
+       {"space",       CSPACE},
+       {"upper",       CUPPER},
+       {"xdigit",      CXDIGIT},
+       {NULL,          }
 };