Mercurial > hg > nginx
comparison src/core/ngx_regex.h @ 3319:be47fe127f8c
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
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 13 Nov 2009 20:41:41 +0000 |
parents | 7d313324d874 |
children | 42c16d8bddbe |
comparison
equal
deleted
inserted
replaced
3318:48402deff89a | 3319:be47fe127f8c |
---|---|
12 #include <ngx_core.h> | 12 #include <ngx_core.h> |
13 | 13 |
14 #include <pcre.h> | 14 #include <pcre.h> |
15 | 15 |
16 | 16 |
17 #define NGX_REGEX_NO_MATCHED -1000 | 17 #define NGX_REGEX_NO_MATCHED PCRE_ERROR_NOMATCH /* -1 */ |
18 | 18 |
19 #define NGX_REGEX_CASELESS PCRE_CASELESS | 19 #define NGX_REGEX_CASELESS PCRE_CASELESS |
20 | 20 |
21 typedef pcre ngx_regex_t; | 21 typedef pcre ngx_regex_t; |
22 | 22 |
28 | 28 |
29 void ngx_regex_init(void); | 29 void ngx_regex_init(void); |
30 ngx_regex_t *ngx_regex_compile(ngx_str_t *pattern, ngx_int_t options, | 30 ngx_regex_t *ngx_regex_compile(ngx_str_t *pattern, ngx_int_t options, |
31 ngx_pool_t *pool, ngx_str_t *err); | 31 ngx_pool_t *pool, ngx_str_t *err); |
32 ngx_int_t ngx_regex_capture_count(ngx_regex_t *re); | 32 ngx_int_t ngx_regex_capture_count(ngx_regex_t *re); |
33 ngx_int_t ngx_regex_exec(ngx_regex_t *re, ngx_str_t *s, int *captures, | 33 |
34 ngx_int_t size); | 34 #define ngx_regex_exec(re, s, captures, size) \ |
35 pcre_exec(re, NULL, (const char *) (s)->data, (s)->len, 0, 0, \ | |
36 captures, size) | |
37 | |
35 ngx_int_t ngx_regex_exec_array(ngx_array_t *a, ngx_str_t *s, ngx_log_t *log); | 38 ngx_int_t ngx_regex_exec_array(ngx_array_t *a, ngx_str_t *s, ngx_log_t *log); |
36 | 39 |
37 | 40 |
38 #define ngx_regex_exec_n "pcre_exec()" | 41 #define ngx_regex_exec_n "pcre_exec()" |
39 #define ngx_regex_capture_count_n "pcre_fullinfo()" | 42 #define ngx_regex_capture_count_n "pcre_fullinfo()" |