diff options
Diffstat (limited to 'src/libsystemd/sd-bus/bus-kernel.h')
-rw-r--r-- | src/libsystemd/sd-bus/bus-kernel.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libsystemd/sd-bus/bus-kernel.h b/src/libsystemd/sd-bus/bus-kernel.h index 7b1e9ef981..b9f31ba790 100644 --- a/src/libsystemd/sd-bus/bus-kernel.h +++ b/src/libsystemd/sd-bus/bus-kernel.h @@ -33,6 +33,11 @@ ((uint8_t *)(part) < (uint8_t *)(head) + (head)->size) && \ ((uint8_t *) part >= (uint8_t *) head); \ part = KDBUS_ITEM_NEXT(part)) +#define KDBUS_FOREACH(iter, first, _size) \ + for (iter = (first); \ + ((uint8_t *)(iter) < (uint8_t *)(first) + (_size)) && \ + ((uint8_t *)(iter) >= (uint8_t *)(first)); \ + iter = (void*)(((uint8_t *)iter) + ALIGN8((iter)->size))) #define KDBUS_ITEM_HEADER_SIZE offsetof(struct kdbus_item, data) #define KDBUS_ITEM_SIZE(s) ALIGN8((s) + KDBUS_ITEM_HEADER_SIZE) |