summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-message.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-12-09 23:03:21 +0100
committerLennart Poettering <lennart@poettering.net>2013-12-09 23:04:49 +0100
commit6647dc6659e1e42b3cff3cf5033ea5624000e650 (patch)
treed791130268d4f28f4126343003210c0669653625 /src/libsystemd-bus/bus-message.h
parentd3a485135a98184cba28992752834a1bb4769003 (diff)
bus: demarshal gvariant
Diffstat (limited to 'src/libsystemd-bus/bus-message.h')
-rw-r--r--src/libsystemd-bus/bus-message.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/libsystemd-bus/bus-message.h b/src/libsystemd-bus/bus-message.h
index b862cb9443..75a560b3c0 100644
--- a/src/libsystemd-bus/bus-message.h
+++ b/src/libsystemd-bus/bus-message.h
@@ -34,18 +34,20 @@
struct bus_container {
char enclosing;
+ bool need_offsets:1;
+ /* Indexes into the signature string */
unsigned index, saved_index;
-
char *signature;
- uint32_t *array_size;
- size_t before, begin;
+ size_t before, begin, end;
- size_t *offsets;
- size_t n_offsets, n_allocated;
+ /* dbus1: pointer to the array size value, if this is a value */
+ uint32_t *array_size;
- bool need_offsets;
+ /* gvariant: list of offsets to end of children if this is struct/dict entry/array */
+ size_t *offsets, n_offsets, n_offsets_allocated, offset_index;
+ size_t item_size;
};
struct bus_header {
@@ -98,7 +100,6 @@ struct sd_bus_message {
bool free_fds:1;
bool release_kdbus:1;
bool poisoned:1;
- bool is_gvariant:1;
struct bus_header *header;
struct bus_body_part body;
@@ -180,6 +181,10 @@ static inline void* BUS_MESSAGE_FIELDS(sd_bus_message *m) {
return (uint8_t*) m->header + sizeof(struct bus_header);
}
+static inline bool BUS_MESSAGE_IS_GVARIANT(sd_bus_message *m) {
+ return m->header->version == 2;
+}
+
int bus_message_seal(sd_bus_message *m, uint64_t serial);
int bus_message_get_blob(sd_bus_message *m, void **buffer, size_t *sz);
int bus_message_read_strv_extend(sd_bus_message *m, char ***l);