Mercurial > hg > nginx
comparison src/http/ngx_http_script.h @ 2587:8afc4df77ee8
ngx_http_script_flush_complex_value()
ngx_http_complex_value()
ngx_http_compile_complex_value()
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 22 Mar 2009 09:36:51 +0000 |
parents | 912ce4113f21 |
children | ad99a49cd313 |
comparison
equal
deleted
inserted
replaced
2586:41a965fba141 | 2587:8afc4df77ee8 |
---|---|
51 void *main; | 51 void *main; |
52 | 52 |
53 unsigned compile_args:1; | 53 unsigned compile_args:1; |
54 unsigned complete_lengths:1; | 54 unsigned complete_lengths:1; |
55 unsigned complete_values:1; | 55 unsigned complete_values:1; |
56 unsigned zero:1; | |
57 unsigned conf_prefix:1; | |
58 unsigned root_prefix:1; | |
59 | |
56 unsigned dup_capture:1; | 60 unsigned dup_capture:1; |
57 | |
58 unsigned args:1; | 61 unsigned args:1; |
59 } ngx_http_script_compile_t; | 62 } ngx_http_script_compile_t; |
60 | 63 |
61 | 64 |
65 typedef struct { | |
66 ngx_str_t value; | |
67 ngx_uint_t *flushes; | |
68 void *lengths; | |
69 void *values; | |
70 } ngx_http_complex_value_t; | |
71 | |
72 | |
73 typedef struct { | |
74 ngx_conf_t *cf; | |
75 ngx_str_t *value; | |
76 ngx_http_complex_value_t *complex_value; | |
77 | |
78 unsigned zero:1; | |
79 unsigned conf_prefix:1; | |
80 unsigned root_prefix:1; | |
81 } ngx_http_compile_complex_value_t; | |
82 | |
83 | |
62 typedef void (*ngx_http_script_code_pt) (ngx_http_script_engine_t *e); | 84 typedef void (*ngx_http_script_code_pt) (ngx_http_script_engine_t *e); |
63 typedef size_t (*ngx_http_script_len_code_pt) (ngx_http_script_engine_t *e); | 85 typedef size_t (*ngx_http_script_len_code_pt) (ngx_http_script_engine_t *e); |
64 | 86 |
65 | 87 |
66 typedef struct { | 88 typedef struct { |
67 ngx_http_script_code_pt code; | 89 ngx_http_script_code_pt code; |
68 uintptr_t len; | 90 uintptr_t len; |
69 } ngx_http_script_copy_code_t; | 91 } ngx_http_script_copy_code_t; |
70 | 92 |
71 | 93 |
72 typedef struct { | 94 typedef struct { |
73 ngx_http_script_code_pt code; | 95 ngx_http_script_code_pt code; |
74 uintptr_t index; | 96 uintptr_t index; |
75 } ngx_http_script_var_code_t; | 97 } ngx_http_script_var_code_t; |
76 | 98 |
77 | 99 |
78 typedef struct { | 100 typedef struct { |
79 ngx_http_script_code_pt code; | 101 ngx_http_script_code_pt code; |
80 ngx_http_set_variable_pt handler; | 102 ngx_http_set_variable_pt handler; |
81 uintptr_t data; | 103 uintptr_t data; |
82 } ngx_http_script_var_handler_code_t; | 104 } ngx_http_script_var_handler_code_t; |
83 | 105 |
84 | 106 |
85 typedef struct { | 107 typedef struct { |
86 ngx_http_script_code_pt code; | 108 ngx_http_script_code_pt code; |
87 uintptr_t n; | 109 uintptr_t n; |
88 } ngx_http_script_copy_capture_code_t; | 110 } ngx_http_script_copy_capture_code_t; |
89 | 111 |
90 | 112 |
91 #if (NGX_PCRE) | 113 #if (NGX_PCRE) |
92 | 114 |
93 typedef struct { | 115 typedef struct { |
94 ngx_http_script_code_pt code; | 116 ngx_http_script_code_pt code; |
95 ngx_regex_t *regex; | 117 ngx_regex_t *regex; |
96 ngx_array_t *lengths; | 118 ngx_array_t *lengths; |
97 uintptr_t size; | 119 uintptr_t size; |
98 uintptr_t ncaptures; | 120 uintptr_t ncaptures; |
99 uintptr_t status; | 121 uintptr_t status; |
100 uintptr_t next; | 122 uintptr_t next; |
101 | 123 |
102 uintptr_t test:1; | 124 uintptr_t test:1; |
103 uintptr_t negative_test:1; | 125 uintptr_t negative_test:1; |
104 uintptr_t uri:1; | 126 uintptr_t uri:1; |
105 uintptr_t args:1; | 127 uintptr_t args:1; |
106 | 128 |
107 /* add the r->args to the new arguments */ | 129 /* add the r->args to the new arguments */ |
108 uintptr_t add_args:1; | 130 uintptr_t add_args:1; |
109 | 131 |
110 uintptr_t redirect:1; | 132 uintptr_t redirect:1; |
111 uintptr_t break_cycle:1; | 133 uintptr_t break_cycle:1; |
112 | 134 |
113 ngx_str_t name; | 135 ngx_str_t name; |
114 } ngx_http_script_regex_code_t; | 136 } ngx_http_script_regex_code_t; |
115 | 137 |
116 | 138 |
117 typedef struct { | 139 typedef struct { |
118 ngx_http_script_code_pt code; | 140 ngx_http_script_code_pt code; |
119 | 141 |
120 uintptr_t uri:1; | 142 uintptr_t uri:1; |
121 uintptr_t args:1; | 143 uintptr_t args:1; |
122 | 144 |
123 /* add the r->args to the new arguments */ | 145 /* add the r->args to the new arguments */ |
124 uintptr_t add_args:1; | 146 uintptr_t add_args:1; |
125 | 147 |
126 uintptr_t redirect:1; | 148 uintptr_t redirect:1; |
127 } ngx_http_script_regex_end_code_t; | 149 } ngx_http_script_regex_end_code_t; |
128 | 150 |
129 #endif | 151 #endif |
130 | 152 |
131 | 153 |
132 typedef struct { | 154 typedef struct { |
133 ngx_http_script_code_pt code; | 155 ngx_http_script_code_pt code; |
134 uintptr_t status; | 156 uintptr_t prefix; |
135 uintptr_t null; | 157 } ngx_http_script_full_name_code_t; |
158 | |
159 | |
160 typedef struct { | |
161 ngx_http_script_code_pt code; | |
162 uintptr_t status; | |
163 uintptr_t null; | |
136 } ngx_http_script_return_code_t; | 164 } ngx_http_script_return_code_t; |
137 | 165 |
138 | 166 |
139 typedef enum { | 167 typedef enum { |
140 ngx_http_script_file_plain = 0, | 168 ngx_http_script_file_plain = 0, |
147 ngx_http_script_file_not_exec | 175 ngx_http_script_file_not_exec |
148 } ngx_http_script_file_op_e; | 176 } ngx_http_script_file_op_e; |
149 | 177 |
150 | 178 |
151 typedef struct { | 179 typedef struct { |
152 ngx_http_script_code_pt code; | 180 ngx_http_script_code_pt code; |
153 uintptr_t op; | 181 uintptr_t op; |
154 } ngx_http_script_file_code_t; | 182 } ngx_http_script_file_code_t; |
155 | 183 |
156 | 184 |
157 typedef struct { | 185 typedef struct { |
158 ngx_http_script_code_pt code; | 186 ngx_http_script_code_pt code; |
159 uintptr_t next; | 187 uintptr_t next; |
160 void **loc_conf; | 188 void **loc_conf; |
161 } ngx_http_script_if_code_t; | 189 } ngx_http_script_if_code_t; |
162 | 190 |
163 | 191 |
164 typedef struct { | 192 typedef struct { |
165 ngx_http_script_code_pt code; | 193 ngx_http_script_code_pt code; |
166 ngx_array_t *lengths; | 194 ngx_array_t *lengths; |
167 } ngx_http_script_complex_value_code_t; | 195 } ngx_http_script_complex_value_code_t; |
168 | 196 |
169 | 197 |
170 typedef struct { | 198 typedef struct { |
171 ngx_http_script_code_pt code; | 199 ngx_http_script_code_pt code; |
172 uintptr_t value; | 200 uintptr_t value; |
173 uintptr_t text_len; | 201 uintptr_t text_len; |
174 uintptr_t text_data; | 202 uintptr_t text_data; |
175 } ngx_http_script_value_code_t; | 203 } ngx_http_script_value_code_t; |
176 | 204 |
205 | |
206 void ngx_http_scrip_flush_complex_value(ngx_http_request_t *r, | |
207 ngx_http_complex_value_t *val); | |
208 ngx_int_t ngx_http_complex_value(ngx_http_request_t *r, | |
209 ngx_http_complex_value_t *val, ngx_str_t *value); | |
210 ngx_int_t ngx_http_compile_complex_value(ngx_http_compile_complex_value_t *ccv); | |
177 | 211 |
178 ngx_uint_t ngx_http_script_variables_count(ngx_str_t *value); | 212 ngx_uint_t ngx_http_script_variables_count(ngx_str_t *value); |
179 ngx_int_t ngx_http_script_compile(ngx_http_script_compile_t *sc); | 213 ngx_int_t ngx_http_script_compile(ngx_http_script_compile_t *sc); |
180 u_char *ngx_http_script_run(ngx_http_request_t *r, ngx_str_t *value, | 214 u_char *ngx_http_script_run(ngx_http_request_t *r, ngx_str_t *value, |
181 void *code_lengths, size_t reserved, void *code_values); | 215 void *code_lengths, size_t reserved, void *code_values); |