Systemd/src/libudev
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
..
libudev-device-internal.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
libudev-device-private.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
libudev-device.c tree-wide: use "cannot" instead of "can not" 2018-02-08 10:34:52 +01:00
libudev-enumerate.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
libudev-hwdb.c Replace free and return NULL with return mfree 2017-11-24 10:31:49 +00:00
libudev-list.c coccinelle: add reallocarray() coccinelle script 2018-03-02 12:39:07 +01:00
libudev-monitor.c Replace free and return NULL with return mfree 2017-11-24 10:31:49 +00:00
libudev-private.h udev: use "#pragma once" 2018-02-09 16:33:30 +09:00
libudev-queue.c io-util: make flush_fd() return how many bytes where flushed 2018-01-05 13:55:08 +01:00
libudev-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
libudev.c Make MANAGER_TEST_RUN_MINIMAL just allocate data structures 2018-03-11 16:33:59 +01:00
libudev.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
libudev.pc.in Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
libudev.sym Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
meson.build meson: rename libudev_internal to libudev_static and link into libudev 2018-01-03 12:09:46 +01:00