mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-06 17:14:02 +00:00
libnm-core: simplify _nm_register_setting(), register error types too
Simplify the use of _nm_register_setting() by having it splice together various symbol names itself rather than requiring them to be specified explicitly, and extend it to also ensure that the type's corresponding error type is registered (allowing one to find it via g_type_from_name() if necessary).
This commit is contained in:
parent
8faef95dae
commit
40bb402898
|
@ -80,10 +80,7 @@ nm_setting_802_1x_error_quark (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSetting8021x, nm_setting_802_1x, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSetting8021x, nm_setting_802_1x, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_802_1X_SETTING_NAME,
|
_nm_register_setting (802_1X, 2))
|
||||||
g_define_type_id,
|
|
||||||
2,
|
|
||||||
NM_SETTING_802_1X_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_802_1X)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_802_1X)
|
||||||
|
|
||||||
#define NM_SETTING_802_1X_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_802_1X, NMSetting8021xPrivate))
|
#define NM_SETTING_802_1X_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_802_1X, NMSetting8021xPrivate))
|
||||||
|
|
|
@ -53,10 +53,7 @@ nm_setting_adsl_error_quark (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingAdsl, nm_setting_adsl, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingAdsl, nm_setting_adsl, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_ADSL_SETTING_NAME,
|
_nm_register_setting (ADSL, 1))
|
||||||
g_define_type_id,
|
|
||||||
1,
|
|
||||||
NM_SETTING_ADSL_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_ADSL)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_ADSL)
|
||||||
|
|
||||||
#define NM_SETTING_ADSL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_ADSL, NMSettingAdslPrivate))
|
#define NM_SETTING_ADSL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_ADSL, NMSettingAdslPrivate))
|
||||||
|
|
|
@ -60,10 +60,7 @@ nm_setting_bluetooth_error_quark (void)
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingBluetooth, nm_setting_bluetooth, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingBluetooth, nm_setting_bluetooth, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_BLUETOOTH_SETTING_NAME,
|
_nm_register_setting (BLUETOOTH, 1))
|
||||||
g_define_type_id,
|
|
||||||
1,
|
|
||||||
NM_SETTING_BLUETOOTH_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_BLUETOOTH)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_BLUETOOTH)
|
||||||
|
|
||||||
#define NM_SETTING_BLUETOOTH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_BLUETOOTH, NMSettingBluetoothPrivate))
|
#define NM_SETTING_BLUETOOTH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_BLUETOOTH, NMSettingBluetoothPrivate))
|
||||||
|
|
|
@ -61,10 +61,7 @@ nm_setting_bond_error_quark (void)
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingBond, nm_setting_bond, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingBond, nm_setting_bond, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_BOND_SETTING_NAME,
|
_nm_register_setting (BOND, 1))
|
||||||
g_define_type_id,
|
|
||||||
1,
|
|
||||||
NM_SETTING_BOND_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_BOND)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_BOND)
|
||||||
|
|
||||||
#define NM_SETTING_BOND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_BOND, NMSettingBondPrivate))
|
#define NM_SETTING_BOND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_BOND, NMSettingBondPrivate))
|
||||||
|
|
|
@ -56,10 +56,7 @@ nm_setting_bridge_port_error_quark (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingBridgePort, nm_setting_bridge_port, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingBridgePort, nm_setting_bridge_port, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_BRIDGE_PORT_SETTING_NAME,
|
_nm_register_setting (BRIDGE_PORT, 3))
|
||||||
g_define_type_id,
|
|
||||||
3,
|
|
||||||
NM_SETTING_BRIDGE_PORT_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_BRIDGE_PORT)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_BRIDGE_PORT)
|
||||||
|
|
||||||
#define NM_SETTING_BRIDGE_PORT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_BRIDGE_PORT, NMSettingBridgePortPrivate))
|
#define NM_SETTING_BRIDGE_PORT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_BRIDGE_PORT, NMSettingBridgePortPrivate))
|
||||||
|
|
|
@ -59,10 +59,7 @@ nm_setting_bridge_error_quark (void)
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingBridge, nm_setting_bridge, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingBridge, nm_setting_bridge, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_BRIDGE_SETTING_NAME,
|
_nm_register_setting (BRIDGE, 1))
|
||||||
g_define_type_id,
|
|
||||||
1,
|
|
||||||
NM_SETTING_BRIDGE_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_BRIDGE)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_BRIDGE)
|
||||||
|
|
||||||
#define NM_SETTING_BRIDGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_BRIDGE, NMSettingBridgePrivate))
|
#define NM_SETTING_BRIDGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_BRIDGE, NMSettingBridgePrivate))
|
||||||
|
|
|
@ -54,10 +54,7 @@ nm_setting_cdma_error_quark (void)
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingCdma, nm_setting_cdma, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingCdma, nm_setting_cdma, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_CDMA_SETTING_NAME,
|
_nm_register_setting (CDMA, 1))
|
||||||
g_define_type_id,
|
|
||||||
1,
|
|
||||||
NM_SETTING_CDMA_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_CDMA)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_CDMA)
|
||||||
|
|
||||||
#define NM_SETTING_CDMA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_CDMA, NMSettingCdmaPrivate))
|
#define NM_SETTING_CDMA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_CDMA, NMSettingCdmaPrivate))
|
||||||
|
|
|
@ -58,10 +58,7 @@ nm_setting_connection_error_quark (void)
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingConnection, nm_setting_connection, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingConnection, nm_setting_connection, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_CONNECTION_SETTING_NAME,
|
_nm_register_setting (CONNECTION, 0))
|
||||||
g_define_type_id,
|
|
||||||
0,
|
|
||||||
NM_SETTING_CONNECTION_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_CONNECTION)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_CONNECTION)
|
||||||
|
|
||||||
#define NM_SETTING_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_CONNECTION, NMSettingConnectionPrivate))
|
#define NM_SETTING_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_CONNECTION, NMSettingConnectionPrivate))
|
||||||
|
|
|
@ -60,10 +60,7 @@ nm_setting_dcb_error_quark (void)
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingDcb, nm_setting_dcb, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingDcb, nm_setting_dcb, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_DCB_SETTING_NAME,
|
_nm_register_setting (DCB, 2))
|
||||||
g_define_type_id,
|
|
||||||
2,
|
|
||||||
NM_SETTING_DCB_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_DCB)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_DCB)
|
||||||
|
|
||||||
#define NM_SETTING_DCB_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_DCB, NMSettingDcbPrivate))
|
#define NM_SETTING_DCB_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_DCB, NMSettingDcbPrivate))
|
||||||
|
|
|
@ -54,10 +54,7 @@ nm_setting_generic_error_quark (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingGeneric, nm_setting_generic, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingGeneric, nm_setting_generic, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_GENERIC_SETTING_NAME,
|
_nm_register_setting (GENERIC, 1))
|
||||||
g_define_type_id,
|
|
||||||
1,
|
|
||||||
NM_SETTING_GENERIC_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_GENERIC)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_GENERIC)
|
||||||
|
|
||||||
#define NM_SETTING_GENERIC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_GENERIC, NMSettingGenericPrivate))
|
#define NM_SETTING_GENERIC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_GENERIC, NMSettingGenericPrivate))
|
||||||
|
|
|
@ -55,10 +55,7 @@ nm_setting_gsm_error_quark (void)
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingGsm, nm_setting_gsm, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingGsm, nm_setting_gsm, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_GSM_SETTING_NAME,
|
_nm_register_setting (GSM, 1))
|
||||||
g_define_type_id,
|
|
||||||
1,
|
|
||||||
NM_SETTING_GSM_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_GSM)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_GSM)
|
||||||
|
|
||||||
#define NM_SETTING_GSM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_GSM, NMSettingGsmPrivate))
|
#define NM_SETTING_GSM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_GSM, NMSettingGsmPrivate))
|
||||||
|
|
|
@ -56,10 +56,7 @@ nm_setting_infiniband_error_quark (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingInfiniband, nm_setting_infiniband, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingInfiniband, nm_setting_infiniband, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_INFINIBAND_SETTING_NAME,
|
_nm_register_setting (INFINIBAND, 1))
|
||||||
g_define_type_id,
|
|
||||||
1,
|
|
||||||
NM_SETTING_INFINIBAND_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_INFINIBAND)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_INFINIBAND)
|
||||||
|
|
||||||
#define NM_SETTING_INFINIBAND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_INFINIBAND, NMSettingInfinibandPrivate))
|
#define NM_SETTING_INFINIBAND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_INFINIBAND, NMSettingInfinibandPrivate))
|
||||||
|
|
|
@ -62,10 +62,7 @@ G_DEFINE_BOXED_TYPE (NMIP4Address, nm_ip4_address, nm_ip4_address_dup, nm_ip4_ad
|
||||||
G_DEFINE_BOXED_TYPE (NMIP4Route, nm_ip4_route, nm_ip4_route_dup, nm_ip4_route_unref)
|
G_DEFINE_BOXED_TYPE (NMIP4Route, nm_ip4_route, nm_ip4_route_dup, nm_ip4_route_unref)
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingIP4Config, nm_setting_ip4_config, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingIP4Config, nm_setting_ip4_config, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_IP4_CONFIG_SETTING_NAME,
|
_nm_register_setting (IP4_CONFIG, 4))
|
||||||
g_define_type_id,
|
|
||||||
4,
|
|
||||||
NM_SETTING_IP4_CONFIG_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_IP4_CONFIG)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_IP4_CONFIG)
|
||||||
|
|
||||||
#define NM_SETTING_IP4_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP4_CONFIG, NMSettingIP4ConfigPrivate))
|
#define NM_SETTING_IP4_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP4_CONFIG, NMSettingIP4ConfigPrivate))
|
||||||
|
|
|
@ -59,10 +59,7 @@ G_DEFINE_BOXED_TYPE (NMIP6Address, nm_ip6_address, nm_ip6_address_dup, nm_ip6_ad
|
||||||
G_DEFINE_BOXED_TYPE (NMIP6Route, nm_ip6_route, nm_ip6_route_dup, nm_ip6_route_unref)
|
G_DEFINE_BOXED_TYPE (NMIP6Route, nm_ip6_route, nm_ip6_route_dup, nm_ip6_route_unref)
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingIP6Config, nm_setting_ip6_config, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingIP6Config, nm_setting_ip6_config, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_IP6_CONFIG_SETTING_NAME,
|
_nm_register_setting (IP6_CONFIG, 4))
|
||||||
g_define_type_id,
|
|
||||||
4,
|
|
||||||
NM_SETTING_IP6_CONFIG_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_IP6_CONFIG)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_IP6_CONFIG)
|
||||||
|
|
||||||
#define NM_SETTING_IP6_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP6_CONFIG, NMSettingIP6ConfigPrivate))
|
#define NM_SETTING_IP6_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP6_CONFIG, NMSettingIP6ConfigPrivate))
|
||||||
|
|
|
@ -45,10 +45,7 @@ nm_setting_olpc_mesh_error_quark (void)
|
||||||
static void nm_setting_olpc_mesh_init (NMSettingOlpcMesh *setting);
|
static void nm_setting_olpc_mesh_init (NMSettingOlpcMesh *setting);
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingOlpcMesh, nm_setting_olpc_mesh, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingOlpcMesh, nm_setting_olpc_mesh, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_OLPC_MESH_SETTING_NAME,
|
_nm_register_setting (OLPC_MESH, 1))
|
||||||
g_define_type_id,
|
|
||||||
1,
|
|
||||||
NM_SETTING_OLPC_MESH_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_OLPC_MESH)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_OLPC_MESH)
|
||||||
|
|
||||||
#define NM_SETTING_OLPC_MESH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_OLPC_MESH, NMSettingOlpcMeshPrivate))
|
#define NM_SETTING_OLPC_MESH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_OLPC_MESH, NMSettingOlpcMeshPrivate))
|
||||||
|
|
|
@ -54,10 +54,7 @@ nm_setting_ppp_error_quark (void)
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingPpp, nm_setting_ppp, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingPpp, nm_setting_ppp, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_PPP_SETTING_NAME,
|
_nm_register_setting (PPP, 3))
|
||||||
g_define_type_id,
|
|
||||||
3,
|
|
||||||
NM_SETTING_PPP_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_PPP)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_PPP)
|
||||||
|
|
||||||
#define NM_SETTING_PPP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_PPP, NMSettingPppPrivate))
|
#define NM_SETTING_PPP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_PPP, NMSettingPppPrivate))
|
||||||
|
|
|
@ -55,10 +55,7 @@ nm_setting_pppoe_error_quark (void)
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingPppoe, nm_setting_pppoe, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingPppoe, nm_setting_pppoe, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_PPPOE_SETTING_NAME,
|
_nm_register_setting (PPPOE, 3))
|
||||||
g_define_type_id,
|
|
||||||
3,
|
|
||||||
NM_SETTING_PPPOE_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_PPPOE)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_PPPOE)
|
||||||
|
|
||||||
#define NM_SETTING_PPPOE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_PPPOE, NMSettingPppoePrivate))
|
#define NM_SETTING_PPPOE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_PPPOE, NMSettingPppoePrivate))
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
#include "nm-setting.h"
|
#include "nm-setting.h"
|
||||||
#include "nm-connection.h"
|
#include "nm-connection.h"
|
||||||
|
#include "nm-core-enum-types.h"
|
||||||
#include "nm-glib-compat.h"
|
#include "nm-glib-compat.h"
|
||||||
|
|
||||||
#include "nm-core-internal.h"
|
#include "nm-core-internal.h"
|
||||||
|
@ -48,8 +49,11 @@ void _nm_register_setting (const char *name,
|
||||||
const guint32 priority,
|
const guint32 priority,
|
||||||
const GQuark error_quark);
|
const GQuark error_quark);
|
||||||
|
|
||||||
/* Ensure, that name is a compile time constant string. Put the function name in parenthesis to suppress expansion. */
|
#define _nm_register_setting(name, priority) \
|
||||||
#define _nm_register_setting(name, type, priority, error_quark) _nm_register_setting ((name ""), type, priority, error_quark)
|
G_STMT_START { \
|
||||||
|
_nm_register_setting (NM_SETTING_ ## name ## _SETTING_NAME "", g_define_type_id, priority, NM_SETTING_ ## name ## _ERROR); \
|
||||||
|
g_type_ensure (NM_TYPE_SETTING_ ## name ## _ERROR); \
|
||||||
|
} G_STMT_END
|
||||||
|
|
||||||
gboolean _nm_setting_is_base_type (NMSetting *setting);
|
gboolean _nm_setting_is_base_type (NMSetting *setting);
|
||||||
gboolean _nm_setting_type_is_base_type (GType type);
|
gboolean _nm_setting_type_is_base_type (GType type);
|
||||||
|
|
|
@ -55,10 +55,7 @@ nm_setting_serial_error_quark (void)
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingSerial, nm_setting_serial, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingSerial, nm_setting_serial, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_SERIAL_SETTING_NAME,
|
_nm_register_setting (SERIAL, 2))
|
||||||
g_define_type_id,
|
|
||||||
2,
|
|
||||||
NM_SETTING_SERIAL_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_SERIAL)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_SERIAL)
|
||||||
|
|
||||||
#define NM_SETTING_SERIAL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_SERIAL, NMSettingSerialPrivate))
|
#define NM_SETTING_SERIAL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_SERIAL, NMSettingSerialPrivate))
|
||||||
|
|
|
@ -55,10 +55,7 @@ nm_setting_team_port_error_quark (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingTeamPort, nm_setting_team_port, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingTeamPort, nm_setting_team_port, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_TEAM_PORT_SETTING_NAME,
|
_nm_register_setting (TEAM_PORT, 3))
|
||||||
g_define_type_id,
|
|
||||||
3,
|
|
||||||
NM_SETTING_TEAM_PORT_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_TEAM_PORT)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_TEAM_PORT)
|
||||||
|
|
||||||
#define NM_SETTING_TEAM_PORT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_TEAM_PORT, NMSettingTeamPortPrivate))
|
#define NM_SETTING_TEAM_PORT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_TEAM_PORT, NMSettingTeamPortPrivate))
|
||||||
|
|
|
@ -57,10 +57,7 @@ nm_setting_team_error_quark (void)
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingTeam, nm_setting_team, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingTeam, nm_setting_team, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_TEAM_SETTING_NAME,
|
_nm_register_setting (TEAM, 1))
|
||||||
g_define_type_id,
|
|
||||||
1,
|
|
||||||
NM_SETTING_TEAM_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_TEAM)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_TEAM)
|
||||||
|
|
||||||
#define NM_SETTING_TEAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_TEAM, NMSettingTeamPrivate))
|
#define NM_SETTING_TEAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_TEAM, NMSettingTeamPrivate))
|
||||||
|
|
|
@ -57,10 +57,7 @@ nm_setting_vlan_error_quark (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingVlan, nm_setting_vlan, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingVlan, nm_setting_vlan, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_VLAN_SETTING_NAME,
|
_nm_register_setting (VLAN, 1))
|
||||||
g_define_type_id,
|
|
||||||
1,
|
|
||||||
NM_SETTING_VLAN_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_VLAN)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_VLAN)
|
||||||
|
|
||||||
#define NM_SETTING_VLAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_VLAN, NMSettingVlanPrivate))
|
#define NM_SETTING_VLAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_VLAN, NMSettingVlanPrivate))
|
||||||
|
|
|
@ -63,10 +63,7 @@ nm_setting_vpn_error_quark (void)
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingVpn, nm_setting_vpn, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingVpn, nm_setting_vpn, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_VPN_SETTING_NAME,
|
_nm_register_setting (VPN, 1))
|
||||||
g_define_type_id,
|
|
||||||
1,
|
|
||||||
NM_SETTING_VPN_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_VPN)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_VPN)
|
||||||
|
|
||||||
#define NM_SETTING_VPN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_VPN, NMSettingVpnPrivate))
|
#define NM_SETTING_VPN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_VPN, NMSettingVpnPrivate))
|
||||||
|
|
|
@ -56,10 +56,7 @@ nm_setting_wimax_error_quark (void)
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingWimax, nm_setting_wimax, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingWimax, nm_setting_wimax, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_WIMAX_SETTING_NAME,
|
_nm_register_setting (WIMAX, 1))
|
||||||
g_define_type_id,
|
|
||||||
1,
|
|
||||||
NM_SETTING_WIMAX_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_WIMAX)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_WIMAX)
|
||||||
|
|
||||||
#define NM_SETTING_WIMAX_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIMAX, NMSettingWimaxPrivate))
|
#define NM_SETTING_WIMAX_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIMAX, NMSettingWimaxPrivate))
|
||||||
|
|
|
@ -59,10 +59,7 @@ nm_setting_wired_error_quark (void)
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingWired, nm_setting_wired, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingWired, nm_setting_wired, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_WIRED_SETTING_NAME,
|
_nm_register_setting (WIRED, 1))
|
||||||
g_define_type_id,
|
|
||||||
1,
|
|
||||||
NM_SETTING_WIRED_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_WIRED)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_WIRED)
|
||||||
|
|
||||||
#define NM_SETTING_WIRED_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIRED, NMSettingWiredPrivate))
|
#define NM_SETTING_WIRED_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIRED, NMSettingWiredPrivate))
|
||||||
|
|
|
@ -74,10 +74,7 @@ nm_setting_wireless_security_error_quark (void)
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingWirelessSecurity, nm_setting_wireless_security, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingWirelessSecurity, nm_setting_wireless_security, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_WIRELESS_SECURITY_SETTING_NAME,
|
_nm_register_setting (WIRELESS_SECURITY, 2))
|
||||||
g_define_type_id,
|
|
||||||
2,
|
|
||||||
NM_SETTING_WIRELESS_SECURITY_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_WIRELESS_SECURITY)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_WIRELESS_SECURITY)
|
||||||
|
|
||||||
#define NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIRELESS_SECURITY, NMSettingWirelessSecurityPrivate))
|
#define NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIRELESS_SECURITY, NMSettingWirelessSecurityPrivate))
|
||||||
|
|
|
@ -60,10 +60,7 @@ nm_setting_wireless_error_quark (void)
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSettingWireless, nm_setting_wireless, NM_TYPE_SETTING,
|
G_DEFINE_TYPE_WITH_CODE (NMSettingWireless, nm_setting_wireless, NM_TYPE_SETTING,
|
||||||
_nm_register_setting (NM_SETTING_WIRELESS_SETTING_NAME,
|
_nm_register_setting (WIRELESS, 1))
|
||||||
g_define_type_id,
|
|
||||||
1,
|
|
||||||
NM_SETTING_WIRELESS_ERROR))
|
|
||||||
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_WIRELESS)
|
NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_WIRELESS)
|
||||||
|
|
||||||
#define NM_SETTING_WIRELESS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIRELESS, NMSettingWirelessPrivate))
|
#define NM_SETTING_WIRELESS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIRELESS, NMSettingWirelessPrivate))
|
||||||
|
|
Loading…
Reference in a new issue