Systemd/src/login
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 pam: systemd-user - call selinux module 2015-09-22 17:54:13 +02:00
70-power-switch.rules login: support more than just power-gpio-key 2015-09-22 16:18:17 +02:00
70-uaccess.rules rules: uaccess - add ID_SOFTWARE_RADIO 2014-07-15 17:35:53 +02:00
71-seat.rules.in treewide: fix typos 2015-07-06 12:51:16 +02:00
73-seat-late.rules.in
inhibit.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
loginctl.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
logind-acl.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
logind-acl.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
logind-action.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
logind-action.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
logind-button.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
logind-button.h remove unused includes 2015-02-23 23:53:42 +01:00
logind-core.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
logind-dbus.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
logind-device.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
logind-device.h remove unused includes 2015-02-23 23:53:42 +01:00
logind-gperf.gperf logind: add a new UserTasksMax= setting to logind.conf 2015-11-13 19:50:52 +01:00
logind-inhibit.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
logind-inhibit.h remove unused includes 2015-02-23 23:53:42 +01:00
logind-seat-dbus.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
logind-seat.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
logind-seat.h sd-bus: drop bus parameter from message callback prototype 2015-04-29 18:36:25 +02:00
logind-session-dbus.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
logind-session-device.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
logind-session-device.h remove unused includes 2015-02-23 23:53:42 +01:00
logind-session.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
logind-session.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
logind-user-dbus.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
logind-user.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
logind-user.h login: group static fields in "struct User" 2015-11-16 15:34:41 +01:00
logind-utmp.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
logind.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
logind.conf logind: change default to UserTasksMax= to 4096 2015-11-16 11:58:04 +01:00
logind.h logind: add a new UserTasksMax= setting to logind.conf 2015-11-13 19:50:52 +01:00
Makefile
org.freedesktop.login1.conf logind/systemctl: introduce SetWallMessage and --message 2015-08-25 13:52:44 +02:00
org.freedesktop.login1.policy.in logind/systemctl: introduce SetWallMessage and --message 2015-08-25 13:52:44 +02:00
org.freedesktop.login1.service
pam_systemd.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
pam_systemd.sym pam_systemd: replace regex with sym file 2014-06-21 15:45:49 +02:00
sysfs-show.c tree-wide: group include of libudev.h with sd-* 2015-11-17 07:06:08 +01:00
sysfs-show.h build-sys: move core/build.h → shared/build.h 2014-12-23 21:05:28 +01:00
systemd-user.m4 pam: systemd-user - call selinux module 2015-09-22 17:54:13 +02:00
test-inhibit.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
test-login-shared.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
test-login-tables.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00