2 * Copyright (C) 2012,2013 Toni Gundogdu <legatvs@gmail.com>
4 * This file is part of quvi <http://quvi.sourceforge.net/>.
6 * This program is free software: you can redistribute it and/or
7 * modify it under the terms of the GNU Affero General Public
8 * License as published by the Free Software Foundation, either
9 * version 3 of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
16 * You should have received a copy of the GNU Affero General
17 * Public License along with this program. If not, see
18 * <http://www.gnu.org/licenses/>.
26 typedef void (*lopts_cb_parse_keyfile_values
)(GKeyFile
*,const gchar
*);
27 typedef gchar
*(*lopts_cb_get_config_fpath
)();
29 typedef gint (*lopts_cb_cmdline_validate_values
)();
30 typedef void (*lopts_cb_set_post_parse_defaults
)();
32 typedef gint (*lopts_cb_chk_ok_strv
)(const gchar
*,
37 typedef gint (*lopts_cb_chk_ok_re
)(const gchar
*,
41 typedef gint (*lopts_cb_chk_ok_str
)(const gchar
*,
46 typedef gint (*lopts_cb_chk_ok_int
)(const gchar
*,
54 const GOptionEntry
*entries
;
59 lopts_cb_cmdline_validate_values cmdline_validate_values
;
60 lopts_cb_set_post_parse_defaults set_post_parse_defaults
;
61 lopts_cb_parse_keyfile_values parse_keyfile_values
;
62 lopts_cb_get_config_fpath get_config_fpath
;
66 typedef struct lopts_s
*lopts_t
;
70 gint
lopts_new(lopts_t
);
72 gint
lopts_chk_strv(const gchar
**, const gchar
**, gchar
**);
73 gint
lopts_chk_str(const gchar
*, const gchar
**, gchar
**);
74 gint
lopts_chk_re(const gchar
**, gchar
**);
76 gchar
*lopts_keyfile_get_str(GKeyFile
*,
84 gchar
**lopts_keyfile_get_strv(GKeyFile
*,
92 gchar
**lopts_keyfile_get_re(GKeyFile
*,
100 gboolean
lopts_keyfile_get_bool(GKeyFile
*,
106 gint
lopts_keyfile_get_double(GKeyFile
*,
113 gint
lopts_keyfile_get_int(GKeyFile
*,
120 gint
lopts_invalid_value(const gchar
*, const gchar
*,
121 const gchar
*, const gchar
**);
123 void lopts_print_config_values(lopts_t
);
124 void lopts_print_config_paths(lopts_t
);
128 /* vim: set ts=2 sw=2 tw=72 expandtab: */