From 58f8be580039b0575b197b9573a1c92745d96d30 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Tue, 17 Jan 2017 20:25:09 +0100 Subject: New upstream version 1.5.90 --- libnm-core/nm-keyfile-utils.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'libnm-core/nm-keyfile-utils.c') diff --git a/libnm-core/nm-keyfile-utils.c b/libnm-core/nm-keyfile-utils.c index bdd18bab..13cf6161 100644 --- a/libnm-core/nm-keyfile-utils.c +++ b/libnm-core/nm-keyfile-utils.c @@ -68,7 +68,7 @@ nm_keyfile_plugin_get_setting_name_for_alias (const char *alias) return NULL; } -/**********************************************************************/ +/*****************************************************************************/ /* List helpers */ #define DEFINE_KF_LIST_WRAPPER(stype, get_ctype, set_ctype) \ @@ -112,6 +112,30 @@ nm_keyfile_plugin_kf_set_##stype##_list (GKeyFile *kf, \ DEFINE_KF_LIST_WRAPPER(integer, gint*, gint); DEFINE_KF_LIST_WRAPPER(string, gchar **, const gchar* const); +void +nm_keyfile_plugin_kf_set_integer_list_uint8 (GKeyFile *kf, + const char *group, + const char *key, + const guint8 *data, + gsize length) +{ + gsize i; + gsize l = length * 4 + 2; + gs_free char *value = g_malloc (l); + char *s = value; + + g_return_if_fail (kf); + g_return_if_fail (!length || data); + g_return_if_fail (group && group[0]); + g_return_if_fail (key && key[0]); + + value[0] = '\0'; + for (i = 0; i < length; i++) + nm_utils_strbuf_append (&s, &l, "%d;", (int) data[i]); + nm_assert (l > 0); + nm_keyfile_plugin_kf_set_value (kf, group, key, value); +} + /* Single value helpers */ #define DEFINE_KF_WRAPPER(stype, get_ctype, set_ctype) \ get_ctype \ @@ -202,7 +226,7 @@ nm_keyfile_plugin_kf_has_key (GKeyFile *kf, return has; } -/************************************************************************/ +/*****************************************************************************/ void _nm_keyfile_copy (GKeyFile *dst, GKeyFile *src) @@ -232,7 +256,7 @@ _nm_keyfile_copy (GKeyFile *dst, GKeyFile *src) } } -/************************************************************************/ +/*****************************************************************************/ gboolean _nm_keyfile_a_contains_all_in_b (GKeyFile *kf_a, GKeyFile *kf_b) -- cgit 1.3.0-6-gf8a5