From 1a56a2105cf1b3ca18a2e889bb1edcf4539bacf7 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 14 May 2020 09:16:33 +0200 Subject: libnm: add nm_setting_option_get_names() More general purpose API for generic options of settings. --- libnm-core/nm-core-internal.h | 3 --- libnm-core/nm-setting.c | 14 ++++++-------- libnm-core/nm-setting.h | 4 ++++ libnm/libnm.ver | 1 + 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libnm-core/nm-core-internal.h b/libnm-core/nm-core-internal.h index b1689da62e..9fe658c1c2 100644 --- a/libnm-core/nm-core-internal.h +++ b/libnm-core/nm-core-internal.h @@ -322,9 +322,6 @@ guint _nm_setting_option_get_all (NMSetting *setting, const char *const**out_names, GVariant *const**out_values); -const char *const*_nm_setting_option_get_all_names (NMSetting *setting, - guint *out_len); - gboolean _nm_setting_option_clear (NMSetting *setting, const char *optname); diff --git a/libnm-core/nm-setting.c b/libnm-core/nm-setting.c index 98d9d9498f..a99a46b0ea 100644 --- a/libnm-core/nm-setting.c +++ b/libnm-core/nm-setting.c @@ -2482,24 +2482,22 @@ out_zero: } /** - * _nm_setting_option_get_all_names: + * nm_setting_option_get_all_names: * @setting: the #NMSetting * @out_len: (allow-none) (out): * - * Gives the number of generic data elements and optionally returns all their - * key names and values. This API is low level access and unless you know what you - * are doing, it might not be what you want. + * Gives the name of all set options. * * Returns: (array length=out_len zero-terminated=1) (transfer none): * A %NULL terminated array of key names. If no names are present, this returns * %NULL. The returned array and the names are owned by %NMSetting and might be invalidated - * soon. + * by the next operation. * - * Since: 1.14 + * Since: 1.26 **/ const char *const* -_nm_setting_option_get_all_names (NMSetting *setting, - guint *out_len) +nm_setting_option_get_all_names (NMSetting *setting, + guint *out_len) { const char *const*names; guint len; diff --git a/libnm-core/nm-setting.h b/libnm-core/nm-setting.h index 27e9208e6f..a3a732218e 100644 --- a/libnm-core/nm-setting.h +++ b/libnm-core/nm-setting.h @@ -362,6 +362,10 @@ void nm_setting_option_set_boolean (NMSetting *setting, const char *opt_name, gboolean value); +NM_AVAILABLE_IN_1_26 +const char *const*nm_setting_option_get_all_names (NMSetting *setting, + guint *out_len); + /*****************************************************************************/ const GVariantType *nm_setting_get_dbus_property_type (NMSetting *setting, diff --git a/libnm/libnm.ver b/libnm/libnm.ver index b1abdc257d..5a3c5eeeac 100644 --- a/libnm/libnm.ver +++ b/libnm/libnm.ver @@ -1733,6 +1733,7 @@ global: nm_setting_match_remove_kernel_command_line; nm_setting_match_remove_kernel_command_line_by_value; nm_setting_option_get; + nm_setting_option_get_all_names; nm_setting_option_get_boolean; nm_setting_option_get_uint32; nm_setting_option_set; -- cgit v1.2.1