summaryrefslogtreecommitdiff
path: root/libnm-util
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2012-02-08 12:56:52 -0500
committerDan Winship <danw@gnome.org>2012-02-15 11:42:15 -0500
commit839eab556419b6af5046e44361bdcf14fe028d27 (patch)
treeb9183f7d2cc207e7741960a2120756043a95f847 /libnm-util
parent0b57cc68fd4a146c9fe255f14c667ab306266c0c (diff)
downloadNetworkManager-839eab556419b6af5046e44361bdcf14fe028d27.tar.gz
Use glib-mkenums to generate enum types
Rather than generating enum classes by hand (and complaining in each file that "this should really be standard"), use glib-mkenums. Unfortunately, we need a very new version of glib-mkenums in order to deal with NM's naming conventions and to fix a few other bugs, so just import that into the source tree temporarily. Also, to simplify the use of glib-mkenums, import Makefile.glib from https://bugzilla.gnome.org/654395. To avoid having to run glib-mkenums for every subdirectory of src/, add a new "generated" directory, and put the generated enums files there. Finally, use Makefile.glib for marshallers too, and generate separate ones for libnm-glib and NetworkManager.
Diffstat (limited to 'libnm-util')
-rw-r--r--libnm-util/Makefile.am10
-rw-r--r--libnm-util/libnm-util.ver10
-rw-r--r--libnm-util/nm-connection.c21
-rw-r--r--libnm-util/nm-connection.h3
-rw-r--r--libnm-util/nm-setting-8021x.c24
-rw-r--r--libnm-util/nm-setting-8021x.h9
-rw-r--r--libnm-util/nm-setting-bluetooth.c21
-rw-r--r--libnm-util/nm-setting-bluetooth.h3
-rw-r--r--libnm-util/nm-setting-bond.c25
-rw-r--r--libnm-util/nm-setting-bond.h3
-rw-r--r--libnm-util/nm-setting-cdma.c25
-rw-r--r--libnm-util/nm-setting-cdma.h3
-rw-r--r--libnm-util/nm-setting-connection.c22
-rw-r--r--libnm-util/nm-setting-connection.h3
-rw-r--r--libnm-util/nm-setting-gsm.c25
-rw-r--r--libnm-util/nm-setting-gsm.h3
-rw-r--r--libnm-util/nm-setting-infiniband.c23
-rw-r--r--libnm-util/nm-setting-infiniband.h3
-rw-r--r--libnm-util/nm-setting-ip4-config.c25
-rw-r--r--libnm-util/nm-setting-ip4-config.h3
-rw-r--r--libnm-util/nm-setting-ip6-config.c25
-rw-r--r--libnm-util/nm-setting-ip6-config.h3
-rw-r--r--libnm-util/nm-setting-olpc-mesh.c23
-rw-r--r--libnm-util/nm-setting-olpc-mesh.h3
-rw-r--r--libnm-util/nm-setting-ppp.c25
-rw-r--r--libnm-util/nm-setting-ppp.h3
-rw-r--r--libnm-util/nm-setting-pppoe.c25
-rw-r--r--libnm-util/nm-setting-pppoe.h3
-rw-r--r--libnm-util/nm-setting-serial.c25
-rw-r--r--libnm-util/nm-setting-serial.h3
-rw-r--r--libnm-util/nm-setting-vpn.c23
-rw-r--r--libnm-util/nm-setting-vpn.h3
-rw-r--r--libnm-util/nm-setting-wimax.c23
-rw-r--r--libnm-util/nm-setting-wimax.h3
-rw-r--r--libnm-util/nm-setting-wired.c23
-rw-r--r--libnm-util/nm-setting-wired.h3
-rw-r--r--libnm-util/nm-setting-wireless-security.c31
-rw-r--r--libnm-util/nm-setting-wireless-security.h3
-rw-r--r--libnm-util/nm-setting-wireless.c27
-rw-r--r--libnm-util/nm-setting-wireless.h3
-rw-r--r--libnm-util/nm-setting.c21
-rw-r--r--libnm-util/nm-setting.h3
-rw-r--r--libnm-util/nm-utils.h1
43 files changed, 24 insertions, 545 deletions
diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am
index 1ccb5a6ebc..2ccf1bdca9 100644
--- a/libnm-util/Makefile.am
+++ b/libnm-util/Makefile.am
@@ -1,3 +1,5 @@
+include $(GLIB_MAKEFILE)
+
SUBDIRS=. tests
INCLUDES = -I${top_srcdir} -I${top_srcdir}/include -I${top_builddir}/include
@@ -31,6 +33,7 @@ libnm_util_include_HEADERS = \
nm-setting-wireless.h \
nm-setting-wireless-security.h \
nm-setting-vpn.h \
+ nm-utils-enum-types.h \
nm-utils.h
libnm_util_la_private_headers = \
@@ -62,12 +65,19 @@ libnm_util_la_csources = \
nm-setting-wireless.c \
nm-setting-wireless-security.c \
nm-setting-vpn.c \
+ nm-utils-enum-types.c \
nm-utils.c
libnm_util_la_SOURCES = \
$(libnm_util_la_csources) \
$(libnm_util_la_private_headers)
+GLIB_GENERATED = nm-utils-enum-types.h nm-utils-enum-types.c
+BUILT_SOURCES = $(GLIB_GENERATED)
+nm_utils_enum_types_sources = $(libnm_util_include_HEADERS)
+GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
+GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM
+
libnm_util_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) $(UUID_LIBS)
SYMBOL_VIS_FILE=$(srcdir)/libnm-util.ver
diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver
index cd676fe256..7b835aa713 100644
--- a/libnm-util/libnm-util.ver
+++ b/libnm-util/libnm-util.ver
@@ -103,6 +103,8 @@ global:
nm_setting_802_1x_add_altsubject_match;
nm_setting_802_1x_add_eap_method;
nm_setting_802_1x_add_phase2_altsubject_match;
+ nm_setting_802_1x_ck_format_get_type;
+ nm_setting_802_1x_ck_scheme_get_type;
nm_setting_802_1x_clear_altsubject_matches;
nm_setting_802_1x_clear_eap_methods;
nm_setting_802_1x_clear_phase2_altsubject_matches;
@@ -196,6 +198,7 @@ global:
nm_setting_clear_secrets;
nm_setting_clear_secrets_with_flags;
nm_setting_compare;
+ nm_setting_compare_flags_get_type;
nm_setting_connection_add_permission;
nm_setting_connection_error_get_type;
nm_setting_connection_error_quark;
@@ -216,6 +219,7 @@ global:
nm_setting_connection_permissions_user_allowed;
nm_setting_connection_remove_permission;
nm_setting_diff;
+ nm_setting_diff_result_get_type;
nm_setting_duplicate;
nm_setting_enumerate_values;
nm_setting_error_get_type;
@@ -238,7 +242,10 @@ global:
nm_setting_gsm_get_pin_flags;
nm_setting_gsm_get_type;
nm_setting_gsm_get_username;
+ nm_setting_gsm_network_band_get_type;
+ nm_setting_gsm_network_type_get_type;
nm_setting_gsm_new;
+ nm_setting_hash_flags_get_type;
nm_setting_infiniband_error_get_type;
nm_setting_infiniband_error_quark;
nm_setting_infiniband_get_mac_address;
@@ -346,6 +353,7 @@ global:
nm_setting_pppoe_get_type;
nm_setting_pppoe_get_username;
nm_setting_pppoe_new;
+ nm_setting_secret_flags_get_type;
nm_setting_serial_error_get_type;
nm_setting_serial_error_quark;
nm_setting_serial_get_baud;
@@ -477,6 +485,7 @@ global:
nm_utils_is_empty_ssid;
nm_utils_rsa_key_encrypt;
nm_utils_same_ssid;
+ nm_utils_security_type_get_type;
nm_utils_security_valid;
nm_utils_slist_free;
nm_utils_ssid_to_utf8;
@@ -486,6 +495,7 @@ global:
nm_utils_wifi_find_next_channel;
nm_utils_wifi_freq_to_channel;
nm_utils_wifi_is_channel_valid;
+ nm_wep_key_type_get_type;
local:
*;
};
diff --git a/libnm-util/nm-connection.c b/libnm-util/nm-connection.c
index a63050e85c..b4b6f9d8a1 100644
--- a/libnm-util/nm-connection.c
+++ b/libnm-util/nm-connection.c
@@ -89,27 +89,6 @@ nm_connection_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_connection_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- ENUM_ENTRY (NM_CONNECTION_ERROR_UNKNOWN, "UnknownError"),
- ENUM_ENTRY (NM_CONNECTION_ERROR_CONNECTION_SETTING_NOT_FOUND, "ConnectionSettingNotFound"),
- ENUM_ENTRY (NM_CONNECTION_ERROR_CONNECTION_TYPE_INVALID, "ConnectionTypeInvalid"),
- ENUM_ENTRY (NM_CONNECTION_ERROR_SETTING_NOT_FOUND, "SettingNotFound"),
- { 0, 0, 0 }
- };
- etype = g_enum_register_static ("NMConnectionError", values);
- }
- return etype;
-}
-
typedef struct {
GHashTable *settings;
diff --git a/libnm-util/nm-connection.h b/libnm-util/nm-connection.h
index 28dce127fc..77f59eafc7 100644
--- a/libnm-util/nm-connection.h
+++ b/libnm-util/nm-connection.h
@@ -83,9 +83,6 @@ typedef enum
NM_CONNECTION_ERROR_SETTING_NOT_FOUND
} NMConnectionError;
-#define NM_TYPE_CONNECTION_ERROR (nm_connection_error_get_type ())
-GType nm_connection_error_get_type (void);
-
#define NM_CONNECTION_ERROR nm_connection_error_quark ()
GQuark nm_connection_error_quark (void);
diff --git a/libnm-util/nm-setting-8021x.c b/libnm-util/nm-setting-8021x.c
index 3d745c0689..28c0d3f956 100644
--- a/libnm-util/nm-setting-8021x.c
+++ b/libnm-util/nm-setting-8021x.c
@@ -82,30 +82,6 @@ nm_setting_802_1x_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_setting_802_1x_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- /* Unknown error. */
- ENUM_ENTRY (NM_SETTING_802_1X_ERROR_UNKNOWN, "UnknownError"),
- /* The specified property was invalid. */
- ENUM_ENTRY (NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, "InvalidProperty"),
- /* The specified property was missing and is required. */
- ENUM_ENTRY (NM_SETTING_802_1X_ERROR_MISSING_PROPERTY, "MissingProperty"),
- { 0, 0, 0 }
- };
- etype = g_enum_register_static ("NMSetting8021xError", values);
- }
- return etype;
-}
-
-
G_DEFINE_TYPE (NMSetting8021x, nm_setting_802_1x, NM_TYPE_SETTING)
#define NM_SETTING_802_1X_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_802_1X, NMSetting8021xPrivate))
diff --git a/libnm-util/nm-setting-8021x.h b/libnm-util/nm-setting-8021x.h
index cf9bd76476..fa7086332f 100644
--- a/libnm-util/nm-setting-8021x.h
+++ b/libnm-util/nm-setting-8021x.h
@@ -42,7 +42,7 @@ G_BEGIN_DECLS
* #NMSetting8021xCKFormat values indicate the general type of a certificate
* or private key
*/
-typedef enum {
+typedef enum { /*< underscore_name=nm_setting_802_1x_ck_format >*/
NM_SETTING_802_1X_CK_FORMAT_UNKNOWN = 0,
NM_SETTING_802_1X_CK_FORMAT_X509,
NM_SETTING_802_1X_CK_FORMAT_RAW_KEY,
@@ -62,7 +62,7 @@ typedef enum {
* stored in the setting properties, either as a blob of the item's data, or as
* a path to a certificate or private key file on the filesystem
*/
-typedef enum {
+typedef enum { /*< underscore_name=nm_setting_802_1x_ck_scheme >*/
NM_SETTING_802_1X_CK_SCHEME_UNKNOWN = 0,
NM_SETTING_802_1X_CK_SCHEME_BLOB,
NM_SETTING_802_1X_CK_SCHEME_PATH
@@ -85,15 +85,12 @@ typedef enum {
* @NM_SETTING_802_1X_ERROR_MISSING_PROPERTY: the property was missing and is
* required
*/
-typedef enum {
+typedef enum { /*< underscore_name=nm_setting_802_1x_error >*/
NM_SETTING_802_1X_ERROR_UNKNOWN = 0,
NM_SETTING_802_1X_ERROR_INVALID_PROPERTY,
NM_SETTING_802_1X_ERROR_MISSING_PROPERTY
} NMSetting8021xError;
-#define NM_TYPE_SETTING_802_1X_ERROR (nm_setting_802_1x_error_get_type ())
-GType nm_setting_802_1x_error_get_type (void);
-
#define NM_SETTING_802_1X_ERROR nm_setting_802_1x_error_quark ()
GQuark nm_setting_802_1x_error_quark (void);
diff --git a/libnm-util/nm-setting-bluetooth.c b/libnm-util/nm-setting-bluetooth.c
index 1b1178b240..6a2fed74ff 100644
--- a/libnm-util/nm-setting-bluetooth.c
+++ b/libnm-util/nm-setting-bluetooth.c
@@ -62,27 +62,6 @@ nm_setting_bluetooth_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_setting_bluetooth_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- ENUM_ENTRY (NM_SETTING_BLUETOOTH_ERROR_UNKNOWN, "UnknownError"),
- ENUM_ENTRY (NM_SETTING_BLUETOOTH_ERROR_INVALID_PROPERTY, "InvalidProperty"),
- ENUM_ENTRY (NM_SETTING_BLUETOOTH_ERROR_MISSING_PROPERTY, "MissingProperty"),
- ENUM_ENTRY (NM_SETTING_BLUETOOTH_ERROR_TYPE_SETTING_NOT_FOUND, "TypeSettingNotFound"),
- { 0, 0, 0 }
- };
- etype = g_enum_register_static ("NMSettingBluetoothError", values);
- }
- return etype;
-}
-
G_DEFINE_TYPE (NMSettingBluetooth, nm_setting_bluetooth, NM_TYPE_SETTING)
diff --git a/libnm-util/nm-setting-bluetooth.h b/libnm-util/nm-setting-bluetooth.h
index a17a72bf40..1dd679fd3d 100644
--- a/libnm-util/nm-setting-bluetooth.h
+++ b/libnm-util/nm-setting-bluetooth.h
@@ -57,9 +57,6 @@ typedef enum {
NM_SETTING_BLUETOOTH_ERROR_TYPE_SETTING_NOT_FOUND,
} NMSettingBluetoothError;
-#define NM_TYPE_SETTING_BLUETOOTH_ERROR (nm_setting_bluetooth_error_get_type ())
-GType nm_setting_bluetooth_error_get_type (void);
-
#define NM_SETTING_BLUETOOTH_ERROR nm_setting_bluetooth_error_quark ()
GQuark nm_setting_bluetooth_error_quark (void);
diff --git a/libnm-util/nm-setting-bond.c b/libnm-util/nm-setting-bond.c
index 3aa9cf3d92..7c1c23367b 100644
--- a/libnm-util/nm-setting-bond.c
+++ b/libnm-util/nm-setting-bond.c
@@ -57,31 +57,6 @@ nm_setting_bond_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_setting_bond_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- /* Unknown error. */
- ENUM_ENTRY (NM_SETTING_BOND_ERROR_UNKNOWN, "UnknownError"),
- /* The specified property was invalid. */
- ENUM_ENTRY (NM_SETTING_BOND_ERROR_INVALID_PROPERTY, "InvalidProperty"),
- /* The specified property was missing and is required. */
- ENUM_ENTRY (NM_SETTING_BOND_ERROR_MISSING_PROPERTY, "MissingProperty"),
- { 0, 0, 0 }
- };
-
- etype = g_enum_register_static ("NMSettingBondError", values);
- }
-
- return etype;
-}
-
G_DEFINE_TYPE (NMSettingBond, nm_setting_bond, NM_TYPE_SETTING)
diff --git a/libnm-util/nm-setting-bond.h b/libnm-util/nm-setting-bond.h
index 6ef699240d..c868737900 100644
--- a/libnm-util/nm-setting-bond.h
+++ b/libnm-util/nm-setting-bond.h
@@ -50,9 +50,6 @@ typedef enum {
NM_SETTING_BOND_ERROR_MISSING_PROPERTY,
} NMSettingBondError;
-#define NM_TYPE_SETTING_BOND_ERROR (nm_setting_bond_error_get_type ())
-GType nm_setting_bond_error_get_type (void);
-
#define NM_SETTING_BOND_ERROR nm_setting_bond_error_quark ()
GQuark nm_setting_bond_error_quark (void);
diff --git a/libnm-util/nm-setting-cdma.c b/libnm-util/nm-setting-cdma.c
index cb5b27e882..43bf93b198 100644
--- a/libnm-util/nm-setting-cdma.c
+++ b/libnm-util/nm-setting-cdma.c
@@ -53,31 +53,6 @@ nm_setting_cdma_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_setting_cdma_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- /* Unknown error. */
- ENUM_ENTRY (NM_SETTING_CDMA_ERROR_UNKNOWN, "UnknownError"),
- /* The specified property was invalid. */
- ENUM_ENTRY (NM_SETTING_CDMA_ERROR_INVALID_PROPERTY, "InvalidProperty"),
- /* The specified property was missing and is required. */
- ENUM_ENTRY (NM_SETTING_CDMA_ERROR_MISSING_PROPERTY, "MissingProperty"),
- /* The required serial setting is missing (DEPRECATED) */
- ENUM_ENTRY (NM_SETTING_CDMA_ERROR_MISSING_SERIAL_SETTING, "MissingSerialSetting"),
- { 0, 0, 0 }
- };
- etype = g_enum_register_static ("NMSettingCdmaError", values);
- }
- return etype;
-}
-
G_DEFINE_TYPE (NMSettingCdma, nm_setting_cdma, NM_TYPE_SETTING)
diff --git a/libnm-util/nm-setting-cdma.h b/libnm-util/nm-setting-cdma.h
index d0a5de4cb5..229bb32b57 100644
--- a/libnm-util/nm-setting-cdma.h
+++ b/libnm-util/nm-setting-cdma.h
@@ -55,9 +55,6 @@ typedef enum {
NM_SETTING_CDMA_ERROR_MISSING_SERIAL_SETTING
} NMSettingCdmaError;
-#define NM_TYPE_SETTING_CDMA_ERROR (nm_setting_cdma_error_get_type ())
-GType nm_setting_cdma_error_get_type (void);
-
#define NM_SETTING_CDMA_ERROR nm_setting_cdma_error_quark ()
GQuark nm_setting_cdma_error_quark (void);
diff --git a/libnm-util/nm-setting-connection.c b/libnm-util/nm-setting-connection.c
index 6c8b8b2cb2..94ca911207 100644
--- a/libnm-util/nm-setting-connection.c
+++ b/libnm-util/nm-setting-connection.c
@@ -58,28 +58,6 @@ nm_setting_connection_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_setting_connection_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- ENUM_ENTRY (NM_SETTING_CONNECTION_ERROR_UNKNOWN, "UnknownError"),
- ENUM_ENTRY (NM_SETTING_CONNECTION_ERROR_INVALID_PROPERTY, "InvalidProperty"),
- ENUM_ENTRY (NM_SETTING_CONNECTION_ERROR_MISSING_PROPERTY, "MissingProperty"),
- ENUM_ENTRY (NM_SETTING_CONNECTION_ERROR_TYPE_SETTING_NOT_FOUND, "TypeSettingNotFound"),
- ENUM_ENTRY (NM_SETTING_CONNECTION_ERROR_IP_CONFIG_NOT_ALLOWED, "IpConfigNotAllowed"),
- { 0, 0, 0 }
- };
- etype = g_enum_register_static ("NMSettingConnectionError", values);
- }
- return etype;
-}
-
G_DEFINE_TYPE (NMSettingConnection, nm_setting_connection, NM_TYPE_SETTING)
diff --git a/libnm-util/nm-setting-connection.h b/libnm-util/nm-setting-connection.h
index 53976351a5..da9c03a2d5 100644
--- a/libnm-util/nm-setting-connection.h
+++ b/libnm-util/nm-setting-connection.h
@@ -65,9 +65,6 @@ typedef enum
NM_SETTING_CONNECTION_ERROR_IP_CONFIG_NOT_ALLOWED,
} NMSettingConnectionError;
-#define NM_TYPE_SETTING_CONNECTION_ERROR (nm_setting_connection_error_get_type ())
-GType nm_setting_connection_error_get_type (void);
-
#define NM_SETTING_CONNECTION_ERROR nm_setting_connection_error_quark ()
GQuark nm_setting_connection_error_quark (void);
diff --git a/libnm-util/nm-setting-gsm.c b/libnm-util/nm-setting-gsm.c
index c23e8b0114..2264d008c0 100644
--- a/libnm-util/nm-setting-gsm.c
+++ b/libnm-util/nm-setting-gsm.c
@@ -56,31 +56,6 @@ nm_setting_gsm_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_setting_gsm_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- /* Unknown error. */
- ENUM_ENTRY (NM_SETTING_GSM_ERROR_UNKNOWN, "UnknownError"),
- /* The specified property was invalid. */
- ENUM_ENTRY (NM_SETTING_GSM_ERROR_INVALID_PROPERTY, "InvalidProperty"),
- /* The specified property was missing and is required. */
- ENUM_ENTRY (NM_SETTING_GSM_ERROR_MISSING_PROPERTY, "MissingProperty"),
- /* The required serial setting is missing (DEPRECATED) */
- ENUM_ENTRY (NM_SETTING_GSM_ERROR_MISSING_SERIAL_SETTING, "MissingSerialSetting"),
- { 0, 0, 0 }
- };
- etype = g_enum_register_static ("NMSettingGsmError", values);
- }
- return etype;
-}
-
G_DEFINE_TYPE (NMSettingGsm, nm_setting_gsm, NM_TYPE_SETTING)
diff --git a/libnm-util/nm-setting-gsm.h b/libnm-util/nm-setting-gsm.h
index 6459a4abf1..69183d4642 100644
--- a/libnm-util/nm-setting-gsm.h
+++ b/libnm-util/nm-setting-gsm.h
@@ -55,9 +55,6 @@ typedef enum {
NM_SETTING_GSM_ERROR_MISSING_SERIAL_SETTING
} NMSettingGsmError;
-#define NM_TYPE_SETTING_GSM_ERROR (nm_setting_gsm_error_get_type ())
-GType nm_setting_gsm_error_get_type (void);
-
#define NM_SETTING_GSM_ERROR nm_setting_gsm_error_quark ()
GQuark nm_setting_gsm_error_quark (void);
diff --git a/libnm-util/nm-setting-infiniband.c b/libnm-util/nm-setting-infiniband.c
index 9e8ec9acca..d0eef24343 100644
--- a/libnm-util/nm-setting-infiniband.c
+++ b/libnm-util/nm-setting-infiniband.c
@@ -52,29 +52,6 @@ nm_setting_infiniband_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_setting_infiniband_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- /* Unknown error. */
- ENUM_ENTRY (NM_SETTING_INFINIBAND_ERROR_UNKNOWN, "UnknownError"),
- /* The specified property was invalid. */
- ENUM_ENTRY (NM_SETTING_INFINIBAND_ERROR_INVALID_PROPERTY, "InvalidProperty"),
- /* The specified property was missing and is required. */
- ENUM_ENTRY (NM_SETTING_INFINIBAND_ERROR_MISSING_PROPERTY, "MissingProperty"),
- { 0, 0, 0 }
- };
- etype = g_enum_register_static ("NMSettingInfinibandError", values);
- }
- return etype;
-}
-
G_DEFINE_TYPE (NMSettingInfiniband, nm_setting_infiniband, NM_TYPE_SETTING)
#define NM_SETTING_INFINIBAND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_INFINIBAND, NMSettingInfinibandPrivate))
diff --git a/libnm-util/nm-setting-infiniband.h b/libnm-util/nm-setting-infiniband.h
index 8d1831b4e6..90cd6ed935 100644
--- a/libnm-util/nm-setting-infiniband.h
+++ b/libnm-util/nm-setting-infiniband.h
@@ -48,9 +48,6 @@ typedef enum {
NM_SETTING_INFINIBAND_ERROR_MISSING_PROPERTY
} NMSettingInfinibandError;
-#define NM_TYPE_SETTING_INFINIBAND_ERROR (nm_setting_infiniband_error_get_type ())
-GType nm_setting_infiniband_error_get_type (void);
-
#define NM_SETTING_INFINIBAND_ERROR nm_setting_infiniband_error_quark ()
GQuark nm_setting_infiniband_error_quark (void);
diff --git a/libnm-util/nm-setting-ip4-config.c b/libnm-util/nm-setting-ip4-config.c
index 6b164ea88a..db5a5311a4 100644
--- a/libnm-util/nm-setting-ip4-config.c
+++ b/libnm-util/nm-setting-ip4-config.c
@@ -57,31 +57,6 @@ nm_setting_ip4_config_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_setting_ip4_config_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- /* Unknown error. */
- ENUM_ENTRY (NM_SETTING_IP4_CONFIG_ERROR_UNKNOWN, "UnknownError"),
- /* The specified property was invalid. */
- ENUM_ENTRY (NM_SETTING_IP4_CONFIG_ERROR_INVALID_PROPERTY, "InvalidProperty"),
- /* The specified property was missing and is required. */
- ENUM_ENTRY (NM_SETTING_IP4_CONFIG_ERROR_MISSING_PROPERTY, "MissingProperty"),
- /* The specified property was not allowed in combination with the current 'method' */
- ENUM_ENTRY (NM_SETTING_IP4_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD, "NotAllowedForMethod"),
- { 0, 0, 0 }
- };
- etype = g_enum_register_static ("NMSettingIP4ConfigError", values);
- }
- return etype;
-}
-
#if GLIB_CHECK_VERSION(2,26,0)
G_DEFINE_BOXED_TYPE (NMIP4Address, nm_ip4_address, nm_ip4_address_dup, nm_ip4_address_unref)
G_DEFINE_BOXED_TYPE (NMIP4Route, nm_ip4_route, nm_ip4_route_dup, nm_ip4_route_unref)
diff --git a/libnm-util/nm-setting-ip4-config.h b/libnm-util/nm-setting-ip4-config.h
index 76dcf37a63..2db34eeb91 100644
--- a/libnm-util/nm-setting-ip4-config.h
+++ b/libnm-util/nm-setting-ip4-config.h
@@ -55,9 +55,6 @@ typedef enum {
NM_SETTING_IP4_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD
} NMSettingIP4ConfigError;
-#define NM_TYPE_SETTING_IP4_CONFIG_ERROR (nm_setting_ip4_config_error_get_type ())
-GType nm_setting_ip4_config_error_get_type (void);
-
#define NM_SETTING_IP4_CONFIG_ERROR nm_setting_ip4_config_error_quark ()
GQuark nm_setting_ip4_config_error_quark (void);
diff --git a/libnm-util/nm-setting-ip6-config.c b/libnm-util/nm-setting-ip6-config.c
index 4dc8f46cef..89011771f0 100644
--- a/libnm-util/nm-setting-ip6-config.c
+++ b/libnm-util/nm-setting-ip6-config.c
@@ -56,31 +56,6 @@ nm_setting_ip6_config_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_setting_ip6_config_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- /* Unknown error. */
- ENUM_ENTRY (NM_SETTING_IP6_CONFIG_ERROR_UNKNOWN, "UnknownError"),
- /* The specified property was invalid. */
- ENUM_ENTRY (NM_SETTING_IP6_CONFIG_ERROR_INVALID_PROPERTY, "InvalidProperty"),
- /* The specified property was missing and is required. */
- ENUM_ENTRY (NM_SETTING_IP6_CONFIG_ERROR_MISSING_PROPERTY, "MissingProperty"),
- /* The specified property was not allowed in combination with the current 'method' */
- ENUM_ENTRY (NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD, "NotAllowedForMethod"),
- { 0, 0, 0 }
- };
- etype = g_enum_register_static ("NMSettingIP6ConfigError", values);
- }
- return etype;
-}
-
#if GLIB_CHECK_VERSION(2,26,0)
G_DEFINE_BOXED_TYPE (NMIP6Address, nm_ip6_address, nm_ip6_address_dup, nm_ip6_address_unref)
G_DEFINE_BOXED_TYPE (NMIP6Route, nm_ip6_route, nm_ip6_route_dup, nm_ip6_route_unref)
diff --git a/libnm-util/nm-setting-ip6-config.h b/libnm-util/nm-setting-ip6-config.h
index 6b8fe5c445..01425af18c 100644
--- a/libnm-util/nm-setting-ip6-config.h
+++ b/libnm-util/nm-setting-ip6-config.h
@@ -56,9 +56,6 @@ typedef enum {
NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD
} NMSettingIP6ConfigError;
-#define NM_TYPE_SETTING_IP6_CONFIG_ERROR (nm_setting_ip6_config_error_get_type ())
-GType nm_setting_ip6_config_error_get_type (void);
-
#define NM_SETTING_IP6_CONFIG_ERROR nm_setting_ip6_config_error_quark ()
GQuark nm_setting_ip6_config_error_quark (void);
diff --git a/libnm-util/nm-setting-olpc-mesh.c b/libnm-util/nm-setting-olpc-mesh.c
index 1653bb0768..96770e4fc8 100644
--- a/libnm-util/nm-setting-olpc-mesh.c
+++ b/libnm-util/nm-setting-olpc-mesh.c
@@ -46,29 +46,6 @@ nm_setting_olpc_mesh_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_setting_olpc_mesh_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- /* Unknown error. */
- ENUM_ENTRY (NM_SETTING_OLPC_MESH_ERROR_UNKNOWN, "UnknownError"),
- /* The specified property was invalid. */
- ENUM_ENTRY (NM_SETTING_OLPC_MESH_ERROR_INVALID_PROPERTY, "InvalidProperty"),
- /* The specified property was missing and is required. */
- ENUM_ENTRY (NM_SETTING_OLPC_MESH_ERROR_MISSING_PROPERTY, "MissingProperty"),
- { 0, 0, 0 }
- };
- etype = g_enum_register_static ("NMSettingOlpcMeshError", values);
- }
- return etype;
-}
-
static void nm_setting_olpc_mesh_init (NMSettingOlpcMesh *setting);
G_DEFINE_TYPE (NMSettingOlpcMesh, nm_setting_olpc_mesh, NM_TYPE_SETTING)
diff --git a/libnm-util/nm-setting-olpc-mesh.h b/libnm-util/nm-setting-olpc-mesh.h
index 84abd1264a..c693610a71 100644
--- a/libnm-util/nm-setting-olpc-mesh.h
+++ b/libnm-util/nm-setting-olpc-mesh.h
@@ -48,9 +48,6 @@ typedef enum
NM_SETTING_OLPC_MESH_ERROR_MISSING_PROPERTY
} NMSettingOlpcMeshError;
-#define NM_TYPE_SETTING_OLPC_MESH_ERROR (nm_setting_olpc_mesh_error_get_type ())
-GType nm_setting_olpc_mesh_error_get_type (void);
-
#define NM_SETTING_OLPC_MESH_ERROR nm_setting_olpc_mesh_error_quark ()
GQuark nm_setting_olpc_mesh_error_quark (void);
diff --git a/libnm-util/nm-setting-ppp.c b/libnm-util/nm-setting-ppp.c
index 8933813117..6b1fd5aca1 100644
--- a/libnm-util/nm-setting-ppp.c
+++ b/libnm-util/nm-setting-ppp.c
@@ -53,31 +53,6 @@ nm_setting_ppp_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_setting_ppp_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- /* Unknown error. */
- ENUM_ENTRY (NM_SETTING_PPP_ERROR_UNKNOWN, "UnknownError"),
- /* The specified property was invalid. */
- ENUM_ENTRY (NM_SETTING_PPP_ERROR_INVALID_PROPERTY, "InvalidProperty"),
- /* The specified property was missing and is required. */
- ENUM_ENTRY (NM_SETTING_PPP_ERROR_MISSING_PROPERTY, "MissingProperty"),
- /* The 'require-mppe' option is not allowed in conjunction with the specified authentication. */
- ENUM_ENTRY (NM_SETTING_PPP_ERROR_REQUIRE_MPPE_NOT_ALLOWED, "RequireMPPENotAllowed"),
- { 0, 0, 0 }
- };
- etype = g_enum_register_static ("NMSettingPPPError", values);
- }
- return etype;
-}
-
G_DEFINE_TYPE (NMSettingPPP, nm_setting_ppp, NM_TYPE_SETTING)
diff --git a/libnm-util/nm-setting-ppp.h b/libnm-util/nm-setting-ppp.h
index 7a6e4e47b6..5dcdf904a7 100644
--- a/libnm-util/nm-setting-ppp.h
+++ b/libnm-util/nm-setting-ppp.h
@@ -55,9 +55,6 @@ typedef enum {
NM_SETTING_PPP_ERROR_REQUIRE_MPPE_NOT_ALLOWED
} NMSettingPPPError;
-#define NM_TYPE_SETTING_PPP_ERROR (nm_setting_ppp_error_get_type ())
-GType nm_setting_ppp_error_get_type (void);
-
#define NM_SETTING_PPP_ERROR nm_setting_ppp_error_quark ()
GQuark nm_setting_ppp_error_quark (void);
diff --git a/libnm-util/nm-setting-pppoe.c b/libnm-util/nm-setting-pppoe.c
index 4a9b8a2294..e25c092621 100644
--- a/libnm-util/nm-setting-pppoe.c
+++ b/libnm-util/nm-setting-pppoe.c
@@ -55,31 +55,6 @@ nm_setting_pppoe_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_setting_pppoe_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- /* Unknown error. */
- ENUM_ENTRY (NM_SETTING_PPPOE_ERROR_UNKNOWN, "UnknownError"),
- /* The specified property was invalid. */
- ENUM_ENTRY (NM_SETTING_PPPOE_ERROR_INVALID_PROPERTY, "InvalidProperty"),
- /* The specified property was missing and is required. */
- ENUM_ENTRY (NM_SETTING_PPPOE_ERROR_MISSING_PROPERTY, "MissingProperty"),
- /* The required PPP setting is missing */
- ENUM_ENTRY (NM_SETTING_PPPOE_ERROR_MISSING_PPP_SETTING, "MissingPPPSetting"),
- { 0, 0, 0 }
- };
- etype = g_enum_register_static ("NMSettingPPPOEError", values);
- }
- return etype;
-}
-
G_DEFINE_TYPE (NMSettingPPPOE, nm_setting_pppoe, NM_TYPE_SETTING)
diff --git a/libnm-util/nm-setting-pppoe.h b/libnm-util/nm-setting-pppoe.h
index aef6bd686e..6ec137600e 100644
--- a/libnm-util/nm-setting-pppoe.h
+++ b/libnm-util/nm-setting-pppoe.h
@@ -55,9 +55,6 @@ typedef enum {
NM_SETTING_PPPOE_ERROR_MISSING_PPP_SETTING
} NMSettingPPPOEError;
-#define NM_TYPE_SETTING_PPPOE_ERROR (nm_setting_pppoe_error_get_type ())
-GType nm_setting_pppoe_error_get_type (void);
-
#define NM_SETTING_PPPOE_ERROR nm_setting_pppoe_error_quark ()
GQuark nm_setting_pppoe_error_quark (void);
diff --git a/libnm-util/nm-setting-serial.c b/libnm-util/nm-setting-serial.c
index 24e6253ec5..44f14986bb 100644
--- a/libnm-util/nm-setting-serial.c
+++ b/libnm-util/nm-setting-serial.c
@@ -56,31 +56,6 @@ nm_setting_serial_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_setting_serial_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- /* Unknown error. */
- ENUM_ENTRY (NM_SETTING_SERIAL_ERROR_UNKNOWN, "UnknownError"),
- /* The specified property was invalid. */
- ENUM_ENTRY (NM_SETTING_SERIAL_ERROR_INVALID_PROPERTY, "InvalidProperty"),
- /* The specified property was missing and is required. */
- ENUM_ENTRY (NM_SETTING_SERIAL_ERROR_MISSING_PROPERTY, "MissingProperty"),
- /* The required PPP setting is missing (DEPRECATED) */
- ENUM_ENTRY (NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING, "MissingPPPSetting"),
- { 0, 0, 0 }
- };
- etype = g_enum_register_static ("NMSettingSerialError", values);
- }
- return etype;
-}
-
G_DEFINE_TYPE (NMSettingSerial, nm_setting_serial, NM_TYPE_SETTING)
diff --git a/libnm-util/nm-setting-serial.h b/libnm-util/nm-setting-serial.h
index 9562950c95..b1fa7bc4b7 100644
--- a/libnm-util/nm-setting-serial.h
+++ b/libnm-util/nm-setting-serial.h
@@ -55,9 +55,6 @@ typedef enum {
NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING
} NMSettingSerialError;
-#define NM_TYPE_SETTING_SERIAL_ERROR (nm_setting_serial_error_get_type ())
-GType nm_setting_serial_error_get_type (void);
-
#define NM_SETTING_SERIAL_ERROR nm_setting_serial_error_quark ()
GQuark nm_setting_serial_error_quark (void);
diff --git a/libnm-util/nm-setting-vpn.c b/libnm-util/nm-setting-vpn.c
index 04b8fcefe1..d1fc8b7670 100644
--- a/libnm-util/nm-setting-vpn.c
+++ b/libnm-util/nm-setting-vpn.c
@@ -63,29 +63,6 @@ nm_setting_vpn_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_setting_vpn_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- /* Unknown error. */
- ENUM_ENTRY (NM_SETTING_VPN_ERROR_UNKNOWN, "UnknownError"),
- /* The specified property was invalid. */
- ENUM_ENTRY (NM_SETTING_VPN_ERROR_INVALID_PROPERTY, "InvalidProperty"),
- /* The specified property was missing and is required. */
- ENUM_ENTRY (NM_SETTING_VPN_ERROR_MISSING_PROPERTY, "MissingProperty"),
- { 0, 0, 0 }
- };
- etype = g_enum_register_static ("NMSettingVpnError", values);
- }
- return etype;
-}
-
G_DEFINE_TYPE (NMSettingVPN, nm_setting_vpn, NM_TYPE_SETTING)
diff --git a/libnm-util/nm-setting-vpn.h b/libnm-util/nm-setting-vpn.h
index 7179baa0fe..bfd2ac5776 100644
--- a/libnm-util/nm-setting-vpn.h
+++ b/libnm-util/nm-setting-vpn.h
@@ -52,9 +52,6 @@ typedef enum {
NM_SETTING_VPN_ERROR_MISSING_PROPERTY,
} NMSettingVpnError;
-#define NM_TYPE_SETTING_VPN_ERROR (nm_setting_vpn_error_get_type ())
-GType nm_setting_vpn_error_get_type (void);
-
#define NM_SETTING_VPN_ERROR nm_setting_vpn_error_quark ()
GQuark nm_setting_vpn_error_quark (void);
diff --git a/libnm-util/nm-setting-wimax.c b/libnm-util/nm-setting-wimax.c
index 38a442f621..a099cad202 100644
--- a/libnm-util/nm-setting-wimax.c
+++ b/libnm-util/nm-setting-wimax.c
@@ -53,29 +53,6 @@ nm_setting_wimax_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_setting_wimax_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- /* Unknown error. */
- ENUM_ENTRY (NM_SETTING_WIMAX_ERROR_UNKNOWN, "UnknownError"),
- /* The specified property was invalid. */
- ENUM_ENTRY (NM_SETTING_WIMAX_ERROR_INVALID_PROPERTY, "InvalidProperty"),
- /* The specified property was missing and is required. */
- ENUM_ENTRY (NM_SETTING_WIMAX_ERROR_MISSING_PROPERTY, "MissingProperty"),
- { 0, 0, 0 }
- };
- etype = g_enum_register_static ("NMSettingWimaxError", values);
- }
- return etype;
-}
-
G_DEFINE_TYPE (NMSettingWimax, nm_setting_wimax, NM_TYPE_SETTING)
diff --git a/libnm-util/nm-setting-wimax.h b/libnm-util/nm-setting-wimax.h
index 2462ac06a7..6991b8e7dc 100644
--- a/libnm-util/nm-setting-wimax.h
+++ b/libnm-util/nm-setting-wimax.h
@@ -48,9 +48,6 @@ typedef enum {
NM_SETTING_WIMAX_ERROR_MISSING_PROPERTY
} NMSettingWimaxError;
-#define NM_TYPE_SETTING_WIMAX_ERROR (nm_setting_wimax_error_get_type ())
-GType nm_setting_wimax_error_get_type (void);
-
#define NM_SETTING_WIMAX_ERROR nm_setting_wimax_error_quark ()
GQuark nm_setting_wimax_error_quark (void);
diff --git a/libnm-util/nm-setting-wired.c b/libnm-util/nm-setting-wired.c
index d4e52e0311..fb21711d90 100644
--- a/libnm-util/nm-setting-wired.c
+++ b/libnm-util/nm-setting-wired.c
@@ -61,29 +61,6 @@ nm_setting_wired_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_setting_wired_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- /* Unknown error. */
- ENUM_ENTRY (NM_SETTING_WIRED_ERROR_UNKNOWN, "UnknownError"),
- /* The specified property was invalid. */
- ENUM_ENTRY (NM_SETTING_WIRED_ERROR_INVALID_PROPERTY, "InvalidProperty"),
- /* The specified property was missing and is required. */
- ENUM_ENTRY (NM_SETTING_WIRED_ERROR_MISSING_PROPERTY, "MissingProperty"),
- { 0, 0, 0 }
- };
- etype = g_enum_register_static ("NMSettingWiredError", values);
- }
- return etype;
-}
-
G_DEFINE_TYPE (NMSettingWired, nm_setting_wired, NM_TYPE_SETTING)
diff --git a/libnm-util/nm-setting-wired.h b/libnm-util/nm-setting-wired.h
index 36799fbe8c..9eae7f2e7b 100644
--- a/libnm-util/nm-setting-wired.h
+++ b/libnm-util/nm-setting-wired.h
@@ -52,9 +52,6 @@ typedef enum {
NM_SETTING_WIRED_ERROR_MISSING_PROPERTY
} NMSettingWiredError;
-#define NM_TYPE_SETTING_WIRED_ERROR (nm_setting_wired_error_get_type ())
-GType nm_setting_wired_error_get_type (void);
-
#define NM_SETTING_WIRED_ERROR nm_setting_wired_error_quark ()
GQuark nm_setting_wired_error_quark (void);
diff --git a/libnm-util/nm-setting-wireless-security.c b/libnm-util/nm-setting-wireless-security.c
index cb9a60810b..98473120a5 100644
--- a/libnm-util/nm-setting-wireless-security.c
+++ b/libnm-util/nm-setting-wireless-security.c
@@ -75,37 +75,6 @@ nm_setting_wireless_security_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_setting_wireless_security_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- /* Unknown error. */
- ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_UNKNOWN, "UnknownError"),
- /* The specified property was invalid. */
- ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, "InvalidProperty"),
- /* The specified property was missing and is required. */
- ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_PROPERTY, "MissingProperty"),
- /* The required 802.1x setting is missing */
- ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_802_1X_SETTING, "Missing8021xSetting"),
- /* The LEAP authentication algorithm requires use of 802.1x key management. */
- ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_802_1X, "LEAPRequires8021x"),
- /* The LEAP authentication algorithm requires a username. */
- ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_USERNAME, "LEAPRequiresUsername"),
- /* Shared Key authentication can only be used with WEP encryption. */
- ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_SHARED_KEY_REQUIRES_WEP, "SharedKeyRequiresWEP"),
- { 0, 0, 0 }
- };
- etype = g_enum_register_static ("NMSettingWirelessSecurityError", values);
- }
- return etype;
-}
-
G_DEFINE_TYPE (NMSettingWirelessSecurity, nm_setting_wireless_security, NM_TYPE_SETTING)
diff --git a/libnm-util/nm-setting-wireless-security.h b/libnm-util/nm-setting-wireless-security.h
index 5f23893aa2..0240b031b7 100644
--- a/libnm-util/nm-setting-wireless-security.h
+++ b/libnm-util/nm-setting-wireless-security.h
@@ -65,9 +65,6 @@ typedef enum {
NM_SETTING_WIRELESS_SECURITY_ERROR_SHARED_KEY_REQUIRES_WEP
} NMSettingWirelessSecurityError;
-#define NM_TYPE_SETTING_WIRELESS_SECURITY_ERROR (nm_setting_wireless_security_error_get_type ())
-GType nm_setting_wireless_security_error_get_type (void);
-
#define NM_SETTING_WIRELESS_SECURITY_ERROR nm_setting_wireless_security_error_quark ()
GQuark nm_setting_wireless_security_error_quark (void);
diff --git a/libnm-util/nm-setting-wireless.c b/libnm-util/nm-setting-wireless.c
index 13fda9f7bd..31882516d8 100644
--- a/libnm-util/nm-setting-wireless.c
+++ b/libnm-util/nm-setting-wireless.c
@@ -61,33 +61,6 @@ nm_setting_wireless_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_setting_wireless_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- /* Unknown error. */
- ENUM_ENTRY (NM_SETTING_WIRELESS_ERROR_UNKNOWN, "UnknownError"),
- /* The specified property was invalid. */
- ENUM_ENTRY (NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY, "InvalidProperty"),
- /* The specified property was missing and is required. */
- ENUM_ENTRY (NM_SETTING_WIRELESS_ERROR_MISSING_PROPERTY, "MissingProperty"),
- /* The required security setting is missing */
- ENUM_ENTRY (NM_SETTING_WIRELESS_ERROR_MISSING_SECURITY_SETTING, "MissingSecuritySetting"),
- /* The 'channel' property requires a valid 'band' */
- ENUM_ENTRY (NM_SETTING_WIRELESS_ERROR_CHANNEL_REQUIRES_BAND, "ChannelRequiresBand"),
- { 0, 0, 0 }
- };
- etype = g_enum_register_static ("NMSettingWirelessError", values);
- }
- return etype;
-}
-
G_DEFINE_TYPE (NMSettingWireless, nm_setting_wireless, NM_TYPE_SETTING)
diff --git a/libnm-util/nm-setting-wireless.h b/libnm-util/nm-setting-wireless.h
index 746466be94..76d539a408 100644
--- a/libnm-util/nm-setting-wireless.h
+++ b/libnm-util/nm-setting-wireless.h
@@ -60,9 +60,6 @@ typedef enum {
NM_SETTING_WIRELESS_ERROR_CHANNEL_REQUIRES_BAND
} NMSettingWirelessError;
-#define NM_TYPE_SETTING_WIRELESS_ERROR (nm_setting_wireless_error_get_type ())
-GType nm_setting_wireless_error_get_type (void);
-
#define NM_SETTING_WIRELESS_ERROR nm_setting_wireless_error_quark ()
GQuark nm_setting_wireless_error_quark (void);
diff --git a/libnm-util/nm-setting.c b/libnm-util/nm-setting.c
index 6144f181d4..21dab0ba6a 100644
--- a/libnm-util/nm-setting.c
+++ b/libnm-util/nm-setting.c
@@ -60,27 +60,6 @@ nm_setting_error_quark (void)
return quark;
}
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-nm_setting_error_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- ENUM_ENTRY (NM_SETTING_ERROR_UNKNOWN, "UnknownError"),
- ENUM_ENTRY (NM_SETTING_ERROR_PROPERTY_NOT_FOUND, "PropertyNotFound"),
- ENUM_ENTRY (NM_SETTING_ERROR_PROPERTY_NOT_SECRET, "PropertyNotSecret"),
- ENUM_ENTRY (NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH, "PropertyTypeMismatch"),
- { 0, 0, 0 }
- };
- etype = g_enum_register_static ("NMSettingError", values);
- }
- return etype;
-}
-
G_DEFINE_ABSTRACT_TYPE (NMSetting, nm_setting, G_TYPE_OBJECT)
#define NM_SETTING_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING, NMSettingPrivate))
diff --git a/libnm-util/nm-setting.h b/libnm-util/nm-setting.h
index 843b7918a3..3a9092555f 100644
--- a/libnm-util/nm-setting.h
+++ b/libnm-util/nm-setting.h
@@ -60,9 +60,6 @@ typedef enum
NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH
} NMSettingError;
-#define NM_TYPE_SETTING_ERROR (nm_setting_error_get_type ())
-GType nm_setting_error_get_type (void);
-
#define NM_SETTING_ERROR nm_setting_error_quark ()
GQuark nm_setting_error_quark (void);
diff --git a/libnm-util/nm-utils.h b/libnm-util/nm-utils.h
index 7684ed6bc8..7bc536acc9 100644
--- a/libnm-util/nm-utils.h
+++ b/libnm-util/nm-utils.h
@@ -29,6 +29,7 @@
#include <glib.h>
#include "nm-connection.h"
+#include "nm-utils-enum-types.h"
G_BEGIN_DECLS