Annotation of embedaddon/strongswan/src/libstrongswan/utils/lexparser.h, revision 1.1.1.1

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>