Apache2
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
34 extern "C" {
35 #endif
36 
38 typedef struct ap_expr_node ap_expr_t;
39 
41 typedef 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 
105 typedef struct {
115  const char **err;
123  const char **re_source;
128  const char **vary_this;
130  const char **result_string;
132  void *data;
134  int reclvl;
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,
181  ap_regmatch_t *pmatch,
182  const char **source,
183  const char **err);
184 
185 
211 typedef int ap_expr_op_unary_t(ap_expr_eval_ctx_t *ctx, const void *data,
212  const char *arg);
213 
222 typedef int ap_expr_op_binary_t(ap_expr_eval_ctx_t *ctx, const void *data,
223  const char *arg1, const char *arg2);
224 
231 typedef const char *(ap_expr_string_func_t)(ap_expr_eval_ctx_t *ctx,
232  const void *data,
233  const char *arg);
234 
242  const void *data,
243  const apr_array_header_t *args);
244 
253  const void *data,
254  const char *arg);
255 
261 typedef const char *(ap_expr_var_func_t)(ap_expr_eval_ctx_t *ctx,
262  const void *data);
263 
265 typedef struct {
267  int type;
268 #define AP_EXPR_FUNC_VAR 0
269 #define AP_EXPR_FUNC_STRING 1
270 #define AP_EXPR_FUNC_LIST 2
271 #define AP_EXPR_FUNC_OP_UNARY 3
272 #define AP_EXPR_FUNC_OP_BINARY 4
274  const char *name;
275 
276  int flags;
277 
280 
282  const void **func;
284  const void **data;
286  const char **err;
287 
293  const char *arg;
295 
305 
311 
313 
314 
326  ap_expr_info_t *info, const char *expr,
327  ap_expr_lookup_fn_t *lookup_fn);
328 
343  const char *expr,
344  unsigned int flags,
345  const char **err,
346  ap_expr_lookup_fn_t *lookup_fn,
347  int module_index);
348 
353 #define ap_expr_parse_cmd(cmd, expr, flags, err, lookup_fn) \
354  ap_expr_parse_cmd_mi(cmd, expr, flags, err, lookup_fn, APLOG_MODULE_INDEX)
355 
360 
361 #ifdef __cplusplus
362 }
363 #endif
364 
365 #endif /* AP_EXPR_H */
#define AP_DECLARE_HOOK(ret, name, args)
Definition: ap_hooks.h:74
Apache Regex defines.
int expr_lookup(ap_expr_lookup_parms *parms)
int ap_expr_lookup_default(ap_expr_lookup_parms *parms)
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)
const char *() ap_expr_string_list_func_t(ap_expr_eval_ctx_t *ctx, const void *data, const apr_array_header_t *args)
Definition: ap_expr.h:241
int ap_expr_exec(request_rec *r, const ap_expr_info_t *expr, const char **err)
int() ap_expr_lookup_fn_t(ap_expr_lookup_parms *parms)
Definition: ap_expr.h:304
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_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)
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)
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_var_func_t(ap_expr_eval_ctx_t *ctx, const void *data)
Definition: ap_expr.h:261
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
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:252
int ap_expr_exec_ctx(ap_expr_eval_ctx_t *ctx)
void ap_expr_init(apr_pool_t *pool)
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)
dav_resource int dav_locktoken dav_response int flags
Definition: mod_dav.h:1458
request_rec * r
Definition: mod_dav.h:518
const dav_liveprop_group const dav_liveprop_spec ** info
Definition: mod_dav.h:1055
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:557
dav_error * err
Definition: mod_dav.h:203
int
Definition: mod_proxy.h:674
size_t apr_size_t
Definition: apr.h:394
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
Apache Configuration.
HTTP Daemon routines.
#define AP_DECLARE(x)
Definition: macros.h:1
#define AP_DECLARE_NONSTD(x)
Definition: macros.h:2
Definition: ap_expr.h:105
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
int reclvl
Definition: ap_expr.h:134
void * data
Definition: ap_expr.h:132
const char ** result_string
Definition: ap_expr.h:130
const ap_expr_info_t * info
Definition: ap_expr.h:117
Definition: ap_expr.h:41
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
Definition: ap_expr.h:265
const char ** err
Definition: ap_expr.h:286
const void ** data
Definition: ap_expr.h:284
int type
Definition: ap_expr.h:267
apr_pool_t * pool
Definition: ap_expr.h:278
const char * name
Definition: ap_expr.h:274
const void ** func
Definition: ap_expr.h:282
int flags
Definition: ap_expr.h:276
apr_pool_t * ptemp
Definition: ap_expr.h:279
const char * arg
Definition: ap_expr.h:293
Definition: util_expr_private.h:77
Definition: ap_regex.h:118
Definition: apr_tables.h:62
Definition: http_config.h:288
Structure to store things which are per connection.
Definition: httpd.h:1193
A structure that represents the current request.
Definition: httpd.h:856
A structure to store information for each virtual server.
Definition: httpd.h:1382