xref: /dragonfly/usr.bin/dfregress/parser.h (revision 6d08986d)
1a563ca70SAlex Hornung  /*
2a563ca70SAlex Hornung  * Copyright (c) 2009-2011 Alex Hornung <alex@alexhornung.com>.
3a563ca70SAlex Hornung  * All rights reserved.
4a563ca70SAlex Hornung  *
5a563ca70SAlex Hornung  * Redistribution and use in source and binary forms, with or without
6a563ca70SAlex Hornung  * modification, are permitted provided that the following conditions
7a563ca70SAlex Hornung  * are met:
8a563ca70SAlex Hornung  *
9a563ca70SAlex Hornung  * 1. Redistributions of source code must retain the above copyright
10a563ca70SAlex Hornung  *    notice, this list of conditions and the following disclaimer.
11a563ca70SAlex Hornung  * 2. Redistributions in binary form must reproduce the above copyright
12a563ca70SAlex Hornung  *    notice, this list of conditions and the following disclaimer in
13a563ca70SAlex Hornung  *    the documentation and/or other materials provided with the
14a563ca70SAlex Hornung  *    distribution.
15a563ca70SAlex Hornung  *
16a563ca70SAlex Hornung  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17a563ca70SAlex Hornung  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18a563ca70SAlex Hornung  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
19a563ca70SAlex Hornung  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
20a563ca70SAlex Hornung  * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21a563ca70SAlex Hornung  * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
22a563ca70SAlex Hornung  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23a563ca70SAlex Hornung  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24a563ca70SAlex Hornung  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25a563ca70SAlex Hornung  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26a563ca70SAlex Hornung  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27a563ca70SAlex Hornung  * SUCH DAMAGE.
28a563ca70SAlex Hornung  */
29a563ca70SAlex Hornung 
30a563ca70SAlex Hornung typedef void (*parser_t)(void *, char **);
31a563ca70SAlex Hornung 
32*6d08986dSSascha Wildner void syntax_error(const char *, ...) __dead2 __printflike(1, 2);
33a563ca70SAlex Hornung int entry_check_num_args(char **tokens, int num);
34a563ca70SAlex Hornung int parse_options(char *str, char **options);
35a563ca70SAlex Hornung int process_file(const char *file, parser_t parser, void *arg, int *nlines);
36