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
17/**
18 * @verbatim
19                        _             _
20    _ __ ___   ___   __| |    ___ ___| |  mod_ssl
21   | '_ ` _ \ / _ \ / _` |   / __/ __| |  Apache Interface to OpenSSL
22   | | | | | | (_) | (_| |   \__ \__ \ |
23   |_| |_| |_|\___/ \__,_|___|___/___/_|
24                        |_____|
25 @endverbatim
26 *  @file  ssl_expr.h
27 *  @brief Expression Handling (Header).
28 *         ``May all your PUSHes be POPed.''
29 *
30 * @defgroup MOD_SSL_EXPR Expression Handling
31 * @ingroup MOD_SSL
32 * @{
33 */
34
35#ifndef __SSL_EXPR_H__
36#define __SSL_EXPR_H__
37
38#ifndef FALSE
39#define FALSE 0
40#endif
41
42#ifndef TRUE
43#define TRUE !FALSE
44#endif
45
46#ifndef YY_NULL
47#define YY_NULL 0
48#endif
49
50#ifndef MIN
51#define MIN(a,b) (((a)<(b))?(a):(b))
52#endif
53
54#ifndef BOOL
55#define BOOL unsigned int
56#endif
57
58#ifndef NULL
59#define NULL (void *)0
60#endif
61
62#ifndef NUL
63#define NUL '\0'
64#endif
65
66#ifndef YYDEBUG
67#define YYDEBUG 0
68#endif
69
70typedef enum {
71    op_NOP, op_ListElement, op_OidListElement,
72    op_True, op_False, op_Not, op_Or, op_And, op_Comp,
73    op_EQ, op_NE, op_LT, op_LE, op_GT, op_GE, op_IN, op_REG, op_NRE,
74    op_Digit, op_String, op_Regex, op_Var, op_Func
75} ssl_expr_node_op;
76
77typedef struct {
78    ssl_expr_node_op node_op;
79    void *node_arg1;
80    void *node_arg2;
81    apr_pool_t *p;
82} ssl_expr_node;
83
84typedef ssl_expr_node ssl_expr;
85
86typedef struct {
87	apr_pool_t *pool;
88    char     *inputbuf;
89    int       inputlen;
90    char     *inputptr;
91    ssl_expr *expr;
92} ssl_expr_info_type;
93
94extern ssl_expr_info_type ssl_expr_info;
95extern char *ssl_expr_error;
96
97#define yylval  ssl_expr_yylval
98#define yyerror ssl_expr_yyerror
99#define yyinput ssl_expr_yyinput
100
101extern int ssl_expr_yyparse(void);
102extern int ssl_expr_yyerror(char *);
103extern int ssl_expr_yylex(void);
104
105extern ssl_expr *ssl_expr_comp(apr_pool_t *, char *);
106extern int       ssl_expr_exec(request_rec *, ssl_expr *);
107extern char     *ssl_expr_get_error(void);
108extern ssl_expr *ssl_expr_make(ssl_expr_node_op, void *, void *);
109extern BOOL      ssl_expr_eval(request_rec *, ssl_expr *);
110
111#endif /* __SSL_EXPR_H__ */
112/** @} */
113
114