X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fsystemd%2Fsd-bus.h;h=402c61dae22369b53b1fb7e74f1454f061f5421a;hp=b23a7d21ea89882d4e7249c8418e0f8ce47c4473;hb=f392163119aa4b0e9680db2d61ae41374b465d46;hpb=4084669c7f802c9745bcb6bed77bdaf49ffd896d diff --git a/src/systemd/sd-bus.h b/src/systemd/sd-bus.h index b23a7d21e..402c61dae 100644 --- a/src/systemd/sd-bus.h +++ b/src/systemd/sd-bus.h @@ -1,5 +1,3 @@ -/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ - #ifndef foosdbushfoo #define foosdbushfoo @@ -27,8 +25,9 @@ #include #include -#include "sd-id128.h" #include "sd-event.h" +#include "sd-id128.h" + #include "_sd-common.h" _SD_BEGIN_DECLARATIONS; @@ -167,6 +166,8 @@ sd_bus *sd_bus_flush_close_unref(sd_bus *bus); #if 0 /// UNNEEDED by elogind void sd_bus_default_flush_close(void); +int sd_bus_is_open(sd_bus *bus); + int sd_bus_get_bus_id(sd_bus *bus, sd_id128_t *id); int sd_bus_get_scope(sd_bus *bus, const char **scope); int sd_bus_get_tid(sd_bus *bus, pid_t *tid); @@ -512,6 +513,14 @@ const char* sd_bus_track_contains(sd_bus_track *track, const char *names); const char* sd_bus_track_first(sd_bus_track *track); const char* sd_bus_track_next(sd_bus_track *track); +/* Define helpers so that __attribute__((cleanup(sd_bus_unrefp))) and similar may be used. */ +_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_bus, sd_bus_unref); +_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_bus, sd_bus_flush_close_unref); +_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_bus_slot, sd_bus_slot_unref); +_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_bus_message, sd_bus_message_unref); +_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_bus_creds, sd_bus_creds_unref); +_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_bus_track, sd_bus_track_unref); + _SD_END_DECLARATIONS; #endif