Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
ca4f31ea
Commit
ca4f31ea
authored
Aug 16, 2009
by
Michael Albinus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* dbusbind.c (Fdbus_call_method_asynchronously): Allow nil HANDLER.
parent
55659495
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
12 deletions
+30
-12
src/ChangeLog
src/ChangeLog
+1
-0
src/dbusbind.c
src/dbusbind.c
+29
-12
No files found.
src/ChangeLog
View file @
ca4f31ea
...
...
@@ -3,6 +3,7 @@
* dbusbind.c (xd_initialize): Add connection file descriptor to
input_wait_mask, in order to let select() detect, whether a new
message has been arrived.
(Fdbus_call_method_asynchronously): Allow nil HANDLER.
2009-08-15 Michael Albinus <michael.albinus@gmx.de>
...
...
src/dbusbind.c
View file @
ca4f31ea
...
...
@@ -967,7 +967,8 @@ object path SERVICE is registered at. INTERFACE is an interface
offered by SERVICE. It must provide METHOD.
HANDLER is a Lisp function, which is called when the corresponding
return message has arrived.
return message has arrived. If HANDLER is nil, no return message will
be expected.
If the parameter `:timeout' is given, the following integer TIMEOUT
specifies the maximun number of milliseconds the method call must
...
...
@@ -987,7 +988,7 @@ converted into D-Bus types via the following rules:
All arguments can be preceded by a type symbol. For details about
type symbols, see Info node `(dbus)Type Conversion'.
T
he function returns a key into the hash table
Unless HANDLER is nil, t
he function returns a key into the hash table
`dbus-registered-functions-table'. The corresponding entry in the
hash table is removed, when the return message has been arrived, and
HANDLER is called.
...
...
@@ -1032,7 +1033,7 @@ usage: (dbus-call-method-asynchronously BUS SERVICE PATH INTERFACE METHOD HANDLE
CHECK_STRING
(
path
);
CHECK_STRING
(
interface
);
CHECK_STRING
(
method
);
if
(
!
FUNCTIONP
(
handler
))
if
(
!
NILP
(
handler
)
&&
!
FUNCTIONP
(
handler
))
wrong_type_argument
(
intern
(
"functionp"
),
handler
);
GCPRO6
(
bus
,
service
,
path
,
interface
,
method
,
handler
);
...
...
@@ -1091,18 +1092,34 @@ usage: (dbus-call-method-asynchronously BUS SERVICE PATH INTERFACE METHOD HANDLE
xd_append_arg
(
dtype
,
args
[
i
],
&
iter
);
}
/* Send the message. The message is just added to the outgoing
message queue. */
if
(
!
dbus_connection_send_with_reply
(
connection
,
dmessage
,
NULL
,
timeout
))
XD_SIGNAL1
(
build_string
(
"Cannot send message"
));
if
(
!
NILP
(
handler
))
{
/* Send the message. The message is just added to the outgoing
message queue. */
if
(
!
dbus_connection_send_with_reply
(
connection
,
dmessage
,
NULL
,
timeout
))
XD_SIGNAL1
(
build_string
(
"Cannot send message"
));
XD_DEBUG_MESSAGE
(
"Message sent"
);
/* The result is the key in Vdbus_registered_functions_table. */
result
=
(
list2
(
bus
,
make_number
(
dbus_message_get_serial
(
dmessage
))));
/* Create a hash table entry. */
Fputhash
(
result
,
handler
,
Vdbus_registered_functions_table
);
}
else
{
/* Send the message. The message is just added to the outgoing
message queue. */
if
(
!
dbus_connection_send
(
connection
,
dmessage
,
NULL
))
XD_SIGNAL1
(
build_string
(
"Cannot send message"
));
/* The
result
is the key in Vdbus_registered_functions_table. */
result
=
(
list2
(
bus
,
make_number
(
dbus_message_get_serial
(
dmessage
))));
result
=
Qnil
;
}
/* Create a hash table entry. */
Fputhash
(
result
,
handler
,
Vdbus_registered_functions_table
);
/* Flush connection to ensure the message is handled. */
dbus_connection_flush
(
connection
);
XD_DEBUG_MESSAGE
(
"Message sent"
);
/* Cleanup. */
dbus_message_unref
(
dmessage
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment