Mercurial > hg > nginx
comparison src/http/ngx_http_variables.h @ 3872:83cd1910329c
allow regex as "map" parameter
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 16 Mar 2011 15:32:31 +0000 |
parents | 6802ba529ec4 |
children | fa4612bfb9fa |
comparison
equal
deleted
inserted
replaced
3871:8ccd6ed1d4bb | 3872:83cd1910329c |
---|---|
74 ngx_uint_t nvariables; | 74 ngx_uint_t nvariables; |
75 ngx_str_t name; | 75 ngx_str_t name; |
76 } ngx_http_regex_t; | 76 } ngx_http_regex_t; |
77 | 77 |
78 | 78 |
79 typedef struct { | |
80 ngx_http_regex_t *regex; | |
81 void *value; | |
82 } ngx_http_map_regex_t; | |
83 | |
84 | |
79 ngx_http_regex_t *ngx_http_regex_compile(ngx_conf_t *cf, | 85 ngx_http_regex_t *ngx_http_regex_compile(ngx_conf_t *cf, |
80 ngx_regex_compile_t *rc); | 86 ngx_regex_compile_t *rc); |
81 ngx_int_t ngx_http_regex_exec(ngx_http_request_t *r, ngx_http_regex_t *re, | 87 ngx_int_t ngx_http_regex_exec(ngx_http_request_t *r, ngx_http_regex_t *re, |
82 ngx_str_t *s); | 88 ngx_str_t *s); |
83 | 89 |
84 #endif | 90 #endif |
91 | |
92 | |
93 typedef struct { | |
94 ngx_hash_combined_t hash; | |
95 #if (NGX_PCRE) | |
96 ngx_http_map_regex_t *regex; | |
97 ngx_uint_t nregex; | |
98 #endif | |
99 } ngx_http_map_t; | |
100 | |
101 | |
102 void *ngx_http_map_find(ngx_http_request_t *r, ngx_http_map_t *map, | |
103 ngx_uint_t key, u_char *text, size_t len, ngx_str_t *match); | |
85 | 104 |
86 | 105 |
87 ngx_int_t ngx_http_variables_add_core_vars(ngx_conf_t *cf); | 106 ngx_int_t ngx_http_variables_add_core_vars(ngx_conf_t *cf); |
88 ngx_int_t ngx_http_variables_init_vars(ngx_conf_t *cf); | 107 ngx_int_t ngx_http_variables_init_vars(ngx_conf_t *cf); |
89 | 108 |