1SD_BUS_SLOT_REF(3) sd_bus_slot_ref SD_BUS_SLOT_REF(3)
2
3
4
6 sd_bus_slot_ref, sd_bus_slot_unref, sd_bus_slot_unrefp - Create and
7 destroy references to a bus slot object
8
10 #include <systemd/sd-bus.h>
11
12 sd_bus_slot *sd_bus_slot_ref(sd_bus_slot *slot);
13
14 sd_bus_slot *sd_bus_slot_unref(sd_bus_slot *slot);
15
16 void sd_bus_slot_unrefp(sd_bus_slot **slotp);
17
19 sd_bus_slot_ref() increases the internal reference counter of slot by
20 one.
21
22 sd_bus_slot_unref() decreases the internal reference counter of slot by
23 one. Once the reference count has dropped to zero, slot object is
24 destroyed and cannot be used anymore, so further calls to
25 sd_bus_slot_ref() or sd_bus_slot_unref() are illegal.
26
27 sd_bus_slot_unrefp() is similar to sd_bus_slot_unref() but takes a
28 pointer to a pointer to an sd_bus_slot object. This call is useful in
29 conjunction with GCC's and LLVM's Clean-up Variable Attribute[1]. See
30 sd_bus_new(3) for an example how to use the cleanup attribute.
31
32 sd_bus_slot_ref() and sd_bus_slot_unref() execute no operation if the
33 passed in bus object address is NULL. sd_bus_slot_unrefp() will first
34 dereference its argument, which must not be NULL, and will execute no
35 operation if that is NULL.
36
38 sd_bus_slot_ref() always returns the argument.
39
40 sd_bus_slot_unref() always returns NULL.
41
43 These APIs are implemented as a shared library, which can be compiled
44 and linked to with the libsystemd pkg-config(1) file.
45
47 systemd(1), sd-bus(3), sd_bus_new(3), sd_bus_message_new(3),
48 sd_bus_call_method_async(3)
49
51 1. Clean-up Variable Attribute
52 https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html
53
54
55
56systemd 251 SD_BUS_SLOT_REF(3)