diff options
author | Dan Winship <danw@gnome.org> | 2014-07-29 09:22:07 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2014-09-04 09:20:10 -0400 |
commit | ca9938f458521b24b262be79a6f86a89f6d630a6 (patch) | |
tree | 2e1a057c45f5dc10ce3eaccd9f8b439daef8dcb3 /libnm-core/nm-property-compare.h | |
parent | 99e1699d8971f7cb5787989eed301ecb7f2eb863 (diff) | |
download | NetworkManager-ca9938f458521b24b262be79a6f86a89f6d630a6.tar.gz |
libnm-core: drop NMParamSpecSpecialized, add nm_property_compare()
NMParamSpecSpecialized existed basically to provide a version of
GParamSpecBoxed that could compare dbus-glib-valued properties
correctly.
However, g_param_values_cmp() was only used by NM directly in one
place (NMSetting's compare_property()), and we don't actually need to
indirect through GParamSpec there; we could just call
NMParamSpecSpecialized's value-comparison function directly.
So, change all NMParamSpecSpecialized properties to GParamSpecBoxed,
rename the _gvalues_compare() function it used to
"nm_property_compare()", and use that from NMSetting.
(g_param_values_cmp() also gets used internally by
g_param_value_defaults(), but all NMParamSpecSpecialized properties
have a default value of NULL, so GParamSpecBoxed's pointer-equality
check will do the job just fine there.)
Diffstat (limited to 'libnm-core/nm-property-compare.h')
-rw-r--r-- | libnm-core/nm-property-compare.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/libnm-core/nm-property-compare.h b/libnm-core/nm-property-compare.h new file mode 100644 index 0000000000..72fc76baf7 --- /dev/null +++ b/libnm-core/nm-property-compare.h @@ -0,0 +1,30 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2007 - 2014 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + */ + +#ifndef __NM_PROPERTY_COMPARE_H__ +#define __NM_PROPERTY_COMPARE_H__ + +#include <glib-object.h> + +int nm_property_compare (const GValue *value1, const GValue *value2); + +#endif /* __NM_PROPERTY_COMPARE_H__ */ |