dynwatch

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