summaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* 2006-11-14 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-11-151-7/+12
| | | | | | | | | | | | | | * dbus/dbus-internals.c (_dbus_generate_uuid): The spec said the UUID had the timestamp last, but the implementation had it first; move it to last since I think it's a tiny bit nicer (easier to compare at a glance, faster to sort, less code), and will not cause any practical compatibility problems. Also, always convert the timestamp to big endian. * doc/dbus-specification.xml: Clean up the docs on the UUID. * tools/dbus-uuidgen.1: more prominently say it is not suitable as a replacement for regular uuidgen/RFC4122.
* * tools/dbus-monitor.c: Handle sigint so we flush stdoutJohn (J5) Palmieri2006-11-081-1/+15
| | | | (Patch from Olli Salli <olli dot salli at collabora dot co dot uk>)
* * tools/dbus-monitor.1: update the manpage for dbus-monitorJohn (J5) Palmieri2006-11-081-1/+16
| | | | (Patch from Olli Salli <olli dot salli at collabora dot co dot uk>)
* * tools/dbus-monitor.c: add profiling tools to dbus-monitorJohn (J5) Palmieri2006-11-081-4/+122
| | | | (Patch from Olli Salli <olli dot salli at collabora dot co dot uk>)
* * bus/config-parser.c (service_dirs_find_dir): useJohn (J5) Palmieri2006-11-021-0/+4
| | | | | | | | | | | _dbus_list_get_next_link so we don't get stuck in an infinite loop (start_busconfig_child): move processing of standard_session_servicedirs tags here because they have no content (bus_config_parser_content): check we don't have content in standard_session_servicedirs tag * tools/Makefile.am: Make sure the /var/lib/dbus directory is created Packagers need to own this directory
* * tools/run-with-tmp-session-bus.sh: fixed script to replace theJohn (J5) Palmieri2006-11-021-1/+1
| | | | | <standard_session_servicedirs> tag with a <sevicedir> tag that points to the test service directory
* 2006-10-30 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-301-1/+7
| | | | | * tools/dbus-launch.1, doc/TODO: capture intent to change the command line options of dbus-launch a bit post 1.0
* * configure.in, dbus-1.pc.in: Check to see if thread methodsJohn (J5) Palmieri2006-10-261-4/+4
| | | | | are in glibc or libpthread and add -lpthread to the link stage if it is the latter
* * tools/dbus-launch-x11.c (get_session_file, init_x_atoms):Thiago Macieira2006-10-261-4/+8
| | | | | | | | check if get_machine_uuid() returns NULL before proceeding any further: we can't init the X atoms or create a session file name if there is no machine ID. This solves a crash reported by some users if --exit-with-session was used without --autolaunch=<machine-id>
* * tools/dbus-launch.c (main): run the dbus-daemon in the builddirJohn (J5) Palmieri2006-10-262-1/+21
| | | | | | | | | | if tests are enabled and the DBUS_USE_TEST_BINARY env variable is set * tools/run-with-tmp-session-bus.sh: set DBUS_USE_TEST_BINARY before we run dbus-launch * configure.in: define TEST_BUS_BINARY to be the full path to dbus-daemon in the build root
* 2006-10-25 Sjoerd Simons <sjoerd@luon.net>Sjoerd Simons2006-10-252-17/+10
| | | | | | | * dbus/Makefile.am: * tools/Makefile.am: * toos/dbus-uuidgen.1: Move the machine-id file to /var/lib/dbus
* 2006-10-17 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-171-1/+1
| | | | | * tools/dbus-send.c (main): don't close shared connection, fix from Timo Hoenig
* * dbus/dbus-sysdeps.c (_dbus_abort): Remove fromJohn (J5) Palmieri2006-10-021-1/+2
| | | | | | | | | | #ifndef DBUS_DISABLE_ASSERTS macro to fix distcheck * dbus/dbus-sysdeps-unix.c (_dbus_print_backtrace): Remove from #if !defined (DBUS_DISABLE_ASSERT) || defined(DBUS_BUILD_TESTS) macro because _dbus_abort calls it * tools/Makefile.am: Add dbus-launch.h to the source list so distcheck works
* * tools/dbus-launch.c (main): make it complain and abortThiago Macieira2006-10-011-6/+28
| | | | | execution in case an unknown option is given. Also, process the '--' argument as the end of arguments.
* 2006-10-01 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-015-85/+300
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tools/dbus-launch.c (print_variables): if no syntax is given, don't print something that's sort-of-half-sh-syntax, just print a plain key-value pairs thing. * tools/dbus-launch-x11.c: use machine ID rather than hostname for the local machine representation (but still have the hostname in the display). Remove the hostname from the display if it is localhost. Change session files to be named ~/.dbus/session-bus/machine-display. Change X atoms to be underscore-prefixed so nobody whines about ICCCM compliance. Otherwise name them the same as the env variables. Change session file format to include key-value pairs and an explanatory comment. Keys are the same as the env variables. (set_address_in_x11): X property format can't depend on sizeof(pid_t) on a particular machine, fix to always be 32 bits * tools/dbus-launch.c: make --autolaunch take a machine id argument. If --autolaunch is used with a program to run, complain for now (but add a FIXME). Also, don't look for existing bus if there's a program to run (but add a FIXME). * dbus/dbus-sysdeps-unix.c (_dbus_get_autolaunch_address): pass machine uuid to dbus-launch (avoids linking dbus-launch to libdbus just to get this, and avoids duplicating uuid-reading code). * tools/dbus-launch.1: clarify various things
* 2006-10-01 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-connection.c (_dbus_connection_close_if_only_one_ref): Add a hack to make DBusNewConnectionFunction work right. * dbus/dbus-server-socket.c (handle_new_client_fd_and_unlock): use the hack here. Also, fix the todo about refcount leak. * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new): and use the hack here * dbus/dbus-connection.c: Kill the "shared" flag vs. the "shareable" flag; this was completely broken, since it meant dbus_connection_open() returned a connection of unknown shared-ness. Now, we always hold a ref on anything opened as shareable. Move the call to notify dbus-bus.c into connection_forget_shared_unlocked, so libdbus consistently forgets all its knowledge of a connection at once. This exposed numerous places where things were totally broken if we dropped a ref inside get_dispatch_status_unlocked where connection_forget_shared_unlocked was previously, so move connection_forget_shared_unlocked into _dbus_connection_update_dispatch_status_and_unlock. Also move the exit_on_disconnect here. (shared_connections_shutdown): this assumed weak refs to the shared connections; since we have strong refs now, the assertion was failing and stuff was left in the hash. Fix it to close still-open shared connections. * bus/dispatch.c: fixup to use dbus_connection_open_private on the debug pipe connections * dbus/dbus-connection.c (dbus_connection_dispatch): only notify dbus-bus.c if the closed connection is in fact shared (_dbus_connection_close_possibly_shared): rename from _dbus_connection_close_internal (dbus_connection_close, dbus_connection_open, dbus_connection_open_private): Improve docs to explain the deal with when you should close or unref or both * dbus/dbus-bus.c (_dbus_bus_notify_shared_connection_disconnected_unlocked): rename from _dbus_bus_check_connection_and_unref_unlocked and modify to loop over all connections * test/test-utils.c (test_connection_shutdown): don't try to close shared connections. * test/name-test/test-threads-init.c (main): fix warnings in here * dbus/dbus-sysdeps.c (_dbus_abort): support DBUS_BLOCK_ON_ABORT env variable to cause blocking waiting for gdb; drop DBUS_PRINT_BACKTRACE and just call _dbus_print_backtrace() unconditionally. * configure.in: add -export-dynamic to libtool flags if assertions enabled so _dbus_print_backtrace works. * dbus/dbus-sysdeps-unix.c (_dbus_print_backtrace): use fprintf instead of _dbus_verbose to print the backtrace, and diagnose lack of -rdynamic/-export-dynamic
* 2006-09-30 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-017-35/+311
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.in (LT_CURRENT, LT_AGE): increment current and age to reflect addition of interfaces. * doc/dbus-specification.xml: describe a new org.freedesktop.DBus.Peer.GetMachineId method * dbus/dbus-string.c (_dbus_string_skip_white_reverse): new function (_dbus_string_skip_white, _dbus_string_skip_blank): use new DBUS_IS_ASCII_BLANK, DBUS_IS_ASCII_WHITE macros and fix assertion at end of skip_white (_dbus_string_chop_white): new function * bus/connection.c (bus_connections_setup_connection): call dbus_connection_set_route_peer_messages. * dbus/dbus-connection.c (_dbus_connection_peer_filter_unlocked_no_update): modify to support a GetMachineId method. Also, support a new flag to let the bus pass peer methods through to apps on the bus, which can be set with dbus_connection_set_route_peer_messages. Finally, handle and return an error for anything unknown on the Peer interface, which will allow us to extend the Peer interface in the future without fear that we're now intercepting something apps were wanting to see. * tools/dbus-uuidgen.c: a thin wrapper around the functions in dbus/dbus-uuidgen.c * dbus/dbus-uuidgen.c: implement the bulk of the dbus-uuidgen binary here, since most of the code is already in libdbus * dbus/dbus-sysdeps.c (_dbus_read_local_machine_uuid): read the uuid from the system config file * dbus/dbus-internals.c (_dbus_generate_uuid, _dbus_uuid_encode) (_dbus_read_uuid_file_without_creating) (_dbus_create_uuid_file_exclusively, _dbus_read_uuid_file): new uuid-related functions, partly factored out from dbus-server.c * dbus/dbus-sysdeps.c (_dbus_error_from_errno): convert EEXIST to DBUS_ERROR_FILE_EXISTS instead of EEXIST * dbus/dbus-protocol.h (DBUS_ERROR_FILE_EXISTS): add file exists error * tools/dbus-cleanup-sockets.1: explain what the point of this thing is a bit more * autogen.sh (run_configure): add --config-cache to default configure args * dbus/dbus-internals.h (_DBUS_ASSERT_ERROR_IS_SET): disable the error set/clear assertions when DBUS_DISABLE_CHECKS is defined * tools/dbus-launch.c (main): if xdisplay hasn't been opened, don't try to save address, fixes crash in make check
* * configure.in: add DBUS_BINDIR as a #define to C source code.Thiago Macieira2006-09-305-125/+636
| | | | | | | | | | | | | | | | | | | | | | | | | * tools/dbus-launch.c * tools/dbus-launch.h * tools/dbus-launch-x11.c: * tools/dbus-launch.1: Add the --autolaunch option to dbus-launch, which makes it scan for an existing session started with --autolaunch. With that option, it also creates an X11 window and saves the bus address and PID to it. * dbus/dbus-sysdeps.h: * dbus/dbus-sysdeps-unix.c (_dbus_get_autolaunch_address): Add a function that runs "dbus-launch --autolaunch" to retrieve the running D-Bus session address (or start one if none was running) * dbus/dbus-transport.c: Add the handler for the "autolaunch:" address protocol, which tries to get the running session from dbus-launch. * dbus/dbus-bus.c: * dbus/dbus-internals.h: Make "autolaunch:" be the default D-Bus session bus address. * dbus/dbus-connection.c: Fix horrible typo in error message.
* * tools/Makefile.am: use @EXPANDED_DATADIR@ instead of @DATADIRNAME@John (J5) Palmieri2006-09-181-1/+1
|
* * tools/dbus-launch.c: Add a sigterm handler (patch from Frederic CrozatJohn (J5) Palmieri2006-09-011-0/+2
| | | | <fcrozat at mandriva dot com>)
* * tools/run-with-tmp-session-bus.sh:John (J5) Palmieri2006-08-101-2/+2
| | | | | | * test/name-test/run-test.sh: Remove bashisms (patch from Julio M. Merino Vidal <jmmv at NetBSD dot org>)
* * tools/run-with-tmp-session-bus.sh: use #!/bin/sh instead ofJohn (J5) Palmieri2006-08-081-1/+1
| | | | #!/bin/bash
* * configure.in:John (J5) Palmieri2006-08-082-1/+20
| | | | | | | | | * tools/Makefile.am: * tools/dbus-launch.c: * bus/Makefile.am: allow --with-dbus-daemondir switch to be used to make the daemon install to a seperate bindir like /usr/libexec (patch from Brian Cameron <brian dot cameron at sun dot com)
* * s/D-BUS/D-Bus/gJohn (J5) Palmieri2006-08-038-16/+16
|
* * Remove all bindingsJohn (J5) Palmieri2006-07-145-865/+3
|
* 2006-06-14 Ross Burton <ross@openedhand.com>Ross Burton2006-06-142-15/+5
| | | | | | | * tools/Makefile.am: * tools/dbus-monitor.c: Don't use the GLib bindings in dbus-monitor (patch from Ralf Habacker).
* 2006-06-14 Ross Burton <ross@openedhand.com>Ross Burton2006-06-141-1/+2
| | | | | * tools/dbus-print-message.c: Also print the object path when outputting signals or method calls.
* Added support for printing of all remaining data types. Fixed logic for ↵Daniel P. Berrange2006-04-161-56/+134
| | | | indentation of compound data types.
* 2006-03-10 Ross Burton <ross@openedhand.com>Ross Burton2006-03-101-3/+21
| | | | | * tools/dbus-print-message.c: Add support for object paths and signatures.
* 2006-02-13 John (J5) Palmieri <johnp@redhat.com>John (J5) Palmieri2006-02-131-3/+3
| | | | * tools/dbus-launch.c: Fixed sh syntax output
* 2006-02-10 John (J5) Palmieri <johnp@redhat.com>John (J5) Palmieri2006-02-101-2/+2
| | | | * tools/dbus-launch.c: Fixed csh syntax output (Bug #5720)
* * dbus/dbus-auth.c, dbus/dbus-connection.c, dbus/dbus-keyring.c,John (J5) Palmieri2005-11-304-18/+5
| | | | | | | | | | dbus/dbus-server-debug-pipe.c, glib/dbus-binding-tool-glib.c glib/dbus-glib-tool.c, glib/dbus-gparser.c, glib/dbus-gproxy.c test/test-segfault.c, test/test-utils.c, test/glib/test-dbus-glib.c, tools/dbus-cleanup-sockets.c tools/dbus-launch.c, tools/dbus-tree-view.c, tools/dbus-viewer.c: Various cleanup of dead code and compiler warnings (patch from Kjartan Maraas <kmaraas at gnome.org>)
* 2005-10-29 Robert McQueen <robot101@debian.org>Robert McQueen2005-10-292-27/+65
| | | | | | | | | | | | * glib/Makefile.am, glib/examples/Makefile.am, glib/examples/statemachine/Makefile.am: Merge patch from Ubuntu by Daniel Stone to replace explicit calls to libtool with $(LIBTOOL). * test/python/.cvsignore: Add run-with-tmp-session-bus.conf. * tools/dbus-monitor.1, tools/dbus-monitor.c: Merge dbus-monitor patch from Ubuntu by Daniel Silverstone to allow specifying match rules on the command line.
* * Released 0.50dbus-0.50John (J5) Palmieri2005-09-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Patch from Steve Grubb: - bus/activation.c (bus_activation_service_reload_test): clean up some indentation - dbus/dbus-keyring.c (_dbus_keyring_reload): fix conditional - dbus/dbus-message-factory.c (generate_special): fix a couple of buffer overflows in the test suite. This is non critical because it can not be exploited and this code is only run when doing a make check. * Patch from Yaakov Selkowitz: Build fixes for Cygwin - configure.in: Don't check and link against kdecore, only qt headers - dbus/Makefile.am: Add -no-undefined to libdbus_1_la_LDFLAGS - gcj/org/freedesktop/dbus/Makefile.am: add libdbus_gcj_1_la_LDFLAGS = -no-undefined - glib/Makefile.am: Add -no-undefined to libdbus_glib_1_la_LDFLAGS and $(DBUS_GLIB_LIBS) to dbus_binding_tool_LDADD - qt/Makefile.am: Add -no-undefined to libdbus_qt_1_la_LDFLAGS - tools/Makefile.am: Add platform extentions to binaries (i.e. .exe on windows) * configure.in: - Make it so if no suitable version of python is found we only disable building python instead of exiting the configure script - Require version 2.4 of glib for glib bindings - Up version to 0.50 * python/__init__.py: Sync version with libdbus to (0,50,0)
* 2005-08-26 Colin Walters <walters@verbum.org>Colin Walters2005-08-261-0/+1
| | | | | | * tools/dbus-print-message.c (print_message): Flush stdout after printing a message, so that redirecting to a file, then hitting Ctrl-C works.
* 2005-08-01 Colin Walters <walters@verbum.org>Colin Walters2005-08-011-1/+1
| | | | | | | | Patch from Joe Markus Clarke: * tools/dbus-send.c (main): Don't use C99 style initializers (bug #3933).
* 2005-07-31 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-07-311-1/+1
| | | | | * tools/dbus-viewer.c (load_child_nodes): fix invocation of dbus_g_proxy_call, fix from Piotr Zielinski bug #3920
* 2005-07-13 David Zeuthen <davidz@redhat.com>David Zeuthen2005-07-131-0/+32
| | | | | * tools/dbus-send.c (append_arg, type_from_name): Also support 16 and 64 bit signed and unsigned parameters
* 2005-07-12 Colin Walters <walters@verbum.org>Colin Walters2005-07-121-0/+1
| | | | | | Patch from Jim Gettys <Jim.Gettys@hp.com>. * tools/dbus-launch.c: Include sys/select.h.
* 2005-07-08 Colin Walters <walters@verbum.org>Colin Walters2005-07-082-90/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tools/Makefile.am: Kill of print-introspect in favor of using dbus-send --print-reply=literal. * tools/print-introspect.c: Deleted. * test/glib/test-service-glib.xml: * test/glib/test-service-glib.c (my_object_get_objs): New test for "ao". * test/glib/test-dbus-glib.c (echo_received_cb): Free echo data. (main): Test GetObjs. * glib/examples/statemachine/Makefile.am: * glib/examples/statemachine/sm-marshal.list: * glib/examples/statemachine/statemachine-client.c: * glib/examples/statemachine/statemachine-server.c: * glib/examples/statemachine/statemachine-server.xml: * glib/examples/statemachine/statemachine.c: * glib/examples/statemachine/statemachine.h: * glib/examples/statemachine/statemachine.xml: New example. * glib/examples/example-service.c (main): Move invocation of dbus_g_object_type_install_info earlier, to emphasize it should only be done once. * glib/examples/example-signal-emitter.c (main): Ditto. * glib/examples/Makefile.am (SUBDIRS): Include statemachine. * glib/dbus-gvalue.h (dbus_gtype_to_signature) (dbus_gvalue_marshal): Update prototypes. * glib/dbus-gvalue.c: Update all marshalling functions to take const GValue instead of GValue. (signature_iter_to_g_type_array): Return a GPtrArray for nonfixed types. (dbus_gvalue_to_signature): Update for dbus_gtype_to_signature change. (dbus_gtype_to_signature): Handle generic collecitons and maps. Return a newly-allocated string. (demarshal_proxy, demarshal_object_path, demarshal_object) (demarshal_strv, demarshal_ghashtable): Set error, don't assert if we get the wrong types from message. (get_type_demarshaller): New function, extracted from dbus_gvalue_demarshal. (demarshal_collection): New function, demarshals generic collection. (dbus_gvalue_demarshal): Just invoke result of get_type_demarshaller. Throw error if we don't have one. (marshal_garray_basic): Abort on OOM. (get_type_marshaller): New function, extracted from dbus_gvalue_marshal. (collection_marshal_iterator, marshal_collection): New functions; implements generic marshalling for an iteratable specialized collection. (dbus_gvalue_marshal): Just invoke result of get_type_marshaller. * glib/dbus-gvalue-utils.c (gvalue_from_ptrarray_value): Handle G_TYPE_STRING. (ptrarray_value_from_gvalue): Ditto. (ptrarray_append, ptrarray_free): New functions. (slist_constructor, slist_iterator, slist_copy_elt, slist_copy) (slist_append, slist_end_append, slist_free): New functions. (dbus_g_type_specialized_builtins_init): Add append fuctions for GPtrArray and GSList. Register GSList. (test_specialized_hash, _dbus_gvalue_utils_test): New functions. * glib/dbus-gtype-specialized.h (DBusGTypeSpecializedAppendContext): New. (dbus_g_type_specialized_collection_init_append) (dbus_g_type_specialized_collection_append) (dbus_g_type_specialized_collection_end_append): Prototype. (DBusGTypeSpecializedCollectionVtable): Add append_func and end_append_func. * glib/dbus-gtype-specialized.c (dbus_g_type_specialized_collection_init_append) (dbus_g_type_specialized_collection_append) (dbus_g_type_specialized_collection_end_append): New functions. (dbus_g_type_map_value_iterate): Take const GValue. (dbus_g_type_collection_value_iterate): Ditto. * glib/dbus-gtest.c (dbus_glib_internal_do_not_use_run_tests): Run _dbus_gvalue_utils_test. * glib/dbus-gtest.h: Prototype it. * glib/dbus-gproxy.c (dbus_g_proxy_manager_filter): Avoid using uninitialized owner_list. (dbus_g_proxy_begin_call_internal): Move return_if_fail to public API. (dbus_g_proxy_end_call_internal): Update to use error set from dbus_gvalue_demarshal instead of setting it here. (dbus_g_proxy_begin_call): Move return_if_fail here. * glib/dbus-gobject.c (write_interface): Update for dbus_gtype_to_signature returning new string. * configure.in: Add glib/examples/statemachine.
* 2005-07-06 Colin Walters <walters@verbum.org>Colin Walters2005-07-067-76/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-glib.h (DBusGPendingCall, DBusGPendingCallNotify) (DBUS_TYPE_G_PENDING_CALL, dbus_g_pending_call_get_g_type) (dbus_g_pending_call_ref, dbus_g_pending_call_unref): Delete. (dbus_g_pending_call_set_notify, dbus_g_pending_call_cancel): Delete in favor of dbus_g_proxy_begin_call and dbus_g_proxy_cancel_call. (DBusGProxyCall, DBusGProxyCallNotify): New. (dbus_g_proxy_begin_call): Change prototype to take callback, user data, and destroy function. This replaces dbus_g_pending_call_set_notify. (dbus_g_proxy_cancel_call): Prototype. (DBusGAsyncData): Delete, shouldn't be needed anymore. * glib/dbus-gproxy.c (struct _DBusGProxy): Add call_id_counter and pending_calls map. (struct _DBusGProxyManager): Add bus_proxy member, which is an internal proxy for calls to the bus. Remove pending_nameowner_calls, now the internal proxy keeps track. (dbus_g_proxy_manager_unref): Unref bus proxy, remove reference to pending_nameowner_calls. (got_name_owner_cb): Update prototype, and use dbus_g_proxy_end_call. (got_name_owner_cb): Remove reference to pending_nameowner_calls. (dbus_g_proxy_manager_register): Delete directly libdbus code in favor of using internal proxy. (dbus_g_proxy_manager_unregister): Update to use dbus_g_proxy_cancel_call for any pending GetNameOwner call. (dbus_g_proxy_init): Initialize pending calls map. (dbus_g_proxy_constructor): New. (dbus_g_proxy_class_init): Add get/set property functions, constructor, and add NAME, PATH, and INTERFACE properties. (cancel_pending_call): New function. (dbus_g_proxy_dispose): Iterate over any outstanding calls and cancel them. (dbus_g_proxy_set_property, dbus_g_proxy_get_property): New. (GPendingNotifyClosure): New structure. (d_pending_call_notify, d_pending_call_free): Moved here from dbus-glib.c. (DBUS_G_VALUE_ARRAY_COLLECT_ALL): Moved around to satisfy function ordering. (manager_begin_bus_call): New internal function for talking to internal bus proxy. (dbus_g_proxy_new): Construct object using GObjet properties. (dbus_g_proxy_begin_call_internal): Update to take user data, etc. Create closure of same, and insert call into map of pending calls. (dbus_g_proxy_end_call_internal): Take call id instead of pending call. Look up pending call in current set. Remove it when we've completed. (dbus_g_pending_call_end, dbus_g_proxy_end_call_internal): Delete. (dbus_g_proxy_begin_call): Change API to take callback, user data, and destroy function directly. (dbus_g_proxy_end_call): Update to take DBusGProxyCall. (dbus_g_proxy_call): Invoke with NULL callback. (dbus_g_proxy_cancel_call): New function, replaces dbus_g_pending_call_cancel. * glib/dbus-gparser.c (validate_signature): Fix call to dbus_set_g_error. * glib/dbus-gobject.c (dbus_g_object_type_dbus_metadata_quark): New quark for attaching metadata to GType. (info_hash): Delete. (lookup_object_info): Look up using quark. (dbus_g_object_type_install_info): Check that a type is classed, not that it's an object. Also just install type data using quark instead of using global hash. * glib/dbus-glib.c (dbus_g_pending_call_ref) (dbus_g_pending_call_unref, dbus_pending_call_get_g_type) (GPendingNotifyClosure): Delete. (d_pending_call_notify, d_pending_call_free): Move to dbus-gproxy.c. (dbus_g_pending_call_set_notify, dbus_g_pending_call_cancel): Delete. * glib/dbus-binding-tool-glib.c (generate_client_glue): Disable async client method generation until we can fix it... * tools/dbus-viewer.c (load_child_nodes): Use dbus_g_proxy_call. (load_from_service_thread_func): Ditto. * tools/dbus-names-model.c (struct NamesModel): Hold DBusGProxyCall. (have_names_notify): Update prototype, use dbus_g_proxy_cancel_call. (names_model_reload): Update for new dbus_g_proxy_begin_call API. * tools/dbus-monitor.c (filter_func): Update for print_message API change. * test/glib/test-dbus-glib.c: Add more tests for async invocations. Update many begin_call/end_call pairs to just use dbus_g_proxy_call. * tools/dbus-send.c (main): Add --print-reply=literal mode. This allows us to dump print-introspect.c. * tools/dbus-print-message.h (print_message): Add literal argument to print_message which is intended to allow printing arguments without metadata like "string=". * tools/dbus-print-message.c (print_iter): Add literal argument. (print_message): Allow printing string messages literally.
* 2005-06-29 Colin Walters <walters@verbum.org>Colin Walters2005-06-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * glib/dbus-gproxy.c (struct _DBusGProxy): Add new member name_call for keeping track of any outgoing GetNameOwner call. Also add for_owner and associated. (struct _DBusGProxyManager): Add owner_names, which is hash table that maps a base name to a list of names it owns (that we're interested in). Add pending_nameowner_calls which is a list of all outstanding GetNameOwner; avoids us having to iterate over every proxy. Add unassociated_proxies which keeps track of name proxies with no associated name owner. (dbus_g_proxy_manager_unref): Destroy owner_names. (struct DBusGProxyNameOwnerInfo): New struct for keeping track of name refcounts. (find_name_in_info, name_owner_foreach) (dbus_g_proxy_manager_lookup_name_owner, insert_nameinfo) (dbus_g_proxy_manager_monitor_name_owner) (dbus_g_proxy_manager_unmonitor_name_owner) (unassociate_proxies, dbus_g_proxy_manager_replace_name_owner): New functions; they manipulate the owner_names mapping. (got_name_owner_cb): New function. (get_name_owner): New function, extracted from dbus_g_proxy_new_for_name_owner. (dbus_g_proxy_manager_register): For now we need to keep track of all NameOwnerChanged. Also if the proxy is for a name, if we don't already know the name owner, queue a new GetNameOwner request and add it to our list of unassociated proxies. Otherwise inc the refcount. (dbus_g_proxy_manager_unregister): If this proxy is for a name, cancel any pending GetNameOwner call, etc. (dbus_g_proxy_manager_filter): Handle NameOwnerChanged. Also use the owner_names mapping to look up the current names for the signal source, and dispatch to any proxies for that name. (dbus_g_proxy_new): Initialize new members. (dbus_g_proxy_new_for_name): Delete unused proxy variable. (dbus_g_proxy_new_for_name_owner): Use get_name_owner. (dbus_g_pending_call_end_valist): New function, extracted from dbus_g_proxy_end_call_internal. Useful when we don't have a proxy but want to use the GLib infrastructure. Also note how many arguments in reply were over. (dbus_g_pending_call_end): New function, just call dbus_g_pending_call_end_valist. (dbus_g_proxy_end_call_internal): Just call dbus_g_pending_call_end_valist. * glib/dbus-gobject.c (_dbus_gobject_lookup_marshaller): Fix lookup of builtin marshaller for STRING_STRING_STRING. * test/glib/test-dbus-glib.c: * test/glib/test-service-glib.c: * test/glib/test-service-glib.xml: Extend tests to cover name proxies, destruction of owner proxies, etc. * glib/examples/example-signal-recipient.c (dbus_g_proxy_new_for_name_owner): Create a name proxy. * tools/dbus-send.c (main): Print D-BUS error name in addition to message.
* 2005-06-17 Colin Walters <walters@verbum.org>Colin Walters2005-06-171-5/+2
| | | | | * tools/dbus-names-model.c (have_names_notify): Fix call to dbus_g_proxy_end_call.
* 2005-06-16 Colin Walters <walters@verbum.org>Colin Walters2005-06-162-22/+114
| | | | | | | | | | * tools/dbus-send.c (append_array): Use strtok. (append_dict): New function. (type_from_name): New function, extracted from main. (main): Handle sending dicts. * tools/dbus-print-message.c (print_iter): Print dict entries.
* 2005-06-12 Colin Walters <walters@verbum.org>Colin Walters2005-06-134-21/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Async signals and various bugfixes and testing by Ross Burton <ross@burtonini.com>. * glib/dbus-gvalue.h: (struct DBusBasicGValue): Delete. (dbus_gvalue_genmarshal_name_from_type) (dbus_gvalue_ctype_from_type): Moved to dbus-binding-tool-glib.c. (dbus_gtype_to_dbus_type): Renamed to dbus_gtype_from_signature. (dbus_g_value_types_init, dbus_gtype_from_signature) (dbus_gtype_from_signature_iter, dbus_gtype_to_signature) (dbus_gtypes_from_arg_signature): New function prototypes. (dbus_gvalue_demarshal): Take context and error arguments. (dbus_gvalue_demarshal_variant): New function. (dbus_gvalue_demarshal_message): New function. (dbus_gvalue_store): Delete. * glib/dbus-gvalue.c: File has been almost entirely rewritten; now we special-case more types such as DBUS_TYPE_SIGNATURE, handle arrays and hash tables correctly, etc. Full support for recursive values is not yet complete. * glib/dbus-gproxy.c (dbus_g_proxy_class_init): Change last argument of signal to G_TYPE_POINTER since we now pass a structure. (lookup_g_marshaller): Delete in favor of _dbus_gobject_lookup_marshaller. (marshal_dbus_message_to_g_marshaller): Use _dbus_gobject_lookup_marshaller and dbus_gvalue_demarshal_message to handle remote signal callbacks. (dbus_g_proxy_new_from_proxy): New function; creates a new DBusGProxy by copying an existing one. (dbus_g_proxy_get_interface, dbus_g_proxy_set_interface) (dbus_g_proxy_get_path): New functions. (dbus_g_proxy_marshal_args_to_message): New function; factored out of existing code. (DBUS_G_VALUE_ARRAY_COLLECT_ALL): Collect all arguments from a varargs array. (dbus_g_proxy_begin_call_internal): New function. (dbus_g_proxy_end_call_internal): New function. (dbus_g_proxy_begin_call): Take GTypes instead of DBus types as arguments; simply invoke dbus_g_proxy_begin_call_internal after collecting args into value array. (dbus_g_proxy_end_call): Take GTypes instead of DBus types; invoke dbus_g_proxy_end_call_internal. (dbus_g_proxy_invoke): Simply invoke begin_call_interanl and end_call_internal. (dbus_g_proxy_call_no_reply): Take GTypes instead of DBus types. (array_free_all): New function. (dbus_g_proxy_add_signal): Take GTypes. * glib/dbus-gobject.h: (_dbus_glib_marshal_dbus_message_to_gvalue_array): Delete. (_dbus_gobject_get_path, _dbus_gobject_lookup_marshaller): Prototype. * glib/dbus-gobject.c: Add a global marshal_table hash which stores mappings from type signatures to marshallers. Change lots of invocations of dbus_gtype_to_dbus_type to dbus_gtype_to_signature. (_dbus_glib_marshal_dbus_message_to_gvalue_array): Delete. (introspect_signals): Fix test for query.return_type. (set_object_property): Update invocation of dbus_gvalue_demarshal. (invoke_object_method): Many changes. Handle asynchronous invocations. Convert arguments with dbus_gvalue_demarshal_message. Handle errors. Use DBusSignatureIter instead of strlen on args. Handle all arguments generically. Special-case variants. (dbus_g_method_return, dbus_g_method_return_error): New function. (DBusGSignalClosure): New structure, closes over signal information. (dbus_g_signal_closure_new): New function. (dbus_g_signal_closure_finalize): New function. (signal_emitter_marshaller): New function; is special marshaller which emits signals on bus. (export_signals): New function; introspects object signals and connects to them. (dbus_g_object_type_install_info): Take GType instead of GObjectClass. (dbus_g_connection_register_g_object): Invoke export_signals. (dbus_g_connection_lookup_g_object): New function. (DBusGFuncSignature) New structure; used for mapping type signatures to marshallers. (funcsig_hash): New function; hashes DBusGFuncSignature. (funcsig_equal): New function; compares DBusGFuncSignature. (_dbus_gobject_lookup_marshaller): New function. (dbus_g_object_register_marshaller): New function; used to register a marshaller at runtime for a particular signature. * glib/dbus-gmain.c (_dbus_gmain_test): Add various tests. * glib/dbus-binding-tool-glib.h: Add DBUS_GLIB_ANNOTATION_ASYNC which notes a server method implementation should be asynchronous. * glib/dbus-binding-tool-glib.c (dbus_binding_tool_output_glib_server): Call dbus_g_value_types_init. (write_formal_parameters): Use dbus_gtype_from_signature. Handle variants specially. (dbus_g_type_get_lookup_function): Turn GType into an invocation of a lookup function. (write_args_for_direction): Use dbus_g_type_get_lookup_function. (write_untyped_out_args): New method; write output arguments. (write_formal_declarations_for_direction): Function for writing prototypes. (write_formal_parameters_for_direction): Function for writing implementations. (write_typed_args_for_direction): Function for writing arguments prefixed with GTypes. (write_async_method_client): Write out async version of method. * glib/dbus-binding-tool-glib.c: Include dbus-gvalue-utils.h. (dbus_g_type_get_marshal_name): Move mapping from GType to marshal name into here. (dbus_g_type_get_c_name): Move into here. (compute_marshaller): Convert signature to type with dbus_gtype_from_signature, use dbus_g_type_get_marshal_name. (compute_marshaller_name): Ditto. (compute_marshaller): Handle async signal annotations. (gather_marshallers): Return if we don't have a known prefix. (generate_glue): Collect introspection blob here, and write all of the blob at the end. This allows an object with multiple interfaces to work. Mark async methods in introspection blob. * glib/Makefile.am (libdbus_glib_1_la_SOURCES): Add dbus-gtype-specialized.c, dbus-gtype-specialized.h, dbus-gvalue-utils.h, dbus-gvalue-utils.c. * dbus/dbus-glib.h: Don't include dbus-protocol.h; this avoids people accidentally using DBUS_TYPE_* which should not be necessary anymore. Do include dbus-gtype-specialized.h, which are utilities for GLib container types. Add various #defines for types such as DBUS_TYPE_G_BOOLEAN_ARRAY. (DBusGValueIterator, DBusGValue): Define, not fully used yet. (dbus_g_value_get_g_type): Type for recursive value. (dbus_g_value_open, dbus_g_value_iterator_get_value) (dbus_g_value_iterator_get_values, dbus_g_value_iterator_recurse) (dbus_g_value_free): Prototypes. (dbus_g_object_register_marshaller, dbus_g_proxy_new_from_proxy): Prototype. (dbus_g_proxy_set_interface): Prototype. (dbus_g_proxy_begin_call, dbus_g_proxy_end_call) (dbus_g_proxy_call_no_reply): Take GLib types instead of DBus types. (dbus_g_proxy_get_path, dbus_g_proxy_get_interface): Accessors. (DBusGAsyncData, DBusGMethodInvocation): Structures for doing async invocations. (dbus_g_method_return, dbus_g_method_return_error): Prototypes. * doc/dbus-tutorial.xml: Update GLib section. * tools/dbus-viewer.c (load_child_nodes): Update for new invocation type of dbus_g_proxy_end_call. (load_from_service_thread_func): Ditto. * tools/print-introspect.c (main): Ditto. * tools/dbus-names-model.c (have_names_notify) (names_model_reload, names_model_set_connection) Use GTypes. * python/Makefile.am (INCLUDES): Define DBUS_COMPILATION, needed since Python bindings use GLib bindings. * test/glib/Makefile.am (INCLUDES): Define DBUS_COMPILATION. Add --prefix argument. * tools/Makefile.am: Define DBUS_COMPILATION. Remove unneeded --ignore-unsupported arg. * test/glib/test-service-glib.c: * test/glib/test-service-glib.xml: * test/glib/test-dbus-glib.c: Add many more tests.
* * tools/dbus-send.c (main):John (J5) Palmieri2005-06-021-1/+1
| | | | | | | | | | s/dbus_connection_disconnect/dbus_connection_close * test/glib/test-profile.c (no_bus_thread_func, with_bus_thread_func): s/dbus_connection_disconnect/dbus_connection_close * test/test-service.c (path_message_func, filter_func): s/dbus_connection_disconnect/dbus_connection_close
* 2005-05-11 Colin Walters <walters@verbum.org>Colin Walters2005-05-112-113/+225
| | | | | | | | | * tools/dbus-send.c (append_array): New function. (append_arg): Broken out from main. (main): Add cheesy hack to send arrays and variants. (usage): Update. * tools/dbus-print-message.c (print_iter): Broken out from main.
* 2005-03-30 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-03-311-6/+13
| | | | | | | | * configure.in: change check to gtk 2.4 * tools/dbus-viewer.c (name_combo_changed_callback): remove gtk_combo_box_get_active_text() usage to decrement GTK requirement to 2.4
* 2005-03-24 Daniel Reed <n@ml.org>Colin Walters2005-03-241-0/+2
| | | | | * tools/Makefile.am: Make print-introspect and dbus-bus-introspect.xml building conditional on HAVE_GLIB.
* * tools/Makefile.am: Patch by Colin Walters that fixes distcheckJohn (J5) Palmieri2005-03-221-7/+7
| | | | | | | | | | | | | | * dbus/dbus-userdb.c, dbus/dbus-userdb-util.c: Add patch we have had in Red Hat packages for a while but for some reason never got merged upstream (_dbus_is_a_number): New checks if a string can be converted to a number and does the conversion if it can (_dbus_user_database_lookup): Add check to see if the given username is a udi. This allows udi's to be used instead of usernames in the config file. (_dbus_user_database_lookup_group): Add check to see if the given groupname is a gdi. This allows gdi's to be used instead of groupnames in the config file.