summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile.am4
-rw-r--r--tools/dbus-names-model.c14
-rw-r--r--tools/dbus-viewer.c23
-rw-r--r--tools/print-introspect.c10
4 files changed, 30 insertions, 21 deletions
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 333d89d1..71db5203 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES=-I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) $(DBUS_GLIB_CFLAGS) $(DBUS_X_CFLAGS) $(DBUS_GTK_THREADS_CFLAGS) -DDBUS_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\"
+INCLUDES=-I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) $(DBUS_GLIB_CFLAGS) $(DBUS_X_CFLAGS) $(DBUS_GTK_THREADS_CFLAGS) -DDBUS_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DDBUS_COMPILATION
if HAVE_GLIB
GLIB_TOOLS=dbus-monitor
@@ -7,7 +7,7 @@ nodist_libdbus_glib_HEADERS = dbus-glib-bindings.h
libdbus_glibdir = $(includedir)/dbus-1.0/dbus
dbus-glib-bindings.h: dbus-bus-introspect.xml $(top_builddir)/glib/dbus-binding-tool
- $(top_builddir)/glib/dbus-binding-tool --ignore-unsupported --mode=glib-client --output=dbus-glib-bindings.h dbus-bus-introspect.xml # FIXME - remove --ignore-unsupported when we can do arrays
+ $(top_builddir)/glib/dbus-binding-tool --mode=glib-client --output=dbus-glib-bindings.h dbus-bus-introspect.xml
BUILT_SOURCES = dbus-glib-bindings.h dbus-bus-introspect.xml
diff --git a/tools/dbus-names-model.c b/tools/dbus-names-model.c
index ab83e5f2..01f7c4e8 100644
--- a/tools/dbus-names-model.c
+++ b/tools/dbus-names-model.c
@@ -23,6 +23,7 @@
#include "dbus-names-model.h"
#include <glib/gi18n.h>
#include <string.h>
+#include <dbus/dbus-protocol.h>
enum
{
@@ -76,8 +77,8 @@ have_names_notify (DBusGPendingCall *call,
error = NULL;
if (!dbus_g_proxy_end_call (names_model->driver_proxy,
names_model->pending_list_names,
- &error, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
- &names, &n_elements, DBUS_TYPE_INVALID))
+ &error, G_TYPE_STRV,
+ &names, &n_elements, G_TYPE_INVALID))
{
g_assert (names == NULL);
g_assert (error != NULL);
@@ -210,7 +211,7 @@ names_model_reload (NamesModel *names_model)
names_model->pending_list_names =
dbus_g_proxy_begin_call (names_model->driver_proxy,
"ListNames",
- DBUS_TYPE_INVALID);
+ G_TYPE_INVALID);
dbus_g_pending_call_set_notify (names_model->pending_list_names,
have_names_notify, names_model, NULL);
@@ -252,9 +253,10 @@ names_model_set_connection (NamesModel *names_model,
dbus_g_proxy_add_signal (names_model->driver_proxy,
"NameOwnerChanged",
- DBUS_TYPE_STRING_AS_STRING
- DBUS_TYPE_STRING_AS_STRING
- DBUS_TYPE_STRING_AS_STRING);
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_INVALID);
dbus_g_proxy_connect_signal (names_model->driver_proxy,
"NameOwnerChanged",
diff --git a/tools/dbus-viewer.c b/tools/dbus-viewer.c
index b031c7dd..95d00c19 100644
--- a/tools/dbus-viewer.c
+++ b/tools/dbus-viewer.c
@@ -148,7 +148,7 @@ load_child_nodes (const char *service_name,
{
DBusGProxy *proxy;
DBusGPendingCall *call;
- const char *data;
+ char *data;
NodeInfo *child;
NodeInfo *complete_child;
int save_len;
@@ -184,14 +184,19 @@ load_child_nodes (const char *service_name,
}
call = dbus_g_proxy_begin_call (proxy, "Introspect",
- DBUS_TYPE_INVALID);
+ G_TYPE_INVALID);
data = NULL;
- if (!dbus_g_proxy_end_call (proxy, call, error, DBUS_TYPE_STRING, &data,
- DBUS_TYPE_INVALID))
- goto done;
+ if (!dbus_g_proxy_end_call (proxy, call, error, G_TYPE_STRING, &data,
+ G_TYPE_INVALID))
+ {
+ call = NULL;
+ goto done;
+ }
+ call = NULL;
complete_child = description_load_from_string (data, -1, error);
+ g_free (data);
if (complete_child == NULL)
{
g_printerr ("%s\n", data);
@@ -300,16 +305,18 @@ load_from_service_thread_func (void *thread_data)
#endif
call = dbus_g_proxy_begin_call (root_proxy, "Introspect",
- DBUS_TYPE_INVALID);
+ G_TYPE_INVALID);
data = NULL;
- if (!dbus_g_proxy_end_call (root_proxy, call, &lfsd->error, DBUS_TYPE_STRING, &data,
- DBUS_TYPE_INVALID))
+ if (!dbus_g_proxy_end_call (root_proxy, call, &lfsd->error, G_TYPE_STRING, &data,
+ G_TYPE_INVALID))
{
+ call = NULL;
g_printerr ("Failed to Introspect() %s\n",
dbus_g_proxy_get_bus_name (root_proxy));
goto out;
}
+ call = NULL;
node = description_load_from_string (data, -1, &lfsd->error);
diff --git a/tools/print-introspect.c b/tools/print-introspect.c
index 9784af00..e9fe3ce4 100644
--- a/tools/print-introspect.c
+++ b/tools/print-introspect.c
@@ -41,7 +41,7 @@ main (int argc, char *argv[])
GError *error;
const char *service;
const char *path;
- const char *introspect_data;
+ char *introspect_data;
if (argc != 3)
usage (argv[0], 1);
@@ -64,9 +64,9 @@ main (int argc, char *argv[])
proxy = dbus_g_proxy_new_for_name (connection,
service, path,
DBUS_INTERFACE_INTROSPECTABLE);
- call = dbus_g_proxy_begin_call (proxy, "Introspect", DBUS_TYPE_INVALID);
- if (!dbus_g_proxy_end_call (proxy, call, &error, DBUS_TYPE_STRING,
- &introspect_data, DBUS_TYPE_INVALID))
+ call = dbus_g_proxy_begin_call (proxy, "Introspect", G_TYPE_INVALID);
+ if (!dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING,
+ &introspect_data, G_TYPE_INVALID))
{
fprintf (stderr, "Failed to get introspection data: %s\n",
error->message);
@@ -75,8 +75,8 @@ main (int argc, char *argv[])
}
printf ("%s", introspect_data);
+ g_free (introspect_data);
- dbus_g_pending_call_unref (call);
g_object_unref (proxy);
exit (0);