Systemd/src/import
Lennart Poettering 4afd3348c7 tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy
GLIB has recently started to officially support the gcc cleanup
attribute in its public API, hence let's do the same for our APIs.

With this patch we'll define an xyz_unrefp() call for each public
xyz_unref() call, to make it easy to use inside a
__attribute__((cleanup())) expression. Then, all code is ported over to
make use of this.

The new calls are also documented in the man pages, with examples how to
use them (well, I only added docs where the _unref() call itself already
had docs, and the examples, only cover sd_bus_unrefp() and
sd_event_unrefp()).

This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we
tend to call our destructors these days.

Note that this defines no public macro that wraps gcc's attribute and
makes it easier to use. While I think it's our duty in the library to
make our stuff easy to use, I figure it's not our duty to make gcc's own
features easy to use on its own. Most likely, client code which wants to
make use of this should define its own:

       #define _cleanup_(function) __attribute__((cleanup(function)))

Or similar, to make the gcc feature easier to use.

Making this logic public has the benefit that we can remove three header
files whose only purpose was to define these functions internally.

See #2008.
2015-11-27 19:19:36 +01:00
..
.gitignore import: introduce new mini-daemon systemd-importd, and make machinectl a client to it 2015-01-22 04:02:07 +01:00
aufs-util.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
aufs-util.h import: add new minimal tool "systemd-import" for pulling down foreign containers and install them locally 2014-12-19 02:08:14 +01:00
curl-util.c tree-wide: make macros for converting fds to pointers and back generic and use them everywhere 2015-11-17 00:52:10 +01:00
curl-util.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
export-raw.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
export-raw.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
export-tar.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
export-tar.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
export.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
import-common.c src/basic: rename audit.[ch] → audit-util.[ch] and capability.[ch] → capability-util.[ch] 2015-10-27 13:25:57 +01:00
import-common.h importd: add API for exporting container/VM images 2015-03-09 18:02:23 +01:00
import-compress.c util-lib: move string table stuff into its own string-table.[ch] 2015-10-27 13:25:56 +01:00
import-compress.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
import-pubring.gpg import: add image verification using gpg 2015-01-21 04:03:54 +01:00
import-raw.c treewide: use the negative error codes returned by our functions 2015-11-05 13:44:06 +01:00
import-raw.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
import-tar.c treewide: use the negative error codes returned by our functions 2015-11-05 13:44:06 +01:00
import-tar.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
import.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
importd.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
Makefile import: add new minimal tool "systemd-import" for pulling down foreign containers and install them locally 2014-12-19 02:08:14 +01:00
org.freedesktop.import1.conf importd: fix bus policy 2015-01-23 01:17:55 +01:00
org.freedesktop.import1.policy.in importd: add API for exporting container/VM images 2015-03-09 18:02:23 +01:00
org.freedesktop.import1.service import: introduce new mini-daemon systemd-importd, and make machinectl a client to it 2015-01-22 04:02:07 +01:00
pull-common.c siphash24: let siphash24_finalize() and siphash24() return the result directly 2015-11-16 23:17:52 +01:00
pull-common.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
pull-dkr.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
pull-dkr.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
pull-job.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
pull-job.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
pull-raw.c import: report error before losing errno 2015-11-05 13:44:09 +01:00
pull-raw.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
pull-tar.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
pull-tar.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
pull.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
qcow2-util.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
qcow2-util.h import: support importing qcow2 images 2015-01-16 20:09:33 +01:00
test-qcow2.c util-lib: split out fd-related operations into fd-util.[ch] 2015-10-25 13:19:18 +01:00