passenger 4.0.27 → 4.0.28
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- data.tar.gz.asc +7 -7
- data/.gitignore +1 -0
- data/NEWS +22 -0
- data/build/preprocessor.rb +10 -0
- data/build/rpm.rb +74 -65
- data/debian.template/rules.template +8 -0
- data/dev/copy_boost_headers.rb +11 -2
- data/doc/Users guide Apache.idmap.txt +161 -145
- data/doc/Users guide Apache.txt +12 -1
- data/doc/Users guide Nginx.idmap.txt +142 -126
- data/doc/Users guide Nginx.txt +14 -1
- data/doc/Users guide Standalone.txt +1 -0
- data/doc/users_guide_snippets/environment_variables.txt +1 -1
- data/doc/users_guide_snippets/installation.txt +2 -0
- data/doc/users_guide_snippets/tips.txt +118 -0
- data/ext/apache2/Configuration.cpp +0 -6
- data/ext/apache2/Configuration.hpp +0 -5
- data/ext/apache2/ConfigurationCommands.cpp +7 -0
- data/ext/apache2/ConfigurationFields.hpp +2 -0
- data/ext/apache2/ConfigurationSetters.cpp +24 -0
- data/ext/apache2/CreateDirConfig.cpp +1 -0
- data/ext/apache2/Hooks.cpp +0 -1
- data/ext/apache2/MergeDirConfig.cpp +7 -0
- data/ext/apache2/SetHeaders.cpp +5 -1
- data/ext/boost/cregex.hpp +39 -0
- data/ext/boost/libs/regex/src/c_regex_traits.cpp +193 -0
- data/ext/boost/libs/regex/src/cpp_regex_traits.cpp +117 -0
- data/ext/boost/libs/regex/src/cregex.cpp +660 -0
- data/ext/boost/libs/regex/src/instances.cpp +32 -0
- data/ext/boost/libs/regex/src/internals.hpp +35 -0
- data/ext/boost/libs/regex/src/posix_api.cpp +296 -0
- data/ext/boost/libs/regex/src/regex.cpp +227 -0
- data/ext/boost/libs/regex/src/regex_debug.cpp +59 -0
- data/ext/boost/libs/regex/src/regex_raw_buffer.cpp +72 -0
- data/ext/boost/libs/regex/src/regex_traits_defaults.cpp +692 -0
- data/ext/boost/libs/regex/src/static_mutex.cpp +179 -0
- data/ext/boost/libs/regex/src/wc_regex_traits.cpp +301 -0
- data/ext/boost/libs/regex/src/wide_posix_api.cpp +315 -0
- data/ext/boost/libs/regex/src/winstances.cpp +35 -0
- data/ext/boost/regex.h +100 -0
- data/ext/boost/regex.hpp +37 -0
- data/ext/boost/regex/concepts.hpp +1128 -0
- data/ext/boost/regex/config.hpp +435 -0
- data/ext/boost/regex/config/borland.hpp +72 -0
- data/ext/boost/regex/config/cwchar.hpp +207 -0
- data/ext/boost/regex/mfc.hpp +190 -0
- data/ext/boost/regex/pattern_except.hpp +100 -0
- data/ext/boost/regex/pending/object_cache.hpp +165 -0
- data/ext/boost/regex/pending/static_mutex.hpp +179 -0
- data/ext/boost/regex/pending/unicode_iterator.hpp +776 -0
- data/ext/boost/regex/regex_traits.hpp +35 -0
- data/ext/boost/regex/user.hpp +93 -0
- data/ext/boost/regex/v4/basic_regex.hpp +782 -0
- data/ext/boost/regex/v4/basic_regex_creator.hpp +1571 -0
- data/ext/boost/regex/v4/basic_regex_parser.hpp +2874 -0
- data/ext/boost/regex/v4/c_regex_traits.hpp +211 -0
- data/ext/boost/regex/v4/char_regex_traits.hpp +81 -0
- data/ext/boost/regex/v4/cpp_regex_traits.hpp +1099 -0
- data/ext/boost/regex/v4/cregex.hpp +330 -0
- data/ext/boost/regex/v4/error_type.hpp +59 -0
- data/ext/boost/regex/v4/fileiter.hpp +455 -0
- data/ext/boost/regex/v4/instances.hpp +222 -0
- data/ext/boost/regex/v4/iterator_category.hpp +91 -0
- data/ext/boost/regex/v4/iterator_traits.hpp +135 -0
- data/ext/boost/regex/v4/match_flags.hpp +138 -0
- data/ext/boost/regex/v4/match_results.hpp +702 -0
- data/ext/boost/regex/v4/mem_block_cache.hpp +99 -0
- data/ext/boost/regex/v4/perl_matcher.hpp +587 -0
- data/ext/boost/regex/v4/perl_matcher_common.hpp +996 -0
- data/ext/boost/regex/v4/perl_matcher_non_recursive.hpp +1642 -0
- data/ext/boost/regex/v4/perl_matcher_recursive.hpp +991 -0
- data/ext/boost/regex/v4/primary_transform.hpp +146 -0
- data/ext/boost/regex/v4/protected_call.hpp +81 -0
- data/ext/boost/regex/v4/regbase.hpp +180 -0
- data/ext/boost/regex/v4/regex.hpp +202 -0
- data/ext/boost/regex/v4/regex_format.hpp +1156 -0
- data/ext/boost/regex/v4/regex_fwd.hpp +73 -0
- data/ext/boost/regex/v4/regex_grep.hpp +155 -0
- data/ext/boost/regex/v4/regex_iterator.hpp +201 -0
- data/ext/boost/regex/v4/regex_match.hpp +382 -0
- data/ext/boost/regex/v4/regex_merge.hpp +93 -0
- data/ext/boost/regex/v4/regex_raw_buffer.hpp +210 -0
- data/ext/boost/regex/v4/regex_replace.hpp +99 -0
- data/ext/boost/regex/v4/regex_search.hpp +217 -0
- data/ext/boost/regex/v4/regex_split.hpp +172 -0
- data/ext/boost/regex/v4/regex_token_iterator.hpp +342 -0
- data/ext/boost/regex/v4/regex_traits.hpp +189 -0
- data/ext/boost/regex/v4/regex_traits_defaults.hpp +371 -0
- data/ext/boost/regex/v4/regex_workaround.hpp +232 -0
- data/ext/boost/regex/v4/states.hpp +301 -0
- data/ext/boost/regex/v4/sub_match.hpp +512 -0
- data/ext/boost/regex/v4/syntax_type.hpp +105 -0
- data/ext/boost/regex/v4/u32regex_iterator.hpp +193 -0
- data/ext/boost/regex/v4/u32regex_token_iterator.hpp +377 -0
- data/ext/boost/regex/v4/w32_regex_traits.hpp +741 -0
- data/ext/boost/regex_fwd.hpp +33 -0
- data/ext/common/AgentsStarter.h +0 -11
- data/ext/common/ApplicationPool2/Common.h +1 -7
- data/ext/common/ApplicationPool2/DirectSpawner.h +3 -3
- data/ext/common/ApplicationPool2/Group.h +166 -69
- data/ext/common/ApplicationPool2/Implementation.cpp +55 -10
- data/ext/common/ApplicationPool2/Options.h +45 -10
- data/ext/common/ApplicationPool2/PipeWatcher.h +1 -2
- data/ext/common/ApplicationPool2/Pool.h +29 -7
- data/ext/common/ApplicationPool2/Process.h +22 -3
- data/ext/common/ApplicationPool2/Session.h +1 -0
- data/ext/common/ApplicationPool2/SmartSpawner.h +5 -10
- data/ext/common/ApplicationPool2/Spawner.h +10 -15
- data/ext/common/ApplicationPool2/SuperGroup.h +10 -9
- data/ext/common/Constants.h +1 -3
- data/ext/common/Hooks.h +193 -0
- data/ext/common/Logging.cpp +67 -2
- data/ext/common/Logging.h +23 -1
- data/ext/common/Utils.cpp +0 -21
- data/ext/common/Utils.h +0 -42
- data/ext/common/Utils/CachedFileStat.hpp +1 -1
- data/ext/common/Utils/StrIntUtils.h +61 -14
- data/ext/common/Utils/StringMap.h +4 -0
- data/ext/common/agents/HelperAgent/AgentOptions.h +4 -4
- data/ext/common/agents/HelperAgent/Main.cpp +2 -3
- data/ext/common/agents/HelperAgent/RequestHandler.h +65 -2
- data/ext/common/agents/LoggingAgent/FilterSupport.h +3 -1
- data/ext/common/agents/Watchdog/Main.cpp +8 -72
- data/ext/nginx/CacheLocationConfig.c +29 -1
- data/ext/nginx/Configuration.c +0 -12
- data/ext/nginx/Configuration.h +0 -1
- data/ext/nginx/ConfigurationCommands.c +10 -0
- data/ext/nginx/ConfigurationFields.h +2 -0
- data/ext/nginx/CreateLocationConfig.c +4 -0
- data/ext/nginx/MergeLocationConfig.c +6 -0
- data/ext/oxt/system_calls.cpp +7 -1
- data/ext/oxt/system_calls.hpp +7 -7
- data/helper-scripts/node-loader.js +6 -2
- data/helper-scripts/rack-loader.rb +5 -2
- data/helper-scripts/rack-preloader.rb +5 -2
- data/lib/phusion_passenger.rb +1 -1
- data/lib/phusion_passenger/apache2/config_options.rb +8 -0
- data/lib/phusion_passenger/constants.rb +0 -1
- data/lib/phusion_passenger/nginx/config_options.rb +9 -2
- data/lib/phusion_passenger/platform_info/apache.rb +2 -1
- data/lib/phusion_passenger/platform_info/compiler.rb +15 -1
- data/lib/phusion_passenger/platform_info/cxx_portability.rb +2 -0
- data/node_lib/phusion_passenger/httplib_emulation.js +85 -17
- data/node_lib/phusion_passenger/request_handler.js +10 -2
- data/rpm/Vagrantfile +32 -0
- data/rpm/get_distro_id.py +4 -0
- data/test/cxx/ApplicationPool2/DirectSpawnerTest.cpp +2 -2
- data/test/cxx/ApplicationPool2/PoolTest.cpp +60 -9
- data/test/cxx/ApplicationPool2/SmartSpawnerTest.cpp +2 -6
- data/test/cxx/CachedFileStatTest.cpp +5 -5
- data/test/cxx/RequestHandlerTest.cpp +3 -6
- data/test/cxx/UtilsTest.cpp +30 -0
- data/test/node/httplib_emulation_spec.js +491 -0
- data/test/node/spec_helper.js +25 -0
- metadata +78 -2
- metadata.gz.asc +7 -7
@@ -0,0 +1,232 @@
|
|
1
|
+
/*
|
2
|
+
*
|
3
|
+
* Copyright (c) 1998-2005
|
4
|
+
* John Maddock
|
5
|
+
*
|
6
|
+
* Use, modification and distribution are subject to the
|
7
|
+
* Boost Software License, Version 1.0. (See accompanying file
|
8
|
+
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
9
|
+
*
|
10
|
+
*/
|
11
|
+
|
12
|
+
/*
|
13
|
+
* LOCATION: see http://www.boost.org for most recent version.
|
14
|
+
* FILE regex_workarounds.cpp
|
15
|
+
* VERSION see <boost/version.hpp>
|
16
|
+
* DESCRIPTION: Declares Misc workarounds.
|
17
|
+
*/
|
18
|
+
|
19
|
+
#ifndef BOOST_REGEX_WORKAROUND_HPP
|
20
|
+
#define BOOST_REGEX_WORKAROUND_HPP
|
21
|
+
|
22
|
+
|
23
|
+
#include <new>
|
24
|
+
#include <cstring>
|
25
|
+
#include <cstdlib>
|
26
|
+
#include <cstddef>
|
27
|
+
#include <cassert>
|
28
|
+
#include <cstdio>
|
29
|
+
#include <climits>
|
30
|
+
#include <string>
|
31
|
+
#include <stdexcept>
|
32
|
+
#include <iterator>
|
33
|
+
#include <algorithm>
|
34
|
+
#include <iosfwd>
|
35
|
+
#include <vector>
|
36
|
+
#include <map>
|
37
|
+
#include <boost/limits.hpp>
|
38
|
+
#include <boost/assert.hpp>
|
39
|
+
#include <boost/cstdint.hpp>
|
40
|
+
#include <boost/throw_exception.hpp>
|
41
|
+
#include <boost/scoped_ptr.hpp>
|
42
|
+
#include <boost/scoped_array.hpp>
|
43
|
+
#include <boost/shared_ptr.hpp>
|
44
|
+
#include <boost/mpl/bool_fwd.hpp>
|
45
|
+
#ifndef BOOST_NO_STD_LOCALE
|
46
|
+
# include <locale>
|
47
|
+
#endif
|
48
|
+
|
49
|
+
#if defined(BOOST_NO_STDC_NAMESPACE)
|
50
|
+
namespace std{
|
51
|
+
using ::sprintf; using ::strcpy; using ::strcat; using ::strlen;
|
52
|
+
}
|
53
|
+
#endif
|
54
|
+
|
55
|
+
namespace boost{ namespace re_detail{
|
56
|
+
#ifdef BOOST_NO_STD_DISTANCE
|
57
|
+
template <class T>
|
58
|
+
std::ptrdiff_t distance(const T& x, const T& y)
|
59
|
+
{ return y - x; }
|
60
|
+
#else
|
61
|
+
using std::distance;
|
62
|
+
#endif
|
63
|
+
}}
|
64
|
+
|
65
|
+
|
66
|
+
#ifdef BOOST_REGEX_NO_BOOL
|
67
|
+
# define BOOST_REGEX_MAKE_BOOL(x) static_cast<bool>((x) ? true : false)
|
68
|
+
#else
|
69
|
+
# define BOOST_REGEX_MAKE_BOOL(x) static_cast<bool>(x)
|
70
|
+
#endif
|
71
|
+
|
72
|
+
/*****************************************************************************
|
73
|
+
*
|
74
|
+
* Fix broken broken namespace support:
|
75
|
+
*
|
76
|
+
****************************************************************************/
|
77
|
+
|
78
|
+
#if defined(BOOST_NO_STDC_NAMESPACE) && defined(__cplusplus)
|
79
|
+
|
80
|
+
namespace std{
|
81
|
+
using ::ptrdiff_t;
|
82
|
+
using ::size_t;
|
83
|
+
using ::abs;
|
84
|
+
using ::memset;
|
85
|
+
using ::memcpy;
|
86
|
+
}
|
87
|
+
|
88
|
+
#endif
|
89
|
+
|
90
|
+
/*****************************************************************************
|
91
|
+
*
|
92
|
+
* helper functions pointer_construct/pointer_destroy:
|
93
|
+
*
|
94
|
+
****************************************************************************/
|
95
|
+
|
96
|
+
#ifdef __cplusplus
|
97
|
+
namespace boost{ namespace re_detail{
|
98
|
+
|
99
|
+
#ifdef BOOST_MSVC
|
100
|
+
#pragma warning (push)
|
101
|
+
#pragma warning (disable : 4100)
|
102
|
+
#endif
|
103
|
+
|
104
|
+
template <class T>
|
105
|
+
inline void pointer_destroy(T* p)
|
106
|
+
{ p->~T(); (void)p; }
|
107
|
+
|
108
|
+
#ifdef BOOST_MSVC
|
109
|
+
#pragma warning (pop)
|
110
|
+
#endif
|
111
|
+
|
112
|
+
template <class T>
|
113
|
+
inline void pointer_construct(T* p, const T& t)
|
114
|
+
{ new (p) T(t); }
|
115
|
+
|
116
|
+
}} // namespaces
|
117
|
+
#endif
|
118
|
+
|
119
|
+
/*****************************************************************************
|
120
|
+
*
|
121
|
+
* helper function copy:
|
122
|
+
*
|
123
|
+
****************************************************************************/
|
124
|
+
|
125
|
+
#ifdef __cplusplus
|
126
|
+
namespace boost{ namespace re_detail{
|
127
|
+
#if BOOST_WORKAROUND(BOOST_MSVC,>=1400) && BOOST_WORKAROUND(BOOST_MSVC, <1600) && defined(_CPPLIB_VER) && defined(BOOST_DINKUMWARE_STDLIB) && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
|
128
|
+
//
|
129
|
+
// MSVC 8 will either emit warnings or else refuse to compile
|
130
|
+
// code that makes perfectly legitimate use of std::copy, when
|
131
|
+
// the OutputIterator type is a user-defined class (apparently all user
|
132
|
+
// defined iterators are "unsafe"). This code works around that:
|
133
|
+
//
|
134
|
+
template<class InputIterator, class OutputIterator>
|
135
|
+
inline OutputIterator copy(
|
136
|
+
InputIterator first,
|
137
|
+
InputIterator last,
|
138
|
+
OutputIterator dest
|
139
|
+
)
|
140
|
+
{
|
141
|
+
return stdext::unchecked_copy(first, last, dest);
|
142
|
+
}
|
143
|
+
template<class InputIterator1, class InputIterator2>
|
144
|
+
inline bool equal(
|
145
|
+
InputIterator1 first,
|
146
|
+
InputIterator1 last,
|
147
|
+
InputIterator2 with
|
148
|
+
)
|
149
|
+
{
|
150
|
+
return stdext::unchecked_equal(first, last, with);
|
151
|
+
}
|
152
|
+
#elif BOOST_WORKAROUND(BOOST_MSVC, > 1500)
|
153
|
+
//
|
154
|
+
// MSVC 10 will either emit warnings or else refuse to compile
|
155
|
+
// code that makes perfectly legitimate use of std::copy, when
|
156
|
+
// the OutputIterator type is a user-defined class (apparently all user
|
157
|
+
// defined iterators are "unsafe"). What's more Microsoft have removed their
|
158
|
+
// non-standard "unchecked" versions, even though their still in the MS
|
159
|
+
// documentation!! Work around this as best we can:
|
160
|
+
//
|
161
|
+
template<class InputIterator, class OutputIterator>
|
162
|
+
inline OutputIterator copy(
|
163
|
+
InputIterator first,
|
164
|
+
InputIterator last,
|
165
|
+
OutputIterator dest
|
166
|
+
)
|
167
|
+
{
|
168
|
+
while(first != last)
|
169
|
+
*dest++ = *first++;
|
170
|
+
return dest;
|
171
|
+
}
|
172
|
+
template<class InputIterator1, class InputIterator2>
|
173
|
+
inline bool equal(
|
174
|
+
InputIterator1 first,
|
175
|
+
InputIterator1 last,
|
176
|
+
InputIterator2 with
|
177
|
+
)
|
178
|
+
{
|
179
|
+
while(first != last)
|
180
|
+
if(*first++ != *with++) return false;
|
181
|
+
return true;
|
182
|
+
}
|
183
|
+
#else
|
184
|
+
using std::copy;
|
185
|
+
using std::equal;
|
186
|
+
#endif
|
187
|
+
#if BOOST_WORKAROUND(BOOST_MSVC,>=1400) && defined(__STDC_WANT_SECURE_LIB__) && __STDC_WANT_SECURE_LIB__
|
188
|
+
|
189
|
+
// use safe versions of strcpy etc:
|
190
|
+
using ::strcpy_s;
|
191
|
+
using ::strcat_s;
|
192
|
+
#else
|
193
|
+
inline std::size_t strcpy_s(
|
194
|
+
char *strDestination,
|
195
|
+
std::size_t sizeInBytes,
|
196
|
+
const char *strSource
|
197
|
+
)
|
198
|
+
{
|
199
|
+
if(std::strlen(strSource)+1 > sizeInBytes)
|
200
|
+
return 1;
|
201
|
+
std::strcpy(strDestination, strSource);
|
202
|
+
return 0;
|
203
|
+
}
|
204
|
+
inline std::size_t strcat_s(
|
205
|
+
char *strDestination,
|
206
|
+
std::size_t sizeInBytes,
|
207
|
+
const char *strSource
|
208
|
+
)
|
209
|
+
{
|
210
|
+
if(std::strlen(strSource) + std::strlen(strDestination) + 1 > sizeInBytes)
|
211
|
+
return 1;
|
212
|
+
std::strcat(strDestination, strSource);
|
213
|
+
return 0;
|
214
|
+
}
|
215
|
+
|
216
|
+
#endif
|
217
|
+
|
218
|
+
inline void overflow_error_if_not_zero(std::size_t i)
|
219
|
+
{
|
220
|
+
if(i)
|
221
|
+
{
|
222
|
+
std::overflow_error e("String buffer too small");
|
223
|
+
boost::throw_exception(e);
|
224
|
+
}
|
225
|
+
}
|
226
|
+
|
227
|
+
}} // namespaces
|
228
|
+
|
229
|
+
#endif // __cplusplus
|
230
|
+
|
231
|
+
#endif // include guard
|
232
|
+
|
@@ -0,0 +1,301 @@
|
|
1
|
+
/*
|
2
|
+
*
|
3
|
+
* Copyright (c) 1998-2002
|
4
|
+
* John Maddock
|
5
|
+
*
|
6
|
+
* Use, modification and distribution are subject to the
|
7
|
+
* Boost Software License, Version 1.0. (See accompanying file
|
8
|
+
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
9
|
+
*
|
10
|
+
*/
|
11
|
+
|
12
|
+
/*
|
13
|
+
* LOCATION: see http://www.boost.org for most recent version.
|
14
|
+
* FILE states.cpp
|
15
|
+
* VERSION see <boost/version.hpp>
|
16
|
+
* DESCRIPTION: Declares internal state machine structures.
|
17
|
+
*/
|
18
|
+
|
19
|
+
#ifndef BOOST_REGEX_V4_STATES_HPP
|
20
|
+
#define BOOST_REGEX_V4_STATES_HPP
|
21
|
+
|
22
|
+
#ifdef BOOST_MSVC
|
23
|
+
#pragma warning(push)
|
24
|
+
#pragma warning(disable: 4103)
|
25
|
+
#endif
|
26
|
+
#ifdef BOOST_HAS_ABI_HEADERS
|
27
|
+
# include BOOST_ABI_PREFIX
|
28
|
+
#endif
|
29
|
+
#ifdef BOOST_MSVC
|
30
|
+
#pragma warning(pop)
|
31
|
+
#endif
|
32
|
+
|
33
|
+
namespace boost{
|
34
|
+
namespace re_detail{
|
35
|
+
|
36
|
+
/*** mask_type *******************************************************
|
37
|
+
Whenever we have a choice of two alternatives, we use an array of bytes
|
38
|
+
to indicate which of the two alternatives it is possible to take for any
|
39
|
+
given input character. If mask_take is set, then we can take the next
|
40
|
+
state, and if mask_skip is set then we can take the alternative.
|
41
|
+
***********************************************************************/
|
42
|
+
enum mask_type
|
43
|
+
{
|
44
|
+
mask_take = 1,
|
45
|
+
mask_skip = 2,
|
46
|
+
mask_init = 4,
|
47
|
+
mask_any = mask_skip | mask_take,
|
48
|
+
mask_all = mask_any
|
49
|
+
};
|
50
|
+
|
51
|
+
/*** helpers **********************************************************
|
52
|
+
These helpers let us use function overload resolution to detect whether
|
53
|
+
we have narrow or wide character strings:
|
54
|
+
***********************************************************************/
|
55
|
+
struct _narrow_type{};
|
56
|
+
struct _wide_type{};
|
57
|
+
template <class charT> struct is_byte;
|
58
|
+
template<> struct is_byte<char> { typedef _narrow_type width_type; };
|
59
|
+
template<> struct is_byte<unsigned char>{ typedef _narrow_type width_type; };
|
60
|
+
template<> struct is_byte<signed char> { typedef _narrow_type width_type; };
|
61
|
+
template <class charT> struct is_byte { typedef _wide_type width_type; };
|
62
|
+
|
63
|
+
/*** enum syntax_element_type ******************************************
|
64
|
+
Every record in the state machine falls into one of the following types:
|
65
|
+
***********************************************************************/
|
66
|
+
enum syntax_element_type
|
67
|
+
{
|
68
|
+
// start of a marked sub-expression, or perl-style (?...) extension
|
69
|
+
syntax_element_startmark = 0,
|
70
|
+
// end of a marked sub-expression, or perl-style (?...) extension
|
71
|
+
syntax_element_endmark = syntax_element_startmark + 1,
|
72
|
+
// any sequence of literal characters
|
73
|
+
syntax_element_literal = syntax_element_endmark + 1,
|
74
|
+
// start of line assertion: ^
|
75
|
+
syntax_element_start_line = syntax_element_literal + 1,
|
76
|
+
// end of line assertion $
|
77
|
+
syntax_element_end_line = syntax_element_start_line + 1,
|
78
|
+
// match any character: .
|
79
|
+
syntax_element_wild = syntax_element_end_line + 1,
|
80
|
+
// end of expression: we have a match when we get here
|
81
|
+
syntax_element_match = syntax_element_wild + 1,
|
82
|
+
// perl style word boundary: \b
|
83
|
+
syntax_element_word_boundary = syntax_element_match + 1,
|
84
|
+
// perl style within word boundary: \B
|
85
|
+
syntax_element_within_word = syntax_element_word_boundary + 1,
|
86
|
+
// start of word assertion: \<
|
87
|
+
syntax_element_word_start = syntax_element_within_word + 1,
|
88
|
+
// end of word assertion: \>
|
89
|
+
syntax_element_word_end = syntax_element_word_start + 1,
|
90
|
+
// start of buffer assertion: \`
|
91
|
+
syntax_element_buffer_start = syntax_element_word_end + 1,
|
92
|
+
// end of buffer assertion: \'
|
93
|
+
syntax_element_buffer_end = syntax_element_buffer_start + 1,
|
94
|
+
// backreference to previously matched sub-expression
|
95
|
+
syntax_element_backref = syntax_element_buffer_end + 1,
|
96
|
+
// either a wide character set [..] or one with multicharacter collating elements:
|
97
|
+
syntax_element_long_set = syntax_element_backref + 1,
|
98
|
+
// narrow character set: [...]
|
99
|
+
syntax_element_set = syntax_element_long_set + 1,
|
100
|
+
// jump to a new state in the machine:
|
101
|
+
syntax_element_jump = syntax_element_set + 1,
|
102
|
+
// choose between two production states:
|
103
|
+
syntax_element_alt = syntax_element_jump + 1,
|
104
|
+
// a repeat
|
105
|
+
syntax_element_rep = syntax_element_alt + 1,
|
106
|
+
// match a combining character sequence
|
107
|
+
syntax_element_combining = syntax_element_rep + 1,
|
108
|
+
// perl style soft buffer end: \z
|
109
|
+
syntax_element_soft_buffer_end = syntax_element_combining + 1,
|
110
|
+
// perl style continuation: \G
|
111
|
+
syntax_element_restart_continue = syntax_element_soft_buffer_end + 1,
|
112
|
+
// single character repeats:
|
113
|
+
syntax_element_dot_rep = syntax_element_restart_continue + 1,
|
114
|
+
syntax_element_char_rep = syntax_element_dot_rep + 1,
|
115
|
+
syntax_element_short_set_rep = syntax_element_char_rep + 1,
|
116
|
+
syntax_element_long_set_rep = syntax_element_short_set_rep + 1,
|
117
|
+
// a backstep for lookbehind repeats:
|
118
|
+
syntax_element_backstep = syntax_element_long_set_rep + 1,
|
119
|
+
// an assertion that a mark was matched:
|
120
|
+
syntax_element_assert_backref = syntax_element_backstep + 1,
|
121
|
+
syntax_element_toggle_case = syntax_element_assert_backref + 1,
|
122
|
+
// a recursive expression:
|
123
|
+
syntax_element_recurse = syntax_element_toggle_case + 1
|
124
|
+
};
|
125
|
+
|
126
|
+
#ifdef BOOST_REGEX_DEBUG
|
127
|
+
// dwa 09/26/00 - This is needed to suppress warnings about an ambiguous conversion
|
128
|
+
std::ostream& operator<<(std::ostream&, syntax_element_type);
|
129
|
+
#endif
|
130
|
+
|
131
|
+
struct re_syntax_base;
|
132
|
+
|
133
|
+
/*** union offset_type ************************************************
|
134
|
+
Points to another state in the machine. During machine construction
|
135
|
+
we use integral offsets, but these are converted to pointers before
|
136
|
+
execution of the machine.
|
137
|
+
***********************************************************************/
|
138
|
+
union offset_type
|
139
|
+
{
|
140
|
+
re_syntax_base* p;
|
141
|
+
std::ptrdiff_t i;
|
142
|
+
};
|
143
|
+
|
144
|
+
/*** struct re_syntax_base ********************************************
|
145
|
+
Base class for all states in the machine.
|
146
|
+
***********************************************************************/
|
147
|
+
struct re_syntax_base
|
148
|
+
{
|
149
|
+
syntax_element_type type; // what kind of state this is
|
150
|
+
offset_type next; // next state in the machine
|
151
|
+
};
|
152
|
+
|
153
|
+
/*** struct re_brace **************************************************
|
154
|
+
A marked parenthesis.
|
155
|
+
***********************************************************************/
|
156
|
+
struct re_brace : public re_syntax_base
|
157
|
+
{
|
158
|
+
// The index to match, can be zero (don't mark the sub-expression)
|
159
|
+
// or negative (for perl style (?...) extentions):
|
160
|
+
int index;
|
161
|
+
bool icase;
|
162
|
+
};
|
163
|
+
|
164
|
+
/*** struct re_dot **************************************************
|
165
|
+
Match anything.
|
166
|
+
***********************************************************************/
|
167
|
+
enum
|
168
|
+
{
|
169
|
+
dont_care = 1,
|
170
|
+
force_not_newline = 0,
|
171
|
+
force_newline = 2,
|
172
|
+
|
173
|
+
test_not_newline = 2,
|
174
|
+
test_newline = 3
|
175
|
+
};
|
176
|
+
struct re_dot : public re_syntax_base
|
177
|
+
{
|
178
|
+
unsigned char mask;
|
179
|
+
};
|
180
|
+
|
181
|
+
/*** struct re_literal ************************************************
|
182
|
+
A string of literals, following this structure will be an
|
183
|
+
array of characters: charT[length]
|
184
|
+
***********************************************************************/
|
185
|
+
struct re_literal : public re_syntax_base
|
186
|
+
{
|
187
|
+
unsigned int length;
|
188
|
+
};
|
189
|
+
|
190
|
+
/*** struct re_case ************************************************
|
191
|
+
Indicates whether we are moving to a case insensive block or not
|
192
|
+
***********************************************************************/
|
193
|
+
struct re_case : public re_syntax_base
|
194
|
+
{
|
195
|
+
bool icase;
|
196
|
+
};
|
197
|
+
|
198
|
+
/*** struct re_set_long ***********************************************
|
199
|
+
A wide character set of characters, following this structure will be
|
200
|
+
an array of type charT:
|
201
|
+
First csingles null-terminated strings
|
202
|
+
Then 2 * cranges NULL terminated strings
|
203
|
+
Then cequivalents NULL terminated strings
|
204
|
+
***********************************************************************/
|
205
|
+
template <class mask_type>
|
206
|
+
struct re_set_long : public re_syntax_base
|
207
|
+
{
|
208
|
+
unsigned int csingles, cranges, cequivalents;
|
209
|
+
mask_type cclasses;
|
210
|
+
mask_type cnclasses;
|
211
|
+
bool isnot;
|
212
|
+
bool singleton;
|
213
|
+
};
|
214
|
+
|
215
|
+
/*** struct re_set ****************************************************
|
216
|
+
A set of narrow-characters, matches any of _map which is none-zero
|
217
|
+
***********************************************************************/
|
218
|
+
struct re_set : public re_syntax_base
|
219
|
+
{
|
220
|
+
unsigned char _map[1 << CHAR_BIT];
|
221
|
+
};
|
222
|
+
|
223
|
+
/*** struct re_jump ***************************************************
|
224
|
+
Jump to a new location in the machine (not next).
|
225
|
+
***********************************************************************/
|
226
|
+
struct re_jump : public re_syntax_base
|
227
|
+
{
|
228
|
+
offset_type alt; // location to jump to
|
229
|
+
};
|
230
|
+
|
231
|
+
/*** struct re_alt ***************************************************
|
232
|
+
Jump to a new location in the machine (possibly next).
|
233
|
+
***********************************************************************/
|
234
|
+
struct re_alt : public re_jump
|
235
|
+
{
|
236
|
+
unsigned char _map[1 << CHAR_BIT]; // which characters can take the jump
|
237
|
+
unsigned int can_be_null; // true if we match a NULL string
|
238
|
+
};
|
239
|
+
|
240
|
+
/*** struct re_repeat *************************************************
|
241
|
+
Repeat a section of the machine
|
242
|
+
***********************************************************************/
|
243
|
+
struct re_repeat : public re_alt
|
244
|
+
{
|
245
|
+
std::size_t min, max; // min and max allowable repeats
|
246
|
+
int state_id; // Unique identifier for this repeat
|
247
|
+
bool leading; // True if this repeat is at the start of the machine (lets us optimize some searches)
|
248
|
+
bool greedy; // True if this is a greedy repeat
|
249
|
+
};
|
250
|
+
|
251
|
+
/*** struct re_recurse ************************************************
|
252
|
+
Recurse to a particular subexpression.
|
253
|
+
**********************************************************************/
|
254
|
+
struct re_recurse : public re_jump
|
255
|
+
{
|
256
|
+
int state_id; // identifier of first nested repeat within the recursion.
|
257
|
+
};
|
258
|
+
|
259
|
+
/*** enum re_jump_size_type *******************************************
|
260
|
+
Provides compiled size of re_jump structure (allowing for trailing alignment).
|
261
|
+
We provide this so we know how manybytes to insert when constructing the machine
|
262
|
+
(The value of padding_mask is defined in regex_raw_buffer.hpp).
|
263
|
+
***********************************************************************/
|
264
|
+
enum re_jump_size_type
|
265
|
+
{
|
266
|
+
re_jump_size = (sizeof(re_jump) + padding_mask) & ~(padding_mask),
|
267
|
+
re_repeater_size = (sizeof(re_repeat) + padding_mask) & ~(padding_mask),
|
268
|
+
re_alt_size = (sizeof(re_alt) + padding_mask) & ~(padding_mask)
|
269
|
+
};
|
270
|
+
|
271
|
+
/*** proc re_is_set_member *********************************************
|
272
|
+
Forward declaration: we'll need this one later...
|
273
|
+
***********************************************************************/
|
274
|
+
|
275
|
+
template<class charT, class traits>
|
276
|
+
struct regex_data;
|
277
|
+
|
278
|
+
template <class iterator, class charT, class traits_type, class char_classT>
|
279
|
+
iterator BOOST_REGEX_CALL re_is_set_member(iterator next,
|
280
|
+
iterator last,
|
281
|
+
const re_set_long<char_classT>* set_,
|
282
|
+
const regex_data<charT, traits_type>& e, bool icase);
|
283
|
+
|
284
|
+
} // namespace re_detail
|
285
|
+
|
286
|
+
} // namespace boost
|
287
|
+
|
288
|
+
#ifdef BOOST_MSVC
|
289
|
+
#pragma warning(push)
|
290
|
+
#pragma warning(disable: 4103)
|
291
|
+
#endif
|
292
|
+
#ifdef BOOST_HAS_ABI_HEADERS
|
293
|
+
# include BOOST_ABI_SUFFIX
|
294
|
+
#endif
|
295
|
+
#ifdef BOOST_MSVC
|
296
|
+
#pragma warning(pop)
|
297
|
+
#endif
|
298
|
+
|
299
|
+
#endif
|
300
|
+
|
301
|
+
|