~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Nginx/http/ngx_http_script.h

Version: ~ [ nginx-0.8.20 ] ~ [ nginx-0.7.62 ] ~ [ nginx-0.6.39 ] ~

  1 
  2 /*
  3  * Copyright (C) Igor Sysoev
  4  */
  5 
  6 
  7 #ifndef _NGX_HTTP_SCRIPT_H_INCLUDED_
  8 #define _NGX_HTTP_SCRIPT_H_INCLUDED_
  9 
 10 
 11 #include <ngx_config.h>
 12 #include <ngx_core.h>
 13 #include <ngx_http.h>
 14 
 15 
 16 typedef struct {
 17     u_char                     *ip;
 18     u_char                     *pos;
 19     ngx_http_variable_value_t  *sp;
 20 
 21     ngx_str_t                   buf;
 22     ngx_str_t                   line;
 23 
 24     /* the start of the rewritten arguments */
 25     u_char                     *args;
 26 
 27     unsigned                    flushed:1;
 28     unsigned                    skip:1;
 29     unsigned                    quote:1;
 30     unsigned                    is_args:1;
 31     unsigned                    log:1;
 32 
 33     ngx_int_t                   status;
 34     ngx_http_request_t         *request;
 35 } ngx_http_script_engine_t;
 36 
 37 
 38 typedef struct {
 39     ngx_conf_t                 *cf;
 40     ngx_str_t                  *source;
 41 
 42     ngx_array_t               **flushes;
 43     ngx_array_t               **lengths;
 44     ngx_array_t               **values;
 45 
 46     ngx_uint_t                  variables;
 47     ngx_uint_t                  ncaptures;
 48     ngx_uint_t                  captures_mask;
 49     ngx_uint_t                  size;
 50 
 51     void                       *main;
 52 
 53     unsigned                    compile_args:1;
 54     unsigned                    complete_lengths:1;
 55     unsigned                    complete_values:1;
 56     unsigned                    zero:1;
 57     unsigned                    conf_prefix:1;
 58     unsigned                    root_prefix:1;
 59 
 60     unsigned                    dup_capture:1;
 61     unsigned                    args:1;
 62 } ngx_http_script_compile_t;
 63 
 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 
 84 typedef void (*ngx_http_script_code_pt) (ngx_http_script_engine_t *e);
 85 typedef size_t (*ngx_http_script_len_code_pt) (ngx_http_script_engine_t *e);
 86 
 87 
 88 typedef struct {
 89     ngx_http_script_code_pt     code;
 90     uintptr_t                   len;
 91 } ngx_http_script_copy_code_t;
 92 
 93 
 94 typedef struct {
 95     ngx_http_script_code_pt     code;
 96     uintptr_t                   index;
 97 } ngx_http_script_var_code_t;
 98 
 99 
100 typedef struct {
101     ngx_http_script_code_pt     code;
102     ngx_http_set_variable_pt    handler;
103     uintptr_t                   data;
104 } ngx_http_script_var_handler_code_t;
105 
106 
107 typedef struct {
108     ngx_http_script_code_pt     code;
109     uintptr_t                   n;
110 } ngx_http_script_copy_capture_code_t;
111 
112 
113 #if (NGX_PCRE)
114 
115 typedef struct {
116     ngx_http_script_code_pt     code;
117     ngx_regex_t                *regex;
118     ngx_array_t                *lengths;
119     uintptr_t                   size;
120     uintptr_t                   ncaptures;
121     uintptr_t                   status;
122     uintptr_t                   next;
123 
124     uintptr_t                   test:1;
125     uintptr_t                   negative_test:1;
126     uintptr_t                   uri:1;
127     uintptr_t                   args:1;
128 
129     /* add the r->args to the new arguments */
130     uintptr_t                   add_args:1;
131 
132     uintptr_t                   redirect:1;
133     uintptr_t                   break_cycle:1;
134 
135     ngx_str_t                   name;
136 } ngx_http_script_regex_code_t;
137 
138 
139 typedef struct {
140     ngx_http_script_code_pt     code;
141 
142     uintptr_t                   uri:1;
143     uintptr_t                   args:1;
144 
145     /* add the r->args to the new arguments */
146     uintptr_t                   add_args:1;
147 
148     uintptr_t                   redirect:1;
149 } ngx_http_script_regex_end_code_t;
150 
151 #endif
152 
153 
154 typedef struct {
155     ngx_http_script_code_pt     code;
156     uintptr_t                   conf_prefix;
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;
164 } ngx_http_script_return_code_t;
165 
166 
167 typedef enum {
168     ngx_http_script_file_plain = 0,
169     ngx_http_script_file_not_plain,
170     ngx_http_script_file_dir,
171     ngx_http_script_file_not_dir,
172     ngx_http_script_file_exists,
173     ngx_http_script_file_not_exists,
174     ngx_http_script_file_exec,
175     ngx_http_script_file_not_exec
176 } ngx_http_script_file_op_e;
177 
178 
179 typedef struct {
180     ngx_http_script_code_pt     code;
181     uintptr_t                   op;
182 } ngx_http_script_file_code_t;
183 
184 
185 typedef struct {
186     ngx_http_script_code_pt     code;
187     uintptr_t                   next;
188     void                      **loc_conf;
189 } ngx_http_script_if_code_t;
190 
191 
192 typedef struct {
193     ngx_http_script_code_pt     code;
194     ngx_array_t                *lengths;
195 } ngx_http_script_complex_value_code_t;
196 
197 
198 typedef struct {
199     ngx_http_script_code_pt     code;
200     uintptr_t                   value;
201     uintptr_t                   text_len;
202     uintptr_t                   text_data;
203 } ngx_http_script_value_code_t;
204 
205 
206 void ngx_http_script_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);
211 
212 ngx_uint_t ngx_http_script_variables_count(ngx_str_t *value);
213 ngx_int_t ngx_http_script_compile(ngx_http_script_compile_t *sc);
214 u_char *ngx_http_script_run(ngx_http_request_t *r, ngx_str_t *value,
215     void *code_lengths, size_t reserved, void *code_values);
216 void ngx_http_script_flush_no_cacheable_variables(ngx_http_request_t *r,
217     ngx_array_t *indices);
218 
219 void *ngx_http_script_start_code(ngx_pool_t *pool, ngx_array_t **codes,
220     size_t size);
221 void *ngx_http_script_add_code(ngx_array_t *codes, size_t size, void *code);
222 
223 size_t ngx_http_script_copy_len_code(ngx_http_script_engine_t *e);
224 void ngx_http_script_copy_code(ngx_http_script_engine_t *e);
225 size_t ngx_http_script_copy_var_len_code(ngx_http_script_engine_t *e);
226 void ngx_http_script_copy_var_code(ngx_http_script_engine_t *e);
227 size_t ngx_http_script_copy_capture_len_code(ngx_http_script_engine_t *e);
228 void ngx_http_script_copy_capture_code(ngx_http_script_engine_t *e);
229 size_t ngx_http_script_mark_args_code(ngx_http_script_engine_t *e);
230 void ngx_http_script_start_args_code(ngx_http_script_engine_t *e);
231 #if (NGX_PCRE)
232 void ngx_http_script_regex_start_code(ngx_http_script_engine_t *e);
233 void ngx_http_script_regex_end_code(ngx_http_script_engine_t *e);
234 #endif
235 void ngx_http_script_return_code(ngx_http_script_engine_t *e);
236 void ngx_http_script_break_code(ngx_http_script_engine_t *e);
237 void ngx_http_script_if_code(ngx_http_script_engine_t *e);
238 void ngx_http_script_equal_code(ngx_http_script_engine_t *e);
239 void ngx_http_script_not_equal_code(ngx_http_script_engine_t *e);
240 void ngx_http_script_file_code(ngx_http_script_engine_t *e);
241 void ngx_http_script_complex_value_code(ngx_http_script_engine_t *e);
242 void ngx_http_script_value_code(ngx_http_script_engine_t *e);
243 void ngx_http_script_set_var_code(ngx_http_script_engine_t *e);
244 void ngx_http_script_var_set_handler_code(ngx_http_script_engine_t *e);
245 void ngx_http_script_var_code(ngx_http_script_engine_t *e);
246 void ngx_http_script_nop_code(ngx_http_script_engine_t *e);
247 
248 
249 #endif /* _NGX_HTTP_SCRIPT_H_INCLUDED_ */
250 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.