1 /**
2 * oconfig - src/utils.h
3 * Copyright (C) 2012 2012 Sebastian 'tokkee' Harl <sh@tokkee.org>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; only version 2 of the License is applicable.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
19 #ifndef OCONFIG_UTILS_H
20 #define OCONFIG_UTILS_H 1
22 #include "liboconfig/oconfig.h"
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
28 /* oconfig_get_<type>:
29 * Checks if the specified item has exactly one value of the respective type
30 * and returns that value through the appropriate parameter.
31 *
32 * Returns:
33 * - 0 on success
34 * - a negative value else
35 */
36 int
37 oconfig_get_string(oconfig_item_t *ci, char **value);
38 int
39 oconfig_get_number(oconfig_item_t *ci, double *value);
40 int
41 oconfig_get_boolean(oconfig_item_t *ci, _Bool *value);
43 #ifdef __cplusplus
44 } /* extern "C" */
45 #endif
47 #endif /* OCONFIG_UTILS_H */
49 /* vim: set tw=78 sw=4 ts=4 noexpandtab : */