1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* NetworkManager system settings service
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 * (C) Copyright 2010-2015 Red Hat, Inc.
21 #ifndef __NM_KEYFILE_UTILS_H__
22 #define __NM_KEYFILE_UTILS_H__
26 #define NM_KEYFILE_GROUP_VPN_SECRETS "vpn-secrets"
28 const char *nm_keyfile_plugin_get_alias_for_setting_name (const char *setting_name);
30 const char *nm_keyfile_plugin_get_setting_name_for_alias (const char *alias);
32 /*********************************************************/
35 #define DEFINE_KF_LIST_WRAPPER_PROTO(stype, get_ctype, set_ctype) \
36 get_ctype nm_keyfile_plugin_kf_get_##stype##_list (GKeyFile *kf, \
42 void nm_keyfile_plugin_kf_set_##stype##_list (GKeyFile *kf, \
47 DEFINE_KF_LIST_WRAPPER_PROTO(integer, gint*, gint)
48 DEFINE_KF_LIST_WRAPPER_PROTO(string, gchar**, const gchar* const)
50 /* Single-value helpers */
51 #define DEFINE_KF_WRAPPER_PROTO(stype, get_ctype, set_ctype) \
52 get_ctype nm_keyfile_plugin_kf_get_##stype (GKeyFile *kf, \
57 void nm_keyfile_plugin_kf_set_##stype (GKeyFile *kf, \
61 DEFINE_KF_WRAPPER_PROTO(string, gchar*, const gchar*)
62 DEFINE_KF_WRAPPER_PROTO(integer, gint, gint)
63 DEFINE_KF_WRAPPER_PROTO(uint64, guint64, guint64)
64 DEFINE_KF_WRAPPER_PROTO(boolean, gboolean, gboolean)
65 DEFINE_KF_WRAPPER_PROTO(value, gchar*, const gchar*)
68 gchar ** nm_keyfile_plugin_kf_get_keys (GKeyFile *kf,
73 gboolean nm_keyfile_plugin_kf_has_key (GKeyFile *kf,
78 #endif /* __NM_KEYFILE_UTILS_H__ */