summaryrefslogtreecommitdiff
path: root/src/settings/nm-settings.h
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-05-17 11:03:53 +0200
committerThomas Haller <thaller@redhat.com>2016-05-24 12:35:58 +0200
commit6e54057bf754d9311e42d92956feb9b1036ca654 (patch)
tree2008d0784759d9cff9ba3f1cc44ac4f393f408ad /src/settings/nm-settings.h
parentb4e8ce876d7d26eb61c9a89bbcb4193b71aebfc2 (diff)
downloadNetworkManager-6e54057bf754d9311e42d92956feb9b1036ca654.tar.gz
settings: add nm_settings_get_connections()
This will replace nm_connection_provider_get_connections(), but has a different API. Instead of returning a (const) GSList list, it returns a (cached) NULL terminated array. The reason for this change is simply that I find arrays more convenient to use (in this case) and it doesn't have the overhead of a GSList instance per entry. Like with nm_connection_provider_get_connections(), cache the result internally. This for one is more convenient for the caller, which doesn't need to free the result. On the other hand, the list of connections is fairly static, this allows us to reuse the same list.
Diffstat (limited to 'src/settings/nm-settings.h')
-rw-r--r--src/settings/nm-settings.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/settings/nm-settings.h b/src/settings/nm-settings.h
index 417cfeb9f5..c855d3a842 100644
--- a/src/settings/nm-settings.h
+++ b/src/settings/nm-settings.h
@@ -89,9 +89,8 @@ void nm_settings_add_connection_dbus (NMSettings *self,
NMSettingsAddCallback callback,
gpointer user_data);
-/* Returns a list of NMSettingsConnections. Caller must free the list with
- * g_slist_free().
- */
+NMSettingsConnection *const* nm_settings_get_connections (NMSettings *settings, guint *out_len);
+
GSList *nm_settings_get_connections_sorted (NMSettings *settings);
NMSettingsConnection *nm_settings_add_connection (NMSettings *settings,