Apache HTTPD
ap_expr.h
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
26#ifndef AP_EXPR_H
27#define AP_EXPR_H
28
29#include "httpd.h"
30#include "http_config.h"
31#include "ap_regex.h"
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
38typedef struct ap_expr_node ap_expr_t;
39
41typedef struct {
47 const char *filename;
49 unsigned int line_number;
51 unsigned int flags;
55
59#define AP_EXPR_FLAG_SSL_EXPR_COMPAT 1
61#define AP_EXPR_FLAG_DONT_VARY 2
66#define AP_EXPR_FLAG_RESTRICTED 4
68#define AP_EXPR_FLAG_STRING_RESULT 8
69
70
82 const char **err);
83
101 apr_size_t nmatch, ap_regmatch_t *pmatch,
102 const char **source, const char **err);
103
105typedef struct {
115 const char **err;
121 apr_size_t re_nmatch;
123 const char **re_source;
128 const char **vary_this;
130 const char **result_string;
132 void *data;
136
147
159 const ap_expr_info_t *expr,
160 const char **err);
161
179 const ap_expr_info_t *expr,
180 apr_size_t nmatch,
182 const char **source,
183 const char **err);
184
185
212 const char *arg);
213
223 const char *arg1, const char *arg2);
224
232 const void *data,
233 const char *arg);
234
243 const void *data,
244 const char *arg);
245
252 const void *data);
253
255typedef struct {
257 int type;
258#define AP_EXPR_FUNC_VAR 0
259#define AP_EXPR_FUNC_STRING 1
260#define AP_EXPR_FUNC_LIST 2
261#define AP_EXPR_FUNC_OP_UNARY 3
262#define AP_EXPR_FUNC_OP_BINARY 4
264 const char *name;
265
266 int flags;
267
270
272 const void **func;
274 const void **data;
276 const char **err;
277
280 const char *arg;
282
292
298
299AP_DECLARE_HOOK(int, expr_lookup, (ap_expr_lookup_parms *parms))
300
301
312AP_DECLARE(const char *) ap_expr_parse(apr_pool_t *pool, apr_pool_t *ptemp,
313 ap_expr_info_t *info, const char *expr,
314 ap_expr_lookup_fn_t *lookup_fn);
315
330 const char *expr,
331 unsigned int flags,
332 const char **err,
333 ap_expr_lookup_fn_t *lookup_fn,
334 int module_index);
335
340#define ap_expr_parse_cmd(cmd, expr, flags, err, lookup_fn) \
341 ap_expr_parse_cmd_mi(cmd, expr, flags, err, lookup_fn, APLOG_MODULE_INDEX)
342
347
348#ifdef __cplusplus
349}
350#endif
351
352#endif /* AP_EXPR_H */
#define AP_DECLARE_NONSTD(type)
Definition ap_config.h:77
#define AP_DECLARE(type)
Definition ap_config.h:67
#define AP_DECLARE_HOOK(ret, name, args)
Definition ap_hooks.h:74
Apache Regex defines.
const char apr_size_t ap_regmatch_t * pmatch
Definition ap_regex.h:172
const char apr_size_t nmatch
Definition ap_regex.h:172
request_rec * r
void const char * arg
Definition http_vhost.h:63
apr_brigade_flush void * ctx
const char apr_ssize_t int flags
Definition apr_encode.h:168
const char *() ap_expr_string_func_t(ap_expr_eval_ctx_t *ctx, const void *data, const char *arg)
Definition ap_expr.h:231
int ap_expr_lookup_default(ap_expr_lookup_parms *parms)
apr_array_header_t *() ap_expr_list_func_t(ap_expr_eval_ctx_t *ctx, const void *data, const char *arg)
Definition ap_expr.h:242
int ap_expr_exec(request_rec *r, const ap_expr_info_t *expr, const char **err)
ap_expr_info_t * ap_expr_parse_cmd_mi(const cmd_parms *cmd, const char *expr, unsigned int flags, const char **err, ap_expr_lookup_fn_t *lookup_fn, int module_index)
int() ap_expr_lookup_fn_t(ap_expr_lookup_parms *parms)
Definition ap_expr.h:291
int ap_expr_exec_re(request_rec *r, const ap_expr_info_t *expr, apr_size_t nmatch, ap_regmatch_t *pmatch, const char **source, const char **err)
int ap_expr_op_unary_t(ap_expr_eval_ctx_t *ctx, const void *data, const char *arg)
Definition ap_expr.h:211
const char * ap_expr_parse(apr_pool_t *pool, apr_pool_t *ptemp, ap_expr_info_t *info, const char *expr, ap_expr_lookup_fn_t *lookup_fn)
const char * ap_expr_str_exec(request_rec *r, const ap_expr_info_t *expr, const char **err)
int ap_expr_op_binary_t(ap_expr_eval_ctx_t *ctx, const void *data, const char *arg1, const char *arg2)
Definition ap_expr.h:222
const char * ap_expr_str_exec_re(request_rec *r, const ap_expr_info_t *expr, apr_size_t nmatch, ap_regmatch_t *pmatch, const char **source, const char **err)
int ap_expr_exec_ctx(ap_expr_eval_ctx_t *ctx)
const char *() ap_expr_var_func_t(ap_expr_eval_ctx_t *ctx, const void *data)
Definition ap_expr.h:251
void ap_expr_init(apr_pool_t *pool)
const char int apr_pool_t * pool
Definition apr_cstr.h:84
void * data
apr_sockaddr_t apr_sockaddr_t apr_sockaddr_t * source
apr_int32_t apr_int32_t apr_int32_t err
apr_cmdtype_e cmd
Apache Configuration.
HTTP Daemon routines.
const char ** re_source
Definition ap_expr.h:123
request_rec * r
Definition ap_expr.h:107
apr_pool_t * p
Definition ap_expr.h:113
ap_regmatch_t * re_pmatch
Definition ap_expr.h:119
const char ** err
Definition ap_expr.h:115
server_rec * s
Definition ap_expr.h:111
conn_rec * c
Definition ap_expr.h:109
apr_size_t re_nmatch
Definition ap_expr.h:121
const char ** vary_this
Definition ap_expr.h:128
const char ** result_string
Definition ap_expr.h:130
const ap_expr_info_t * info
Definition ap_expr.h:117
unsigned int line_number
Definition ap_expr.h:49
unsigned int flags
Definition ap_expr.h:51
int module_index
Definition ap_expr.h:53
ap_expr_t * root_node
Definition ap_expr.h:43
const char * filename
Definition ap_expr.h:47
const char ** err
Definition ap_expr.h:276
const void ** data
Definition ap_expr.h:274
apr_pool_t * pool
Definition ap_expr.h:268
const char * name
Definition ap_expr.h:264
const void ** func
Definition ap_expr.h:272
apr_pool_t * ptemp
Definition ap_expr.h:269
const char * arg
Definition ap_expr.h:280
Structure to store things which are per connection.
Definition httpd.h:1152
A structure that represents the current request.
Definition httpd.h:845
A structure to store information for each virtual server.
Definition httpd.h:1322
typedef int(WSAAPI *apr_winapi_fpt_WSAPoll)(IN OUT LPWSAPOLLFD fdArray
INT info