diff options
author | Dan Winship <danw@redhat.com> | 2015-04-16 12:34:55 -0400 |
---|---|---|
committer | Dan Winship <danw@redhat.com> | 2015-08-10 09:41:26 -0400 |
commit | 1cf35cb26b6cc04f8b2c51c3cde4bc08ef311062 (patch) | |
tree | 4d237cb0792d871ba87bee87d71832d126162538 /libnm-util | |
parent | 34ba4e14b8674dc74327975159e101710ebd5403 (diff) | |
download | NetworkManager-1cf35cb26b6cc04f8b2c51c3cde4bc08ef311062.tar.gz |
core: final gdbus porting
Port remaining bits to gdbus and remove stray dbus-glib references
Drop the dbus-glib version check from configure, since nothing depends
on new dbus-glib any more.
Move nm-dbus-glib-types.h and nm-gvaluearray-compat.h from include/ to
libnm-util/ since they are now only used by libnm-util and libnm-glib.
Diffstat (limited to 'libnm-util')
-rw-r--r-- | libnm-util/Makefile.am | 6 | ||||
-rw-r--r-- | libnm-util/nm-dbus-glib-types.h | 45 | ||||
-rw-r--r-- | libnm-util/nm-gvaluearray-compat.h | 104 | ||||
-rw-r--r-- | libnm-util/nm-param-spec-specialized.c | 1 | ||||
-rw-r--r-- | libnm-util/nm-utils.c | 1 | ||||
-rw-r--r-- | libnm-util/nm-value-transforms.c | 1 | ||||
-rw-r--r-- | libnm-util/tests/test-general.c | 1 |
7 files changed, 157 insertions, 2 deletions
diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am index d7d3ba8206..14c6ccacb6 100644 --- a/libnm-util/Makefile.am +++ b/libnm-util/Makefile.am @@ -62,9 +62,11 @@ nodist_libnm_util_include_HEADERS = \ libnm_util_la_private_headers = \ crypto.h \ + nm-dbus-glib-types.h \ + nm-gvaluearray-compat.h \ nm-param-spec-specialized.h \ - nm-utils-private.h \ - nm-setting-private.h + nm-setting-private.h \ + nm-utils-private.h libnm_util_la_csources = \ crypto.c \ diff --git a/libnm-util/nm-dbus-glib-types.h b/libnm-util/nm-dbus-glib-types.h new file mode 100644 index 0000000000..ad11ab6812 --- /dev/null +++ b/libnm-util/nm-dbus-glib-types.h @@ -0,0 +1,45 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright 2008 Red Hat, Inc. + */ + +#ifndef __NM_DBUS_GLIB_TYPES_H__ +#define __NM_DBUS_GLIB_TYPES_H__ + +#include <dbus/dbus-glib.h> + +#define DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH)) +#define DBUS_TYPE_G_ARRAY_OF_STRING (dbus_g_type_get_collection ("GPtrArray", G_TYPE_STRING)) +#define DBUS_TYPE_G_ARRAY_OF_UINT (dbus_g_type_get_collection ("GArray", G_TYPE_UINT)) +#define DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_UCHAR_ARRAY)) +#define DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_ARRAY_OF_UINT)) +#define DBUS_TYPE_G_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)) +#define DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, DBUS_TYPE_G_MAP_OF_VARIANT)) +#define DBUS_TYPE_G_MAP_OF_STRING (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING)) +#define DBUS_TYPE_G_LIST_OF_STRING (dbus_g_type_get_collection ("GSList", G_TYPE_STRING)) + +#define DBUS_TYPE_G_IP6_ADDRESS (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_INVALID)) +#define DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_IP6_ADDRESS)) +#define DBUS_TYPE_G_IP6_ROUTE (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, G_TYPE_INVALID)) +#define DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_IP6_ROUTE)) + +#define DBUS_TYPE_NM_IP_ADDRESS DBUS_TYPE_G_MAP_OF_VARIANT +#define DBUS_TYPE_NM_IP_ADDRESSES (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_NM_IP_ADDRESS)) +#define DBUS_TYPE_NM_IP_ROUTE DBUS_TYPE_G_MAP_OF_VARIANT +#define DBUS_TYPE_NM_IP_ROUTES (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_NM_IP_ROUTE)) + +#endif /* __NM_DBUS_GLIB_TYPES_H__ */ diff --git a/libnm-util/nm-gvaluearray-compat.h b/libnm-util/nm-gvaluearray-compat.h new file mode 100644 index 0000000000..424e6be78d --- /dev/null +++ b/libnm-util/nm-gvaluearray-compat.h @@ -0,0 +1,104 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright 2013 Red Hat, Inc. + */ + +#ifndef __NM_GVALUEARRAY_COMPAT_H__ +#define __NM_GVALUEARRAY_COMPAT_H__ + +#define g_value_array_get_type() \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_get_type (); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +#define g_value_array_get_nth(value_array, index_) \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_get_nth (value_array, index_); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +#define g_value_array_new(n_prealloced) \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_new (n_prealloced); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +static inline void +__g_value_array_free (GValueArray *value_array) +{ + G_GNUC_EXTENSION ({ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + g_value_array_free (value_array); + G_GNUC_END_IGNORE_DEPRECATIONS + }); +} +#define g_value_array_free __g_value_array_free + +#define g_value_array_copy(value_array) \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_copy (value_array); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +#define g_value_array_prepend(value_array, value) \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_prepend (value_array, value); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +#define g_value_array_append(value_array, value) \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_append (value_array, value); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +#define g_value_array_insert(value_array, index_, value) \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_insert (value_array, index_, value); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +#define g_value_array_remove(value_array, index_) \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_remove (value_array, index_); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +#define g_value_array_sort(value_array, compare_func) \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_sort (value_array, compare_func); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +#define g_value_array_sort_with_data(value_array, compare_func, user_data) \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_sort_with_data (value_array, compare_func, user_data); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +#endif /* __NM_GVALUEARRAY_COMPAT_H__ */ diff --git a/libnm-util/nm-param-spec-specialized.c b/libnm-util/nm-param-spec-specialized.c index 50903b067d..7f242acfca 100644 --- a/libnm-util/nm-param-spec-specialized.c +++ b/libnm-util/nm-param-spec-specialized.c @@ -23,6 +23,7 @@ #include "config.h" #include "nm-default.h" +#include "nm-gvaluearray-compat.h" #include "nm-param-spec-specialized.h" struct _NMParamSpecSpecialized { diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index ab19f2a68d..1659a1a3c9 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -30,6 +30,7 @@ #include <gmodule.h> #include "nm-default.h" +#include "nm-gvaluearray-compat.h" #include "nm-utils.h" #include "nm-utils-private.h" #include "nm-dbus-glib-types.h" diff --git a/libnm-util/nm-value-transforms.c b/libnm-util/nm-value-transforms.c index cc7bc50bfa..fd4aaf6069 100644 --- a/libnm-util/nm-value-transforms.c +++ b/libnm-util/nm-value-transforms.c @@ -24,6 +24,7 @@ #include <string.h> #include "nm-default.h" +#include "nm-gvaluearray-compat.h" #include "nm-utils.h" #include "nm-utils-private.h" #include "nm-dbus-glib-types.h" diff --git a/libnm-util/tests/test-general.c b/libnm-util/tests/test-general.c index 73c9dd8b5d..2dfa0b6dc1 100644 --- a/libnm-util/tests/test-general.c +++ b/libnm-util/tests/test-general.c @@ -30,6 +30,7 @@ #include <nm-utils.h> #include "nm-default.h" +#include "nm-gvaluearray-compat.h" #include "nm-setting-private.h" #include "nm-setting-connection.h" |