diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2011-03-16 15:32:31 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2011-03-16 15:32:31 +0000 |
| commit | 0519b43a772476a7537e02a34acb9b265e814815 (patch) | |
| tree | 291b9eaa9e0a27313d60439b893c8d820f6aedeb /src/http/ngx_http_variables.h | |
| parent | 32c73df97a205e59d3df9b6def7ca2beb36a4012 (diff) | |
| download | nginx-0519b43a772476a7537e02a34acb9b265e814815.tar.gz nginx-0519b43a772476a7537e02a34acb9b265e814815.tar.bz2 | |
allow regex as "map" parameter
Diffstat (limited to 'src/http/ngx_http_variables.h')
| -rw-r--r-- | src/http/ngx_http_variables.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/http/ngx_http_variables.h b/src/http/ngx_http_variables.h index 588f5caf5..8e7263646 100644 --- a/src/http/ngx_http_variables.h +++ b/src/http/ngx_http_variables.h @@ -76,6 +76,12 @@ typedef struct { } ngx_http_regex_t; +typedef struct { + ngx_http_regex_t *regex; + void *value; +} ngx_http_map_regex_t; + + ngx_http_regex_t *ngx_http_regex_compile(ngx_conf_t *cf, ngx_regex_compile_t *rc); ngx_int_t ngx_http_regex_exec(ngx_http_request_t *r, ngx_http_regex_t *re, @@ -84,6 +90,19 @@ ngx_int_t ngx_http_regex_exec(ngx_http_request_t *r, ngx_http_regex_t *re, #endif +typedef struct { + ngx_hash_combined_t hash; +#if (NGX_PCRE) + ngx_http_map_regex_t *regex; + ngx_uint_t nregex; +#endif +} ngx_http_map_t; + + +void *ngx_http_map_find(ngx_http_request_t *r, ngx_http_map_t *map, + ngx_uint_t key, u_char *text, size_t len, ngx_str_t *match); + + ngx_int_t ngx_http_variables_add_core_vars(ngx_conf_t *cf); ngx_int_t ngx_http_variables_init_vars(ngx_conf_t *cf); |
