Mercurial > hg > nginx-quic
annotate src/http/ngx_http_script.h @ 1124:f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 20 Feb 2007 15:47:54 +0000 |
parents | 562806624c4a |
children | 4c43e25d11ea |
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; | |
641 | 50 ngx_uint_t captures_mask; |
573 | 51 ngx_uint_t size; |
52 | |
53 void *main; | |
507 | 54 |
573 | 55 unsigned compile_args:1; |
56 unsigned complete_lengths:1; | |
57 unsigned complete_values:1; | |
641 | 58 unsigned dup_capture:1; |
509 | 59 |
573 | 60 unsigned args:1; |
509 | 61 } ngx_http_script_compile_t; |
62 | |
63 | |
64 typedef void (*ngx_http_script_code_pt) (ngx_http_script_engine_t *e); | |
65 typedef size_t (*ngx_http_script_len_code_pt) (ngx_http_script_engine_t *e); | |
507 | 66 |
479 | 67 |
507 | 68 typedef struct { |
69 ngx_http_script_code_pt code; | |
70 uintptr_t len; | |
71 } ngx_http_script_copy_code_t; | |
72 | |
73 | |
74 typedef struct { | |
75 ngx_http_script_code_pt code; | |
76 uintptr_t index; | |
77 } ngx_http_script_var_code_t; | |
78 | |
79 | |
509 | 80 typedef struct { |
637 | 81 ngx_http_script_code_pt code; |
82 ngx_http_set_variable_pt handler; | |
83 uintptr_t data; | |
84 } ngx_http_script_var_handler_code_t; | |
85 | |
86 | |
87 typedef struct { | |
509 | 88 ngx_http_script_code_pt code; |
89 uintptr_t n; | |
90 } ngx_http_script_copy_capture_code_t; | |
91 | |
92 | |
517 | 93 #if (NGX_PCRE) |
94 | |
509 | 95 typedef struct { |
96 ngx_http_script_code_pt code; | |
97 ngx_regex_t *regex; | |
98 ngx_array_t *lengths; | |
99 uintptr_t size; | |
100 uintptr_t ncaptures; | |
101 uintptr_t status; | |
102 uintptr_t next; | |
103 | |
104 uintptr_t test:1; | |
631 | 105 uintptr_t negative_test:1; |
509 | 106 uintptr_t uri:1; |
107 uintptr_t args:1; | |
108 | |
109 /* add the r->args to the new arguments */ | |
110 uintptr_t add_args:1; | |
577 | 111 |
509 | 112 uintptr_t redirect:1; |
113 uintptr_t break_cycle:1; | |
114 | |
115 ngx_str_t name; | |
116 } ngx_http_script_regex_code_t; | |
117 | |
118 | |
119 typedef struct { | |
120 ngx_http_script_code_pt code; | |
121 | |
122 uintptr_t uri:1; | |
123 uintptr_t args:1; | |
124 | |
125 /* add the r->args to the new arguments */ | |
126 uintptr_t add_args:1; | |
127 | |
128 uintptr_t redirect:1; | |
129 } ngx_http_script_regex_end_code_t; | |
507 | 130 |
517 | 131 #endif |
132 | |
507 | 133 |
509 | 134 typedef struct { |
135 ngx_http_script_code_pt code; | |
136 uintptr_t status; | |
137 uintptr_t null; | |
138 } ngx_http_script_return_code_t; | |
139 | |
140 | |
631 | 141 typedef enum { |
142 ngx_http_script_file_plain = 0, | |
669 | 143 ngx_http_script_file_not_plain, |
144 ngx_http_script_file_dir, | |
145 ngx_http_script_file_not_dir, | |
146 ngx_http_script_file_exists, | |
147 ngx_http_script_file_not_exists, | |
148 ngx_http_script_file_exec, | |
149 ngx_http_script_file_not_exec | |
631 | 150 } ngx_http_script_file_op_e; |
151 | |
152 | |
153 typedef struct { | |
154 ngx_http_script_code_pt code; | |
155 uintptr_t op; | |
156 } ngx_http_script_file_code_t; | |
157 | |
158 | |
509 | 159 typedef struct { |
160 ngx_http_script_code_pt code; | |
161 uintptr_t next; | |
162 void **loc_conf; | |
163 } ngx_http_script_if_code_t; | |
164 | |
165 | |
166 typedef struct { | |
167 ngx_http_script_code_pt code; | |
515 | 168 ngx_array_t *lengths; |
169 } ngx_http_script_complex_value_code_t; | |
170 | |
171 | |
172 typedef struct { | |
173 ngx_http_script_code_pt code; | |
509 | 174 uintptr_t value; |
175 uintptr_t text_len; | |
176 uintptr_t text_data; | |
177 } ngx_http_script_value_code_t; | |
178 | |
507 | 179 |
509 | 180 ngx_uint_t ngx_http_script_variables_count(ngx_str_t *value); |
181 ngx_int_t ngx_http_script_compile(ngx_http_script_compile_t *sc); | |
623 | 182 u_char *ngx_http_script_run(ngx_http_request_t *r, ngx_str_t *value, |
183 void *code_lengths, size_t reserved, void *code_values); | |
573 | 184 void ngx_http_script_flush_no_cachable_variables(ngx_http_request_t *r, |
185 ngx_array_t *indices); | |
509 | 186 |
187 void *ngx_http_script_start_code(ngx_pool_t *pool, ngx_array_t **codes, | |
188 size_t size); | |
189 void *ngx_http_script_add_code(ngx_array_t *codes, size_t size, void *code); | |
507 | 190 |
509 | 191 size_t ngx_http_script_copy_len_code(ngx_http_script_engine_t *e); |
192 void ngx_http_script_copy_code(ngx_http_script_engine_t *e); | |
193 size_t ngx_http_script_copy_var_len_code(ngx_http_script_engine_t *e); | |
194 void ngx_http_script_copy_var_code(ngx_http_script_engine_t *e); | |
195 size_t ngx_http_script_copy_capture_len_code(ngx_http_script_engine_t *e); | |
196 void ngx_http_script_copy_capture_code(ngx_http_script_engine_t *e); | |
517 | 197 void ngx_http_script_start_args_code(ngx_http_script_engine_t *e); |
198 #if (NGX_PCRE) | |
509 | 199 void ngx_http_script_regex_start_code(ngx_http_script_engine_t *e); |
200 void ngx_http_script_regex_end_code(ngx_http_script_engine_t *e); | |
517 | 201 #endif |
509 | 202 void ngx_http_script_return_code(ngx_http_script_engine_t *e); |
527 | 203 void ngx_http_script_break_code(ngx_http_script_engine_t *e); |
509 | 204 void ngx_http_script_if_code(ngx_http_script_engine_t *e); |
577 | 205 void ngx_http_script_equal_code(ngx_http_script_engine_t *e); |
206 void ngx_http_script_not_equal_code(ngx_http_script_engine_t *e); | |
631 | 207 void ngx_http_script_file_code(ngx_http_script_engine_t *e); |
515 | 208 void ngx_http_script_complex_value_code(ngx_http_script_engine_t *e); |
509 | 209 void ngx_http_script_value_code(ngx_http_script_engine_t *e); |
210 void ngx_http_script_set_var_code(ngx_http_script_engine_t *e); | |
637 | 211 void ngx_http_script_var_set_handler_code(ngx_http_script_engine_t *e); |
509 | 212 void ngx_http_script_var_code(ngx_http_script_engine_t *e); |
213 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
|
214 |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
215 |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
216 #endif /* _NGX_HTTP_SCRIPT_H_INCLUDED_ */ |