Mercurial > hg > nginx-quic
annotate src/http/ngx_http_script.h @ 588:0a2c30f516e6
release-0.3.15 tag
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 07 Dec 2005 14:51:31 +0000 |
parents | 4d9ea73a627a |
children | 0216fd1471f3 |
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 compile_null:1; | |
56 unsigned complete_lengths:1; | |
57 unsigned complete_values:1; | |
509 | 58 |
573 | 59 unsigned args:1; |
509 | 60 } ngx_http_script_compile_t; |
61 | |
62 | |
63 typedef void (*ngx_http_script_code_pt) (ngx_http_script_engine_t *e); | |
64 typedef size_t (*ngx_http_script_len_code_pt) (ngx_http_script_engine_t *e); | |
507 | 65 |
479 | 66 |
507 | 67 typedef struct { |
68 ngx_http_script_code_pt code; | |
69 uintptr_t len; | |
70 } ngx_http_script_copy_code_t; | |
71 | |
72 | |
73 typedef struct { | |
74 ngx_http_script_code_pt code; | |
75 uintptr_t index; | |
76 } ngx_http_script_var_code_t; | |
77 | |
78 | |
509 | 79 typedef struct { |
80 ngx_http_script_code_pt code; | |
81 uintptr_t n; | |
82 } ngx_http_script_copy_capture_code_t; | |
83 | |
84 | |
517 | 85 #if (NGX_PCRE) |
86 | |
509 | 87 typedef struct { |
88 ngx_http_script_code_pt code; | |
89 ngx_regex_t *regex; | |
90 ngx_array_t *lengths; | |
91 uintptr_t size; | |
92 uintptr_t ncaptures; | |
93 uintptr_t status; | |
94 uintptr_t next; | |
95 | |
96 uintptr_t test:1; | |
97 uintptr_t uri:1; | |
98 uintptr_t args:1; | |
99 | |
100 /* add the r->args to the new arguments */ | |
101 uintptr_t add_args:1; | |
577 | 102 |
509 | 103 uintptr_t redirect:1; |
104 uintptr_t break_cycle:1; | |
105 | |
106 ngx_str_t name; | |
107 } ngx_http_script_regex_code_t; | |
108 | |
109 | |
110 typedef struct { | |
111 ngx_http_script_code_pt code; | |
112 | |
113 uintptr_t uri:1; | |
114 uintptr_t args:1; | |
115 | |
116 /* add the r->args to the new arguments */ | |
117 uintptr_t add_args:1; | |
118 | |
119 uintptr_t redirect:1; | |
120 } ngx_http_script_regex_end_code_t; | |
507 | 121 |
517 | 122 #endif |
123 | |
507 | 124 |
509 | 125 typedef struct { |
126 ngx_http_script_code_pt code; | |
127 uintptr_t status; | |
128 uintptr_t null; | |
129 } ngx_http_script_return_code_t; | |
130 | |
131 | |
132 typedef struct { | |
133 ngx_http_script_code_pt code; | |
134 uintptr_t next; | |
135 void **loc_conf; | |
136 } ngx_http_script_if_code_t; | |
137 | |
138 | |
139 typedef struct { | |
140 ngx_http_script_code_pt code; | |
515 | 141 ngx_array_t *lengths; |
142 } ngx_http_script_complex_value_code_t; | |
143 | |
144 | |
145 typedef struct { | |
146 ngx_http_script_code_pt code; | |
509 | 147 uintptr_t value; |
148 uintptr_t text_len; | |
149 uintptr_t text_data; | |
150 } ngx_http_script_value_code_t; | |
151 | |
507 | 152 |
509 | 153 ngx_uint_t ngx_http_script_variables_count(ngx_str_t *value); |
154 ngx_int_t ngx_http_script_compile(ngx_http_script_compile_t *sc); | |
573 | 155 void ngx_http_script_flush_no_cachable_variables(ngx_http_request_t *r, |
156 ngx_array_t *indices); | |
509 | 157 |
158 void *ngx_http_script_start_code(ngx_pool_t *pool, ngx_array_t **codes, | |
159 size_t size); | |
160 void *ngx_http_script_add_code(ngx_array_t *codes, size_t size, void *code); | |
507 | 161 |
509 | 162 size_t ngx_http_script_copy_len_code(ngx_http_script_engine_t *e); |
163 void ngx_http_script_copy_code(ngx_http_script_engine_t *e); | |
164 size_t ngx_http_script_copy_var_len_code(ngx_http_script_engine_t *e); | |
165 void ngx_http_script_copy_var_code(ngx_http_script_engine_t *e); | |
166 size_t ngx_http_script_copy_capture_len_code(ngx_http_script_engine_t *e); | |
167 void ngx_http_script_copy_capture_code(ngx_http_script_engine_t *e); | |
517 | 168 void ngx_http_script_start_args_code(ngx_http_script_engine_t *e); |
169 #if (NGX_PCRE) | |
509 | 170 void ngx_http_script_regex_start_code(ngx_http_script_engine_t *e); |
171 void ngx_http_script_regex_end_code(ngx_http_script_engine_t *e); | |
517 | 172 #endif |
509 | 173 void ngx_http_script_return_code(ngx_http_script_engine_t *e); |
527 | 174 void ngx_http_script_break_code(ngx_http_script_engine_t *e); |
509 | 175 void ngx_http_script_if_code(ngx_http_script_engine_t *e); |
577 | 176 void ngx_http_script_equal_code(ngx_http_script_engine_t *e); |
177 void ngx_http_script_not_equal_code(ngx_http_script_engine_t *e); | |
515 | 178 void ngx_http_script_complex_value_code(ngx_http_script_engine_t *e); |
509 | 179 void ngx_http_script_value_code(ngx_http_script_engine_t *e); |
180 void ngx_http_script_set_var_code(ngx_http_script_engine_t *e); | |
181 void ngx_http_script_var_code(ngx_http_script_engine_t *e); | |
182 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
|
183 |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
184 |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
185 #endif /* _NGX_HTTP_SCRIPT_H_INCLUDED_ */ |