2006-01-24 18:41:05 -05:00
|
|
|
/*
|
|
|
|
* $Id$
|
|
|
|
* Functions for reading and writing the config file
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Ron Pedde (ron@pedde.com)
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _CONFIG_H_
|
|
|
|
#define _CONFIG_H_
|
|
|
|
|
2006-02-08 18:02:43 -05:00
|
|
|
#define CONF_E_SUCCESS 0
|
|
|
|
#define CONF_E_FOPEN 1
|
|
|
|
#define CONF_E_UNKNOWN 2
|
|
|
|
#define CONF_E_BADHEADER 3
|
|
|
|
#define CONF_E_PARSE 4
|
2006-02-04 19:22:46 -05:00
|
|
|
|
2006-01-25 17:31:53 -05:00
|
|
|
|
2006-01-24 18:41:05 -05:00
|
|
|
extern int config_read(char *file);
|
|
|
|
extern int config_close(void);
|
2006-02-19 22:56:47 -05:00
|
|
|
extern int config_get_int(char *section, char *key, int default);
|
|
|
|
extern int config_get_string(char *section, char *key, char *default,
|
|
|
|
char *out, int size);
|
2006-01-24 18:41:05 -05:00
|
|
|
|
|
|
|
#endif /* _CONFIG_H_ */
|