diff options
author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2012-05-20 02:07:29 -0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-05-20 02:47:57 -0700 |
commit | b3489f2ee86c1d7ace388b43420a32f9a76b019c (patch) | |
tree | 90688955099f3fe63186caa79d9d7bcbb2f82770 /src/network.c | |
parent | 8e815c100b566e1de1f5e555e0291f6610a08cd7 (diff) | |
download | ofono-b3489f2ee86c1d7ace388b43420a32f9a76b019c.tar.bz2 |
Convert GDBus methods to use macro helpers
With these macro helpers we can separate in/out arguments and use their
own vector.
Diffstat (limited to 'src/network.c')
-rw-r--r-- | src/network.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/network.c b/src/network.c index 7d28762e..ede8437f 100644 --- a/src/network.c +++ b/src/network.c @@ -624,14 +624,17 @@ static DBusMessage *network_operator_register(DBusConnection *conn, } static const GDBusMethodTable network_operator_methods[] = { - { "GetProperties", "", "a{sv}", network_operator_get_properties }, - { "Register", "", "", network_operator_register, - G_DBUS_METHOD_FLAG_ASYNC }, + { _GDBUS_METHOD("GetProperties", "", "a{sv}", + NULL, GDBUS_ARGS({ "properties", "a{sv}" }), + network_operator_get_properties) }, + { _GDBUS_ASYNC_METHOD("Register", "", "", NULL, NULL, + network_operator_register) }, { } }; static const GDBusSignalTable network_operator_signals[] = { - { "PropertyChanged", "sv" }, + { _GDBUS_SIGNAL("PropertyChanged", "sv", + GDBUS_ARGS({ "name", "s" }, { "value", "v" })) }, { } }; @@ -1021,17 +1024,23 @@ static DBusMessage *network_get_operators(DBusConnection *conn, } static const GDBusMethodTable network_registration_methods[] = { - { "GetProperties", "", "a{sv}", network_get_properties }, - { "Register", "", "", network_register, - G_DBUS_METHOD_FLAG_ASYNC }, - { "GetOperators", "", "a(oa{sv})", network_get_operators }, - { "Scan", "", "a(oa{sv})", network_scan, - G_DBUS_METHOD_FLAG_ASYNC }, + { _GDBUS_METHOD("GetProperties", "", "a{sv}", + NULL, GDBUS_ARGS({ "properties", "a{sv}" }), + network_get_properties) }, + { _GDBUS_ASYNC_METHOD("Register", "", "", + NULL, NULL, network_register) }, + { _GDBUS_METHOD("GetOperators", "", "a(oa{sv})", + NULL, GDBUS_ARGS({ "operators_with_properties", "a(oa{sv})" }), + network_get_operators) }, + { _GDBUS_ASYNC_METHOD("Scan", "", "a(oa{sv})", + NULL, GDBUS_ARGS({ "operators_with_properties", "a(oa{sv})" }), + network_scan) }, { } }; static const GDBusSignalTable network_registration_signals[] = { - { "PropertyChanged", "sv" }, + { _GDBUS_SIGNAL("PropertyChanged", "a{sv}", + GDBUS_ARGS({ "name", "s" }, { "value", "v" })) }, { } }; |