X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flibsystemd-bus%2Fbus-message.h;h=b9cd4c8f30965cec13e251af9f15e3cd69002120;hb=043ccd8383a36a9d4f7b37c04670c9e6a57f391d;hp=b862cb9443b60cde358d2b7d91faab032ee22585;hpb=c1b9d935725103e95901f347b8981647ce4dd546;p=elogind.git diff --git a/src/libsystemd-bus/bus-message.h b/src/libsystemd-bus/bus-message.h index b862cb944..b9cd4c8f3 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,7 +181,11 @@ static inline void* BUS_MESSAGE_FIELDS(sd_bus_message *m) { return (uint8_t*) m->header + sizeof(struct bus_header); } -int bus_message_seal(sd_bus_message *m, uint64_t serial); +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, usec_t timeout); 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);