Mercurial > hg > nginx-quic
annotate src/http/ngx_http_script.h @ 637:e60fe4cf1d4e release-0.3.40
nginx-0.3.40-RELEASE import
*) Feature: the ngx_http_dav_module supports the MKCOL method.
*) Feature: the "create_full_put_path" directive.
*) Feature: the "$limit_rate" variable.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 19 Apr 2006 15:30:56 +0000 |
parents | 5d2b8078c1c2 |
children | 5e8fb59c18c1 |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
4 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
5 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
6 |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
7 #ifndef _NGX_HTTP_SCRIPT_H_INCLUDED_ |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
8 #define _NGX_HTTP_SCRIPT_H_INCLUDED_ |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
9 |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 |
479 | 11 #include <ngx_config.h> |
12 #include <ngx_core.h> | |
13 #include <ngx_http.h> | |
14 | |
15 | |
507 | 16 typedef struct { |
573 | 17 u_char *ip; |
18 u_char *pos; | |
19 ngx_http_variable_value_t *sp; | |
509 | 20 |
573 | 21 ngx_str_t buf; |
22 ngx_str_t line; | |
509 | 23 |
24 /* the start of the rewritten arguments */ | |
573 | 25 u_char *args; |
507 | 26 |
573 | 27 unsigned flushed:1; |
28 unsigned skip:1; | |
29 unsigned quote:1; | |
30 unsigned log:1; | |
509 | 31 |
573 | 32 int *captures; |
33 ngx_uint_t ncaptures; | |
34 | |
35 ngx_int_t status; | |
36 ngx_http_request_t *request; | |
507 | 37 } ngx_http_script_engine_t; |
38 | |
39 | |
509 | 40 typedef struct { |
573 | 41 ngx_conf_t *cf; |
42 ngx_str_t *source; | |
509 | 43 |
573 | 44 ngx_array_t **flushes; |
45 ngx_array_t **lengths; | |
46 ngx_array_t **values; | |
509 | 47 |
573 | 48 ngx_uint_t variables; |
49 ngx_uint_t ncaptures; | |
50 ngx_uint_t size; | |
51 | |
52 void *main; | |
507 | 53 |
573 | 54 unsigned compile_args:1; |
55 unsigned complete_lengths:1; | |
56 unsigned complete_values:1; | |
509 | 57 |
573 | 58 unsigned args:1; |
509 | 59 } ngx_http_script_compile_t; |
60 | |
61 | |
62 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); | |
507 | 64 |
479 | 65 |
507 | 66 typedef struct { |
67 ngx_http_script_code_pt code; | |
68 uintptr_t len; | |
69 } ngx_http_script_copy_code_t; | |
70 | |
71 | |
72 typedef struct { | |
73 ngx_http_script_code_pt code; | |
74 uintptr_t index; | |
75 } ngx_http_script_var_code_t; | |
76 | |
77 | |
509 | 78 typedef struct { |
637 | 79 ngx_http_script_code_pt code; |
80 ngx_http_set_variable_pt handler; | |
81 uintptr_t data; | |
82 } ngx_http_script_var_handler_code_t; | |
83 | |
84 | |
85 typedef struct { | |
509 | 86 ngx_http_script_code_pt code; |
87 uintptr_t n; | |
88 } ngx_http_script_copy_capture_code_t; | |
89 | |
90 | |
517 | 91 #if (NGX_PCRE) |
92 | |
509 | 93 typedef struct { |
94 ngx_http_script_code_pt code; | |
95 ngx_regex_t *regex; | |
96 ngx_array_t *lengths; | |
97 uintptr_t size; | |
98 uintptr_t ncaptures; | |
99 uintptr_t status; | |
100 uintptr_t next; | |
101 | |
102 uintptr_t test:1; | |
631 | 103 uintptr_t negative_test:1; |
509 | 104 uintptr_t uri:1; |
105 uintptr_t args:1; | |
106 | |
107 /* add the r->args to the new arguments */ | |
108 uintptr_t add_args:1; | |
577 | 109 |
509 | 110 uintptr_t redirect:1; |
111 uintptr_t break_cycle:1; | |
112 | |
113 ngx_str_t name; | |
114 } ngx_http_script_regex_code_t; | |
115 | |
116 | |
117 typedef struct { | |
118 ngx_http_script_code_pt code; | |
119 | |
120 uintptr_t uri:1; | |
121 uintptr_t args:1; | |
122 | |
123 /* add the r->args to the new arguments */ | |
124 uintptr_t add_args:1; | |
125 | |
126 uintptr_t redirect:1; | |
127 } ngx_http_script_regex_end_code_t; | |
507 | 128 |
517 | 129 #endif |
130 | |
507 | 131 |
509 | 132 typedef struct { |
133 ngx_http_script_code_pt code; | |
134 uintptr_t status; | |
135 uintptr_t null; | |
136 } ngx_http_script_return_code_t; | |
137 | |
138 | |
631 | 139 typedef enum { |
140 ngx_http_script_file_plain = 0, | |
141 ngx_http_script_file_not_plain | |
142 } ngx_http_script_file_op_e; | |
143 | |
144 | |
145 typedef struct { | |
146 ngx_http_script_code_pt code; | |
147 uintptr_t op; | |
148 } ngx_http_script_file_code_t; | |
149 | |
150 | |
509 | 151 typedef struct { |
152 ngx_http_script_code_pt code; | |
153 uintptr_t next; | |
154 void **loc_conf; | |
155 } ngx_http_script_if_code_t; | |
156 | |
157 | |
158 typedef struct { | |
159 ngx_http_script_code_pt code; | |
515 | 160 ngx_array_t *lengths; |
161 } ngx_http_script_complex_value_code_t; | |
162 | |
163 | |
164 typedef struct { | |
165 ngx_http_script_code_pt code; | |
509 | 166 uintptr_t value; |
167 uintptr_t text_len; | |
168 uintptr_t text_data; | |
169 } ngx_http_script_value_code_t; | |
170 | |
507 | 171 |
509 | 172 ngx_uint_t ngx_http_script_variables_count(ngx_str_t *value); |
173 ngx_int_t ngx_http_script_compile(ngx_http_script_compile_t *sc); | |
623 | 174 u_char *ngx_http_script_run(ngx_http_request_t *r, ngx_str_t *value, |
175 void *code_lengths, size_t reserved, void *code_values); | |
573 | 176 void ngx_http_script_flush_no_cachable_variables(ngx_http_request_t *r, |
177 ngx_array_t *indices); | |
509 | 178 |
179 void *ngx_http_script_start_code(ngx_pool_t *pool, ngx_array_t **codes, | |
180 size_t size); | |
181 void *ngx_http_script_add_code(ngx_array_t *codes, size_t size, void *code); | |
507 | 182 |
509 | 183 size_t ngx_http_script_copy_len_code(ngx_http_script_engine_t *e); |
184 void ngx_http_script_copy_code(ngx_http_script_engine_t *e); | |
185 size_t ngx_http_script_copy_var_len_code(ngx_http_script_engine_t *e); | |
186 void ngx_http_script_copy_var_code(ngx_http_script_engine_t *e); | |
187 size_t ngx_http_script_copy_capture_len_code(ngx_http_script_engine_t *e); | |
188 void ngx_http_script_copy_capture_code(ngx_http_script_engine_t *e); | |
517 | 189 void ngx_http_script_start_args_code(ngx_http_script_engine_t *e); |
190 #if (NGX_PCRE) | |
509 | 191 void ngx_http_script_regex_start_code(ngx_http_script_engine_t *e); |
192 void ngx_http_script_regex_end_code(ngx_http_script_engine_t *e); | |
517 | 193 #endif |
509 | 194 void ngx_http_script_return_code(ngx_http_script_engine_t *e); |
527 | 195 void ngx_http_script_break_code(ngx_http_script_engine_t *e); |
509 | 196 void ngx_http_script_if_code(ngx_http_script_engine_t *e); |
577 | 197 void ngx_http_script_equal_code(ngx_http_script_engine_t *e); |
198 void ngx_http_script_not_equal_code(ngx_http_script_engine_t *e); | |
631 | 199 void ngx_http_script_file_code(ngx_http_script_engine_t *e); |
515 | 200 void ngx_http_script_complex_value_code(ngx_http_script_engine_t *e); |
509 | 201 void ngx_http_script_value_code(ngx_http_script_engine_t *e); |
202 void ngx_http_script_set_var_code(ngx_http_script_engine_t *e); | |
637 | 203 void ngx_http_script_var_set_handler_code(ngx_http_script_engine_t *e); |
509 | 204 void ngx_http_script_var_code(ngx_http_script_engine_t *e); |
205 void ngx_http_script_nop_code(ngx_http_script_engine_t *e); | |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
206 |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
207 |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
208 #endif /* _NGX_HTTP_SCRIPT_H_INCLUDED_ */ |