Mercurial > hg > nginx-quic
annotate src/http/ngx_http_script.h @ 651:39b7d7b33c91 release-0.3.47
nginx-0.3.47-RELEASE import
*) Feature: the "upstream" directive.
*) Change: now the "\" escape symbol in the "\"" and "\'" pairs in the
SSI command is always removed.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 23 May 2006 14:54:58 +0000 |
parents | 5e8fb59c18c1 |
children | 562806624c4a |
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, | |
143 ngx_http_script_file_not_plain | |
144 } ngx_http_script_file_op_e; | |
145 | |
146 | |
147 typedef struct { | |
148 ngx_http_script_code_pt code; | |
149 uintptr_t op; | |
150 } ngx_http_script_file_code_t; | |
151 | |
152 | |
509 | 153 typedef struct { |
154 ngx_http_script_code_pt code; | |
155 uintptr_t next; | |
156 void **loc_conf; | |
157 } ngx_http_script_if_code_t; | |
158 | |
159 | |
160 typedef struct { | |
161 ngx_http_script_code_pt code; | |
515 | 162 ngx_array_t *lengths; |
163 } ngx_http_script_complex_value_code_t; | |
164 | |
165 | |
166 typedef struct { | |
167 ngx_http_script_code_pt code; | |
509 | 168 uintptr_t value; |
169 uintptr_t text_len; | |
170 uintptr_t text_data; | |
171 } ngx_http_script_value_code_t; | |
172 | |
507 | 173 |
509 | 174 ngx_uint_t ngx_http_script_variables_count(ngx_str_t *value); |
175 ngx_int_t ngx_http_script_compile(ngx_http_script_compile_t *sc); | |
623 | 176 u_char *ngx_http_script_run(ngx_http_request_t *r, ngx_str_t *value, |
177 void *code_lengths, size_t reserved, void *code_values); | |
573 | 178 void ngx_http_script_flush_no_cachable_variables(ngx_http_request_t *r, |
179 ngx_array_t *indices); | |
509 | 180 |
181 void *ngx_http_script_start_code(ngx_pool_t *pool, ngx_array_t **codes, | |
182 size_t size); | |
183 void *ngx_http_script_add_code(ngx_array_t *codes, size_t size, void *code); | |
507 | 184 |
509 | 185 size_t ngx_http_script_copy_len_code(ngx_http_script_engine_t *e); |
186 void ngx_http_script_copy_code(ngx_http_script_engine_t *e); | |
187 size_t ngx_http_script_copy_var_len_code(ngx_http_script_engine_t *e); | |
188 void ngx_http_script_copy_var_code(ngx_http_script_engine_t *e); | |
189 size_t ngx_http_script_copy_capture_len_code(ngx_http_script_engine_t *e); | |
190 void ngx_http_script_copy_capture_code(ngx_http_script_engine_t *e); | |
517 | 191 void ngx_http_script_start_args_code(ngx_http_script_engine_t *e); |
192 #if (NGX_PCRE) | |
509 | 193 void ngx_http_script_regex_start_code(ngx_http_script_engine_t *e); |
194 void ngx_http_script_regex_end_code(ngx_http_script_engine_t *e); | |
517 | 195 #endif |
509 | 196 void ngx_http_script_return_code(ngx_http_script_engine_t *e); |
527 | 197 void ngx_http_script_break_code(ngx_http_script_engine_t *e); |
509 | 198 void ngx_http_script_if_code(ngx_http_script_engine_t *e); |
577 | 199 void ngx_http_script_equal_code(ngx_http_script_engine_t *e); |
200 void ngx_http_script_not_equal_code(ngx_http_script_engine_t *e); | |
631 | 201 void ngx_http_script_file_code(ngx_http_script_engine_t *e); |
515 | 202 void ngx_http_script_complex_value_code(ngx_http_script_engine_t *e); |
509 | 203 void ngx_http_script_value_code(ngx_http_script_engine_t *e); |
204 void ngx_http_script_set_var_code(ngx_http_script_engine_t *e); | |
637 | 205 void ngx_http_script_var_set_handler_code(ngx_http_script_engine_t *e); |
509 | 206 void ngx_http_script_var_code(ngx_http_script_engine_t *e); |
207 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
|
208 |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
209 |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
210 #endif /* _NGX_HTTP_SCRIPT_H_INCLUDED_ */ |