comparison src/http/ngx_http_variables.h @ 3356:fe08c14530e9

fix building without PCRE, the bug had been introduced in r3326
author Igor Sysoev <igor@sysoev.ru>
date Mon, 23 Nov 2009 13:13:58 +0000
parents 42c16d8bddbe
children 0eb46e3c5c02
comparison
equal deleted inserted replaced
3355:0d315506d18c 3356:fe08c14530e9
39 ngx_uint_t flags; 39 ngx_uint_t flags;
40 ngx_uint_t index; 40 ngx_uint_t index;
41 }; 41 };
42 42
43 43
44 typedef struct {
45 ngx_uint_t capture;
46 ngx_int_t index;
47 } ngx_http_regex_variable_t;
48
49
50 typedef struct {
51 ngx_regex_t *regex;
52 ngx_uint_t ncaptures;
53 ngx_http_regex_variable_t *variables;
54 ngx_uint_t nvariables;
55 ngx_str_t name;
56 } ngx_http_regex_t;
57
58
59 ngx_http_variable_t *ngx_http_add_variable(ngx_conf_t *cf, ngx_str_t *name, 44 ngx_http_variable_t *ngx_http_add_variable(ngx_conf_t *cf, ngx_str_t *name,
60 ngx_uint_t flags); 45 ngx_uint_t flags);
61 ngx_int_t ngx_http_get_variable_index(ngx_conf_t *cf, ngx_str_t *name); 46 ngx_int_t ngx_http_get_variable_index(ngx_conf_t *cf, ngx_str_t *name);
62 ngx_http_variable_value_t *ngx_http_get_indexed_variable(ngx_http_request_t *r, 47 ngx_http_variable_value_t *ngx_http_get_indexed_variable(ngx_http_request_t *r,
63 ngx_uint_t index); 48 ngx_uint_t index);
72 57
73 58
74 #define ngx_http_clear_variable(r, index) r->variables0[index].text.data = NULL; 59 #define ngx_http_clear_variable(r, index) r->variables0[index].text.data = NULL;
75 60
76 61
62 #if (NGX_PCRE)
63
64 typedef struct {
65 ngx_uint_t capture;
66 ngx_int_t index;
67 } ngx_http_regex_variable_t;
68
69
70 typedef struct {
71 ngx_regex_t *regex;
72 ngx_uint_t ncaptures;
73 ngx_http_regex_variable_t *variables;
74 ngx_uint_t nvariables;
75 ngx_str_t name;
76 } ngx_http_regex_t;
77
78
77 ngx_http_regex_t *ngx_http_regex_compile(ngx_conf_t *cf, 79 ngx_http_regex_t *ngx_http_regex_compile(ngx_conf_t *cf,
78 ngx_regex_compile_t *rc); 80 ngx_regex_compile_t *rc);
79 ngx_int_t ngx_http_regex_exec(ngx_http_request_t *r, ngx_http_regex_t *re, 81 ngx_int_t ngx_http_regex_exec(ngx_http_request_t *r, ngx_http_regex_t *re,
80 ngx_str_t *s); 82 ngx_str_t *s);
83
84 #endif
81 85
82 86
83 ngx_int_t ngx_http_variables_add_core_vars(ngx_conf_t *cf); 87 ngx_int_t ngx_http_variables_add_core_vars(ngx_conf_t *cf);
84 ngx_int_t ngx_http_variables_init_vars(ngx_conf_t *cf); 88 ngx_int_t ngx_http_variables_init_vars(ngx_conf_t *cf);
85 89