ap_expr.h revision 78a20a6e7ad3a0229900ee54c7d11a65f647b663
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* conditional expression parser stuff */
typedef enum {
} token_type_t;
typedef struct {
const char *value;
#ifdef DEBUG_INCLUDE
const char *s;
#endif
} token_t;
typedef struct parse_node {
struct parse_node *parent;
struct parse_node *left;
struct parse_node *right;
int value;
int done;
#ifdef DEBUG_INCLUDE
int dump_done;
#endif
} parse_node_t;
typedef struct {
const char *source;
const char *rexp;
} backref_t;
typedef char *(*string_func_t)(request_rec*, const char*);
/**
* Parse an expression into a parse tree
* @param pool Pool
* @param expr The expression to parse
* @param was_error On return, set to zero if parse successful, nonzero on error
* @return The parse tree
*/
int *was_error);
/**
* Evaluate a parse tree
* @param r The current request
* @param root The root node of the parse tree
* @param was_error On return, set to zero if parse successful, nonzero on error
* @param reptr Regular expression memory for backreferencing if a regexp was parsed
* @param string_func String parser function - perform variable substitutions
* @param eval_func Option evaluation function (e.g. -A filename)
* @return the value the expression parsed to
*/
/**
* Evaluate an expression
* @param r The current request
* @param expr The expression to parse
* @param was_error On return, set to zero if parse successful, nonzero on error
* @param reptr Regular expression memory for backreferencing if a regexp was parsed
* @param string_func String parser function - perform variable substitutions
* @param eval_func Option evaluation function (e.g. -A filename)
* @return the value the expression parsed to
*/