Commit 6180ae69 authored by Colin Walters's avatar Colin Walters

2005-03-14 Colin Walters <walters@verbum.org>

	* bus/driver.c (write_args_for_direction): Use
	_dbus_string_get_const_data to retrieve string;
	_dbus_string_get_const_data_len doesn't actually return
	a NULL-terminated substring.

	* test/glib/test-service-glib.c: Include dbus-glib-bindings.h.
	(main): Change to use org_freedesktop_DBus_request_name
	instead of using g_proxy_begin_call/end_call.
parent bcdd1854
2005-03-14 Colin Walters <walters@verbum.org>
* bus/driver.c (write_args_for_direction): Use
_dbus_string_get_const_data to retrieve string;
_dbus_string_get_const_data_len doesn't actually return
a NULL-terminated substring.
* test/glib/test-service-glib.c: Include dbus-glib-bindings.h.
(main): Change to use org_freedesktop_DBus_request_name
instead of using g_proxy_begin_call/end_call.
2005-03-15 Joe Shaw <joeshaw@novell.com>
* mono/ProxyBuilder.cs (BuildFinalizer): Fix some invalid IL when
......
......@@ -1117,7 +1117,14 @@ write_args_for_direction (DBusString *xml,
int start, len;
_dbus_type_reader_get_signature (&typereader, &subsig, &start, &len);
if (!_dbus_string_append_printf (xml, " <arg direction=\"%s\" type=\"%s\"/>\n", in ? "in" : "out", _dbus_string_get_const_data_len (subsig, start, len)))
if (!_dbus_string_append_printf (xml, " <arg direction=\"%s\" type=\"",
in ? "in" : "out"))
goto oom;
if (!_dbus_string_append_len (xml,
_dbus_string_get_const_data (subsig) + start,
len))
goto oom;
if (!_dbus_string_append (xml, "\"/>\n"))
goto oom;
_dbus_type_reader_next (&typereader);
......
/* -*- mode: C; c-file-style: "gnu" -*- */
#include <dbus/dbus-glib.h>
/* NOTE - outside of D-BUS core this would be
* include <dbus/dbus-glib-bindings.h>
*/
#include "glib/dbus-glib-bindings.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......@@ -190,6 +194,8 @@ my_object_many_args (MyObject *obj, guint32 x, const char *str, double trouble,
static GMainLoop *loop;
#define TEST_SERVICE_NAME "org.freedesktop.DBus.TestSuiteGLibService"
int
main (int argc, char **argv)
{
......@@ -197,9 +203,7 @@ main (int argc, char **argv)
GError *error;
GObject *obj;
DBusGProxy *driver_proxy;
DBusGPendingCall *call;
const char *v_STRING;
guint32 v_UINT32;
guint32 request_name_ret;
g_type_init ();
......@@ -231,34 +235,24 @@ main (int argc, char **argv)
DBUS_PATH_DBUS,
DBUS_INTERFACE_DBUS);
v_STRING = "org.freedesktop.DBus.TestSuiteGLibService";
v_UINT32 = 0;
call = dbus_g_proxy_begin_call (driver_proxy, "RequestName",
DBUS_TYPE_STRING,
&v_STRING,
DBUS_TYPE_UINT32,
&v_UINT32,
DBUS_TYPE_INVALID);
if (!dbus_g_proxy_end_call (driver_proxy, call,
&error, DBUS_TYPE_UINT32, &v_UINT32,
DBUS_TYPE_INVALID))
if (!org_freedesktop_DBus_request_name (driver_proxy,
TEST_SERVICE_NAME,
0, &request_name_ret, &error))
{
g_assert (error != NULL);
g_printerr ("Failed to get name: %s\n",
error->message);
g_error_free (error);
error->message);
g_clear_error (&error);
exit (1);
}
g_assert (error == NULL);
dbus_g_pending_call_unref (call);
if (!(v_UINT32 == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER))
if (!(request_name_ret == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER))
{
g_printerr ("Got result code %u from requesting name\n", v_UINT32);
g_printerr ("Got result code %u from requesting name\n", request_name_ret);
exit (1);
}
g_printerr ("GLib test service has name '%s'\n", v_STRING);
g_printerr ("GLib test service has name '%s'\n", TEST_SERVICE_NAME);
g_printerr ("GLib test service entering main loop\n");
g_main_loop_run (loop);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment