chiark / gitweb /
sd-bus: add 'offset' member for vtable methods
[elogind.git] / src / systemd / sd-bus-vtable.h
index a032215..b4d6ed0 100644 (file)
@@ -67,6 +67,7 @@ struct sd_bus_vtable {
                         const char *signature;
                         const char *result;
                         sd_bus_message_handler_t handler;
+                        size_t offset;
                 } method;
                 struct {
                         const char *member;
@@ -89,7 +90,7 @@ struct sd_bus_vtable {
                 .x.start.element_size = sizeof(sd_bus_vtable),          \
         }
 
-#define SD_BUS_METHOD(_member, _signature, _result, _handler, _flags)   \
+#define SD_BUS_VTABLE_METHOD_WITH_OFFSET(_member, _signature, _result, _handler, _offset, _flags)   \
         {                                                               \
                 .type = _SD_BUS_VTABLE_METHOD,                          \
                 .flags = _flags,                                        \
@@ -97,7 +98,10 @@ struct sd_bus_vtable {
                 .x.method.signature = _signature,                       \
                 .x.method.result = _result,                             \
                 .x.method.handler = _handler,                           \
+                .x.method.offset = _offset,                             \
         }
+#define SD_BUS_METHOD(_member, _signature, _result, _handler, _flags)   \
+        SD_BUS_VTABLE_METHOD_WITH_OFFSET(_member, _signature, _result, _handler, 0, _flags)
 
 #define SD_BUS_SIGNAL(_member, _signature, _flags)                      \
         {                                                               \