Systemd/src/libsystemd
Lennart Poettering ae2a15bc14 macro: introduce TAKE_PTR() macro
This macro will read a pointer of any type, return it, and set the
pointer to NULL. This is useful as an explicit concept of passing
ownership of a memory area between pointers.

This takes inspiration from Rust:

https://doc.rust-lang.org/std/option/enum.Option.html#method.take

and was suggested by Alan Jenkins (@sourcejedi).

It drops ~160 lines of code from our codebase, which makes me like it.
Also, I think it clarifies passing of ownership, and thus helps
readability a bit (at least for the initiated who know the new macro)
2018-03-22 20:21:42 +01:00
..
sd-bus macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
sd-daemon macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
sd-device macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
sd-event fd-util: move certain fds above fd #2 (#8129) 2018-02-09 17:53:28 +01:00
sd-hwdb Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
sd-id128 tree-wide: make use of fsync_directory_of_file() all over the place 2018-02-20 15:39:31 +01:00
sd-login macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
sd-netlink macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
sd-network macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
sd-path Remove /sbin from paths if split-bin is false (#8324) 2018-03-01 21:48:36 +01:00
sd-resolve fd-util: move certain fds above fd #2 (#8129) 2018-02-09 17:53:28 +01:00
sd-utf8 Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
libsystemd.pc.in Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
libsystemd.sym sd-bus: add APIs to query the current read and write queue size 2018-02-27 19:54:29 +01:00
meson.build meson: factor out daemon/event/id128 sources into variables (#8170) 2018-02-14 14:08:50 +01:00