Systemd/src/network
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 Revert "update gitignore" 2014-05-22 06:14:41 +09:00
Makefile networkd: add a basic network daemon 2013-11-09 23:41:17 +01:00
networkctl.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
networkd-address-pool.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
networkd-address-pool.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
networkd-address.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
networkd-address.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
networkd-dhcp4.c networkd: dhcp4 - dirty link when the lease changes 2015-11-18 14:26:36 +01:00
networkd-dhcp6.c networkd: ndisc - always configure dhcp6 client 2015-11-17 13:26:46 +01:00
networkd-fdb.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
networkd-fdb.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
networkd-ipv4ll.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
networkd-link-bus.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
networkd-link.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
networkd-link.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
networkd-manager-bus.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
networkd-manager.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
networkd-ndisc.c Revert "networkd: ndisc - revert to letting the kernel handle NDisc" 2015-11-19 01:25:40 +01:00
networkd-netdev-bond.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
networkd-netdev-bond.h networkd: split up networkd.h into per-object header files 2015-08-27 14:01:23 +02:00
networkd-netdev-bridge.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
networkd-netdev-bridge.h networkd: add bridge properties 2015-10-05 09:43:29 +05:30
networkd-netdev-dummy.c remove unused includes 2015-02-23 23:53:42 +01:00
networkd-netdev-dummy.h networkd: netdev - split NetDev struct into per-kind structs 2014-07-21 13:32:27 +02:00
networkd-netdev-gperf.gperf networkd: vxlan add option to set FDB entries 2015-11-03 09:28:03 +05:30
networkd-netdev-ipvlan.c util-lib: move string table stuff into its own string-table.[ch] 2015-10-27 13:25:56 +01:00
networkd-netdev-ipvlan.h networkd: netdev - add ipvlan support 2015-01-19 23:25:16 +01:00
networkd-netdev-macvlan.c util-lib: move string table stuff into its own string-table.[ch] 2015-10-27 13:25:56 +01:00
networkd-netdev-macvlan.h networkd: add support for macvtap 2015-07-27 11:18:28 +05:30
networkd-netdev-tunnel.c util-lib: move string table stuff into its own string-table.[ch] 2015-10-27 13:25:56 +01:00
networkd-netdev-tunnel.h networkd: add support for tunnel encap limit 2015-08-31 13:21:44 +05:30
networkd-netdev-tuntap.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
networkd-netdev-tuntap.h networkd: tap add support for vnet_hdr 2015-07-14 14:10:56 +05:30
networkd-netdev-veth.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
networkd-netdev-veth.h networkd: netdev - split NetDev struct into per-kind structs 2014-07-21 13:32:27 +02:00
networkd-netdev-vlan.c vlan: fix assert 2015-10-25 09:30:17 +05:30
networkd-netdev-vlan.h networkd: netdev - split NetDev struct into per-kind structs 2014-07-21 13:32:27 +02:00
networkd-netdev-vxlan.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
networkd-netdev-vxlan.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
networkd-netdev.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
networkd-netdev.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
networkd-network-bus.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
networkd-network-gperf.gperf networkd: Add support to configure IPV6 hop limit 2015-11-10 09:26:38 +05:30
networkd-network.c networkd: Add support to configure IPV6 hop limit 2015-11-10 09:26:38 +05:30
networkd-network.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
networkd-route.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
networkd-route.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
networkd-util.c networkd: stop managing per-interface IP forwarding settings 2015-11-13 13:02:50 +01:00
networkd-util.h networkd: split up networkd.h into per-object header files 2015-08-27 14:01:23 +02:00
networkd-wait-online-link.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
networkd-wait-online-link.h sd-netlink: rename from sd-rtnl 2015-06-13 19:52:54 +02:00
networkd-wait-online-manager.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
networkd-wait-online.c util: introduce common version() implementation and use it everywhere 2015-09-29 21:08:37 +02:00
networkd-wait-online.h sd-netlink: rename from sd-rtnl 2015-06-13 19:52:54 +02:00
networkd.c networkd: route - track routes 2015-10-30 12:32:48 +01:00
networkd.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
org.freedesktop.network1.conf networkd: add basic dbus API 2015-02-05 11:50:34 +01:00
org.freedesktop.network1.service networkd: add basic dbus API 2015-02-05 11:50:34 +01:00
test-network-tables.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
test-network.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00