sel.h revision 285830
1259694Spfg/*
2259694Spfg * Copyright (c) 2008 Kungliga Tekniska H��gskolan
3259694Spfg * (Royal Institute of Technology, Stockholm, Sweden).
4259694Spfg * All rights reserved.
5259694Spfg *
6259694Spfg * Redistribution and use in source and binary forms, with or without
7259694Spfg * modification, are permitted provided that the following conditions
8259694Spfg * are met:
9259694Spfg *
10260074Spfg * 1. Redistributions of source code must retain the above copyright
11260074Spfg *    notice, this list of conditions and the following disclaimer.
12260074Spfg *
13260074Spfg * 2. Redistributions in binary form must reproduce the above copyright
14260074Spfg *    notice, this list of conditions and the following disclaimer in the
15260074Spfg *    documentation and/or other materials provided with the distribution.
16260074Spfg *
17258428Spfg * 3. Neither the name of the Institute nor the names of its contributors
18258428Spfg *    may be used to endorse or promote products derived from this software
19258428Spfg *    without specific prior written permission.
20258428Spfg *
21258428Spfg * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22258428Spfg * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23258428Spfg * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24258428Spfg * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25258428Spfg * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26258428Spfg * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27258428Spfg * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28259947Spfg * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29259947Spfg * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30259947Spfg * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31259947Spfg * SUCH DAMAGE.
32259947Spfg */
33259947Spfg
34259947Spfgenum hx_expr_op {
35259947Spfg    op_TRUE,
36260230Spfg    op_FALSE,
37260230Spfg    op_NOT,
38260230Spfg    op_AND,
39260230Spfg    op_OR,
40260230Spfg    op_COMP,
41260230Spfg
42259694Spfg    comp_EQ,
43259694Spfg    comp_NE,
44259694Spfg    comp_IN,
45259694Spfg    comp_TAILEQ,
46259694Spfg
47259694Spfg    expr_NUMBER,
48259694Spfg    expr_STRING,
49258428Spfg    expr_FUNCTION,
50258428Spfg    expr_VAR,
51258428Spfg    expr_WORDS
52258428Spfg};
53260074Spfg
54258428Spfgstruct hx_expr {
55260074Spfg    enum hx_expr_op	op;
56260074Spfg    void		*arg1;
57260074Spfg    void		*arg2;
58260074Spfg};
59260074Spfg
60260074Spfgstruct hx_expr_input {
61260074Spfg    const char *buf;
62260074Spfg    size_t length;
63260074Spfg    size_t offset;
64258428Spfg    struct hx_expr *expr;
65258428Spfg    char *error;
66258428Spfg};
67258428Spfg
68258428Spfgextern struct hx_expr_input _hx509_expr_input;
69260074Spfg
70259584Spfg#define yyparse _hx509_sel_yyparse
71259584Spfg#define yylex   _hx509_sel_yylex
72259584Spfg#define yyerror _hx509_sel_yyerror
73259584Spfg#define yylval  _hx509_sel_yylval
74259584Spfg#define yychar  _hx509_sel_yychar
75260139Spfg#define yydebug _hx509_sel_yydebug
76260139Spfg#define yynerrs _hx509_sel_yynerrs
77260139Spfg#define yywrap  _hx509_sel_yywrap
78260139Spfg
79260139Spfgint  _hx509_sel_yyparse(void);
80260139Spfgint  _hx509_sel_yylex(void);
81260139Spfgvoid _hx509_sel_yyerror(const char *);
82260139Spfg
83260139Spfg