1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 19:21:53 +03:00

sd-bus: add sd_bus_message_is_empty() for checking whether a message carries any body

This commit is contained in:
Lennart Poettering 2014-11-14 13:05:01 +01:00
parent 34b950a8d8
commit 8022212b3b
3 changed files with 8 additions and 0 deletions

View File

@ -254,6 +254,7 @@ global:
sd_bus_message_get_realtime_usec; sd_bus_message_get_realtime_usec;
sd_bus_message_get_seqnum; sd_bus_message_get_seqnum;
sd_bus_message_get_creds; sd_bus_message_get_creds;
sd_bus_message_is_empty;
sd_bus_message_is_signal; sd_bus_message_is_signal;
sd_bus_message_is_method_call; sd_bus_message_is_method_call;
sd_bus_message_is_method_error; sd_bus_message_is_method_error;

View File

@ -5380,6 +5380,12 @@ _public_ const char* sd_bus_message_get_signature(sd_bus_message *m, int complet
return strempty(c->signature); return strempty(c->signature);
} }
_public_ int sd_bus_message_is_empty(sd_bus_message *m) {
assert_return(m, -EINVAL);
return isempty(m->root_container.signature);
}
_public_ int sd_bus_message_copy(sd_bus_message *m, sd_bus_message *source, int all) { _public_ int sd_bus_message_copy(sd_bus_message *m, sd_bus_message *source, int all) {
bool done_something = false; bool done_something = false;
int r; int r;

View File

@ -222,6 +222,7 @@ sd_bus_creds *sd_bus_message_get_creds(sd_bus_message *m); /* do not unref the r
int sd_bus_message_is_signal(sd_bus_message *m, const char *interface, const char *member); int sd_bus_message_is_signal(sd_bus_message *m, const char *interface, const char *member);
int sd_bus_message_is_method_call(sd_bus_message *m, const char *interface, const char *member); int sd_bus_message_is_method_call(sd_bus_message *m, const char *interface, const char *member);
int sd_bus_message_is_method_error(sd_bus_message *m, const char *name); int sd_bus_message_is_method_error(sd_bus_message *m, const char *name);
int sd_bus_message_is_empty(sd_bus_message *m);
int sd_bus_message_set_expect_reply(sd_bus_message *m, int b); int sd_bus_message_set_expect_reply(sd_bus_message *m, int b);
int sd_bus_message_set_auto_start(sd_bus_message *m, int b); int sd_bus_message_set_auto_start(sd_bus_message *m, int b);