dynwatch

view config_parser.h @ 0:ce3c5e4c75bf

dynwatch DynDNS updater for windows
author John Tsiombikas <nuclear@siggraph.org>
date Wed, 18 May 2011 05:53:29 +0300
parents
children
line source
1 /*
2 This file is part of dynwatch, a win32 system tray applet which
3 updates automatically the dyndns entry of quake.gr.
5 Copyright (c) 2005 John Tsiombikas <nuclear@siggraph.org>
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21 #ifndef _CONFIG_PARSER_H_
22 #define _CONFIG_PARSER_H_
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* _cplusplus */
30 enum ParserState {
31 PS_AssignmentSymbol,
32 PS_CommentSymbol,
33 PS_Seperators,
34 PS_MaxLineLen
35 };
37 #define CFGOPT_INT 1
38 #define CFGOPT_FLT 2
40 struct ConfigOption {
41 char *option, *str_value;
42 int int_value;
43 float flt_value;
44 unsigned short flags;
45 };
47 void SetParserState(enum ParserState state, int value);
48 int LoadConfigFile(const char *fname);
49 const struct ConfigOption *GetNextOption();
50 void DestroyConfigParser();
53 #ifdef __cplusplus
54 }
55 #endif /* _cplusplus */
57 #endif /* _CONFIG_PARSER_H_ */