• Michael Albinus's avatar
    Move functions from C to Lisp. Make non-blocking method calls · dcbf5805
    Michael Albinus authored
    the default.  Implement further D-Bus standard interfaces.
    
    * configure.in (dbus_validate_bus_name, dbus_validate_path)
    (dbus_validate_interface, dbus_validate_member): Check also for
    these library functions
    
    * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
    (QCdbus_request_name_allow_replacement)
    (QCdbus_request_name_replace_existing)
    (QCdbus_request_name_do_not_queue)
    (QCdbus_request_name_reply_primary_owner)
    (QCdbus_request_name_reply_in_queue)
    (QCdbus_request_name_reply_exists)
    (QCdbus_request_name_reply_already_owner): Move to dbus.el.
    (QCdbus_registered_serial, QCdbus_registered_method)
    (QCdbus_registered_signal): New Lisp objects.
    (XD_DEBUG_MESSAGE): Use sizeof.
    (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
    (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
    (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
    (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
    (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
    (xd_signature, xd_append_arg): Allow float for integer types.
    (xd_get_connection_references): New function.
    (xd_get_connection_address): Rename from xd_initialize.  Return
    cached address.
    (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
    (xd_close_bus): Rename from Fdbus_close_bus.  Not needed on Lisp
    level.
    (Fdbus_init_bus): New optional arg PRIVATE.  Cache address.
    Return number of recounts.
    (Fdbus_get_unique_name): Make stronger parameter check.
    (Fdbus_message_internal): New defun.
    (Fdbus_call_method, Fdbus_call_method_asynchronously)
    (Fdbus_method_return_internal, Fdbus_method_error_internal)
    (Fdbus_send_signal, Fdbus_register_service)
    (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
    (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
    (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
    (Vdbus_compiled_version, Vdbus_runtime_version)
    (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
    (Vdbus_message_type_method_return, Vdbus_message_type_error)
    (Vdbus_message_type_signal): New defvars.
    (Vdbus_registered_buses, Vdbus_registered_objects_table): Adapt
    docstring.
    
    * net/dbus.el (dbus-message-internal): Declare function.  Remove
    unneeded function declarations.
    (defvar dbus-message-type-invalid, dbus-message-type-method-call)
    (dbus-message-type-method-return, dbus-message-type-error)
    (dbus-message-type-signal): Declare variables.  Remove local
    definitions.
    (dbus-interface-dbus, dbus-interface-peer)
    (dbus-interface-introspectable, dbus-interface-properties)
    (dbus-path-emacs, dbus-interface-emacs, dbus-return-values-table):
    Adapt docstring.
    (dbus-interface-objectmanager): New defconst.
    (dbus-call-method, dbus-call-method-asynchronously)
    (dbus-send-signal, dbus-method-return-internal)
    (dbus-method-error-internal, dbus-register-service)
    (dbus-register-signal, dbus-register-method): New defuns, moved
    from dbusbind.c
    (dbus-call-method-handler, dbus-setenv)
    (dbus-get-all-managed-objects, dbus-managed-objects-handler): New
    defuns.
    (dbus-call-method-non-blocking): Make it an obsolete function.
    (dbus-unregister-object, dbus-unregister-service)
    (dbus-handle-event, dbus-register-property)
    (dbus-property-handler): Obey the new structure of
    `bus-registered-objects'.
    (dbus-introspect): Use `dbus-call-method'.  Use a timeout.
    (dbus-get-property, dbus-set-property, dbus-get-all-properties):
    Use `dbus-call-method'.
    
    * dbus.texi (Version): New node.
    (Properties and Annotations): Mention the object manager
    interface.  Describe dbus-get-all-managed-objects.
    (Type Conversion): Floating point numbers are allowed, if an
    anteger does not fit Emacs's integer range.
    (Synchronous Methods): Remove obsolete dbus-call-method-non-blocking.
    (Asynchronous Methods): Fix description of
    dbus-call-method-asynchronously.
    (Receiving Method Calls): Fix some minor errors.  Add
    dbus-interface-emacs.
    (Signals): Describe unicast signals and the new match rules.
    (Alternative Buses): Add the PRIVATE optional argument to
    dbus-init-bus.  Describe its new return value.  Add dbus-setenv.
    dcbf5805
dbusbind.c 54.3 KB