Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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
60 
61 #define AP_EXPR_FLAG_DONT_VARY 2
62 
66 #define AP_EXPR_FLAG_RESTRICTED 4
67 
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
273 
274  const char *name;
275 
276  int flags;
277 
280 
282  const void **func;
284  const void **data;
286  const char **err;
287 
292  const char *arg;
294 
304 
310 
312 
324 AP_DECLARE(const char *) ap_expr_parse(apr_pool_t *pool, apr_pool_t *ptemp,
325  ap_expr_info_t *info, const char *expr,
326  ap_expr_lookup_fn_t *lookup_fn);
327 
342  const char *expr,
343  unsigned int flags,
344  const char **err,
345  ap_expr_lookup_fn_t *lookup_fn,
346  int module_index);
347 
352 #define ap_expr_parse_cmd(cmd, expr, flags, err, lookup_fn) \
353  ap_expr_parse_cmd_mi(cmd, expr, flags, err, lookup_fn, APLOG_MODULE_INDEX)
354 
358 void ap_expr_init(apr_pool_t *pool);
359 
360 #ifdef __cplusplus
361 }
362 #endif
363 
364 #endif /* AP_EXPR_H */
365 
Definition: ap_expr.h:265
size_t apr_size_t
Definition: apr.h:375
int expr_lookup(ap_expr_lookup_parms *parms)
int ap_expr_exec_ctx(ap_expr_eval_ctx_t *ctx)
conn_rec * c
Definition: ap_expr.h:109
Apache Configuration.
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
Definition: apr_tables.h:62
Definition: ap_expr.h:41
const ap_expr_info_t * info
Definition: ap_expr.h:117
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 type
Definition: ap_expr.h:267
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:552
void ap_expr_init(apr_pool_t *pool)
#define AP_DECLARE(x)
Definition: macros.h:1
Apache Regex defines.
const void ** func
Definition: ap_expr.h:282
unsigned int flags
Definition: ap_expr.h:51
#define AP_DECLARE_NONSTD(x)
Definition: macros.h:2
const char ** err
Definition: ap_expr.h:286
ap_expr_t * root_node
Definition: ap_expr.h:43
apr_pool_t * p
Definition: ap_expr.h:113
Structure to store things which are per connection.
Definition: httpd.h:1116
int( ap_expr_lookup_fn_t)(ap_expr_lookup_parms *parms)
Definition: ap_expr.h:303
const char * ap_expr_str_exec(request_rec *r, const ap_expr_info_t *expr, const char **err)
#define AP_DECLARE_HOOK(ret, name, args)
Definition: ap_hooks.h:74
apr_pool_t * ptemp
Definition: ap_expr.h:279
Definition: http_config.h:295
unsigned int line_number
Definition: ap_expr.h:49
int ap_expr_exec(request_rec *r, const ap_expr_info_t *expr, 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
HTTP Daemon routines.
const char ** re_source
Definition: ap_expr.h:123
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
const char *( ap_expr_string_func_t)(ap_expr_eval_ctx_t *ctx, const void *data, const char *arg)
Definition: ap_expr.h:231
A structure to store information for each virtual server.
Definition: httpd.h:1313
int
Definition: mod_proxy.h:626
dav_error * err
Definition: mod_dav.h:203
void * data
Definition: ap_expr.h:132
const char ** result_string
Definition: ap_expr.h:130
Definition: util_expr_private.h:77
apr_pool_t * pool
Definition: ap_expr.h:278
Definition: ap_expr.h:105
apr_size_t re_nmatch
Definition: ap_expr.h:121
const char * name
Definition: ap_expr.h:274
const char ** err
Definition: ap_expr.h:115
const dav_liveprop_group const dav_liveprop_spec ** info
Definition: mod_dav.h:966
ap_regmatch_t * re_pmatch
Definition: ap_expr.h:119
A structure that represents the current request.
Definition: httpd.h:806
const char ** vary_this
Definition: ap_expr.h:128
const void ** data
Definition: ap_expr.h:284
int ap_expr_lookup_default(ap_expr_lookup_parms *parms)
const char * arg
Definition: ap_expr.h:292
int reclvl
Definition: ap_expr.h:134
int flags
Definition: ap_expr.h:276
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
const char *( ap_expr_var_func_t)(ap_expr_eval_ctx_t *ctx, const void *data)
Definition: ap_expr.h:261
Definition: ap_regex.h:114
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)
request_rec * r
Definition: mod_dav.h:515
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)
const char * filename
Definition: ap_expr.h:47
dav_resource int dav_locktoken dav_response int flags
Definition: mod_dav.h:1346
server_rec * s
Definition: ap_expr.h:111
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_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)
request_rec * r
Definition: ap_expr.h:107
int module_index
Definition: ap_expr.h:53