From 61a7962866886dff93f29bee45007dbdac26199a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 6 Dec 2008 18:13:04 +0100 Subject: [PATCH] Allow pre-processor pasting of plugin name --- doc/plugin-api.txt | 3 ++- include/plugin.h | 2 +- plugins/bluetooth.c | 2 +- plugins/dhclient.c | 2 +- plugins/ethernet.c | 2 +- plugins/fake.c | 2 +- plugins/ipv4.c | 2 +- plugins/loopback.c | 2 +- plugins/netdev.c | 2 +- plugins/polkit.c | 2 +- plugins/resolvconf.c | 2 +- plugins/resolvfile.c | 2 +- plugins/rtnllink.c | 2 +- plugins/wifi.c | 2 +- 14 files changed, 15 insertions(+), 14 deletions(-) diff --git a/doc/plugin-api.txt b/doc/plugin-api.txt index baaea30..e329ced 100644 --- a/doc/plugin-api.txt +++ b/doc/plugin-api.txt @@ -4,6 +4,7 @@ Plugin programming interface Plugin basics ============= + The Connection Manager supports plugins for various actions. The basic plugin contains of plugin description via CONNMAN_PLUGIN_DEFINE and also init/exit callbacks definied through that description. @@ -19,5 +20,5 @@ static void example_exit(void) { } -CONNMAN_PLUGIN_DEFINE("example", "Example plugin", VERSION, +CONNMAN_PLUGIN_DEFINE(example, "Example plugin", VERSION, example_init, example_exit) diff --git a/include/plugin.h b/include/plugin.h index 427ceed..587e9d7 100644 --- a/include/plugin.h +++ b/include/plugin.h @@ -52,7 +52,7 @@ struct connman_plugin_desc { */ #define CONNMAN_PLUGIN_DEFINE(name, description, version, init, exit) \ struct connman_plugin_desc connman_plugin_desc = { \ - name, description, version, init, exit \ + #name, description, version, init, exit \ }; #ifdef __cplusplus diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c index 978f257..c09e4a5 100644 --- a/plugins/bluetooth.c +++ b/plugins/bluetooth.c @@ -181,5 +181,5 @@ static void bluetooth_exit(void) dbus_connection_unref(connection); } -CONNMAN_PLUGIN_DEFINE("bluetooth", "Bluetooth technology plugin", VERSION, +CONNMAN_PLUGIN_DEFINE(bluetooth, "Bluetooth technology plugin", VERSION, bluetooth_init, bluetooth_exit) diff --git a/plugins/dhclient.c b/plugins/dhclient.c index 7249773..3d6f189 100644 --- a/plugins/dhclient.c +++ b/plugins/dhclient.c @@ -356,5 +356,5 @@ static void dhclient_exit(void) dbus_connection_unref(connection); } -CONNMAN_PLUGIN_DEFINE("dhclient", "ISC DHCP client plugin", VERSION, +CONNMAN_PLUGIN_DEFINE(dhclient, "ISC DHCP client plugin", VERSION, dhclient_init, dhclient_exit) diff --git a/plugins/ethernet.c b/plugins/ethernet.c index bd2ddc2..28c1742 100644 --- a/plugins/ethernet.c +++ b/plugins/ethernet.c @@ -267,5 +267,5 @@ static void ethernet_exit(void) connman_rtnl_unregister(ðernet_rtnl); } -CONNMAN_PLUGIN_DEFINE("ethernet", "Ethernet interface plugin", VERSION, +CONNMAN_PLUGIN_DEFINE(ethernet, "Ethernet interface plugin", VERSION, ethernet_init, ethernet_exit) diff --git a/plugins/fake.c b/plugins/fake.c index 74b32bc..33165da 100644 --- a/plugins/fake.c +++ b/plugins/fake.c @@ -120,4 +120,4 @@ static void fake_exit(void) connman_driver_unregister(&fake_device_driver); } -CONNMAN_PLUGIN_DEFINE("fake", "Tesing plugin", VERSION, fake_init, fake_exit) +CONNMAN_PLUGIN_DEFINE(fake, "Tesing plugin", VERSION, fake_init, fake_exit) diff --git a/plugins/ipv4.c b/plugins/ipv4.c index 0e38612..173c691 100644 --- a/plugins/ipv4.c +++ b/plugins/ipv4.c @@ -236,5 +236,5 @@ static void ipv4_exit(void) connman_driver_unregister(&ipv4_driver); } -CONNMAN_PLUGIN_DEFINE("ipv4", "IPv4 configuration plugin", VERSION, +CONNMAN_PLUGIN_DEFINE(ipv4, "IPv4 configuration plugin", VERSION, ipv4_init, ipv4_exit) diff --git a/plugins/loopback.c b/plugins/loopback.c index 184ea73..29e6547 100644 --- a/plugins/loopback.c +++ b/plugins/loopback.c @@ -104,5 +104,5 @@ static void loopback_exit(void) { } -CONNMAN_PLUGIN_DEFINE("loopback", "Loopback device plugin", VERSION, +CONNMAN_PLUGIN_DEFINE(loopback, "Loopback device plugin", VERSION, loopback_init, loopback_exit) diff --git a/plugins/netdev.c b/plugins/netdev.c index d8733b7..226d633 100644 --- a/plugins/netdev.c +++ b/plugins/netdev.c @@ -77,5 +77,5 @@ static void netdev_exit(void) connman_driver_unregister(&netdev_driver); } -CONNMAN_PLUGIN_DEFINE("netdev", "Network device plugin", VERSION, +CONNMAN_PLUGIN_DEFINE(netdev, "Network device plugin", VERSION, netdev_init, netdev_exit) diff --git a/plugins/polkit.c b/plugins/polkit.c index 7bed0b1..a2e15a9 100644 --- a/plugins/polkit.c +++ b/plugins/polkit.c @@ -159,5 +159,5 @@ static void polkit_exit(void) dbus_connection_unref(connection); } -CONNMAN_PLUGIN_DEFINE("polkit", "PolicyKit authorization plugin", VERSION, +CONNMAN_PLUGIN_DEFINE(polkit, "PolicyKit authorization plugin", VERSION, polkit_init, polkit_exit) diff --git a/plugins/resolvconf.c b/plugins/resolvconf.c index f81d106..e1d5337 100644 --- a/plugins/resolvconf.c +++ b/plugins/resolvconf.c @@ -114,5 +114,5 @@ static void resolvconf_exit(void) connman_driver_unregister(&resolvconf_driver); } -CONNMAN_PLUGIN_DEFINE("resolvconf", "Name resolver plugin", VERSION, +CONNMAN_PLUGIN_DEFINE(resolvconf, "Name resolver plugin", VERSION, resolvconf_init, resolvconf_exit) diff --git a/plugins/resolvfile.c b/plugins/resolvfile.c index 54ad41b..deb39c9 100644 --- a/plugins/resolvfile.c +++ b/plugins/resolvfile.c @@ -95,5 +95,5 @@ static void resolvfile_exit(void) connman_driver_unregister(&resolvfile_driver); } -CONNMAN_PLUGIN_DEFINE("resolvfile", "Name resolver plugin", VERSION, +CONNMAN_PLUGIN_DEFINE(resolvfile, "Name resolver plugin", VERSION, resolvfile_init, resolvfile_exit) diff --git a/plugins/rtnllink.c b/plugins/rtnllink.c index 094547d..da5a588 100644 --- a/plugins/rtnllink.c +++ b/plugins/rtnllink.c @@ -167,5 +167,5 @@ static void rtnllink_exit(void) device_list = NULL; } -CONNMAN_PLUGIN_DEFINE("rtnllink", "RTNL link detection plugin", VERSION, +CONNMAN_PLUGIN_DEFINE(rtnllink, "RTNL link detection plugin", VERSION, rtnllink_init, rtnllink_exit) diff --git a/plugins/wifi.c b/plugins/wifi.c index 0ae20f5..7d17ae2 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -507,5 +507,5 @@ static void wifi_exit(void) dbus_connection_unref(connection); } -CONNMAN_PLUGIN_DEFINE("wifi", "WiFi interface plugin", VERSION, +CONNMAN_PLUGIN_DEFINE(wifi, "WiFi interface plugin", VERSION, wifi_init, wifi_exit) -- 2.7.4