OLD | NEW |
| (Empty) |
1 /* This is the public header file for JavaScriptCore's variant of the PCRE | |
2 library. While this library started out as a copy of PCRE, many of the | |
3 features of PCRE have been removed. This library now supports only the | |
4 regular expression features required by the JavaScript language | |
5 specification, and has only the functions needed by JavaScriptCore and the | |
6 rest of WebKit. | |
7 | |
8 Copyright (c) 1997-2005 University of Cambridge | |
9 Copyright (C) 2002, 2004, 2006, 2007 Apple Inc. All rights reserved. | |
10 | |
11 ----------------------------------------------------------------------------- | |
12 Redistribution and use in source and binary forms, with or without | |
13 modification, are permitted provided that the following conditions are met: | |
14 | |
15 * Redistributions of source code must retain the above copyright notice, | |
16 this list of conditions and the following disclaimer. | |
17 | |
18 * Redistributions in binary form must reproduce the above copyright | |
19 notice, this list of conditions and the following disclaimer in the | |
20 documentation and/or other materials provided with the distribution. | |
21 | |
22 * Neither the name of the University of Cambridge nor the names of its | |
23 contributors may be used to endorse or promote products derived from | |
24 this software without specific prior written permission. | |
25 | |
26 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
27 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
28 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
29 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | |
30 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
31 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
32 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
33 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
34 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
35 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
36 POSSIBILITY OF SUCH DAMAGE. | |
37 ----------------------------------------------------------------------------- | |
38 */ | |
39 | |
40 /* On Unix-like systems config.in is converted by "configure" into config.h. | |
41 Some other environments also support the use of "configure". PCRE is written in | |
42 Standard C, but there are a few non-standard things it can cope with, allowing | |
43 it to run on SunOS4 and other "close to standard" systems. | |
44 | |
45 On a non-Unix-like system you should just copy this file into config.h, and set | |
46 up the macros the way you need them. You should normally change the definitions | |
47 of HAVE_STRERROR and HAVE_MEMMOVE to 1. Unfortunately, because of the way | |
48 autoconf works, these cannot be made the defaults. If your system has bcopy() | |
49 and not memmove(), change the definition of HAVE_BCOPY instead of HAVE_MEMMOVE. | |
50 If your system has neither bcopy() nor memmove(), leave them both as 0; an | |
51 emulation function will be used. */ | |
52 | |
53 /* If you are compiling for a system that uses EBCDIC instead of ASCII | |
54 character codes, define this macro as 1. On systems that can use "configure", | |
55 this can be done via --enable-ebcdic. */ | |
56 | |
57 #ifndef THIRD_PARTY_JSCRE_CONFIG_H_ | |
58 #define THIRD_PARTY_JSCRE_CONFIG_H_ | |
59 | |
60 #ifndef EBCDIC | |
61 #define EBCDIC 0 | |
62 #endif | |
63 | |
64 /* If you are compiling for a system other than a Unix-like system or Win32, | |
65 and it needs some magic to be inserted before the definition of a function that | |
66 is exported by the library, define this macro to contain the relevant magic. If | |
67 you do not define this macro, it defaults to "extern" for a C compiler and | |
68 "extern C" for a C++ compiler on non-Win32 systems. This macro apears at the | |
69 start of every exported function that is part of the external API. It does not | |
70 appear on functions that are "external" in the C sense, but which are internal | |
71 to the library. */ | |
72 | |
73 /* #define PCRE_DATA_SCOPE */ | |
74 | |
75 /* Define the following macro to empty if the "const" keyword does not work. */ | |
76 | |
77 #undef const | |
78 | |
79 /* Define the following macro to "unsigned" if <stddef.h> does not define | |
80 size_t. */ | |
81 | |
82 #undef size_t | |
83 | |
84 /* The following two definitions are mainly for the benefit of SunOS4, which | |
85 does not have the strerror() or memmove() functions that should be present in | |
86 all Standard C libraries. The macros HAVE_STRERROR and HAVE_MEMMOVE should | |
87 normally be defined with the value 1 for other systems, but unfortunately we | |
88 cannot make this the default because "configure" files generated by autoconf | |
89 will only change 0 to 1; they won't change 1 to 0 if the functions are not | |
90 found. */ | |
91 | |
92 #define HAVE_STRERROR 1 | |
93 #define HAVE_MEMMOVE 1 | |
94 | |
95 /* There are some non-Unix-like systems that don't even have bcopy(). If this | |
96 macro is false, an emulation is used. If HAVE_MEMMOVE is set to 1, the value of | |
97 HAVE_BCOPY is not relevant. */ | |
98 | |
99 #define HAVE_BCOPY 0 | |
100 | |
101 /* The value of NEWLINE determines the newline character. The default is to | |
102 leave it up to the compiler, but some sites want to force a particular value. | |
103 On Unix-like systems, "configure" can be used to override this default. */ | |
104 | |
105 #ifndef NEWLINE | |
106 #define NEWLINE '\n' | |
107 #endif | |
108 | |
109 /* The value of LINK_SIZE determines the number of bytes used to store links as | |
110 offsets within the compiled regex. The default is 2, which allows for compiled | |
111 patterns up to 64K long. This covers the vast majority of cases. However, PCRE | |
112 can also be compiled to use 3 or 4 bytes instead. This allows for longer | |
113 patterns in extreme cases. On systems that support it, "configure" can be used | |
114 to override this default. */ | |
115 | |
116 #ifndef LINK_SIZE | |
117 #define LINK_SIZE 2 | |
118 #endif | |
119 | |
120 /* When calling PCRE via the POSIX interface, additional working storage is | |
121 required for holding the pointers to capturing substrings because PCRE requires | |
122 three integers per substring, whereas the POSIX interface provides only two. If | |
123 the number of expected substrings is small, the wrapper function uses space on | |
124 the stack, because this is faster than using malloc() for each call. The | |
125 threshold above which the stack is no longer used is defined by POSIX_MALLOC_ | |
126 THRESHOLD. On systems that support it, "configure" can be used to override this | |
127 default. */ | |
128 | |
129 #ifndef POSIX_MALLOC_THRESHOLD | |
130 #define POSIX_MALLOC_THRESHOLD 10 | |
131 #endif | |
132 | |
133 /* PCRE uses recursive function calls to handle backtracking while matching. | |
134 This can sometimes be a problem on systems that have stacks of limited size. | |
135 Define NO_RECURSE to get a version that doesn't use recursion in the match() | |
136 function; instead it creates its own stack by steam using pcre_recurse_malloc() | |
137 to obtain memory from the heap. For more detail, see the comments and other | |
138 stuff just above the match() function. On systems that support it, "configure" | |
139 can be used to set this in the Makefile (use --disable-stack-for-recursion). */ | |
140 | |
141 /* #define NO_RECURSE */ | |
142 | |
143 /* The value of MATCH_LIMIT determines the default number of times the internal | |
144 match() function can be called during a single execution of pcre_exec(). There | |
145 is a runtime interface for setting a different limit. The limit exists in order | |
146 to catch runaway regular expressions that take for ever to determine that they | |
147 do not match. The default is set very large so that it does not accidentally | |
148 catch legitimate cases. On systems that support it, "configure" can be used to | |
149 override this default default. */ | |
150 | |
151 #ifndef MATCH_LIMIT | |
152 #define MATCH_LIMIT 10000000 | |
153 #endif | |
154 | |
155 /* The above limit applies to all calls of match(), whether or not they | |
156 increase the recursion depth. In some environments it is desirable to limit the | |
157 depth of recursive calls of match() more strictly, in order to restrict the | |
158 maximum amount of stack (or heap, if NO_RECURSE is defined) that is used. The | |
159 value of MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To | |
160 have any useful effect, it must be less than the value of MATCH_LIMIT. There is | |
161 a runtime method for setting a different limit. On systems that support it, | |
162 "configure" can be used to override this default default. */ | |
163 | |
164 #ifndef MATCH_LIMIT_RECURSION | |
165 #define MATCH_LIMIT_RECURSION MATCH_LIMIT | |
166 #endif | |
167 | |
168 /* These three limits are parameterized just in case anybody ever wants to | |
169 change them. Care must be taken if they are increased, because they guard | |
170 against integer overflow caused by enormously large patterns. */ | |
171 | |
172 #ifndef MAX_NAME_SIZE | |
173 #define MAX_NAME_SIZE 32 | |
174 #endif | |
175 | |
176 #ifndef MAX_NAME_COUNT | |
177 #define MAX_NAME_COUNT 10000 | |
178 #endif | |
179 | |
180 #ifndef MAX_DUPLENGTH | |
181 #define MAX_DUPLENGTH 30000 | |
182 #endif | |
183 | |
184 /* End */ | |
185 #endif // THIRD_PARTY_JSCRE_CONFIG_H_ | |
OLD | NEW |