1118611Snjl/*	$NetBSD: sel.h,v 1.1.1.1 2011/04/13 18:15:12 elric Exp $	*/
2118611Snjl
3245582Sjkim/*
4118611Snjl * Copyright (c) 2008 Kungliga Tekniska H��gskolan
5118611Snjl * (Royal Institute of Technology, Stockholm, Sweden).
6118611Snjl * All rights reserved.
7217365Sjkim *
8245582Sjkim * Redistribution and use in source and binary forms, with or without
9118611Snjl * modification, are permitted provided that the following conditions
10118611Snjl * are met:
11217365Sjkim *
12217365Sjkim * 1. Redistributions of source code must retain the above copyright
13217365Sjkim *    notice, this list of conditions and the following disclaimer.
14217365Sjkim *
15217365Sjkim * 2. Redistributions in binary form must reproduce the above copyright
16217365Sjkim *    notice, this list of conditions and the following disclaimer in the
17217365Sjkim *    documentation and/or other materials provided with the distribution.
18217365Sjkim *
19217365Sjkim * 3. Neither the name of the Institute nor the names of its contributors
20217365Sjkim *    may be used to endorse or promote products derived from this software
21217365Sjkim *    without specific prior written permission.
22217365Sjkim *
23217365Sjkim * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
24217365Sjkim * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25118611Snjl * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26217365Sjkim * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
27217365Sjkim * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28217365Sjkim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29118611Snjl * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30217365Sjkim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31217365Sjkim * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32217365Sjkim * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33217365Sjkim * SUCH DAMAGE.
34217365Sjkim */
35217365Sjkim
36217365Sjkimenum hx_expr_op {
37217365Sjkim    op_TRUE,
38217365Sjkim    op_FALSE,
39217365Sjkim    op_NOT,
40217365Sjkim    op_AND,
41217365Sjkim    op_OR,
42217365Sjkim    op_COMP,
43118611Snjl
44118611Snjl    comp_EQ,
45151937Sjkim    comp_NE,
46118611Snjl    comp_IN,
47193529Sjkim    comp_TAILEQ,
48193529Sjkim
49193529Sjkim    expr_NUMBER,
50193529Sjkim    expr_STRING,
51118611Snjl    expr_FUNCTION,
52118611Snjl    expr_VAR,
53118611Snjl    expr_WORDS
54118611Snjl};
55118611Snjl
56151937Sjkimstruct hx_expr {
57118611Snjl    enum hx_expr_op	op;
58151937Sjkim    void		*arg1;
59167802Sjkim    void		*arg2;
60167802Sjkim};
61167802Sjkim
62167802Sjkimstruct hx_expr_input {
63167802Sjkim    const char *buf;
64151937Sjkim    size_t length;
65212761Sjkim    size_t offset;
66193529Sjkim    struct hx_expr *expr;
67193529Sjkim    char *error;
68193529Sjkim};
69193529Sjkim
70118611Snjlextern struct hx_expr_input _hx509_expr_input;
71118611Snjl
72245582Sjkim#if !defined(yylex)
73118611Snjl#define yylex   _hx509_sel_yylex
74245582Sjkim#define yywrap  _hx509_sel_yywrap
75118611Snjl#endif
76193529Sjkim#if !defined(yyparse)
77193529Sjkim#define yyparse _hx509_sel_yyparse
78245582Sjkim#define yyerror _hx509_sel_yyerror
79245582Sjkim#define yylval  _hx509_sel_yylval
80245582Sjkim#define yychar  _hx509_sel_yychar
81193529Sjkim#define yydebug _hx509_sel_yydebug
82193529Sjkim#define yynerrs _hx509_sel_yynerrs
83193529Sjkim#endif
84167802Sjkim
85245582Sjkimint  _hx509_sel_yyparse(void);
86118611Snjlint  _hx509_sel_yylex(void);
87118611Snjlvoid _hx509_sel_yyerror(char *);
88118611Snjl
89245582Sjkim