/* config-ini.h -- INI config file parser header
   This file is part of Redshift.

   Redshift 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 3 of the License, or
   (at your option) any later version.

   Redshift 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 Redshift.  If not, see <http://www.gnu.org/licenses/>.

   Copyright (c) 2010  Jon Lund Steffensen <jonlst@gmail.com>
*/

#ifndef REDSHIFT_CONFIG_INI_H
#define REDSHIFT_CONFIG_INI_H

struct config_ini_setting {
	struct config_ini_setting *next;
	char *name;
	char *value;
};

struct config_ini_section {
	struct config_ini_section *next;
	char *name;
	struct config_ini_setting *settings;
};

struct config_ini_state {
	struct config_ini_section *sections;
};


int config_ini_init(struct config_ini_state *state, const char *filepath);
void config_ini_free(struct config_ini_state *state);

struct config_ini_section *config_ini_get_section(struct config_ini_state *state, const char *name);

#endif /* ! REDSHIFT_CONFIG_INI_H */