diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-11-13 23:41:41 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-11-13 23:41:41 +0300 |
commit | 950fb268a2b89f782d8f74278a3878651aa3df6f (patch) | |
tree | 7a6d9124c0982f09223fd773aef6db5a6cb0dff6 /src/core/ngx_regex.h | |
parent | 30870b4ab31b4582af200b0abbaae47a6366a7d0 (diff) |
ngx_regex_exec() calling optimiztion:
*) change NGX_REGEX_NO_MATCHED to PCRE_ERROR_NOMATCH
*) declare ngx_regex_exec() as #define
*) optimize SSI regex a little
Diffstat (limited to 'src/core/ngx_regex.h')
-rw-r--r-- | src/core/ngx_regex.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/ngx_regex.h b/src/core/ngx_regex.h index e31470f9f..4a4857222 100644 --- a/src/core/ngx_regex.h +++ b/src/core/ngx_regex.h @@ -14,7 +14,7 @@ #include <pcre.h> -#define NGX_REGEX_NO_MATCHED -1000 +#define NGX_REGEX_NO_MATCHED PCRE_ERROR_NOMATCH /* -1 */ #define NGX_REGEX_CASELESS PCRE_CASELESS @@ -30,8 +30,11 @@ void ngx_regex_init(void); ngx_regex_t *ngx_regex_compile(ngx_str_t *pattern, ngx_int_t options, ngx_pool_t *pool, ngx_str_t *err); ngx_int_t ngx_regex_capture_count(ngx_regex_t *re); -ngx_int_t ngx_regex_exec(ngx_regex_t *re, ngx_str_t *s, int *captures, - ngx_int_t size); + +#define ngx_regex_exec(re, s, captures, size) \ + pcre_exec(re, NULL, (const char *) (s)->data, (s)->len, 0, 0, \ + captures, size) + ngx_int_t ngx_regex_exec_array(ngx_array_t *a, ngx_str_t *s, ngx_log_t *log); |