updated Doxyfile
[strongswan.git] / src / libstrongswan / utils / lexparser.h
1 /*
2 * Copyright (C) 2001-2008 Andreas Steffen
3 *
4 * 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 * $Id$
17 */
18
19 /**
20 * @defgroup lexparser lexparser
21 * @{ @ingroup utils
22 */
23
24 #ifndef LEXPARSER_H_
25 #define LEXPARSER_H_
26
27 #include <library.h>
28
29 /**
30 * Eats whitespace
31 */
32 bool eat_whitespace(chunk_t *src);
33
34 /**
35 * Compare null-terminated pattern with chunk
36 */
37 bool match(const char *pattern, const chunk_t *ch);
38
39 /**
40 * Extracts a token ending with the first occurrence of a given termination symbol
41 */
42 bool extract_token(chunk_t *token, const char termination, chunk_t *src);
43
44 /**
45 * Extracts a token ending with the first occurrence of a given null-terminated string
46 */
47 bool extract_token_str(chunk_t *token, const char *termination, chunk_t *src);
48
49 /**
50 * Fetches a new text line terminated by \\n or \\r\\n
51 */
52 bool fetchline(chunk_t *src, chunk_t *line);
53
54 /**
55 * Extracts a value that might be single or double quoted
56 */
57 err_t extract_value(chunk_t *value, chunk_t *line);
58
59 /**
60 * extracts a name: value pair from a text line
61 */
62 err_t extract_name_value(chunk_t *name, chunk_t *value, chunk_t *line);
63
64 /**
65 * extracts a parameter: value from a text line
66 */
67 err_t extract_parameter_value(chunk_t *name, chunk_t *value, chunk_t *line);
68
69 #endif /** LEXPARSER_H_ @}*/