summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-09-02 17:28:27 +0200
committerThomas Haller <thaller@redhat.com>2020-09-02 17:46:43 +0200
commit63f304ad5876208a7c9c100ea43a243b7893c345 (patch)
tree6bc4debae3691d64f7a27db2851c8d7b3c7f5275
parent715392a45e22791d54496916c8b01079776aa513 (diff)
downloadNetworkManager-63f304ad5876208a7c9c100ea43a243b7893c345.tar.gz
shared: add "nm_auto*" macros as future replacements for "gs_*" cleanup macros
We still use the "gs_*" macros that we originally got from libgsystem. libgsystem no longer exists, we only still use the names of these macros. Our own cleanup macros all follow the "nm_auto*" naming pattern. Eventually, we want to replace all uses of "gs_*" with cleanup macros that follow our naming scheme. Add the macros that will be used to replace the "gs_*" macros.
-rw-r--r--shared/nm-glib-aux/nm-macros-internal.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/shared/nm-glib-aux/nm-macros-internal.h b/shared/nm-glib-aux/nm-macros-internal.h
index 4078871461..2b7c1bbfa1 100644
--- a/shared/nm-glib-aux/nm-macros-internal.h
+++ b/shared/nm-glib-aux/nm-macros-internal.h
@@ -151,6 +151,39 @@ NM_AUTO_DEFINE_FCN0 (GKeyFile *, gs_local_keyfile_unref, g_key_file_unref);
/*****************************************************************************/
+NM_AUTO_DEFINE_FCN_VOID0 (void *, _nm_auto_g_free, g_free);
+#define nm_auto_g_free nm_auto(_nm_auto_g_free)
+
+NM_AUTO_DEFINE_FCN_VOID0 (GObject *, _nm_auto_unref_object, g_object_unref);
+#define nm_auto_unref_object nm_auto(_nm_auto_unref_object)
+
+NM_AUTO_DEFINE_FCN0 (GVariant *, _nm_auto_unref_variant, g_variant_unref);
+#define nm_auto_unref_variant nm_auto(_nm_auto_unref_variant)
+
+NM_AUTO_DEFINE_FCN0 (GArray *, _nm_auto_unref_array, g_array_unref);
+#define nm_auto_unref_array nm_auto(_nm_auto_unref_array)
+
+NM_AUTO_DEFINE_FCN0 (GPtrArray *, _nm_auto_unref_ptrarray, g_ptr_array_unref);
+#define nm_auto_unref_ptrarray nm_auto(_nm_auto_unref_ptrarray)
+
+NM_AUTO_DEFINE_FCN0 (GHashTable *, _nm_auto_unref_hashtable, g_hash_table_unref);
+#define nm_auto_unref_hashtable nm_auto(_nm_auto_unref_hashtable)
+
+NM_AUTO_DEFINE_FCN0 (GSList *, _nm_auto_free_slist, g_slist_free);
+#define nm_auto_free_slist nm_auto(_nm_auto_free_slist)
+
+NM_AUTO_DEFINE_FCN0 (GBytes *, _nm_auto_unref_bytes, g_bytes_unref);
+#define nm_auto_unref_bytes nm_auto(_nm_auto_unref_bytes)
+
+NM_AUTO_DEFINE_FCN0 (char **, _nm_auto_strfreev, g_strfreev);
+#define nm_auto_strfreev nm_auto(_nm_auto_strfreev)
+
+NM_AUTO_DEFINE_FCN0 (GError *, _nm_auto_free_error, g_error_free);
+#define nm_auto_free_error nm_auto(_nm_auto_free_error)
+
+NM_AUTO_DEFINE_FCN0 (GKeyFile *, _nm_auto_unref_keyfile, g_key_file_unref);
+#define nm_auto_unref_keyfile nm_auto(_nm_auto_unref_keyfile)
+
NM_AUTO_DEFINE_FCN0 (GVariantIter *, _nm_auto_free_variant_iter, g_variant_iter_free);
#define nm_auto_free_variant_iter nm_auto(_nm_auto_free_variant_iter)