2 * configfile.h -- definitions for config file parsing
4 * Copyright (C) 2009 Steven Luo
5 * Derived from a Python implementation by Jason Simpson and Steven Luo
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 #define DEFAULT_HOMEDIR "/home/user"
29 #define CONFIGFILE_DIR "/.config/"
30 #define CONFIGFILE_NAME "browser-switchboard"
31 #define CONFIGFILE_NAME_OLD "browser-proxy"
32 #define CONFIGFILE_LOC CONFIGFILE_DIR CONFIGFILE_NAME
33 #define CONFIGFILE_LOC_OLD CONFIGFILE_DIR CONFIGFILE_NAME_OLD
35 struct swb_config_line {
36 /* Whether or not the line has been parsed */
38 /* If parsed, the config key; otherwise, the entire line */
40 /* If parsed, the config value */
44 FILE *open_config_file(void);
46 int parse_config_file_begin(void);
47 void parse_config_file_end(void);
48 int parse_config_file_line(FILE *fp, struct swb_config_line *line);
50 #endif /* _CONFIGFILE_H */