dynwatch
diff 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 diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/config_parser.h Wed May 18 05:53:29 2011 +0300 1.3 @@ -0,0 +1,57 @@ 1.4 +/* 1.5 +This file is part of dynwatch, a win32 system tray applet which 1.6 +updates automatically the dyndns entry of quake.gr. 1.7 + 1.8 +Copyright (c) 2005 John Tsiombikas <nuclear@siggraph.org> 1.9 + 1.10 +This program is free software; you can redistribute it and/or modify 1.11 +it under the terms of the GNU General Public License as published by 1.12 +the Free Software Foundation; either version 2 of the License, or 1.13 +(at your option) any later version. 1.14 + 1.15 +This program is distributed in the hope that it will be useful, 1.16 +but WITHOUT ANY WARRANTY; without even the implied warranty of 1.17 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1.18 +GNU General Public License for more details. 1.19 + 1.20 +You should have received a copy of the GNU General Public License 1.21 +along with this program; if not, write to the Free Software 1.22 +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 1.23 +*/ 1.24 +#ifndef _CONFIG_PARSER_H_ 1.25 +#define _CONFIG_PARSER_H_ 1.26 + 1.27 + 1.28 +#ifdef __cplusplus 1.29 +extern "C" { 1.30 +#endif /* _cplusplus */ 1.31 + 1.32 + 1.33 +enum ParserState { 1.34 + PS_AssignmentSymbol, 1.35 + PS_CommentSymbol, 1.36 + PS_Seperators, 1.37 + PS_MaxLineLen 1.38 +}; 1.39 + 1.40 +#define CFGOPT_INT 1 1.41 +#define CFGOPT_FLT 2 1.42 + 1.43 +struct ConfigOption { 1.44 + char *option, *str_value; 1.45 + int int_value; 1.46 + float flt_value; 1.47 + unsigned short flags; 1.48 +}; 1.49 + 1.50 +void SetParserState(enum ParserState state, int value); 1.51 +int LoadConfigFile(const char *fname); 1.52 +const struct ConfigOption *GetNextOption(); 1.53 +void DestroyConfigParser(); 1.54 + 1.55 + 1.56 +#ifdef __cplusplus 1.57 +} 1.58 +#endif /* _cplusplus */ 1.59 + 1.60 +#endif /* _CONFIG_PARSER_H_ */