xref: /illumos-gate/usr/src/lib/libc/port/regex/regex.h (revision 1da57d55)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1996-2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*
28  * TOKENS THAT MARK SUBEXPRESSIONS IN COMPILED REGULAR EXPRESSIONS
29  *
30  * regcmp() uses the tokens in compiled regular expressions, and
31  * regex() decodes them when checking character strings against
32  * compiled regular expressions.
33  *
34  * NOTE: To maintain backward compatibility with previous versions of regcmp()
35  *       and regex(), these values must stay the same.
36  */
37 
38 #ifndef _LIBC_REGEX_H
39 #define _LIBC_REGEX_H
40 
41 
42 /* TOKENS USED IN COMPILED REGULAR EXPRESSIONS */
43 
44 #define	ASCII_CHAR                   20
45 #define	ANY_CHAR                     16
46 #define	COUNT                        0x3
47 #define	COUNTED_GROUP                48
48 #define	END_GROUP                    44
49 #define	END_REGEX                    52
50 #define	END_SAVED_GROUP              12
51 #define	END_OF_STRING_MARK           28
52 #define	IN_ASCII_CHAR_CLASS          80
53 #define	IN_MULTIBYTE_CHAR_CLASS      72
54 #define	IN_OLD_ASCII_CHAR_CLASS      24
55 #define MAX_SINGLE_BYTE_INT          0xff
56 #define	MULTIBYTE_CHAR               36
57 #define	NOT_IN_ASCII_CHAR_CLASS      84
58 #define	NOT_IN_MULTIBYTE_CHAR_CLASS  76
59 #define	NOT_IN_OLD_ASCII_CHAR_CLASS   8
60 #define	ONE_OR_MORE                  0x2
61 #define	ONE_OR_MORE_GROUP            68
62 #define	SAVED_GROUP                  60
63 #define	SIMPLE_GROUP                 40
64 #define	START_OF_STRING_MARK         32
65 #define	THRU                         16
66 #define TIMES_256_SHIFT               8
67 #ifdef UNLIMITED
68 #undef UNLIMITED
69 #endif
70 #define UNLIMITED                    0xff
71 #define	ZERO_OR_MORE                 0x1
72 #define	ZERO_OR_MORE_GROUP           56
73 
74 
75 /* NUMBER OF SUBSTRING POINTERS THAT MAY BE RETURNED BY regex() */
76 
77 #define NSUBSTRINGS                  10
78 
79 #endif /* #ifndef _LIBC_REGEX_H */
80