client: Do not include headers from the core
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 11 Dec 2012 11:30:50 +0000 (12:30 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 11 Dec 2012 11:30:50 +0000 (12:30 +0100)
client/data_manager.c
client/data_manager.h
client/dbus.h
client/monitor.c
client/services.c
client/technology.c

index f11a385d6a2b15970155c7cb2ca1592198729a9c..895397b59db32e8d9461212a0cf8fb3a10e36cfc 100644 (file)
@@ -33,7 +33,6 @@
 
 #include <glib.h>
 
-#include "src/connman.h"
 #include "client/services.h"
 #include "client/technology.h"
 #include "client/data_manager.h"
index 3fb424c68535eb596a99a52c22284f0f533402e2..211eeb39a924df30338fd5ec82b65dfe4a99fa71 100644 (file)
@@ -23,8 +23,6 @@
 #include <dbus/dbus.h>
 
 #define SIGNAL_LISTEN_TIMEOUT 10
-#define CONNMAN_MANAGER_PATH "/"
-#define CONNMAN_SERVICE "net.connman"
 
 struct signal_args {
        DBusConnection *connection;
index 27f7c5a0ff1be49998d3c2d7c55930ea27c060c7..3cde017f74ba200d8f09316aa0acb0e6ebc52a9b 100644 (file)
 
 #include <dbus/dbus.h>
 
+#define CONNMAN_SERVICE                        "net.connman"
+
+#define CONNMAN_MANAGER_INTERFACE      CONNMAN_SERVICE ".Manager"
+#define CONNMAN_MANAGER_PATH           "/"
+
+#define CONNMAN_SERVICE_INTERFACE      CONNMAN_SERVICE ".Service"
+
 void dbus_property_append_basic(DBusMessageIter *iter,
                                        const char *key, int type, void *val);
 
+static inline void dbus_dict_open(DBusMessageIter *iter, DBusMessageIter *dict)
+{
+       dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
+                       DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+                       DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING
+                       DBUS_DICT_ENTRY_END_CHAR_AS_STRING, dict);
+}
+
+static inline void dbus_dict_open_variant(DBusMessageIter *iter,
+                                                       DBusMessageIter *dict)
+{
+       dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT,
+                       DBUS_TYPE_ARRAY_AS_STRING
+                       DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+                       DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING
+                       DBUS_DICT_ENTRY_END_CHAR_AS_STRING, dict);
+}
+
+static inline void dbus_array_open(DBusMessageIter *iter, DBusMessageIter *dict)
+{
+       dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT,
+                       DBUS_TYPE_ARRAY_AS_STRING
+                       DBUS_TYPE_STRING_AS_STRING,
+                       dict);
+}
+
+static inline void dbus_dict_close(DBusMessageIter *iter, DBusMessageIter *dict)
+{
+       dbus_message_iter_close_container(iter, dict);
+}
+
index 9ae32688ab99afb414870989a026bde1638d72de..ae585be33286caab1a4e5cca01b6ef8520f63778 100644 (file)
@@ -38,7 +38,6 @@
 #include "client/services.h"
 #include "client/technology.h"
 #include "client/data_manager.h"
-#include "src/connman.h"
 #include "gdbus/gdbus.h"
 
 static const char *get_service_name(DBusMessage *message, char *dbus_path)
index 99b1507921c050de655abd2ea4b0d8b94ff1c3bd..df8091141200db00be9cf9dbccf1282f4a238658 100644 (file)
@@ -31,8 +31,9 @@
 #include <unistd.h>
 #include <errno.h>
 
+#include <glib.h>
+
 #include "client/services.h"
-#include "src/connman.h"
 #include "dbus.h"
 
 static void append_property_array(DBusMessageIter *iter, char *property,
@@ -43,7 +44,7 @@ static void append_property_array(DBusMessageIter *iter, char *property,
 
        dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &property);
 
-       connman_dbus_array_open(iter, &value);
+       dbus_array_open(iter, &value);
        dbus_message_iter_open_container(&value, DBUS_TYPE_ARRAY,
                                         DBUS_TYPE_STRING_AS_STRING, &array);
 
@@ -66,9 +67,9 @@ static void append_property_dict(DBusMessageIter *iter, char *property,
        dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &property);
 
        /* Top most level is a{sv} */
-       connman_dbus_dict_open_variant(iter, &value);
+       dbus_dict_open_variant(iter, &value);
 
-       connman_dbus_dict_open(&value, &dict);
+       dbus_dict_open(&value, &dict);
 
        for (i = 0; i < num_args; i++) {
                dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY,
@@ -103,8 +104,8 @@ static void append_property_dict(DBusMessageIter *iter, char *property,
                dbus_message_iter_close_container(&dict, &entry);
        }
        /* Close {sv}, then close a{sv} */
-       connman_dbus_dict_close(&value, &dict);
-       connman_dbus_dict_close(iter, &value);
+       dbus_dict_close(&value, &dict);
+       dbus_dict_close(iter, &value);
 }
 
 void iterate_array(DBusMessageIter *iter)
@@ -421,8 +422,8 @@ int set_proxy_manual(DBusConnection *connection, DBusMessage *message,
 
        dbus_message_iter_init_append(message_send, &iter);
        dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &property);
-       connman_dbus_dict_open_variant(&iter, &value);
-       connman_dbus_dict_open(&value, &dict);
+       dbus_dict_open_variant(&iter, &value);
+       dbus_dict_open(&value, &dict);
        dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL,
                                                        &entry);
        dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &method);
index 3211aec81d32a08dc526108cda2db5e7ffa7f58a..9f368580f0b3a90eed7d9a9ef3a2c2ef142fdb40 100644 (file)
@@ -30,8 +30,9 @@
 #include <string.h>
 #include <errno.h>
 
+#include <glib.h>
+
 #include "client/technology.h"
-#include "src/connman.h"
 #include "dbus.h"
 
 void extract_properties(DBusMessageIter *dict)