Annotation of embedaddon/strongswan/src/libcharon/plugins/uci/uci_parser.h, revision 1.1.1.1
1.1 misho 1: /*
2: * Copyright (C) 2008 Martin Willi
3: * Copyright (C) 2008 Thomas Kallenberg
4: * HSR Hochschule fuer Technik Rapperswil
5: *
6: * This program is free software; you can redistribute it and/or modify it
7: * under the terms of the GNU General Public License as published by the
8: * Free Software Foundation; either version 2 of the License, or (at your
9: * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14: * for more details.
15: */
16:
17: /**
18: * @defgroup uci_parser_t uci_parser
19: * @{ @ingroup uci
20: */
21:
22: #ifndef UCI_PARSER_H_
23: #define UCI_PARSER_H_
24:
25: #include <collections/enumerator.h>
26:
27: typedef struct uci_parser_t uci_parser_t;
28:
29: /**
30: * Wrapper to parse UCI sections with an enumerator.
31: */
32: struct uci_parser_t {
33:
34: /**
35: * Create an enumerator over a section.
36: *
37: * The enumerator returns a section name followed by values for the keywords
38: * specified in the variable argument list of this function.
39: *
40: * @param ... variable argument list with keywords, NULL terminated
41: * @return enumerator over sections
42: */
43: enumerator_t* (*create_section_enumerator)(uci_parser_t *this, ...);
44:
45: /**
46: * Destroy the parser.
47: */
48: void (*destroy)(uci_parser_t *this);
49: };
50:
51: /**
52: * Create a UCI parser.
53: *
54: * @param package UCI package this parser should read
55: * @return parser context
56: */
57: uci_parser_t *uci_parser_create(char *package);
58:
59: #endif /** UCI_PARSER_H_ @}*/
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>