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