]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
util-lib: split our string related calls from util.[ch] into its own file string...
authorLennart Poettering <lennart@poettering.net>
Sat, 24 Oct 2015 20:58:24 +0000 (22:58 +0200)
committerLennart Poettering <lennart@poettering.net>
Sat, 24 Oct 2015 21:05:02 +0000 (23:05 +0200)
There are more than enough calls doing string manipulations to deserve
its own files, hence do something about it.

This patch also sorts the #include blocks of all files that needed to be
updated, according to the sorting suggestions from CODING_STYLE. Since
pretty much every file needs our string manipulation functions this
effectively means that most files have sorted #include blocks now.

Also touches a few unrelated include files.

404 files changed:
Makefile.am
src/activate/activate.c
src/backlight/backlight.c
src/basic/btrfs-util.c
src/basic/calendarspec.c
src/basic/cgroup-util.c
src/basic/clock-util.c
src/basic/conf-files.c
src/basic/copy.c
src/basic/env-util.c
src/basic/fdset.c
src/basic/fileio.c
src/basic/hostname-util.c
src/basic/json.c
src/basic/locale-util.c
src/basic/log.c
src/basic/log.h
src/basic/login-util.c
src/basic/memfd-util.c
src/basic/path-util.c
src/basic/process-util.c
src/basic/rm-rf.c
src/basic/signal-util.c
src/basic/socket-util.c
src/basic/string-util.c [new file with mode: 0644]
src/basic/string-util.h [new file with mode: 0644]
src/basic/strv.c
src/basic/terminal-util.c
src/basic/time-util.c
src/basic/unit-name.c
src/basic/util.c
src/basic/util.h
src/basic/verbs.c
src/basic/virt.c
src/basic/xml.c
src/binfmt/binfmt.c
src/boot/bootctl.c
src/bootchart/bootchart.c
src/bootchart/store.c
src/bus-proxyd/bus-proxyd.c
src/bus-proxyd/bus-xml-policy.c
src/bus-proxyd/driver.c
src/bus-proxyd/proxy.h
src/bus-proxyd/synthesize.c
src/bus-proxyd/synthesize.h
src/bus-proxyd/test-bus-xml-policy.c
src/cgroups-agent/cgroups-agent.c
src/core/automount.c
src/core/busname.c
src/core/busname.h
src/core/cgroup.c
src/core/dbus-automount.c
src/core/dbus-busname.c
src/core/dbus-cgroup.h
src/core/dbus-execute.h
src/core/dbus-job.c
src/core/dbus-job.h
src/core/dbus-kill.h
src/core/dbus-manager.c
src/core/dbus-mount.c
src/core/dbus-mount.h
src/core/dbus-path.c
src/core/dbus-service.c
src/core/dbus-socket.c
src/core/dbus-swap.c
src/core/dbus-target.h
src/core/dbus-unit.c
src/core/dbus.c
src/core/device.c
src/core/execute.c
src/core/hostname-setup.c
src/core/job.c
src/core/job.h
src/core/killall.c
src/core/load-fragment.c
src/core/locale-setup.c
src/core/loopback-setup.c
src/core/machine-id-setup.c
src/core/manager.c
src/core/mount.c
src/core/namespace.c
src/core/path.c
src/core/scope.c
src/core/selinux-setup.c
src/core/service.c
src/core/show-status.c
src/core/shutdown.c
src/core/slice.c
src/core/smack-setup.c
src/core/snapshot.c
src/core/socket.c
src/core/swap.c
src/core/swap.h
src/core/target.c
src/core/timer.c
src/core/umount.c
src/core/unit-printf.c
src/core/unit.c
src/cryptsetup/cryptsetup-generator.c
src/cryptsetup/cryptsetup.c
src/debug-generator/debug-generator.c
src/delta/delta.c
src/escape/escape.c
src/firstboot/firstboot.c
src/fstab-generator/fstab-generator.c
src/getty-generator/getty-generator.c
src/gpt-auto-generator/gpt-auto-generator.c
src/hibernate-resume/hibernate-resume-generator.c
src/hwdb/hwdb.c
src/import/aufs-util.c
src/import/curl-util.c
src/import/curl-util.h
src/import/export-raw.c
src/import/export-tar.c
src/import/export.c
src/import/import-raw.c
src/import/import-tar.c
src/import/import.c
src/import/pull-common.c
src/import/pull-dkr.c
src/import/pull-job.c
src/import/pull-raw.c
src/import/pull-tar.c
src/import/pull.c
src/journal-remote/journal-remote-parse.c
src/journal-remote/journal-remote.c
src/journal-remote/journal-upload.c
src/journal-remote/microhttpd-util.c
src/journal/cat.c
src/journal/catalog.c
src/journal/compress.c
src/journal/coredump-vacuum.c
src/journal/coredump.c
src/journal/coredumpctl.c
src/journal/journal-file.c
src/journal/journal-internal.h
src/journal/journal-send.c
src/journal/journal-vacuum.c
src/journal/journald-audit.c
src/journal/journald-kmsg.c
src/journal/journald-native.c
src/journal/journald-rate-limit.c
src/journal/journald-server.c
src/journal/journald-stream.c
src/journal/journald-syslog.c
src/journal/journald-wall.c
src/journal/sd-journal.c
src/journal/stacktrace.c
src/journal/test-catalog.c
src/journal/test-compress-benchmark.c
src/journal/test-journal-enum.c
src/journal/test-journal-flush.c
src/journal/test-journal-match.c
src/journal/test-journal-syslog.c
src/libsystemd-network/dhcp-identifier.c
src/libsystemd-network/dhcp-identifier.h
src/libsystemd-network/dhcp-internal.h
src/libsystemd-network/dhcp6-internal.h
src/libsystemd-network/lldp-internal.c
src/libsystemd-network/lldp-internal.h
src/libsystemd-network/network-internal.c
src/libsystemd-network/sd-dhcp-client.c
src/libsystemd-network/sd-dhcp-lease.c
src/libsystemd-network/sd-dhcp-server.c
src/libsystemd-network/sd-dhcp6-client.c
src/libsystemd-network/sd-ipv4acd.c
src/libsystemd-network/sd-ipv4ll.c
src/libsystemd-network/sd-lldp.c
src/libsystemd-network/sd-ndisc.c
src/libsystemd-network/sd-pppoe.c
src/libsystemd-network/test-dhcp-client.c
src/libsystemd-network/test-dhcp-server.c
src/libsystemd-network/test-dhcp6-client.c
src/libsystemd-network/test-ipv4ll-manual.c
src/libsystemd-network/test-ipv4ll.c
src/libsystemd-network/test-lldp.c
src/libsystemd-network/test-ndisc-rs.c
src/libsystemd/sd-bus/bus-control.c
src/libsystemd/sd-bus/bus-convenience.c
src/libsystemd/sd-bus/bus-creds.c
src/libsystemd/sd-bus/bus-dump.c
src/libsystemd/sd-bus/bus-error.c
src/libsystemd/sd-bus/bus-internal.c
src/libsystemd/sd-bus/bus-internal.h
src/libsystemd/sd-bus/bus-introspect.c
src/libsystemd/sd-bus/bus-kernel.c
src/libsystemd/sd-bus/bus-match.c
src/libsystemd/sd-bus/bus-match.h
src/libsystemd/sd-bus/bus-message.c
src/libsystemd/sd-bus/bus-message.h
src/libsystemd/sd-bus/bus-objects.c
src/libsystemd/sd-bus/bus-slot.c
src/libsystemd/sd-bus/bus-socket.c
src/libsystemd/sd-bus/bus-type.h
src/libsystemd/sd-bus/busctl-introspect.c
src/libsystemd/sd-bus/sd-bus.c
src/libsystemd/sd-bus/test-bus-benchmark.c
src/libsystemd/sd-bus/test-bus-chat.c
src/libsystemd/sd-bus/test-bus-cleanup.c
src/libsystemd/sd-bus/test-bus-gvariant.c
src/libsystemd/sd-bus/test-bus-kernel-bloom.c
src/libsystemd/sd-bus/test-bus-kernel.c
src/libsystemd/sd-bus/test-bus-marshal.c
src/libsystemd/sd-bus/test-bus-objects.c
src/libsystemd/sd-bus/test-bus-proxy.c
src/libsystemd/sd-bus/test-bus-server.c
src/libsystemd/sd-bus/test-bus-signature.c
src/libsystemd/sd-bus/test-bus-zero-copy.c
src/libsystemd/sd-daemon/sd-daemon.c
src/libsystemd/sd-device/device-enumerator.c
src/libsystemd/sd-device/device-private.c
src/libsystemd/sd-device/device-private.h
src/libsystemd/sd-device/sd-device.c
src/libsystemd/sd-event/event-util.h
src/libsystemd/sd-event/sd-event.c
src/libsystemd/sd-hwdb/hwdb-util.h
src/libsystemd/sd-hwdb/sd-hwdb.c
src/libsystemd/sd-id128/sd-id128.c
src/libsystemd/sd-login/sd-login.c
src/libsystemd/sd-login/test-login.c
src/libsystemd/sd-netlink/netlink-internal.h
src/libsystemd/sd-netlink/netlink-message.c
src/libsystemd/sd-netlink/netlink-socket.c
src/libsystemd/sd-netlink/netlink-util.c
src/libsystemd/sd-netlink/netlink-util.h
src/libsystemd/sd-netlink/rtnl-message.c
src/libsystemd/sd-netlink/sd-netlink.c
src/libsystemd/sd-netlink/test-netlink.c
src/libsystemd/sd-network/sd-network.c
src/libsystemd/sd-path/sd-path.c
src/libsystemd/sd-resolve/resolve-util.h
src/libsystemd/sd-resolve/sd-resolve.c
src/libsystemd/sd-resolve/test-resolve.c
src/libsystemd/sd-utf8/sd-utf8.c
src/libudev/libudev-device-internal.h
src/libudev/libudev-device-private.c
src/libudev/libudev-device.c
src/libudev/libudev-enumerate.c
src/libudev/libudev-hwdb.c
src/libudev/libudev-monitor.c
src/libudev/libudev-private.h
src/libudev/libudev-util.c
src/libudev/libudev.c
src/login/logind-acl.c
src/login/logind-acl.h
src/login/logind-action.h
src/login/logind-button.c
src/login/logind-inhibit.c
src/login/logind-seat.c
src/login/logind-session-device.c
src/login/logind.c
src/login/logind.h
src/login/sysfs-show.c
src/login/test-inhibit.c
src/machine/machined.h
src/modules-load/modules-load.c
src/network/networkctl.c
src/network/networkd-address-pool.c
src/network/networkd-address.c
src/network/networkd-dhcp6.c
src/network/networkd-link.h
src/network/networkd-manager.c
src/network/networkd-ndisc.c
src/network/networkd-netdev-bond.c
src/network/networkd-netdev-tunnel.c
src/network/networkd-netdev.c
src/network/networkd-network-bus.c
src/network/networkd-network.c
src/network/networkd-route.c
src/network/networkd-util.c
src/network/networkd-wait-online-link.c
src/notify/notify.c
src/nspawn/nspawn-cgroup.c
src/nspawn/nspawn-expose-ports.c
src/nspawn/nspawn-mount.c
src/nspawn/nspawn-network.c
src/nspawn/nspawn-setuid.c
src/nspawn/nspawn.c
src/nss-myhostname/nss-myhostname.c
src/nss-mymachines/nss-mymachines.c
src/nss-resolve/nss-resolve.c
src/path/path.c
src/quotacheck/quotacheck.c
src/random-seed/random-seed.c
src/rc-local-generator/rc-local-generator.c
src/reply-password/reply-password.c
src/resolve/resolved-conf.c
src/resolve/resolved-dns-answer.c
src/resolve/resolved-dns-rr.c
src/resolve/resolved-dns-zone.c
src/resolve/resolved-link.c
src/resolve/resolved-manager.c
src/rfkill/rfkill.c
src/shared/acl-util.c
src/shared/architecture.c
src/shared/ask-password-api.c
src/shared/base-filesystem.c
src/shared/bus-util.c
src/shared/bus-util.h
src/shared/cgroup-show.c
src/shared/clean-ipc.c
src/shared/condition.c
src/shared/conf-parser.c
src/shared/dns-domain.c
src/shared/dropin.c
src/shared/fstab-util.c
src/shared/generator.c
src/shared/import-util.c
src/shared/install.c
src/shared/logs-show.c
src/shared/machine-image.c
src/shared/machine-pool.c
src/shared/pager.c
src/shared/path-lookup.c
src/shared/seccomp-util.c
src/shared/sleep-config.c
src/shared/specifier.c
src/shared/switch-root.c
src/shared/sysctl-util.c
src/shared/utmp-wtmp.c
src/sleep/sleep.c
src/socket-proxy/socket-proxyd.c
src/sysctl/sysctl.c
src/system-update-generator/system-update-generator.c
src/systemd/sd-dhcp6-client.h
src/systemd/sd-lldp.h
src/sysusers/sysusers.c
src/sysv-generator/sysv-generator.c
src/test/test-af-list.c
src/test/test-arphrd-list.c
src/test/test-btrfs.c
src/test/test-calendarspec.c
src/test/test-cgroup-util.c
src/test/test-cgroup.c
src/test/test-condition.c
src/test/test-conf-files.c
src/test/test-conf-parser.c
src/test/test-copy.c
src/test/test-date.c
src/test/test-device-nodes.c
src/test/test-dns-domain.c
src/test/test-ellipsize.c
src/test/test-env-replace.c
src/test/test-fileio.c
src/test/test-fstab-util.c
src/test/test-hashmap-plain.c
src/test/test-hostname-util.c
src/test/test-id128.c
src/test/test-json.c
src/test/test-libudev.c
src/test/test-namespace.c
src/test/test-netlink-manual.c
src/test/test-path-lookup.c
src/test/test-path-util.c
src/test/test-path.c
src/test/test-process-util.c
src/test/test-replace-var.c
src/test/test-socket-util.c
src/test/test-strbuf.c
src/test/test-strip-tab-ansi.c
src/test/test-strv.c
src/test/test-strxcpyx.c
src/test/test-tmpfiles.c
src/test/test-udev.c
src/test/test-unit-file.c
src/test/test-unit-name.c
src/test/test-utf8.c
src/test/test-util.c
src/test/test-xml.c
src/timesync/timesyncd-conf.c
src/timesync/timesyncd-manager.c
src/tmpfiles/tmpfiles.c
src/tty-ask-password-agent/tty-ask-password-agent.c
src/udev/ata_id/ata_id.c
src/udev/cdrom_id/cdrom_id.c
src/udev/collect/collect.c
src/udev/net/link-config.c
src/udev/net/link-config.h
src/udev/scsi_id/scsi_id.c
src/udev/scsi_id/scsi_serial.c
src/udev/udev-builtin-blkid.c
src/udev/udev-builtin-btrfs.c
src/udev/udev-builtin-hwdb.c
src/udev/udev-builtin-input_id.c
src/udev/udev-builtin-keyboard.c
src/udev/udev-builtin-kmod.c
src/udev/udev-builtin-net_id.c
src/udev/udev-builtin-path_id.c
src/udev/udev-builtin-usb_id.c
src/udev/udev-builtin.c
src/udev/udev-event.c
src/udev/udev-node.c
src/udev/udev-rules.c
src/udev/udev.h
src/udev/udevadm-hwdb.c
src/udev/udevadm-info.c
src/udev/udevadm-test-builtin.c
src/udev/udevadm-test.c
src/udev/udevadm-trigger.c
src/udev/udevadm-util.c
src/udev/udevadm.c
src/udev/udevd.c
src/user-sessions/user-sessions.c
src/vconsole/vconsole-setup.c

index db96d51aa474c7cecff5791cc4674690c4f7bbbf..9ef55f4e435f36f75421a9d4b860e3fe082d52bb 100644 (file)
@@ -781,6 +781,8 @@ libbasic_la_SOURCES = \
        src/basic/refcnt.h \
        src/basic/util.c \
        src/basic/util.h \
+       src/basic/string-util.c \
+       src/basic/string-util.h \
        src/basic/extract-word.c \
        src/basic/extract-word.h \
        src/basic/escape.c \
index 4ece1367c11e9651da10e5b429b726028bf79f4a..adb43623cfa2efb754f8c854386ae1f6353cc7d9 100644 (file)
@@ -32,6 +32,7 @@
 #include "macro.h"
 #include "signal-util.h"
 #include "socket-util.h"
+#include "string-util.h"
 #include "strv.h"
 
 static char** arg_listen = NULL;
index 84ce842cae6b297723ab17b9205cb13a10529f30..fc96eee6a92edb3350d9f9772e5fa4a69d1ac9a3 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include "libudev.h"
+
 #include "def.h"
 #include "escape.h"
 #include "fileio.h"
-#include "libudev.h"
 #include "mkdir.h"
+#include "string-util.h"
 #include "udev-util.h"
 #include "util.h"
 
index f327c16a808840cf52b3afc30808d18956a6fd38..df7b959c125b08dc4a75c5485ba994972224114c 100644 (file)
 ***/
 
 #include <stdlib.h>
-#include <sys/vfs.h>
 #include <sys/stat.h>
-
+#include <sys/vfs.h>
 #ifdef HAVE_LINUX_BTRFS_H
 #include <linux/btrfs.h>
 #endif
 
+#include "btrfs-ctree.h"
+#include "copy.h"
+#include "fileio.h"
+#include "macro.h"
 #include "missing.h"
-#include "util.h"
 #include "path-util.h"
-#include "macro.h"
-#include "copy.h"
 #include "selinux-util.h"
 #include "smack-util.h"
-#include "fileio.h"
-#include "btrfs-ctree.h"
+#include "string-util.h"
+#include "util.h"
 #include "btrfs-util.h"
 
 /* WARNING: Be careful with file system ioctls! When we get an fd, we
index a2296f4709b2573ee09f0930e92b4481757ee256..987ca81910fe9eb6e57952f5165298c91b20f281 100644 (file)
@@ -22,6 +22,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "string-util.h"
 #include "calendarspec.h"
 
 #define BITS_WEEKDAYS   127
index a3ea512165d4545db80c0bb335bb8645bc909894..ce21ef73eb85e0aff5ec5c857784c0f0022bc781 100644 (file)
@@ -39,6 +39,7 @@
 #include "process-util.h"
 #include "set.h"
 #include "special.h"
+#include "string-util.h"
 #include "unit-name.h"
 #include "util.h"
 #include "cgroup-util.h"
index e4e03df1e47d196f1457e8c2ea00689de0780afb..03ec5725ae517f0586660588e81aa7c6172ddd85 100644 (file)
 ***/
 
 #include <errno.h>
-#include <stdio.h>
 #include <fcntl.h>
+#include <linux/rtc.h>
+#include <stdio.h>
 #include <sys/ioctl.h>
 #include <sys/time.h>
-#include <linux/rtc.h>
 
 #include "macro.h"
+#include "string-util.h"
 #include "util.h"
 #include "clock-util.h"
 
index da8745b284d7462d9a3a03297b0784aff9bf09ce..0e44d1bbad3504350d78dc9239291c0350d6799c 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <string.h>
+#include <dirent.h>
 #include <errno.h>
-#include <stdlib.h>
 #include <stdio.h>
-#include <dirent.h>
+#include <stdlib.h>
+#include <string.h>
 
+#include "hashmap.h"
+#include "log.h"
 #include "macro.h"
-#include "util.h"
 #include "missing.h"
-#include "log.h"
-#include "strv.h"
 #include "path-util.h"
-#include "hashmap.h"
+#include "string-util.h"
+#include "strv.h"
+#include "util.h"
 #include "conf-files.h"
 
 static int files_add(Hashmap *h, const char *root, const char *path, const char *suffix) {
index b20c178727357e33747760911e742ccd285d1491..7702d906c778edce41efa37e819d6e65b7d0726c 100644 (file)
 #include <sys/sendfile.h>
 #include <sys/xattr.h>
 
-#include "util.h"
 #include "btrfs-util.h"
+#include "string-util.h"
 #include "strv.h"
+#include "util.h"
 #include "copy.h"
 
 #define COPY_BUFFER_SIZE (16*1024)
index ecb2192c4d79ea5b8b877a689421241bc1ea9058..a392af737cf67c0cf0e4ff1223e8fec199518b43 100644 (file)
 #include <limits.h>
 #include <unistd.h>
 
+#include "def.h"
+#include "string-util.h"
 #include "strv.h"
 #include "utf8.h"
 #include "util.h"
 #include "env-util.h"
-#include "def.h"
 
 #define VALID_CHARS_ENV_NAME                    \
         DIGITS LETTERS                          \
index d70fe156a26044a3940920b1a8f20edf2f5b2fdc..2882f515b59886ae4760a299d9f5fcd543f501d7 100644 (file)
 #include <dirent.h>
 #include <fcntl.h>
 
+#include "sd-daemon.h"
+
 #include "set.h"
 #include "util.h"
 #include "macro.h"
 #include "fdset.h"
-#include "sd-daemon.h"
 
 #define MAKE_SET(s) ((Set*) s)
 #define MAKE_FDSET(s) ((FDSet*) s)
index 65a6a6558bf865dce8f9ff10a918ec544af5b60d..f8ccf792212ba133483430219616fbb30e2ca949 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "ctype.h"
 #include "escape.h"
+#include "string-util.h"
 #include "strv.h"
 #include "utf8.h"
 #include "util.h"
index 1b816fb77af6823d4febde3a2480952ca910e3f1..8d10615682f29b9241ecc8727d4084032e272759 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/utsname.h>
 #include <ctype.h>
+#include <sys/utsname.h>
 
+#include "string-util.h"
 #include "util.h"
 #include "hostname-util.h"
 
index be40a0d203d9e76d771acc63e2270ed0bc7410b1..2b634aa7f8bc95ca7a68a133b7b36ae58b06b575 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/types.h>
 #include <math.h>
+#include <sys/types.h>
+
 #include "macro.h"
+#include "string-util.h"
 #include "utf8.h"
 #include "json.h"
 
index 61db9a8125d1a77c4072ea4efa569bd192075d42..a44daf8f5ee5da192f01fcd476e96e388a4f7225 100644 (file)
 #include <sys/mman.h>
 
 #include "set.h"
-#include "util.h"
-#include "utf8.h"
+#include "string-util.h"
 #include "strv.h"
-
+#include "utf8.h"
+#include "util.h"
 #include "locale-util.h"
 
 static int add_locales_from_archive(Set *locales) {
index e6d7d151820e8d05a8e11d44eb8ef3b0e52e4d71..acc390b8d35a17529944a8e8e544ad472f0a3dbe 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdarg.h>
-#include <stdio.h>
 #include <errno.h>
-#include <unistd.h>
 #include <fcntl.h>
+#include <printf.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdio.h>
 #include <sys/socket.h>
 #include <sys/un.h>
-#include <stddef.h>
-#include <printf.h>
+#include <unistd.h>
 
 #include "sd-messages.h"
-#include "log.h"
-#include "util.h"
-#include "missing.h"
-#include "macro.h"
-#include "socket-util.h"
+
 #include "formats-util.h"
+#include "macro.h"
+#include "missing.h"
 #include "process-util.h"
-#include "terminal-util.h"
 #include "signal-util.h"
+#include "socket-util.h"
+#include "string-util.h"
+#include "terminal-util.h"
+#include "util.h"
+#include "log.h"
 
 #define SNDBUF_SIZE (8*1024*1024)
 
index 369d6b1127c9d3f7c6d7d5fc08a47fcdca3140f0..cda1e45cc8d3cd491459def4795292c491e1f0e5 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdbool.h>
+#include <errno.h>
 #include <stdarg.h>
+#include <stdbool.h>
 #include <stdlib.h>
-#include <syslog.h>
 #include <sys/signalfd.h>
-#include <errno.h>
+#include <syslog.h>
 
 #include "sd-id128.h"
+
 #include "macro.h"
 
 typedef enum LogTarget{
index e25437f0f4661b1853af68fc8c33a87776dc5d36..832f477bd2bb842781ef6d2b55eb2f013dfaf6a8 100644 (file)
@@ -19,8 +19,9 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "login-util.h"
 #include "def.h"
+#include "string-util.h"
+#include "login-util.h"
 
 bool session_id_valid(const char *id) {
 
index e99a738e1f88a79af71c8ad899c556da5fdd2b9c..4dafd69daf5a62e3ff531f44d8cdfd74acbdf10c 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
 #include <fcntl.h>
-#include <sys/mman.h>
-#include <sys/prctl.h>
-
 #ifdef HAVE_LINUX_MEMFD_H
-#  include <linux/memfd.h>
+#include <linux/memfd.h>
 #endif
+#include <stdio.h>
+#include <sys/mman.h>
+#include <sys/prctl.h>
 
+#include "missing.h"
+#include "string-util.h"
+#include "utf8.h"
 #include "util.h"
 #include "memfd-util.h"
-#include "utf8.h"
-#include "missing.h"
 
 int memfd_new(const char *name) {
         _cleanup_free_ char *g = NULL;
index 6b05b6edb13e01dd34e8ecc99198ed0a18a418ad..31328807f4fb6a4f07ee4087e9cbf917310b49fb 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <string.h>
-#include <unistd.h>
 #include <errno.h>
-#include <stdlib.h>
-#include <stdio.h>
 #include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <sys/statvfs.h>
+#include <unistd.h>
 
-#include "macro.h"
-#include "util.h"
+#include "fileio.h"
 #include "log.h"
+#include "macro.h"
+#include "missing.h"
+#include "string-util.h"
 #include "strv.h"
+#include "util.h"
 #include "path-util.h"
-#include "missing.h"
-#include "fileio.h"
 
 bool path_is_absolute(const char *p) {
         return p[0] == '/';
index 3199efeafdd6153d2af1b1a60200a7ff8be9bb40..bfde17a956bc19728745dfeb7e1dc53f9cfa2ce3 100644 (file)
@@ -32,6 +32,7 @@
 #include "fileio.h"
 #include "log.h"
 #include "signal-util.h"
+#include "string-util.h"
 #include "util.h"
 #include "process-util.h"
 
index 2ef63799d754aa1a2ccc84b939d31ed40e6e0864..5a75090a6d30882c1fc66ada7b23b7c119b63e93 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "util.h"
-#include "path-util.h"
 #include "btrfs-util.h"
+#include "path-util.h"
+#include "string-util.h"
+#include "util.h"
 #include "rm-rf.h"
 
 int rm_rf_children(int fd, RemoveFlags flags, struct stat *root_dev) {
index 90abe8af816d2df154d6ddbc123d0821475bbe87..730f99e0af4fe7ab80e14c5d7d3d96aea701dcfc 100644 (file)
@@ -19,7 +19,9 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include "string-util.h"
 #include "util.h"
+
 #include "signal-util.h"
 
 int reset_all_signal_handlers(void) {
index 8fd3149276e555a1fcad87045495902ecb53e0d8..9ed5feb8496bebfc3b801bd58fbeeca933952b4b 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
 #include <arpa/inet.h>
-#include <stdio.h>
+#include <errno.h>
 #include <net/if.h>
-#include <sys/types.h>
-#include <stddef.h>
 #include <netdb.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
 
+#include "fileio.h"
+#include "formats-util.h"
 #include "macro.h"
+#include "missing.h"
 #include "path-util.h"
+#include "string-util.h"
 #include "util.h"
 #include "socket-util.h"
-#include "missing.h"
-#include "fileio.h"
-#include "formats-util.h"
 
 int socket_address_parse(SocketAddress *a, const char *s) {
         char *e, *n;
diff --git a/src/basic/string-util.c b/src/basic/string-util.c
new file mode 100644 (file)
index 0000000..a7cf4e8
--- /dev/null
@@ -0,0 +1,767 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+/***
+  This file is part of systemd.
+
+  Copyright 2010 Lennart Poettering
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include "gunicode.h"
+#include "utf8.h"
+#include "util.h"
+#include "string-util.h"
+
+int strcmp_ptr(const char *a, const char *b) {
+
+        /* Like strcmp(), but tries to make sense of NULL pointers */
+        if (a && b)
+                return strcmp(a, b);
+
+        if (!a && b)
+                return -1;
+
+        if (a && !b)
+                return 1;
+
+        return 0;
+}
+
+char* endswith(const char *s, const char *postfix) {
+        size_t sl, pl;
+
+        assert(s);
+        assert(postfix);
+
+        sl = strlen(s);
+        pl = strlen(postfix);
+
+        if (pl == 0)
+                return (char*) s + sl;
+
+        if (sl < pl)
+                return NULL;
+
+        if (memcmp(s + sl - pl, postfix, pl) != 0)
+                return NULL;
+
+        return (char*) s + sl - pl;
+}
+
+char* endswith_no_case(const char *s, const char *postfix) {
+        size_t sl, pl;
+
+        assert(s);
+        assert(postfix);
+
+        sl = strlen(s);
+        pl = strlen(postfix);
+
+        if (pl == 0)
+                return (char*) s + sl;
+
+        if (sl < pl)
+                return NULL;
+
+        if (strcasecmp(s + sl - pl, postfix) != 0)
+                return NULL;
+
+        return (char*) s + sl - pl;
+}
+
+char* first_word(const char *s, const char *word) {
+        size_t sl, wl;
+        const char *p;
+
+        assert(s);
+        assert(word);
+
+        /* Checks if the string starts with the specified word, either
+         * followed by NUL or by whitespace. Returns a pointer to the
+         * NUL or the first character after the whitespace. */
+
+        sl = strlen(s);
+        wl = strlen(word);
+
+        if (sl < wl)
+                return NULL;
+
+        if (wl == 0)
+                return (char*) s;
+
+        if (memcmp(s, word, wl) != 0)
+                return NULL;
+
+        p = s + wl;
+        if (*p == 0)
+                return (char*) p;
+
+        if (!strchr(WHITESPACE, *p))
+                return NULL;
+
+        p += strspn(p, WHITESPACE);
+        return (char*) p;
+}
+
+static size_t strcspn_escaped(const char *s, const char *reject) {
+        bool escaped = false;
+        int n;
+
+        for (n=0; s[n]; n++) {
+                if (escaped)
+                        escaped = false;
+                else if (s[n] == '\\')
+                        escaped = true;
+                else if (strchr(reject, s[n]))
+                        break;
+        }
+
+        /* if s ends in \, return index of previous char */
+        return n - escaped;
+}
+
+/* Split a string into words. */
+const char* split(const char **state, size_t *l, const char *separator, bool quoted) {
+        const char *current;
+
+        current = *state;
+
+        if (!*current) {
+                assert(**state == '\0');
+                return NULL;
+        }
+
+        current += strspn(current, separator);
+        if (!*current) {
+                *state = current;
+                return NULL;
+        }
+
+        if (quoted && strchr("\'\"", *current)) {
+                char quotechars[2] = {*current, '\0'};
+
+                *l = strcspn_escaped(current + 1, quotechars);
+                if (current[*l + 1] == '\0' || current[*l + 1] != quotechars[0] ||
+                    (current[*l + 2] && !strchr(separator, current[*l + 2]))) {
+                        /* right quote missing or garbage at the end */
+                        *state = current;
+                        return NULL;
+                }
+                *state = current++ + *l + 2;
+        } else if (quoted) {
+                *l = strcspn_escaped(current, separator);
+                if (current[*l] && !strchr(separator, current[*l])) {
+                        /* unfinished escape */
+                        *state = current;
+                        return NULL;
+                }
+                *state = current + *l;
+        } else {
+                *l = strcspn(current, separator);
+                *state = current + *l;
+        }
+
+        return current;
+}
+
+char *strnappend(const char *s, const char *suffix, size_t b) {
+        size_t a;
+        char *r;
+
+        if (!s && !suffix)
+                return strdup("");
+
+        if (!s)
+                return strndup(suffix, b);
+
+        if (!suffix)
+                return strdup(s);
+
+        assert(s);
+        assert(suffix);
+
+        a = strlen(s);
+        if (b > ((size_t) -1) - a)
+                return NULL;
+
+        r = new(char, a+b+1);
+        if (!r)
+                return NULL;
+
+        memcpy(r, s, a);
+        memcpy(r+a, suffix, b);
+        r[a+b] = 0;
+
+        return r;
+}
+
+char *strappend(const char *s, const char *suffix) {
+        return strnappend(s, suffix, suffix ? strlen(suffix) : 0);
+}
+
+char *strjoin(const char *x, ...) {
+        va_list ap;
+        size_t l;
+        char *r, *p;
+
+        va_start(ap, x);
+
+        if (x) {
+                l = strlen(x);
+
+                for (;;) {
+                        const char *t;
+                        size_t n;
+
+                        t = va_arg(ap, const char *);
+                        if (!t)
+                                break;
+
+                        n = strlen(t);
+                        if (n > ((size_t) -1) - l) {
+                                va_end(ap);
+                                return NULL;
+                        }
+
+                        l += n;
+                }
+        } else
+                l = 0;
+
+        va_end(ap);
+
+        r = new(char, l+1);
+        if (!r)
+                return NULL;
+
+        if (x) {
+                p = stpcpy(r, x);
+
+                va_start(ap, x);
+
+                for (;;) {
+                        const char *t;
+
+                        t = va_arg(ap, const char *);
+                        if (!t)
+                                break;
+
+                        p = stpcpy(p, t);
+                }
+
+                va_end(ap);
+        } else
+                r[0] = 0;
+
+        return r;
+}
+
+char *strstrip(char *s) {
+        char *e;
+
+        /* Drops trailing whitespace. Modifies the string in
+         * place. Returns pointer to first non-space character */
+
+        s += strspn(s, WHITESPACE);
+
+        for (e = strchr(s, 0); e > s; e --)
+                if (!strchr(WHITESPACE, e[-1]))
+                        break;
+
+        *e = 0;
+
+        return s;
+}
+
+char *delete_chars(char *s, const char *bad) {
+        char *f, *t;
+
+        /* Drops all whitespace, regardless where in the string */
+
+        for (f = s, t = s; *f; f++) {
+                if (strchr(bad, *f))
+                        continue;
+
+                *(t++) = *f;
+        }
+
+        *t = 0;
+
+        return s;
+}
+
+char *truncate_nl(char *s) {
+        assert(s);
+
+        s[strcspn(s, NEWLINE)] = 0;
+        return s;
+}
+
+char *ascii_strlower(char *t) {
+        char *p;
+
+        assert(t);
+
+        for (p = t; *p; p++)
+                if (*p >= 'A' && *p <= 'Z')
+                        *p = *p - 'A' + 'a';
+
+        return t;
+}
+
+bool chars_intersect(const char *a, const char *b) {
+        const char *p;
+
+        /* Returns true if any of the chars in a are in b. */
+        for (p = a; *p; p++)
+                if (strchr(b, *p))
+                        return true;
+
+        return false;
+}
+
+bool string_has_cc(const char *p, const char *ok) {
+        const char *t;
+
+        assert(p);
+
+        /*
+         * Check if a string contains control characters. If 'ok' is
+         * non-NULL it may be a string containing additional CCs to be
+         * considered OK.
+         */
+
+        for (t = p; *t; t++) {
+                if (ok && strchr(ok, *t))
+                        continue;
+
+                if (*t > 0 && *t < ' ')
+                        return true;
+
+                if (*t == 127)
+                        return true;
+        }
+
+        return false;
+}
+
+static char *ascii_ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigned percent) {
+        size_t x;
+        char *r;
+
+        assert(s);
+        assert(percent <= 100);
+        assert(new_length >= 3);
+
+        if (old_length <= 3 || old_length <= new_length)
+                return strndup(s, old_length);
+
+        r = new0(char, new_length+1);
+        if (!r)
+                return NULL;
+
+        x = (new_length * percent) / 100;
+
+        if (x > new_length - 3)
+                x = new_length - 3;
+
+        memcpy(r, s, x);
+        r[x] = '.';
+        r[x+1] = '.';
+        r[x+2] = '.';
+        memcpy(r + x + 3,
+               s + old_length - (new_length - x - 3),
+               new_length - x - 3);
+
+        return r;
+}
+
+char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigned percent) {
+        size_t x;
+        char *e;
+        const char *i, *j;
+        unsigned k, len, len2;
+
+        assert(s);
+        assert(percent <= 100);
+        assert(new_length >= 3);
+
+        /* if no multibyte characters use ascii_ellipsize_mem for speed */
+        if (ascii_is_valid(s))
+                return ascii_ellipsize_mem(s, old_length, new_length, percent);
+
+        if (old_length <= 3 || old_length <= new_length)
+                return strndup(s, old_length);
+
+        x = (new_length * percent) / 100;
+
+        if (x > new_length - 3)
+                x = new_length - 3;
+
+        k = 0;
+        for (i = s; k < x && i < s + old_length; i = utf8_next_char(i)) {
+                int c;
+
+                c = utf8_encoded_to_unichar(i);
+                if (c < 0)
+                        return NULL;
+                k += unichar_iswide(c) ? 2 : 1;
+        }
+
+        if (k > x) /* last character was wide and went over quota */
+                x ++;
+
+        for (j = s + old_length; k < new_length && j > i; ) {
+                int c;
+
+                j = utf8_prev_char(j);
+                c = utf8_encoded_to_unichar(j);
+                if (c < 0)
+                        return NULL;
+                k += unichar_iswide(c) ? 2 : 1;
+        }
+        assert(i <= j);
+
+        /* we don't actually need to ellipsize */
+        if (i == j)
+                return memdup(s, old_length + 1);
+
+        /* make space for ellipsis */
+        j = utf8_next_char(j);
+
+        len = i - s;
+        len2 = s + old_length - j;
+        e = new(char, len + 3 + len2 + 1);
+        if (!e)
+                return NULL;
+
+        /*
+        printf("old_length=%zu new_length=%zu x=%zu len=%u len2=%u k=%u\n",
+               old_length, new_length, x, len, len2, k);
+        */
+
+        memcpy(e, s, len);
+        e[len]   = 0xe2; /* tri-dot ellipsis: â€¦ */
+        e[len + 1] = 0x80;
+        e[len + 2] = 0xa6;
+
+        memcpy(e + len + 3, j, len2 + 1);
+
+        return e;
+}
+
+char *ellipsize(const char *s, size_t length, unsigned percent) {
+        return ellipsize_mem(s, strlen(s), length, percent);
+}
+
+bool nulstr_contains(const char*nulstr, const char *needle) {
+        const char *i;
+
+        if (!nulstr)
+                return false;
+
+        NULSTR_FOREACH(i, nulstr)
+                if (streq(i, needle))
+                        return true;
+
+        return false;
+}
+
+char* strshorten(char *s, size_t l) {
+        assert(s);
+
+        if (l < strlen(s))
+                s[l] = 0;
+
+        return s;
+}
+
+char *strreplace(const char *text, const char *old_string, const char *new_string) {
+        const char *f;
+        char *t, *r;
+        size_t l, old_len, new_len;
+
+        assert(text);
+        assert(old_string);
+        assert(new_string);
+
+        old_len = strlen(old_string);
+        new_len = strlen(new_string);
+
+        l = strlen(text);
+        r = new(char, l+1);
+        if (!r)
+                return NULL;
+
+        f = text;
+        t = r;
+        while (*f) {
+                char *a;
+                size_t d, nl;
+
+                if (!startswith(f, old_string)) {
+                        *(t++) = *(f++);
+                        continue;
+                }
+
+                d = t - r;
+                nl = l - old_len + new_len;
+                a = realloc(r, nl + 1);
+                if (!a)
+                        goto oom;
+
+                l = nl;
+                r = a;
+                t = r + d;
+
+                t = stpcpy(t, new_string);
+                f += old_len;
+        }
+
+        *t = 0;
+        return r;
+
+oom:
+        free(r);
+        return NULL;
+}
+
+char *strip_tab_ansi(char **ibuf, size_t *_isz) {
+        const char *i, *begin = NULL;
+        enum {
+                STATE_OTHER,
+                STATE_ESCAPE,
+                STATE_BRACKET
+        } state = STATE_OTHER;
+        char *obuf = NULL;
+        size_t osz = 0, isz;
+        FILE *f;
+
+        assert(ibuf);
+        assert(*ibuf);
+
+        /* Strips ANSI color and replaces TABs by 8 spaces */
+
+        isz = _isz ? *_isz : strlen(*ibuf);
+
+        f = open_memstream(&obuf, &osz);
+        if (!f)
+                return NULL;
+
+        for (i = *ibuf; i < *ibuf + isz + 1; i++) {
+
+                switch (state) {
+
+                case STATE_OTHER:
+                        if (i >= *ibuf + isz) /* EOT */
+                                break;
+                        else if (*i == '\x1B')
+                                state = STATE_ESCAPE;
+                        else if (*i == '\t')
+                                fputs("        ", f);
+                        else
+                                fputc(*i, f);
+                        break;
+
+                case STATE_ESCAPE:
+                        if (i >= *ibuf + isz) { /* EOT */
+                                fputc('\x1B', f);
+                                break;
+                        } else if (*i == '[') {
+                                state = STATE_BRACKET;
+                                begin = i + 1;
+                        } else {
+                                fputc('\x1B', f);
+                                fputc(*i, f);
+                                state = STATE_OTHER;
+                        }
+
+                        break;
+
+                case STATE_BRACKET:
+
+                        if (i >= *ibuf + isz || /* EOT */
+                            (!(*i >= '0' && *i <= '9') && *i != ';' && *i != 'm')) {
+                                fputc('\x1B', f);
+                                fputc('[', f);
+                                state = STATE_OTHER;
+                                i = begin-1;
+                        } else if (*i == 'm')
+                                state = STATE_OTHER;
+                        break;
+                }
+        }
+
+        if (ferror(f)) {
+                fclose(f);
+                free(obuf);
+                return NULL;
+        }
+
+        fclose(f);
+
+        free(*ibuf);
+        *ibuf = obuf;
+
+        if (_isz)
+                *_isz = osz;
+
+        return obuf;
+}
+
+char *strextend(char **x, ...) {
+        va_list ap;
+        size_t f, l;
+        char *r, *p;
+
+        assert(x);
+
+        l = f = *x ? strlen(*x) : 0;
+
+        va_start(ap, x);
+        for (;;) {
+                const char *t;
+                size_t n;
+
+                t = va_arg(ap, const char *);
+                if (!t)
+                        break;
+
+                n = strlen(t);
+                if (n > ((size_t) -1) - l) {
+                        va_end(ap);
+                        return NULL;
+                }
+
+                l += n;
+        }
+        va_end(ap);
+
+        r = realloc(*x, l+1);
+        if (!r)
+                return NULL;
+
+        p = r + f;
+
+        va_start(ap, x);
+        for (;;) {
+                const char *t;
+
+                t = va_arg(ap, const char *);
+                if (!t)
+                        break;
+
+                p = stpcpy(p, t);
+        }
+        va_end(ap);
+
+        *p = 0;
+        *x = r;
+
+        return r + l;
+}
+
+char *strrep(const char *s, unsigned n) {
+        size_t l;
+        char *r, *p;
+        unsigned i;
+
+        assert(s);
+
+        l = strlen(s);
+        p = r = malloc(l * n + 1);
+        if (!r)
+                return NULL;
+
+        for (i = 0; i < n; i++)
+                p = stpcpy(p, s);
+
+        *p = 0;
+        return r;
+}
+
+int split_pair(const char *s, const char *sep, char **l, char **r) {
+        char *x, *a, *b;
+
+        assert(s);
+        assert(sep);
+        assert(l);
+        assert(r);
+
+        if (isempty(sep))
+                return -EINVAL;
+
+        x = strstr(s, sep);
+        if (!x)
+                return -EINVAL;
+
+        a = strndup(s, x - s);
+        if (!a)
+                return -ENOMEM;
+
+        b = strdup(x + strlen(sep));
+        if (!b) {
+                free(a);
+                return -ENOMEM;
+        }
+
+        *l = a;
+        *r = b;
+
+        return 0;
+}
+
+int free_and_strdup(char **p, const char *s) {
+        char *t;
+
+        assert(p);
+
+        /* Replaces a string pointer with an strdup()ed new string,
+         * possibly freeing the old one. */
+
+        if (streq_ptr(*p, s))
+                return 0;
+
+        if (s) {
+                t = strdup(s);
+                if (!t)
+                        return -ENOMEM;
+        } else
+                t = NULL;
+
+        free(*p);
+        *p = t;
+
+        return 1;
+}
+
+void string_erase(char *x) {
+
+        if (!x)
+                return;
+
+        /* A delicious drop of snake-oil! To be called on memory where
+         * we stored passphrases or so, after we used them. */
+
+        memory_erase(x, strlen(x));
+}
+
+char *string_free_erase(char *s) {
+        if (!s)
+                return NULL;
+
+        string_erase(s);
+        return mfree(s);
+}
diff --git a/src/basic/string-util.h b/src/basic/string-util.h
new file mode 100644 (file)
index 0000000..7b7c0e5
--- /dev/null
@@ -0,0 +1,170 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+#pragma once
+
+/***
+  This file is part of systemd.
+
+  Copyright 2010 Lennart Poettering
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include <stdbool.h>
+#include <string.h>
+
+#include "macro.h"
+
+#define streq(a,b) (strcmp((a),(b)) == 0)
+#define strneq(a, b, n) (strncmp((a), (b), (n)) == 0)
+#define strcaseeq(a,b) (strcasecmp((a),(b)) == 0)
+#define strncaseeq(a, b, n) (strncasecmp((a), (b), (n)) == 0)
+
+int strcmp_ptr(const char *a, const char *b) _pure_;
+
+static inline bool streq_ptr(const char *a, const char *b) {
+        return strcmp_ptr(a, b) == 0;
+}
+
+static inline const char* strempty(const char *s) {
+        return s ? s : "";
+}
+
+static inline const char* strnull(const char *s) {
+        return s ? s : "(null)";
+}
+
+static inline const char *strna(const char *s) {
+        return s ? s : "n/a";
+}
+
+static inline bool isempty(const char *p) {
+        return !p || !p[0];
+}
+
+static inline char *startswith(const char *s, const char *prefix) {
+        size_t l;
+
+        l = strlen(prefix);
+        if (strncmp(s, prefix, l) == 0)
+                return (char*) s + l;
+
+        return NULL;
+}
+
+static inline char *startswith_no_case(const char *s, const char *prefix) {
+        size_t l;
+
+        l = strlen(prefix);
+        if (strncasecmp(s, prefix, l) == 0)
+                return (char*) s + l;
+
+        return NULL;
+}
+
+char *endswith(const char *s, const char *postfix) _pure_;
+char *endswith_no_case(const char *s, const char *postfix) _pure_;
+
+char *first_word(const char *s, const char *word) _pure_;
+
+const char* split(const char **state, size_t *l, const char *separator, bool quoted);
+
+#define FOREACH_WORD(word, length, s, state)                            \
+        _FOREACH_WORD(word, length, s, WHITESPACE, false, state)
+
+#define FOREACH_WORD_SEPARATOR(word, length, s, separator, state)       \
+        _FOREACH_WORD(word, length, s, separator, false, state)
+
+#define FOREACH_WORD_QUOTED(word, length, s, state)                     \
+        _FOREACH_WORD(word, length, s, WHITESPACE, true, state)
+
+#define _FOREACH_WORD(word, length, s, separator, quoted, state)        \
+        for ((state) = (s), (word) = split(&(state), &(length), (separator), (quoted)); (word); (word) = split(&(state), &(length), (separator), (quoted)))
+
+char *strappend(const char *s, const char *suffix);
+char *strnappend(const char *s, const char *suffix, size_t length);
+
+char *strjoin(const char *x, ...) _sentinel_;
+
+#define strjoina(a, ...)                                                \
+        ({                                                              \
+                const char *_appendees_[] = { a, __VA_ARGS__ };         \
+                char *_d_, *_p_;                                        \
+                int _len_ = 0;                                          \
+                unsigned _i_;                                           \
+                for (_i_ = 0; _i_ < ELEMENTSOF(_appendees_) && _appendees_[_i_]; _i_++) \
+                        _len_ += strlen(_appendees_[_i_]);              \
+                _p_ = _d_ = alloca(_len_ + 1);                          \
+                for (_i_ = 0; _i_ < ELEMENTSOF(_appendees_) && _appendees_[_i_]; _i_++) \
+                        _p_ = stpcpy(_p_, _appendees_[_i_]);            \
+                *_p_ = 0;                                               \
+                _d_;                                                    \
+        })
+
+char *strstrip(char *s);
+char *delete_chars(char *s, const char *bad);
+char *truncate_nl(char *s);
+
+char *ascii_strlower(char *path);
+
+bool chars_intersect(const char *a, const char *b) _pure_;
+
+static inline bool _pure_ in_charset(const char *s, const char* charset) {
+        assert(s);
+        assert(charset);
+        return s[strspn(s, charset)] == '\0';
+}
+
+bool string_has_cc(const char *p, const char *ok) _pure_;
+
+char *ellipsize_mem(const char *s, size_t old_length_bytes, size_t new_length_columns, unsigned percent);
+char *ellipsize(const char *s, size_t length, unsigned percent);
+
+bool nulstr_contains(const char*nulstr, const char *needle);
+
+char* strshorten(char *s, size_t l);
+
+char *strreplace(const char *text, const char *old_string, const char *new_string);
+
+char *strip_tab_ansi(char **p, size_t *l);
+
+char *strextend(char **x, ...) _sentinel_;
+
+char *strrep(const char *s, unsigned n);
+
+int split_pair(const char *s, const char *sep, char **l, char **r);
+
+int free_and_strdup(char **p, const char *s);
+
+/* Normal memmem() requires haystack to be nonnull, which is annoying for zero-length buffers */
+static inline void *memmem_safe(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen) {
+
+        if (needlelen <= 0)
+                return (void*) haystack;
+
+        if (haystacklen < needlelen)
+                return NULL;
+
+        assert(haystack);
+        assert(needle);
+
+        return memmem(haystack, haystacklen, needle, needlelen);
+}
+
+#define memory_erase(p, l) memset((p), 'x', (l))
+void string_erase(char *x);
+
+char *string_free_erase(char *s);
+DEFINE_TRIVIAL_CLEANUP_FUNC(char *, string_free_erase);
+#define _cleanup_string_free_erase_ _cleanup_(string_free_erasep)
index 446d4a563159e6354a129dd811df6cb68f9110b8..f5df269006a2f7be4ee1e6a396dc17857a3869b6 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
+#include <errno.h>
 #include <stdarg.h>
+#include <stdlib.h>
 #include <string.h>
-#include <errno.h>
 
 #include "escape.h"
+#include "string-util.h"
 #include "util.h"
 #include "strv.h"
 
index ca7554a9fad7d2acb0954ca5eba5e114079454ab..47236535666400c01dda1bc6ee1b33639d3d9346 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <assert.h>
+#include <fcntl.h>
+#include <linux/kd.h>
+#include <linux/tiocl.h>
+#include <linux/vt.h>
+#include <poll.h>
+#include <signal.h>
 #include <sys/ioctl.h>
-#include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/types.h>
 #include <termios.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <signal.h>
 #include <time.h>
-#include <assert.h>
-#include <poll.h>
-#include <linux/vt.h>
-#include <linux/tiocl.h>
-#include <linux/kd.h>
+#include <unistd.h>
 
-#include "terminal-util.h"
-#include "time-util.h"
-#include "process-util.h"
-#include "util.h"
 #include "fileio.h"
 #include "path-util.h"
+#include "process-util.h"
+#include "string-util.h"
+#include "time-util.h"
+#include "util.h"
+#include "terminal-util.h"
 
 static volatile unsigned cached_columns = 0;
 static volatile unsigned cached_lines = 0;
index d4e0914b27a9030ed8184fc19a71e26df6317d49..a516d2807b9333dfc3c3e5c8d8f1b1da4e357e01 100644 (file)
 ***/
 
 #include <string.h>
-#include <sys/timex.h>
 #include <sys/timerfd.h>
+#include <sys/timex.h>
 
-#include "util.h"
-#include "time-util.h"
 #include "path-util.h"
+#include "string-util.h"
 #include "strv.h"
+#include "util.h"
+#include "time-util.h"
 
 usec_t now(clockid_t clock_id) {
         struct timespec ts;
index a8b6b6dacea00040a529b3eb1f4d9ac61fcc3f18..383c4ab871afcef0c7d4e373cd11b61ea5aa01eb 100644 (file)
 #include <errno.h>
 #include <string.h>
 
-#include "path-util.h"
 #include "bus-label.h"
-#include "util.h"
-#include "unit-name.h"
 #include "def.h"
+#include "path-util.h"
+#include "string-util.h"
 #include "strv.h"
+#include "util.h"
+#include "unit-name.h"
 
 #define VALID_CHARS                             \
         DIGITS LETTERS                          \
index d6488f8fd6584829c3ccf9d82c99099f348ba207..233a6c2e351da066a6eb5ba179f6d0a2cbf7cb17 100644 (file)
@@ -94,6 +94,7 @@
 #include "random-util.h"
 #include "signal-util.h"
 #include "sparse-endian.h"
+#include "string-util.h"
 #include "strv.h"
 #include "terminal-util.h"
 #include "utf8.h"
@@ -120,101 +121,6 @@ size_t page_size(void) {
         return pgsz;
 }
 
-int strcmp_ptr(const char *a, const char *b) {
-
-        /* Like strcmp(), but tries to make sense of NULL pointers */
-        if (a && b)
-                return strcmp(a, b);
-
-        if (!a && b)
-                return -1;
-
-        if (a && !b)
-                return 1;
-
-        return 0;
-}
-
-bool streq_ptr(const char *a, const char *b) {
-        return strcmp_ptr(a, b) == 0;
-}
-
-char* endswith(const char *s, const char *postfix) {
-        size_t sl, pl;
-
-        assert(s);
-        assert(postfix);
-
-        sl = strlen(s);
-        pl = strlen(postfix);
-
-        if (pl == 0)
-                return (char*) s + sl;
-
-        if (sl < pl)
-                return NULL;
-
-        if (memcmp(s + sl - pl, postfix, pl) != 0)
-                return NULL;
-
-        return (char*) s + sl - pl;
-}
-
-char* endswith_no_case(const char *s, const char *postfix) {
-        size_t sl, pl;
-
-        assert(s);
-        assert(postfix);
-
-        sl = strlen(s);
-        pl = strlen(postfix);
-
-        if (pl == 0)
-                return (char*) s + sl;
-
-        if (sl < pl)
-                return NULL;
-
-        if (strcasecmp(s + sl - pl, postfix) != 0)
-                return NULL;
-
-        return (char*) s + sl - pl;
-}
-
-char* first_word(const char *s, const char *word) {
-        size_t sl, wl;
-        const char *p;
-
-        assert(s);
-        assert(word);
-
-        /* Checks if the string starts with the specified word, either
-         * followed by NUL or by whitespace. Returns a pointer to the
-         * NUL or the first character after the whitespace. */
-
-        sl = strlen(s);
-        wl = strlen(word);
-
-        if (sl < wl)
-                return NULL;
-
-        if (wl == 0)
-                return (char*) s;
-
-        if (memcmp(s, word, wl) != 0)
-                return NULL;
-
-        p = s + wl;
-        if (*p == 0)
-                return (char*) p;
-
-        if (!strchr(WHITESPACE, *p))
-                return NULL;
-
-        p += strspn(p, WHITESPACE);
-        return (char*) p;
-}
-
 int close_nointr(int fd) {
         assert(fd >= 0);
 
@@ -553,66 +459,6 @@ int safe_atod(const char *s, double *ret_d) {
         return 0;
 }
 
-static size_t strcspn_escaped(const char *s, const char *reject) {
-        bool escaped = false;
-        int n;
-
-        for (n=0; s[n]; n++) {
-                if (escaped)
-                        escaped = false;
-                else if (s[n] == '\\')
-                        escaped = true;
-                else if (strchr(reject, s[n]))
-                        break;
-        }
-
-        /* if s ends in \, return index of previous char */
-        return n - escaped;
-}
-
-/* Split a string into words. */
-const char* split(const char **state, size_t *l, const char *separator, bool quoted) {
-        const char *current;
-
-        current = *state;
-
-        if (!*current) {
-                assert(**state == '\0');
-                return NULL;
-        }
-
-        current += strspn(current, separator);
-        if (!*current) {
-                *state = current;
-                return NULL;
-        }
-
-        if (quoted && strchr("\'\"", *current)) {
-                char quotechars[2] = {*current, '\0'};
-
-                *l = strcspn_escaped(current + 1, quotechars);
-                if (current[*l + 1] == '\0' || current[*l + 1] != quotechars[0] ||
-                    (current[*l + 2] && !strchr(separator, current[*l + 2]))) {
-                        /* right quote missing or garbage at the end */
-                        *state = current;
-                        return NULL;
-                }
-                *state = current++ + *l + 2;
-        } else if (quoted) {
-                *l = strcspn_escaped(current, separator);
-                if (current[*l] && !strchr(separator, current[*l])) {
-                        /* unfinished escape */
-                        *state = current;
-                        return NULL;
-                }
-                *state = current + *l;
-        } else {
-                *l = strcspn(current, separator);
-                *state = current + *l;
-        }
-
-        return current;
-}
 
 int fchmod_umask(int fd, mode_t m) {
         mode_t u;
@@ -625,48 +471,6 @@ int fchmod_umask(int fd, mode_t m) {
         return r;
 }
 
-char *truncate_nl(char *s) {
-        assert(s);
-
-        s[strcspn(s, NEWLINE)] = 0;
-        return s;
-}
-
-char *strnappend(const char *s, const char *suffix, size_t b) {
-        size_t a;
-        char *r;
-
-        if (!s && !suffix)
-                return strdup("");
-
-        if (!s)
-                return strndup(suffix, b);
-
-        if (!suffix)
-                return strdup(s);
-
-        assert(s);
-        assert(suffix);
-
-        a = strlen(s);
-        if (b > ((size_t) -1) - a)
-                return NULL;
-
-        r = new(char, a+b+1);
-        if (!r)
-                return NULL;
-
-        memcpy(r, s, a);
-        memcpy(r+a, suffix, b);
-        r[a+b] = 0;
-
-        return r;
-}
-
-char *strappend(const char *s, const char *suffix) {
-        return strnappend(s, suffix, suffix ? strlen(suffix) : 0);
-}
-
 int readlinkat_malloc(int fd, const char *p, char **ret) {
         size_t l = 100;
         int r;
@@ -769,40 +573,6 @@ int readlink_and_canonicalize(const char *p, char **r) {
         return 0;
 }
 
-char *strstrip(char *s) {
-        char *e;
-
-        /* Drops trailing whitespace. Modifies the string in
-         * place. Returns pointer to first non-space character */
-
-        s += strspn(s, WHITESPACE);
-
-        for (e = strchr(s, 0); e > s; e --)
-                if (!strchr(WHITESPACE, e[-1]))
-                        break;
-
-        *e = 0;
-
-        return s;
-}
-
-char *delete_chars(char *s, const char *bad) {
-        char *f, *t;
-
-        /* Drops all whitespace, regardless where in the string */
-
-        for (f = s, t = s; *f; f++) {
-                if (strchr(bad, *f))
-                        continue;
-
-                *(t++) = *f;
-        }
-
-        *t = 0;
-
-        return s;
-}
-
 char *file_in_same_dir(const char *path, const char *filename) {
         char *e, *ret;
         size_t k;
@@ -1504,18 +1274,6 @@ int undecchar(char c) {
         return -EINVAL;
 }
 
-char *ascii_strlower(char *t) {
-        char *p;
-
-        assert(t);
-
-        for (p = t; *p; p++)
-                if (*p >= 'A' && *p <= 'Z')
-                        *p = *p - 'A' + 'a';
-
-        return t;
-}
-
 _pure_ static bool hidden_file_allow_backup(const char *filename) {
         assert(filename);
 
@@ -1663,17 +1421,6 @@ int close_all_fds(const int except[], unsigned n_except) {
         return r;
 }
 
-bool chars_intersect(const char *a, const char *b) {
-        const char *p;
-
-        /* Returns true if any of the chars in a are in b. */
-        for (p = a; *p; p++)
-                if (strchr(b, *p))
-                        return true;
-
-        return false;
-}
-
 bool fstype_is_network(const char *fstype) {
         static const char table[] =
                 "afs\0"
@@ -2196,115 +1943,6 @@ int running_in_chroot(void) {
         return ret == 0;
 }
 
-static char *ascii_ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigned percent) {
-        size_t x;
-        char *r;
-
-        assert(s);
-        assert(percent <= 100);
-        assert(new_length >= 3);
-
-        if (old_length <= 3 || old_length <= new_length)
-                return strndup(s, old_length);
-
-        r = new0(char, new_length+1);
-        if (!r)
-                return NULL;
-
-        x = (new_length * percent) / 100;
-
-        if (x > new_length - 3)
-                x = new_length - 3;
-
-        memcpy(r, s, x);
-        r[x] = '.';
-        r[x+1] = '.';
-        r[x+2] = '.';
-        memcpy(r + x + 3,
-               s + old_length - (new_length - x - 3),
-               new_length - x - 3);
-
-        return r;
-}
-
-char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigned percent) {
-        size_t x;
-        char *e;
-        const char *i, *j;
-        unsigned k, len, len2;
-
-        assert(s);
-        assert(percent <= 100);
-        assert(new_length >= 3);
-
-        /* if no multibyte characters use ascii_ellipsize_mem for speed */
-        if (ascii_is_valid(s))
-                return ascii_ellipsize_mem(s, old_length, new_length, percent);
-
-        if (old_length <= 3 || old_length <= new_length)
-                return strndup(s, old_length);
-
-        x = (new_length * percent) / 100;
-
-        if (x > new_length - 3)
-                x = new_length - 3;
-
-        k = 0;
-        for (i = s; k < x && i < s + old_length; i = utf8_next_char(i)) {
-                int c;
-
-                c = utf8_encoded_to_unichar(i);
-                if (c < 0)
-                        return NULL;
-                k += unichar_iswide(c) ? 2 : 1;
-        }
-
-        if (k > x) /* last character was wide and went over quota */
-                x ++;
-
-        for (j = s + old_length; k < new_length && j > i; ) {
-                int c;
-
-                j = utf8_prev_char(j);
-                c = utf8_encoded_to_unichar(j);
-                if (c < 0)
-                        return NULL;
-                k += unichar_iswide(c) ? 2 : 1;
-        }
-        assert(i <= j);
-
-        /* we don't actually need to ellipsize */
-        if (i == j)
-                return memdup(s, old_length + 1);
-
-        /* make space for ellipsis */
-        j = utf8_next_char(j);
-
-        len = i - s;
-        len2 = s + old_length - j;
-        e = new(char, len + 3 + len2 + 1);
-        if (!e)
-                return NULL;
-
-        /*
-        printf("old_length=%zu new_length=%zu x=%zu len=%u len2=%u k=%u\n",
-               old_length, new_length, x, len, len2, k);
-        */
-
-        memcpy(e, s, len);
-        e[len]   = 0xe2; /* tri-dot ellipsis: â€¦ */
-        e[len + 1] = 0x80;
-        e[len + 2] = 0xa6;
-
-        memcpy(e + len + 3, j, len2 + 1);
-
-        return e;
-}
-
-char *ellipsize(const char *s, size_t length, unsigned percent) {
-        return ellipsize_mem(s, strlen(s), length, percent);
-}
-
 int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode) {
         _cleanup_close_ int fd;
         int r;
@@ -2637,32 +2275,10 @@ void execute_directories(const char* const* directories, usec_t timeout, char *a
         wait_for_terminate_and_warn(name, executor_pid, true);
 }
 
-bool nulstr_contains(const char*nulstr, const char *needle) {
-        const char *i;
-
-        if (!nulstr)
-                return false;
-
-        NULSTR_FOREACH(i, nulstr)
-                if (streq(i, needle))
-                        return true;
-
-        return false;
-}
-
 bool plymouth_running(void) {
         return access("/run/plymouth/pid", F_OK) >= 0;
 }
 
-char* strshorten(char *s, size_t l) {
-        assert(s);
-
-        if (l < strlen(s))
-                s[l] = 0;
-
-        return s;
-}
-
 int pipe_eof(int fd) {
         struct pollfd pollfd = {
                 .fd = fd,
@@ -3150,63 +2766,6 @@ int get_files_in_directory(const char *path, char ***list) {
         return n;
 }
 
-char *strjoin(const char *x, ...) {
-        va_list ap;
-        size_t l;
-        char *r, *p;
-
-        va_start(ap, x);
-
-        if (x) {
-                l = strlen(x);
-
-                for (;;) {
-                        const char *t;
-                        size_t n;
-
-                        t = va_arg(ap, const char *);
-                        if (!t)
-                                break;
-
-                        n = strlen(t);
-                        if (n > ((size_t) -1) - l) {
-                                va_end(ap);
-                                return NULL;
-                        }
-
-                        l += n;
-                }
-        } else
-                l = 0;
-
-        va_end(ap);
-
-        r = new(char, l+1);
-        if (!r)
-                return NULL;
-
-        if (x) {
-                p = stpcpy(r, x);
-
-                va_start(ap, x);
-
-                for (;;) {
-                        const char *t;
-
-                        t = va_arg(ap, const char *);
-                        if (!t)
-                                break;
-
-                        p = stpcpy(p, t);
-                }
-
-                va_end(ap);
-        } else
-                r[0] = 0;
-
-        return r;
-}
-
 bool is_main_thread(void) {
         static thread_local int cached = 0;
 
@@ -3832,29 +3391,6 @@ bool string_is_safe(const char *p) {
         return true;
 }
 
-/**
- * Check if a string contains control characters. If 'ok' is non-NULL
- * it may be a string containing additional CCs to be considered OK.
- */
-bool string_has_cc(const char *p, const char *ok) {
-        const char *t;
-
-        assert(p);
-
-        for (t = p; *t; t++) {
-                if (ok && strchr(ok, *t))
-                        continue;
-
-                if (*t > 0 && *t < ' ')
-                        return true;
-
-                if (*t == 127)
-                        return true;
-        }
-
-        return false;
-}
-
 bool path_is_safe(const char *p) {
 
         if (isempty(p))
@@ -3976,139 +3512,6 @@ const char *draw_special_char(DrawSpecialChar ch) {
         return draw_table[!is_locale_utf8()][ch];
 }
 
-char *strreplace(const char *text, const char *old_string, const char *new_string) {
-        const char *f;
-        char *t, *r;
-        size_t l, old_len, new_len;
-
-        assert(text);
-        assert(old_string);
-        assert(new_string);
-
-        old_len = strlen(old_string);
-        new_len = strlen(new_string);
-
-        l = strlen(text);
-        r = new(char, l+1);
-        if (!r)
-                return NULL;
-
-        f = text;
-        t = r;
-        while (*f) {
-                char *a;
-                size_t d, nl;
-
-                if (!startswith(f, old_string)) {
-                        *(t++) = *(f++);
-                        continue;
-                }
-
-                d = t - r;
-                nl = l - old_len + new_len;
-                a = realloc(r, nl + 1);
-                if (!a)
-                        goto oom;
-
-                l = nl;
-                r = a;
-                t = r + d;
-
-                t = stpcpy(t, new_string);
-                f += old_len;
-        }
-
-        *t = 0;
-        return r;
-
-oom:
-        free(r);
-        return NULL;
-}
-
-char *strip_tab_ansi(char **ibuf, size_t *_isz) {
-        const char *i, *begin = NULL;
-        enum {
-                STATE_OTHER,
-                STATE_ESCAPE,
-                STATE_BRACKET
-        } state = STATE_OTHER;
-        char *obuf = NULL;
-        size_t osz = 0, isz;
-        FILE *f;
-
-        assert(ibuf);
-        assert(*ibuf);
-
-        /* Strips ANSI color and replaces TABs by 8 spaces */
-
-        isz = _isz ? *_isz : strlen(*ibuf);
-
-        f = open_memstream(&obuf, &osz);
-        if (!f)
-                return NULL;
-
-        for (i = *ibuf; i < *ibuf + isz + 1; i++) {
-
-                switch (state) {
-
-                case STATE_OTHER:
-                        if (i >= *ibuf + isz) /* EOT */
-                                break;
-                        else if (*i == '\x1B')
-                                state = STATE_ESCAPE;
-                        else if (*i == '\t')
-                                fputs("        ", f);
-                        else
-                                fputc(*i, f);
-                        break;
-
-                case STATE_ESCAPE:
-                        if (i >= *ibuf + isz) { /* EOT */
-                                fputc('\x1B', f);
-                                break;
-                        } else if (*i == '[') {
-                                state = STATE_BRACKET;
-                                begin = i + 1;
-                        } else {
-                                fputc('\x1B', f);
-                                fputc(*i, f);
-                                state = STATE_OTHER;
-                        }
-
-                        break;
-
-                case STATE_BRACKET:
-
-                        if (i >= *ibuf + isz || /* EOT */
-                            (!(*i >= '0' && *i <= '9') && *i != ';' && *i != 'm')) {
-                                fputc('\x1B', f);
-                                fputc('[', f);
-                                state = STATE_OTHER;
-                                i = begin-1;
-                        } else if (*i == 'm')
-                                state = STATE_OTHER;
-                        break;
-                }
-        }
-
-        if (ferror(f)) {
-                fclose(f);
-                free(obuf);
-                return NULL;
-        }
-
-        fclose(f);
-
-        free(*ibuf);
-        *ibuf = obuf;
-
-        if (_isz)
-                *_isz = osz;
-
-        return obuf;
-}
-
 int on_ac_power(void) {
         bool found_offline = false, found_online = false;
         _cleanup_closedir_ DIR *d = NULL;
@@ -4267,77 +3670,6 @@ int search_and_fopen_nulstr(const char *path, const char *mode, const char *root
         return search_and_fopen_internal(path, mode, root, s, _f);
 }
 
-char *strextend(char **x, ...) {
-        va_list ap;
-        size_t f, l;
-        char *r, *p;
-
-        assert(x);
-
-        l = f = *x ? strlen(*x) : 0;
-
-        va_start(ap, x);
-        for (;;) {
-                const char *t;
-                size_t n;
-
-                t = va_arg(ap, const char *);
-                if (!t)
-                        break;
-
-                n = strlen(t);
-                if (n > ((size_t) -1) - l) {
-                        va_end(ap);
-                        return NULL;
-                }
-
-                l += n;
-        }
-        va_end(ap);
-
-        r = realloc(*x, l+1);
-        if (!r)
-                return NULL;
-
-        p = r + f;
-
-        va_start(ap, x);
-        for (;;) {
-                const char *t;
-
-                t = va_arg(ap, const char *);
-                if (!t)
-                        break;
-
-                p = stpcpy(p, t);
-        }
-        va_end(ap);
-
-        *p = 0;
-        *x = r;
-
-        return r + l;
-}
-
-char *strrep(const char *s, unsigned n) {
-        size_t l;
-        char *r, *p;
-        unsigned i;
-
-        assert(s);
-
-        l = strlen(s);
-        p = r = malloc(l * n + 1);
-        if (!r)
-                return NULL;
-
-        for (i = 0; i < n; i++)
-                p = stpcpy(p, s);
-
-        *p = 0;
-        return r;
-}
-
 void* greedy_realloc(void **p, size_t *allocated, size_t need, size_t size) {
         size_t a, newalloc;
         void *q;
@@ -4424,37 +3756,6 @@ bool id128_is_valid(const char *s) {
         return true;
 }
 
-int split_pair(const char *s, const char *sep, char **l, char **r) {
-        char *x, *a, *b;
-
-        assert(s);
-        assert(sep);
-        assert(l);
-        assert(r);
-
-        if (isempty(sep))
-                return -EINVAL;
-
-        x = strstr(s, sep);
-        if (!x)
-                return -EINVAL;
-
-        a = strndup(s, x - s);
-        if (!a)
-                return -ENOMEM;
-
-        b = strdup(x + strlen(sep));
-        if (!b) {
-                free(a);
-                return -ENOMEM;
-        }
-
-        *l = a;
-        *r = b;
-
-        return 0;
-}
-
 int shall_restore_state(void) {
         _cleanup_free_ char *value = NULL;
         int r;
@@ -5407,30 +4708,6 @@ int is_device_node(const char *path) {
         return !!(S_ISBLK(info.st_mode) || S_ISCHR(info.st_mode));
 }
 
-int free_and_strdup(char **p, const char *s) {
-        char *t;
-
-        assert(p);
-
-        /* Replaces a string pointer with an strdup()ed new string,
-         * possibly freeing the old one. */
-
-        if (streq_ptr(*p, s))
-                return 0;
-
-        if (s) {
-                t = strdup(s);
-                if (!t)
-                        return -ENOMEM;
-        } else
-                t = NULL;
-
-        free(*p);
-        *p = t;
-
-        return 1;
-}
-
 ssize_t fgetxattrat_fake(int dirfd, const char *filename, const char *attribute, void *value, size_t size, int flags) {
         char fn[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int) + 1];
         _cleanup_close_ int fd = -1;
@@ -6080,22 +5357,3 @@ bool fdname_is_valid(const char *s) {
 bool oom_score_adjust_is_valid(int oa) {
         return oa >= OOM_SCORE_ADJ_MIN && oa <= OOM_SCORE_ADJ_MAX;
 }
-
-void string_erase(char *x) {
-
-        if (!x)
-                return;
-
-        /* A delicious drop of snake-oil! To be called on memory where
-         * we stored passphrases or so, after we used them. */
-
-        memory_erase(x, strlen(x));
-}
-
-char *string_free_erase(char *s) {
-        if (!s)
-                return NULL;
-
-        string_erase(s);
-        return mfree(s);
-}
index 6674111145b07722d46ad80b2353a892ce8adba1..7d1e4e0f629c6abfdc08694dbecb69d0a6fa93df 100644 (file)
 size_t page_size(void) _pure_;
 #define PAGE_ALIGN(l) ALIGN_TO((l), page_size())
 
-#define streq(a,b) (strcmp((a),(b)) == 0)
-#define strneq(a, b, n) (strncmp((a), (b), (n)) == 0)
-#define strcaseeq(a,b) (strcasecmp((a),(b)) == 0)
-#define strncaseeq(a, b, n) (strncasecmp((a), (b), (n)) == 0)
-
-bool streq_ptr(const char *a, const char *b) _pure_;
-int strcmp_ptr(const char *a, const char *b) _pure_;
-
 #define new(t, n) ((t*) malloc_multiply(sizeof(t), (n)))
 
 #define new0(t, n) ((t*) calloc((n), sizeof(t)))
@@ -95,47 +87,6 @@ static inline const char* one_zero(bool b) {
         return b ? "1" : "0";
 }
 
-static inline const char* strempty(const char *s) {
-        return s ? s : "";
-}
-
-static inline const char* strnull(const char *s) {
-        return s ? s : "(null)";
-}
-
-static inline const char *strna(const char *s) {
-        return s ? s : "n/a";
-}
-
-static inline bool isempty(const char *p) {
-        return !p || !p[0];
-}
-
-static inline char *startswith(const char *s, const char *prefix) {
-        size_t l;
-
-        l = strlen(prefix);
-        if (strncmp(s, prefix, l) == 0)
-                return (char*) s + l;
-
-        return NULL;
-}
-
-static inline char *startswith_no_case(const char *s, const char *prefix) {
-        size_t l;
-
-        l = strlen(prefix);
-        if (strncasecmp(s, prefix, l) == 0)
-                return (char*) s + l;
-
-        return NULL;
-}
-
-char *endswith(const char *s, const char *postfix) _pure_;
-char *endswith_no_case(const char *s, const char *postfix) _pure_;
-
-char *first_word(const char *s, const char *word) _pure_;
-
 int close_nointr(int fd);
 int safe_close(int fd);
 void safe_close_pair(int p[]);
@@ -212,33 +163,12 @@ static inline int safe_atoi64(const char *s, int64_t *ret_i) {
 int safe_atou16(const char *s, uint16_t *ret);
 int safe_atoi16(const char *s, int16_t *ret);
 
-const char* split(const char **state, size_t *l, const char *separator, bool quoted);
-
-#define FOREACH_WORD(word, length, s, state)                            \
-        _FOREACH_WORD(word, length, s, WHITESPACE, false, state)
-
-#define FOREACH_WORD_SEPARATOR(word, length, s, separator, state)       \
-        _FOREACH_WORD(word, length, s, separator, false, state)
-
-#define FOREACH_WORD_QUOTED(word, length, s, state)                     \
-        _FOREACH_WORD(word, length, s, WHITESPACE, true, state)
-
-#define _FOREACH_WORD(word, length, s, separator, quoted, state)        \
-        for ((state) = (s), (word) = split(&(state), &(length), (separator), (quoted)); (word); (word) = split(&(state), &(length), (separator), (quoted)))
-
-char *strappend(const char *s, const char *suffix);
-char *strnappend(const char *s, const char *suffix, size_t length);
-
 int readlinkat_malloc(int fd, const char *p, char **ret);
 int readlink_malloc(const char *p, char **r);
 int readlink_value(const char *p, char **ret);
 int readlink_and_make_absolute(const char *p, char **r);
 int readlink_and_canonicalize(const char *p, char **r);
 
-char *strstrip(char *s);
-char *delete_chars(char *s, const char *bad);
-char *truncate_nl(char *s);
-
 char *file_in_same_dir(const char *path, const char *filename);
 
 int rmdir_parents(const char *path, const char *stop);
@@ -254,15 +184,11 @@ int unbase32hexchar(char c) _const_;
 char base64char(int x) _const_;
 int unbase64char(char c) _const_;
 
-char *ascii_strlower(char *path);
-
 bool dirent_is_file(const struct dirent *de) _pure_;
 bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix) _pure_;
 
 bool hidden_file(const char *filename) _pure_;
 
-bool chars_intersect(const char *a, const char *b) _pure_;
-
 /* For basic lookup tables with strictly enumerated entries */
 #define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope)          \
         scope const char *name##_to_string(type i) {                    \
@@ -373,10 +299,6 @@ int files_same(const char *filea, const char *fileb);
 
 int running_in_chroot(void);
 
-char *ellipsize(const char *s, size_t length, unsigned percent);
-                                   /* bytes                 columns */
-char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigned percent);
-
 int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode);
 int touch(const char *path);
 
@@ -392,12 +314,8 @@ char *fstab_node_to_udev_node(const char *p);
 
 void execute_directories(const char* const* directories, usec_t timeout, char *argv[]);
 
-bool nulstr_contains(const char*nulstr, const char *needle);
-
 bool plymouth_running(void);
 
-char* strshorten(char *s, size_t l);
-
 int symlink_idempotent(const char *from, const char *to);
 
 int symlink_atomic(const char *from, const char *to);
@@ -425,16 +343,8 @@ int dirent_ensure_type(DIR *d, struct dirent *de);
 
 int get_files_in_directory(const char *path, char ***list);
 
-char *strjoin(const char *x, ...) _sentinel_;
-
 bool is_main_thread(void);
 
-static inline bool _pure_ in_charset(const char *s, const char* charset) {
-        assert(s);
-        assert(charset);
-        return s[strspn(s, charset)] == '\0';
-}
-
 int block_get_whole_disk(dev_t d, dev_t *ret);
 
 #define NULSTR_FOREACH(i, l)                                    \
@@ -554,7 +464,6 @@ _alloc_(2, 3) static inline void *memdup_multiply(const void *p, size_t a, size_
 bool filename_is_valid(const char *p) _pure_;
 bool path_is_safe(const char *p) _pure_;
 bool string_is_safe(const char *p) _pure_;
-bool string_has_cc(const char *p, const char *ok) _pure_;
 
 /**
  * Check if a string contains any glob patterns.
@@ -586,10 +495,6 @@ typedef enum DrawSpecialChar {
 
 const char *draw_special_char(DrawSpecialChar ch);
 
-char *strreplace(const char *text, const char *old_string, const char *new_string);
-
-char *strip_tab_ansi(char **p, size_t *l);
-
 int on_ac_power(void);
 
 int search_and_fopen(const char *path, const char *mode, const char *root, const char **search, FILE **_f);
@@ -638,9 +543,6 @@ int unbase32hexmem(const char *p, size_t l, bool padding, void **mem, size_t *le
 char *base64mem(const void *p, size_t l);
 int unbase64mem(const char *p, size_t l, void **mem, size_t *len);
 
-char *strextend(char **x, ...) _sentinel_;
-char *strrep(const char *s, unsigned n);
-
 void* greedy_realloc(void **p, size_t *allocated, size_t need, size_t size);
 void* greedy_realloc0(void **p, size_t *allocated, size_t need, size_t size);
 #define GREEDY_REALLOC(array, allocated, need)                          \
@@ -755,25 +657,8 @@ int unlink_noerrno(const char *path);
                 (void*)memset(_new_, 0, _size_);                        \
         })
 
-#define strjoina(a, ...)                                                \
-        ({                                                              \
-                const char *_appendees_[] = { a, __VA_ARGS__ };         \
-                char *_d_, *_p_;                                        \
-                int _len_ = 0;                                          \
-                unsigned _i_;                                           \
-                for (_i_ = 0; _i_ < ELEMENTSOF(_appendees_) && _appendees_[_i_]; _i_++) \
-                        _len_ += strlen(_appendees_[_i_]);              \
-                _p_ = _d_ = alloca(_len_ + 1);                          \
-                for (_i_ = 0; _i_ < ELEMENTSOF(_appendees_) && _appendees_[_i_]; _i_++) \
-                        _p_ = stpcpy(_p_, _appendees_[_i_]);            \
-                *_p_ = 0;                                               \
-                _d_;                                                    \
-        })
-
 bool id128_is_valid(const char *s) _pure_;
 
-int split_pair(const char *s, const char *sep, char **l, char **r);
-
 int shall_restore_state(void);
 
 /**
@@ -788,21 +673,6 @@ static inline void qsort_safe(void *base, size_t nmemb, size_t size, comparison_
         qsort(base, nmemb, size, compar);
 }
 
-/* Normal memmem() requires haystack to be nonnull, which is annoying for zero-length buffers */
-static inline void *memmem_safe(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen) {
-
-        if (needlelen <= 0)
-                return (void*) haystack;
-
-        if (haystacklen < needlelen)
-                return NULL;
-
-        assert(haystack);
-        assert(needle);
-
-        return memmem(haystack, haystacklen, needle, needlelen);
-}
-
 int proc_cmdline(char **ret);
 int parse_proc_cmdline(int (*parse_word)(const char *key, const char *value));
 int get_proc_cmdline_key(const char *parameter, char **value);
@@ -860,8 +730,6 @@ int is_symlink(const char *path);
 int is_dir(const char *path, bool follow);
 int is_device_node(const char *path);
 
-int free_and_strdup(char **p, const char *s);
-
 #define INOTIFY_EVENT_MAX (sizeof(struct inotify_event) + NAME_MAX + 1)
 
 #define FOREACH_INOTIFY_EVENT(e, buffer, sz) \
@@ -923,10 +791,3 @@ int version(void);
 bool fdname_is_valid(const char *s);
 
 bool oom_score_adjust_is_valid(int oa);
-
-#define memory_erase(p, l) memset((p), 'x', (l))
-void string_erase(char *x);
-
-char *string_free_erase(char *s);
-DEFINE_TRIVIAL_CLEANUP_FUNC(char *, string_free_erase);
-#define _cleanup_string_free_erase_ _cleanup_(string_free_erasep)
index c7beccc2dc291c762307a3f7ccb87200c0fdf9eb..d63062d39e3bc88c9eaf5c343cb216e5cd844604 100644 (file)
@@ -19,6 +19,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include "string-util.h"
 #include "util.h"
 #include "verbs.h"
 
index 70543177b6fe1f9910635c2df312a879497676cd..9267a2730b21da96a63c770adadd4a7d2b172b25 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <string.h>
 #include <errno.h>
+#include <string.h>
 #include <unistd.h>
 
-#include "util.h"
+#include "fileio.h"
 #include "process-util.h"
+#include "string-util.h"
+#include "util.h"
 #include "virt.h"
-#include "fileio.h"
 
 static int detect_vm_cpuid(void) {
 
index 15c629b1884ca172ac16e719ba3bd9eec5aba8a0..8126bce212622caffea5d5cc75c5e540b5aa0989 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <string.h>
 
+#include "string-util.h"
 #include "util.h"
 #include "xml.h"
 
index ddb5c88806024556c79f6f1825507a93dfbcd02a..ca3f26a66f3beb607dfc50afb854217e83e9bf4a 100644 (file)
@@ -30,6 +30,7 @@
 #include "conf-files.h"
 #include "fileio.h"
 #include "log.h"
+#include "string-util.h"
 #include "strv.h"
 #include "util.h"
 
index f991e30cfa24f159235aa5f3d2cda58971ad3eb4..101689076824707654f762a24fa1232fb4a6ccd0 100644 (file)
@@ -40,6 +40,7 @@
 #include "blkid-util.h"
 #include "efivars.h"
 #include "rm-rf.h"
+#include "string-util.h"
 #include "util.h"
 
 static int verify_esp(const char *p, uint32_t *part, uint64_t *pstart, uint64_t *psize, sd_id128_t *uuid) {
index 83ad90c222c4a2565ef7b27eefb4c6a2d3f79b9b..7842e0766db530d071724c95a636e4bad6ea5350 100644 (file)
 
  ***/
 
-#include <sys/resource.h>
-#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <getopt.h>
+#include <limits.h>
 #include <signal.h>
+#include <stdbool.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
+#include <sys/resource.h>
 #include <time.h>
-#include <getopt.h>
-#include <limits.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdbool.h>
-#include "systemd/sd-journal.h"
+#include <unistd.h>
 
-#include "util.h"
+#include "sd-journal.h"
+
+#include "bootchart.h"
+#include "conf-parser.h"
 #include "fileio.h"
+#include "list.h"
 #include "macro.h"
-#include "conf-parser.h"
-#include "strxcpyx.h"
 #include "path-util.h"
 #include "store.h"
+#include "string-util.h"
+#include "strxcpyx.h"
 #include "svg.h"
-#include "bootchart.h"
-#include "list.h"
+#include "util.h"
 
 static int exiting = 0;
 
index caa97b97fc1566f69bc760b1fd76e2c2edab95b4..f3f55781ad39d12b651343ad5c3e8ed2259866c9 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
  ***/
 
-#include <unistd.h>
-#include <stdlib.h>
+#include <dirent.h>
+#include <fcntl.h>
 #include <limits.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
-#include <dirent.h>
-#include <fcntl.h>
 #include <time.h>
+#include <unistd.h>
 
-#include "util.h"
-#include "time-util.h"
-#include "strxcpyx.h"
-#include "store.h"
 #include "bootchart.h"
 #include "cgroup-util.h"
 #include "fileio.h"
+#include "string-util.h"
+#include "strxcpyx.h"
+#include "time-util.h"
+#include "util.h"
+#include "store.h"
 
 /*
  * Alloc a static 4k buffer for stdio - primarily used to increase
index 64d1c5231f42ccfd8fa30f2f4922809cd5636884..e558578bd0f59df0c6f71895bbbb82238c6294e5 100644 (file)
@@ -40,6 +40,7 @@
 #include "formats-util.h"
 #include "log.h"
 #include "proxy.h"
+#include "string-util.h"
 #include "strv.h"
 #include "util.h"
 
index 91717653c2a4a0fd6ecf5f9cc7f1f6fac96a5d53..c5a1e09cf8506b691881c1e0fabd11c26b28cc84 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "xml.h"
+#include "sd-login.h"
+
+#include "bus-internal.h"
+#include "conf-files.h"
 #include "fileio.h"
-#include "strv.h"
+#include "formats-util.h"
 #include "set.h"
-#include "conf-files.h"
-#include "bus-internal.h"
+#include "string-util.h"
+#include "strv.h"
+#include "xml.h"
 #include "bus-xml-policy.h"
-#include "sd-login.h"
-#include "formats-util.h"
 
 static void policy_item_free(PolicyItem *i) {
         assert(i);
index fa4aee691a53b5d8fafa1ebb40b42ee14e17cfb7..4e859412f87686e8e51df62c82b573e394d86cf3 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <string.h>
 #include <errno.h>
 #include <stddef.h>
+#include <string.h>
 
-#include "util.h"
 #include "sd-bus.h"
+
 #include "bus-internal.h"
 #include "bus-message.h"
 #include "bus-util.h"
-#include "strv.h"
-#include "set.h"
 #include "driver.h"
+#include "env-util.h"
 #include "proxy.h"
+#include "set.h"
+#include "strv.h"
 #include "synthesize.h"
-#include "env-util.h"
+#include "util.h"
 
 static int get_creds_by_name(sd_bus *bus, const char *name, uint64_t mask, sd_bus_creds **_creds, sd_bus_error *error) {
         _cleanup_bus_creds_unref_ sd_bus_creds *c = NULL;
index 6aac650ac93a8e469e3cadfc97f51d34b756a99b..7b2e5d422fe017f58b921af11b53d1ea32c66b4c 100644 (file)
@@ -22,6 +22,7 @@
 ***/
 
 #include "sd-bus.h"
+
 #include "bus-xml-policy.h"
 
 typedef struct Proxy Proxy;
index 15d99103f6dc0aeaff2731ed339ccd524792eb3a..7f1f9dc28d68309ae3093b0a9abd213f3b1220fe 100644 (file)
 
 #include <stddef.h>
 
-#include "util.h"
 #include "sd-bus.h"
+
 #include "bus-internal.h"
+#include "bus-match.h"
 #include "bus-message.h"
 #include "bus-util.h"
-#include "bus-match.h"
 #include "synthesize.h"
+#include "util.h"
 
 int synthetic_driver_send(sd_bus *b, sd_bus_message *m) {
         int r;
index b596daddf21ea717ade4f4ced0b18ca79cc7d389..ddfe2fd2663ab8ce8668c632404fa9adb9ebae7c 100644 (file)
@@ -22,6 +22,7 @@
 ***/
 
 #include "sd-bus.h"
+
 #include "proxy.h"
 
 int synthetic_driver_send(sd_bus *b, sd_bus_message *m);
index d19d0e1b606ca2650ce0a3491b2d30d0fac1f453..cb7ff6b9700b8ad117a867ec0b203f25119d429a 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <unistd.h>
 #include <errno.h>
 #include <stddef.h>
+#include <unistd.h>
 
-#include "log.h"
-#include "util.h"
 #include "sd-bus.h"
-#include "strv.h"
+
 #include "bus-xml-policy.h"
+#include "log.h"
+#include "string-util.h"
+#include "strv.h"
+#include "util.h"
 
 static int test_policy_load(Policy *p, const char *name) {
         _cleanup_free_ char *path = NULL;
index b79519dd09726fd19ae1445e77b9d5003077b7cc..e48234f07562d568217d53213c5f80ffbdd8b24f 100644 (file)
@@ -22,8 +22,9 @@
 #include <stdlib.h>
 
 #include "sd-bus.h"
-#include "log.h"
+
 #include "bus-util.h"
+#include "log.h"
 
 int main(int argc, char *argv[]) {
         _cleanup_bus_flush_close_unref_ sd_bus *bus = NULL;
index e0535ec20177ed10a8ee37d0d89766d39b97c6a0..1995bb8b7dd27cab2839148a627db9a0b25c6bae 100644 (file)
 ***/
 
 #include <errno.h>
-#include <limits.h>
-#include <sys/mount.h>
-#include <unistd.h>
 #include <fcntl.h>
+#include <limits.h>
+#include <linux/auto_dev-ioctl.h>
+#include <linux/auto_fs4.h>
 #include <sys/epoll.h>
+#include <sys/mount.h>
 #include <sys/stat.h>
-#include <linux/auto_fs4.h>
-#include <linux/auto_dev-ioctl.h>
+#include <unistd.h>
 
-#include "unit.h"
-#include "automount.h"
-#include "mount.h"
-#include "unit-name.h"
-#include "special.h"
+#include "async.h"
+#include "bus-error.h"
+#include "bus-util.h"
+#include "dbus-automount.h"
+#include "formats-util.h"
 #include "label.h"
 #include "mkdir.h"
+#include "mount.h"
 #include "path-util.h"
-#include "dbus-automount.h"
-#include "bus-util.h"
-#include "bus-error.h"
-#include "formats-util.h"
 #include "process-util.h"
-#include "async.h"
+#include "special.h"
+#include "string-util.h"
+#include "unit-name.h"
+#include "unit.h"
+#include "automount.h"
 
 static const UnitActiveState state_translation_table[_AUTOMOUNT_STATE_MAX] = {
         [AUTOMOUNT_DEAD] = UNIT_INACTIVE,
index b85fce5f8df53610ef783bea0d079ec82d5f0f88..a7cb56dcbf1a08a2ec421e70dc430da80200ee2d 100644 (file)
 
 #include <sys/mman.h>
 
-#include "special.h"
-#include "formats-util.h"
-#include "signal-util.h"
-#include "bus-kernel.h"
 #include "bus-internal.h"
+#include "bus-kernel.h"
+#include "bus-policy.h"
 #include "bus-util.h"
+#include "dbus-busname.h"
+#include "formats-util.h"
 #include "kdbus.h"
-#include "bus-policy.h"
 #include "service.h"
-#include "dbus-busname.h"
+#include "signal-util.h"
+#include "special.h"
+#include "string-util.h"
 #include "busname.h"
 
 static const UnitActiveState state_translation_table[_BUSNAME_STATE_MAX] = {
index 1bc32905963947d4f981632c88c71cec73c0ebb8..46f7b6f097ab31bb688a6f984f6f58b0f1bbc4a2 100644 (file)
@@ -24,6 +24,8 @@
 typedef struct BusName BusName;
 typedef struct BusNamePolicy BusNamePolicy;
 
+#include "unit.h"
+
 typedef enum BusNameResult {
         BUSNAME_SUCCESS,
         BUSNAME_FAILURE_RESOURCES,
index 0c790c33da4fa229f07cb3bae409ce1b4991e0a9..73e58f867c9add6252c0cd09800e80ebd30a48fb 100644 (file)
@@ -26,7 +26,7 @@
 #include "path-util.h"
 #include "process-util.h"
 #include "special.h"
-
+#include "string-util.h"
 #include "cgroup.h"
 
 #define CGROUP_CPU_QUOTA_PERIOD_USEC ((usec_t) 100 * USEC_PER_MSEC)
index 5162ce34cb75f09bbbe9d5b019d3169ea197f3ac..45f2c2ffd64411798a564ad9790c12fd434273ee 100644 (file)
@@ -20,8 +20,9 @@
 ***/
 
 #include "automount.h"
-#include "dbus-automount.h"
 #include "bus-util.h"
+#include "string-util.h"
+#include "dbus-automount.h"
 
 static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_result, automount_result, AutomountResult);
 
index b1ceb05b1a2c1c5588efcbea352e20c961df62c3..05ac89c3c0344feee7e162746331c4db32190897 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "unit.h"
+#include "bus-util.h"
 #include "busname.h"
+#include "string-util.h"
+#include "unit.h"
 #include "dbus-busname.h"
-#include "bus-util.h"
 
 static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_result, busname_result, BusNameResult);
 
index c2a3910f3d6466ccf13ffaf56ba58fe3b9a4eb7f..9dc187c066a25414cb2aed8beb210511beebf6d1 100644 (file)
@@ -22,6 +22,7 @@
 ***/
 
 #include "sd-bus.h"
+
 #include "cgroup.h"
 
 extern const sd_bus_vtable bus_cgroup_vtable[];
index e4c2d5ddf678e158f8579ae1c547e502e5ef948b..c44517ea2271a104d75c209c579f33504fb8aefd 100644 (file)
@@ -22,6 +22,7 @@
 ***/
 
 #include "sd-bus.h"
+
 #include "execute.h"
 
 #define BUS_EXEC_STATUS_VTABLE(prefix, offset, flags)                   \
index cd6b909426cdcff94e51f4d90169f75e81fefa70..e95ec5c0cbfe31bc27c668228566811e255c5bff 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "log.h"
 #include "sd-bus.h"
-#include "selinux-access.h"
+
+#include "dbus.h"
 #include "job.h"
+#include "log.h"
+#include "selinux-access.h"
+#include "string-util.h"
 #include "dbus-job.h"
-#include "dbus.h"
 
 static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_type, job_type, JobType);
 static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_state, job_state, JobState);
index fb5f1b513ebcfb88e9246710ba5318e0c2398a97..0f2fbe2ee2930d78466018cb84a431276deea49a 100644 (file)
@@ -22,6 +22,7 @@
 ***/
 
 #include "sd-bus.h"
+
 #include "job.h"
 
 extern const sd_bus_vtable bus_job_vtable[];
index 7c15f3a90b60db16802ce5f1344703485a5f8844..794c402048adf3c663cad1747e717908b40d48c0 100644 (file)
@@ -22,6 +22,7 @@
 ***/
 
 #include "sd-bus.h"
+
 #include "unit.h"
 #include "kill.h"
 
index 00bb39110611005aa952939ef42fb9af525ae5e1..3cd4467efed7ee41df96a366500f6044cc1f85a2 100644 (file)
 #include <sys/prctl.h>
 #include <unistd.h>
 
-#include "log.h"
-#include "strv.h"
+#include "architecture.h"
 #include "build.h"
-#include "install.h"
-#include "selinux-access.h"
-#include "watchdog.h"
+#include "bus-common-errors.h"
 #include "clock-util.h"
-#include "path-util.h"
-#include "virt.h"
-#include "architecture.h"
-#include "env-util.h"
-#include "dbus.h"
+#include "dbus-execute.h"
 #include "dbus-job.h"
-#include "dbus-manager.h"
-#include "dbus-unit.h"
 #include "dbus-snapshot.h"
-#include "dbus-execute.h"
-#include "bus-common-errors.h"
+#include "dbus-unit.h"
+#include "dbus.h"
+#include "env-util.h"
 #include "formats-util.h"
+#include "install.h"
+#include "log.h"
+#include "path-util.h"
+#include "selinux-access.h"
+#include "string-util.h"
+#include "strv.h"
+#include "virt.h"
+#include "watchdog.h"
+#include "dbus-manager.h"
 
 static int property_get_version(
                 sd_bus *bus,
index dbee7fc9080c74a94344acba55ddda36f1171654..318e81abd61e566dd6d8c6cb51ed10780fbb4b34 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "unit.h"
-#include "mount.h"
+#include "bus-util.h"
+#include "dbus-cgroup.h"
 #include "dbus-execute.h"
 #include "dbus-kill.h"
-#include "dbus-cgroup.h"
+#include "mount.h"
+#include "string-util.h"
+#include "unit.h"
 #include "dbus-mount.h"
-#include "bus-util.h"
 
 static int property_get_what(
                 sd_bus *bus,
index f7004d252f02f311f0ff058252decb0702ae0ccb..dd0bf51bb0afcc05f99f9d62e5b3fd9b55fe6369 100644 (file)
@@ -22,6 +22,7 @@
 ***/
 
 #include "sd-bus.h"
+
 #include "unit.h"
 
 extern const sd_bus_vtable bus_mount_vtable[];
index 683561999bd646aa8d3ee400bb926410f80aefac..9e32b5fb06d9c8a60d5d7d498595387df5f968db 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "unit.h"
+#include "bus-util.h"
 #include "path.h"
+#include "string-util.h"
+#include "unit.h"
 #include "dbus-path.h"
-#include "bus-util.h"
 
 static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_result, path_result, PathResult);
 
index fe2a4a3b377a7edf7da17ec3e3c7a1210d18706e..0062f1f7f01fc0c230866112a105048183810249 100644 (file)
 ***/
 
 #include "async.h"
-#include "strv.h"
-#include "path-util.h"
-#include "unit.h"
-#include "service.h"
+#include "bus-util.h"
+#include "dbus-cgroup.h"
 #include "dbus-execute.h"
 #include "dbus-kill.h"
-#include "dbus-cgroup.h"
+#include "path-util.h"
+#include "service.h"
+#include "string-util.h"
+#include "strv.h"
+#include "unit.h"
 #include "dbus-service.h"
-#include "bus-util.h"
 
 static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_type, service_type, ServiceType);
 static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_result, service_result, ServiceResult);
index 7444649f8ba1022b581921b145f4a30cb63c0ed0..5941b72bc0b7ee8e3ee25676d7ab6661c18d9a39 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "unit.h"
-#include "socket.h"
-#include "dbus-execute.h"
+#include "bus-util.h"
 #include "dbus-cgroup.h"
+#include "dbus-execute.h"
+#include "socket.h"
+#include "string-util.h"
+#include "unit.h"
 #include "dbus-socket.h"
-#include "bus-util.h"
 
 static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_result, socket_result, SocketResult);
 static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_bind_ipv6_only, socket_address_bind_ipv6_only, SocketAddressBindIPv6Only);
index 00933713060375257ea63b723ea55d94d221ac5d..603ca95fd9fe02de096eced7af1aee7f00b1e603 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "unit.h"
-#include "swap.h"
-#include "dbus-execute.h"
+#include "bus-util.h"
 #include "dbus-cgroup.h"
+#include "dbus-execute.h"
+#include "string-util.h"
+#include "swap.h"
+#include "unit.h"
 #include "dbus-swap.h"
-#include "bus-util.h"
 
 static int property_get_priority(
                 sd_bus *bus,
index 4c4297bc9e68a63f2eeb1645f7219e2dbd2e4246..6be9c9f7084d0c4c976d14950070962e629f4bda 100644 (file)
@@ -21,5 +21,6 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include "sd-bus.h"
 
 extern const sd_bus_vtable bus_target_vtable[];
index 52daf116104e5f5105ab7864216b7d5535040cdd..b2b9eceeb3cf0561e9477ba52f5f3a42a8af6a5e 100644 (file)
 ***/
 
 #include "sd-bus.h"
+
+#include "bus-common-errors.h"
+#include "cgroup-util.h"
+#include "dbus.h"
 #include "log.h"
 #include "selinux-access.h"
-#include "cgroup-util.h"
-#include "strv.h"
-#include "bus-common-errors.h"
 #include "special.h"
-#include "dbus.h"
+#include "string-util.h"
+#include "strv.h"
 #include "dbus-unit.h"
 
 static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_load_state, unit_load_state, UnitLoadState);
index d8891d49d87140e2c25851ae253eeb9e857a6627..5f27ec4952c31ccf8948fb8f193abf1cefeb89f3 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/epoll.h>
 #include <errno.h>
+#include <sys/epoll.h>
 #include <unistd.h>
 
 #include "sd-bus.h"
-#include "log.h"
-#include "strv.h"
-#include "mkdir.h"
-#include "missing.h"
-#include "dbus-unit.h"
-#include "dbus-job.h"
-#include "dbus-manager.h"
+
+#include "bus-common-errors.h"
+#include "bus-error.h"
+#include "bus-internal.h"
+#include "bus-util.h"
+#include "dbus-cgroup.h"
 #include "dbus-execute.h"
+#include "dbus-job.h"
 #include "dbus-kill.h"
-#include "dbus-cgroup.h"
+#include "dbus-manager.h"
+#include "dbus-unit.h"
+#include "log.h"
+#include "missing.h"
+#include "mkdir.h"
+#include "selinux-access.h"
 #include "special.h"
-#include "dbus.h"
-#include "bus-util.h"
-#include "bus-error.h"
-#include "bus-common-errors.h"
+#include "string-util.h"
+#include "strv.h"
 #include "strxcpyx.h"
-#include "bus-internal.h"
-#include "selinux-access.h"
+#include "dbus.h"
 
 #define CONNECTIONS_MAX 4096
 
index a819ab8d4e121a03866e64466f58b67755d77c42..9127d2d225285e7d80f076a7ce7696cca5018bf4 100644 (file)
 
 #include <errno.h>
 #include <sys/epoll.h>
-#include <libudev.h>
 
-#include "log.h"
-#include "unit-name.h"
+#include "libudev.h"
+
 #include "dbus-device.h"
+#include "log.h"
 #include "path-util.h"
+#include "string-util.h"
+#include "swap.h"
 #include "udev-util.h"
+#include "unit-name.h"
 #include "unit.h"
-#include "swap.h"
 #include "device.h"
 
 static const UnitActiveState state_translation_table[_DEVICE_STATE_MAX] = {
index 51efb7c215a13f6b835f3dbb551692b4a1c8e4b7..a99e636d86bf402a57449c432727e111515112ad 100644 (file)
@@ -77,6 +77,7 @@
 #include "selinux-util.h"
 #include "signal-util.h"
 #include "smack-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "terminal-util.h"
 #include "unit.h"
index 932ddbf95a96147d28f2ef1c8023cf2695ad4210..f1563afff90b25ad91378ad310cc914978316d24 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
 #include <errno.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#include "macro.h"
-#include "util.h"
-#include "log.h"
 #include "fileio.h"
 #include "hostname-util.h"
+#include "log.h"
+#include "macro.h"
+#include "string-util.h"
+#include "util.h"
 #include "hostname-setup.h"
 
 int hostname_setup(void) {
index 13a4e44ec79c76ecf510f0aeaf7cf11c2e5e542d..8a0e0a0ea41f768ae167bd54d18b8871ce53962b 100644 (file)
@@ -32,6 +32,7 @@
 #include "macro.h"
 #include "set.h"
 #include "special.h"
+#include "string-util.h"
 #include "strv.h"
 #include "terminal-util.h"
 #include "unit.h"
index 1d1b10f1d36e845857ec9f36aa7cbf7f1f525a2f..350e9f385f978b095f9648c6b1abbb71bff3c7d8 100644 (file)
 
 #include <stdbool.h>
 
+#include "sd-event.h"
+
+#include "list.h"
+
 typedef struct Job Job;
 typedef struct JobDependency JobDependency;
 typedef enum JobType JobType;
@@ -105,9 +109,7 @@ enum JobResult {
         _JOB_RESULT_INVALID = -1
 };
 
-#include "sd-event.h"
 #include "unit.h"
-#include "list.h"
 
 struct JobDependency {
         /* Encodes that the 'subject' job needs the 'object' job in
index ee5d388560d7da1f45069e4d15263f211a2d2447..6857b0bbf9ce833a9afbb0cb16dd0769a8fa9951 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/wait.h>
-#include <signal.h>
 #include <errno.h>
+#include <signal.h>
+#include <sys/wait.h>
 #include <unistd.h>
 
-#include "util.h"
-#include "killall.h"
-#include "set.h"
 #include "formats-util.h"
 #include "process-util.h"
+#include "set.h"
+#include "string-util.h"
 #include "terminal-util.h"
+#include "util.h"
+#include "killall.h"
 
 #define TIMEOUT_USEC (10 * USEC_PER_SEC)
 
index ae85da25ac43482e4c9421a3985d6c005716ea4f..3212ed24d28efeaa46abbf0f17cd43cde480a8c2 100644 (file)
@@ -52,6 +52,7 @@
 #endif
 #include "securebits.h"
 #include "signal-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "unit-name.h"
 #include "unit-printf.h"
index 6961c26674515a8658c50daa7d0a4095a97fea09..bd632131b90cde0d699f53a97baf78473de82a32 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
 #include <errno.h>
+#include <stdlib.h>
 
-#include "locale-setup.h"
-#include "util.h"
-#include "virt.h"
-#include "fileio.h"
-#include "strv.h"
 #include "env-util.h"
+#include "fileio.h"
 #include "locale-util.h"
+#include "string-util.h"
+#include "strv.h"
+#include "util.h"
+#include "virt.h"
+#include "locale-setup.h"
 
 int locale_setup(char ***environment) {
         char **add;
index 4503fc9dcca86b82863fda04d3dffe898a19a2ab..4a57793104e075ea9985a4d2f6c6b47c36bc55d5 100644 (file)
 #include <stdlib.h>
 
 #include "sd-netlink.h"
-#include "netlink-util.h"
-#include "missing.h"
+
 #include "loopback-setup.h"
+#include "missing.h"
+#include "netlink-util.h"
 
 static int start_loopback(sd_netlink *rtnl) {
         _cleanup_netlink_message_unref_ sd_netlink_message *req = NULL;
index 363ffaaf05af65f7b26df9dbaa4741537af9333e..caa5f3717aa841cfe408b0f15c404c6bdeede141 100644 (file)
@@ -35,6 +35,7 @@
 #include "mkdir.h"
 #include "path-util.h"
 #include "process-util.h"
+#include "string-util.h"
 #include "util.h"
 #include "virt.h"
 #include "machine-id-setup.h"
index d1955a97019b156b1aabda506578351ef40085d6..2d30340828c7a29fb22afe753a14f5694c71f475 100644 (file)
@@ -66,6 +66,7 @@
 #include "rm-rf.h"
 #include "signal-util.h"
 #include "special.h"
+#include "string-util.h"
 #include "strv.h"
 #include "terminal-util.h"
 #include "time-util.h"
index d6da99ecb945d0a3b72c2814ee35cdbfc4f14253..47dd680b93689d4b08b512e8dab107ad85ad9ac4 100644 (file)
@@ -39,6 +39,7 @@
 #include "path-util.h"
 #include "smack-util.h"
 #include "special.h"
+#include "string-util.h"
 #include "strv.h"
 #include "unit-name.h"
 #include "unit.h"
index 2b8b707df5e5bc24ca9e5d6aec7b821d23a99197..6806fc27e6c8813921aa282b3e4ee99cada627a0 100644 (file)
 ***/
 
 #include <errno.h>
-#include <sys/mount.h>
-#include <string.h>
+#include <sched.h>
 #include <stdio.h>
-#include <unistd.h>
+#include <string.h>
+#include <sys/mount.h>
 #include <sys/stat.h>
-#include <sched.h>
+#include <unistd.h>
 #include <linux/fs.h>
 
-#include "strv.h"
-#include "util.h"
-#include "path-util.h"
-#include "missing.h"
-#include "loopback-setup.h"
 #include "dev-setup.h"
+#include "loopback-setup.h"
+#include "missing.h"
+#include "mkdir.h"
+#include "path-util.h"
 #include "selinux-util.h"
+#include "string-util.h"
+#include "strv.h"
+#include "util.h"
 #include "namespace.h"
-#include "mkdir.h"
 
 typedef enum MountMode {
         /* This is ordered by priority! */
index 081ac2040d7531eff41337b114b9f1d59416b445..4d276a79db7c729ceb8ac60bb3c672d64e67936c 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/inotify.h>
-#include <sys/epoll.h>
 #include <errno.h>
+#include <sys/epoll.h>
+#include <sys/inotify.h>
 #include <unistd.h>
 
-#include "unit.h"
-#include "unit-name.h"
-#include "path.h"
-#include "mkdir.h"
+#include "bus-error.h"
+#include "bus-util.h"
 #include "dbus-path.h"
-#include "special.h"
 #include "macro.h"
-#include "bus-util.h"
-#include "bus-error.h"
+#include "mkdir.h"
+#include "special.h"
+#include "string-util.h"
+#include "unit-name.h"
+#include "unit.h"
+#include "path.h"
 
 static const UnitActiveState state_translation_table[_PATH_STATE_MAX] = {
         [PATH_DEAD] = UNIT_INACTIVE,
index ea7d846578bf10ce23ffb12c7a3743f0991e916f..9f72851382592d74bd2745b656bd7ffef310ce8a 100644 (file)
 #include <errno.h>
 #include <unistd.h>
 
+#include "dbus-scope.h"
+#include "load-dropin.h"
 #include "log.h"
-#include "strv.h"
 #include "special.h"
+#include "string-util.h"
+#include "strv.h"
 #include "unit-name.h"
 #include "unit.h"
 #include "scope.h"
-#include "dbus-scope.h"
-#include "load-dropin.h"
 
 static const UnitActiveState state_translation_table[_SCOPE_STATE_MAX] = {
         [SCOPE_DEAD] = UNIT_INACTIVE,
index ff1ea235288ec5880fc5fb56e878b15cde03109e..d9b00fb95c46fc54943a9a9559091a85988eb55b 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <unistd.h>
-#include <stdio.h>
 #include <errno.h>
+#include <stdio.h>
+#include <unistd.h>
 
 #ifdef HAVE_SELINUX
 #include <selinux/selinux.h>
 #endif
 
-#include "selinux-setup.h"
-#include "selinux-util.h"
+#include "log.h"
 #include "macro.h"
+#include "selinux-util.h"
+#include "string-util.h"
 #include "util.h"
-#include "log.h"
+#include "selinux-setup.h"
 
 #ifdef HAVE_SELINUX
 _printf_(2,3)
index 29be0928d364df482cc6a5ad017440b4ca4affac..042ce5d54dfd98b72fe0fd51035fd1a79730d101 100644 (file)
@@ -42,6 +42,7 @@
 #include "process-util.h"
 #include "signal-util.h"
 #include "special.h"
+#include "string-util.h"
 #include "strv.h"
 #include "unit-name.h"
 #include "unit-printf.h"
index 02b1be73e32eb61982216192c46708554c56b500..7951ea73038d767ba349195001438f9479ba5f6e 100644 (file)
@@ -19,8 +19,9 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "show-status.h"
+#include "string-util.h"
 #include "util.h"
+#include "show-status.h"
 
 int parse_show_status(const char *v, ShowStatus *ret) {
         int r;
index 27c581d9c10ca2ef57b51c4d55b80860a2cdc4ef..33383a4b0bd562de1bd181ab851ed0e701108b66 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/mman.h>
-#include <sys/reboot.h>
-#include <linux/reboot.h>
-#include <sys/stat.h>
-#include <sys/mount.h>
 #include <errno.h>
-#include <unistd.h>
+#include <getopt.h>
+#include <linux/reboot.h>
 #include <signal.h>
 #include <stdbool.h>
 #include <stdlib.h>
-#include <getopt.h>
+#include <sys/mman.h>
+#include <sys/mount.h>
+#include <sys/reboot.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
-#include "missing.h"
-#include "log.h"
+#include "cgroup-util.h"
+#include "def.h"
 #include "fileio.h"
+#include "killall.h"
+#include "log.h"
+#include "missing.h"
+#include "process-util.h"
+#include "string-util.h"
+#include "switch-root.h"
+#include "terminal-util.h"
 #include "umount.h"
 #include "util.h"
 #include "virt.h"
 #include "watchdog.h"
-#include "killall.h"
-#include "cgroup-util.h"
-#include "def.h"
-#include "switch-root.h"
-#include "process-util.h"
-#include "terminal-util.h"
 
 #define FINALIZE_ATTEMPTS 50
 
index 1542e83eb6b468e0fef2ecb797083aa06f04b6e5..8fb6d28a3cbfca0c55cd04a004f68a70f18090f9 100644 (file)
 
 #include <errno.h>
 
+#include "dbus-slice.h"
 #include "log.h"
-#include "strv.h"
 #include "special.h"
+#include "string-util.h"
+#include "strv.h"
 #include "unit-name.h"
 #include "unit.h"
 #include "slice.h"
-#include "dbus-slice.h"
 
 static const UnitActiveState state_translation_table[_SLICE_STATE_MAX] = {
         [SLICE_DEAD] = UNIT_INACTIVE,
index 761582c7a2d847e3e637527a34ec118078b76cbf..fb04e1135d881e33cfc00d190210f8765418db40 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
+#include <dirent.h>
 #include <errno.h>
-#include <string.h>
-#include <stdlib.h>
 #include <fcntl.h>
-#include <dirent.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
-#include "macro.h"
-#include "smack-setup.h"
-#include "util.h"
 #include "fileio.h"
 #include "log.h"
+#include "macro.h"
+#include "string-util.h"
+#include "util.h"
+#include "smack-setup.h"
 
 #ifdef HAVE_SMACK
 
index 867f3765e7b1cc01f5db1ac433676492a8d5646d..15726c344e5c950f9192e1c0b9a46c834a92f375 100644 (file)
 
 #include <errno.h>
 
+#include "bus-common-errors.h"
+#include "dbus-snapshot.h"
+#include "string-util.h"
+#include "unit-name.h"
 #include "unit.h"
 #include "snapshot.h"
-#include "unit-name.h"
-#include "dbus-snapshot.h"
-#include "bus-common-errors.h"
 
 static const UnitActiveState state_translation_table[_SNAPSHOT_STATE_MAX] = {
         [SNAPSHOT_DEAD] = UNIT_INACTIVE,
index e42ed62ef1a88e23e83d758867b8d6431fb261c1..cfa17b33257bf1cd8bd0ebfd8bce684939ee37f0 100644 (file)
@@ -48,6 +48,7 @@
 #include "smack-util.h"
 #include "socket.h"
 #include "special.h"
+#include "string-util.h"
 #include "strv.h"
 #include "unit-name.h"
 #include "unit-printf.h"
index 82ca58cd7adae62db2357875d3eea16fa1a73fe8..eeb53d06322d64a05c80b30faa81983c74f4bf2d 100644 (file)
 ***/
 
 #include <errno.h>
-#include <libudev.h>
 #include <sys/epoll.h>
 #include <sys/stat.h>
 #include <unistd.h>
 
+#include "libudev.h"
+
 #include "dbus-swap.h"
 #include "escape.h"
 #include "exit-status.h"
@@ -32,6 +33,7 @@
 #include "fstab-util.h"
 #include "path-util.h"
 #include "special.h"
+#include "string-util.h"
 #include "udev-util.h"
 #include "unit-name.h"
 #include "unit.h"
index 7f29603c32ddc9c54d867282802281c2cf029ce4..303b926568298efbabea55b61a66beb21edd094c 100644 (file)
@@ -22,7 +22,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <libudev.h>
+#include "libudev.h"
 
 typedef struct Swap Swap;
 
index a905a1adf600c6d493fab626b071caf84de6ae47..c3e79fffc8d1f7016baa31c1b1cf613b11e35577 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-
-#include "unit.h"
-#include "target.h"
-#include "log.h"
 #include "dbus-target.h"
+#include "log.h"
 #include "special.h"
+#include "string-util.h"
 #include "unit-name.h"
+#include "unit.h"
+#include "target.h"
 
 static const UnitActiveState state_translation_table[_TARGET_STATE_MAX] = {
         [TARGET_DEAD] = UNIT_INACTIVE,
index 800e58261ccc2266610d9129d73d3037f11cfdc8..4548a4fa526539c61e7fac3e77826072b0e1d715 100644 (file)
 
 #include <errno.h>
 
-#include "unit.h"
-#include "unit-name.h"
-#include "timer.h"
+#include "bus-error.h"
+#include "bus-util.h"
 #include "dbus-timer.h"
 #include "special.h"
-#include "bus-util.h"
-#include "bus-error.h"
+#include "string-util.h"
+#include "unit-name.h"
+#include "unit.h"
+#include "timer.h"
 
 static const UnitActiveState state_translation_table[_TIMER_STATE_MAX] = {
         [TIMER_DEAD] = UNIT_INACTIVE,
index 38d004ece334749f4539ed3a5a42dfc2fa11ba2c..ec887760a1fd9bcb0494268dd1c86b7a76ef41c3 100644 (file)
 #include <sys/mount.h>
 #include <sys/swap.h>
 
-#include "escape.h"
 #include "libudev.h"
+
+#include "escape.h"
 #include "list.h"
 #include "mount-setup.h"
 #include "path-util.h"
+#include "string-util.h"
 #include "udev-util.h"
 #include "util.h"
 #include "virt.h"
index 0889769d0325717cde2745bb6a2f32667901573c..0b7fd4e25bcff93bde7a2555e0aa2e97e17dddd8 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "unit.h"
+#include "cgroup-util.h"
+#include "formats-util.h"
+#include "macro.h"
 #include "specifier.h"
+#include "string-util.h"
 #include "strv.h"
 #include "unit-name.h"
+#include "unit.h"
 #include "unit-printf.h"
-#include "macro.h"
-#include "cgroup-util.h"
-#include "formats-util.h"
 
 static int specifier_prefix_and_instance(char specifier, void *data, void *userdata, char **ret) {
         Unit *u = userdata;
index 841c1ac0180fd3ad5c7f68597f65184132211be5..a054cc79b06c9d4fffe76655e3eb83e634918a60 100644 (file)
 #include "process-util.h"
 #include "set.h"
 #include "special.h"
+#include "string-util.h"
 #include "strv.h"
 #include "unit-name.h"
 #include "virt.h"
-
 #include "unit.h"
 
 const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX] = {
index ab91afec4d1e96374faecd389d01d1744eb6fd8f..fde508ac2501cfa8eb5500cb8844b33876c07ddc 100644 (file)
 #include <errno.h>
 
 #include "dropin.h"
+#include "fstab-util.h"
 #include "generator.h"
 #include "hashmap.h"
 #include "log.h"
 #include "mkdir.h"
 #include "path-util.h"
-#include "fstab-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "unit-name.h"
 #include "util.h"
index 4b5f24ff2e2defb5da074f5e5daf34a1c9d4d09e..f5fb6a09fe070e648f3c246e7be3d049b7d53a26 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <string.h>
 #include <errno.h>
-#include <sys/mman.h>
-#include <mntent.h>
 #include <libcryptsetup.h>
+#include <mntent.h>
+#include <string.h>
+#include <sys/mman.h>
 
 #include "sd-device.h"
 
@@ -33,6 +33,7 @@
 #include "fileio.h"
 #include "log.h"
 #include "path-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "util.h"
 
index 8b29e8fd09314dda37306b41f0b6817a6a3eba36..7f26108e9ccfeeb416a4fc1dbf79e7a2fc389a64 100644 (file)
@@ -23,6 +23,7 @@
 #include "strv.h"
 #include "unit-name.h"
 #include "mkdir.h"
+#include "string-util.h"
 
 static const char *arg_dest = "/tmp";
 static char **arg_mask = NULL;
index 4edafc7cdf7895d61888bbf1348cd7e193ffc98d..fbb6ab564b227473ca4db3d74d542c7f4fc8a1de 100644 (file)
@@ -32,6 +32,7 @@
 #include "path-util.h"
 #include "process-util.h"
 #include "signal-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "terminal-util.h"
 #include "util.h"
index a4bfeb5df53029a6ed04b9de73822716121f0843..9390558554eae1915040708a0e504581b08d5bc6 100644 (file)
@@ -24,6 +24,7 @@
 #include <stdlib.h>
 
 #include "log.h"
+#include "string-util.h"
 #include "strv.h"
 #include "unit-name.h"
 
index cc564d5cd835a532df9ecb64d9499278eacc7a0d..f6b9c095bf1891877c0c5495e51d0b7cf0aeae06 100644 (file)
@@ -35,6 +35,7 @@
 #include "strv.h"
 #include "terminal-util.h"
 #include "time-util.h"
+#include "string-util.h"
 
 static char *arg_root = NULL;
 static char *arg_locale = NULL;  /* $LANG */
index 3f8ea5647cddeb7610f05c31a1eb77d252025bc8..de2962d6008cb5a397d89e25453f11ab2cac0a71 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
-#include <mntent.h>
 #include <errno.h>
+#include <mntent.h>
+#include <stdio.h>
 #include <string.h>
 #include <unistd.h>
 
-#include "log.h"
-#include "util.h"
-#include "unit-name.h"
-#include "path-util.h"
 #include "fstab-util.h"
+#include "generator.h"
+#include "log.h"
+#include "mkdir.h"
 #include "mount-setup.h"
+#include "path-util.h"
 #include "special.h"
-#include "mkdir.h"
-#include "generator.h"
+#include "string-util.h"
 #include "strv.h"
+#include "unit-name.h"
+#include "util.h"
 #include "virt.h"
 
 static const char *arg_dest = "/tmp";
index 9a4b038ef3d31e3e5e4957663eff061f569bc0be..eff9ee236f9324d83468ac27372cfab5dedd0c14 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <string.h>
 #include <errno.h>
-#include <unistd.h>
 #include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
 
+#include "fileio.h"
 #include "log.h"
-#include "util.h"
 #include "mkdir.h"
-#include "unit-name.h"
-#include "virt.h"
-#include "fileio.h"
 #include "path-util.h"
 #include "process-util.h"
+#include "string-util.h"
 #include "terminal-util.h"
+#include "unit-name.h"
+#include "util.h"
+#include "virt.h"
 
 static const char *arg_dest = "/tmp";
 
index 96425c5b07fabc6689bbcb40b5088cab9cf60b52..3e8c745238864dd882c5e4b9e9e93b4900394649 100644 (file)
 #include <sys/statfs.h>
 #include <blkid/blkid.h>
 
-#include "sd-id128.h"
 #include "libudev.h"
-#include "path-util.h"
-#include "util.h"
-#include "mkdir.h"
+#include "sd-id128.h"
+
+#include "blkid-util.h"
+#include "btrfs-util.h"
+#include "efivars.h"
+#include "fileio.h"
+#include "fstab-util.h"
+#include "generator.h"
+#include "gpt.h"
 #include "missing.h"
-#include "udev-util.h"
+#include "mkdir.h"
+#include "path-util.h"
 #include "special.h"
+#include "string-util.h"
+#include "udev-util.h"
 #include "unit-name.h"
+#include "util.h"
 #include "virt.h"
-#include "generator.h"
-#include "gpt.h"
-#include "fileio.h"
-#include "efivars.h"
-#include "fstab-util.h"
-#include "blkid-util.h"
-#include "btrfs-util.h"
 
 static const char *arg_dest = "/tmp";
 static bool arg_enabled = true;
index 9fb6233336b544da23b52b7f69f81cfc681db519..dff2ada3842638843413262543c895a3052baa67 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
 #include <errno.h>
+#include <stdio.h>
 
 #include "log.h"
-#include "util.h"
-#include "special.h"
 #include "mkdir.h"
+#include "special.h"
+#include "string-util.h"
 #include "unit-name.h"
+#include "util.h"
 
 static const char *arg_dest = "/tmp";
 static char *arg_resume_dev = NULL;
index 1e415db845c8fa579d6c8768a8ef040c787c33b9..f60ed4b28b9e0c3b2eb2f531880e39a4cac45fb7 100644 (file)
@@ -27,6 +27,7 @@
 #include "hwdb-util.h"
 #include "mkdir.h"
 #include "strbuf.h"
+#include "string-util.h"
 #include "strv.h"
 #include "util.h"
 #include "verbs.h"
index 18c42b8b6d1652db8cc6bcb3c2bf10351db6818d..7b1ac134a0d2116fced81d3168b7a8669ea70109 100644 (file)
@@ -21,8 +21,9 @@
 
 #include <ftw.h>
 
-#include "util.h"
 #include "rm-rf.h"
+#include "string-util.h"
+#include "util.h"
 #include "aufs-util.h"
 
 static int nftw_cb(
index d390cfb1f3e5f0978bfdfb075a300cae3d22dcca..422d517529db2d56db830702d0051e0d04967c8b 100644 (file)
@@ -19,6 +19,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include "string-util.h"
 #include "curl-util.h"
 
 static void curl_glue_check_finished(CurlGlue *g) {
index c249069ffacf5142d6ba10cacaada5a9161ff975..6a2aa81c76c056ec7344c4ea670d3974b3d07d68 100644 (file)
 #include <sys/types.h>
 #include <curl/curl.h>
 
-#include "hashmap.h"
 #include "sd-event.h"
 
+#include "hashmap.h"
+
 typedef struct CurlGlue CurlGlue;
 
 struct CurlGlue {
index 8f9c9bbc800cbcdc05dc049bde40d9aa37880569..dc4db481cac007a521694ec40d5cdd8feb078548 100644 (file)
 #undef basename
 
 #include "sd-daemon.h"
-#include "util.h"
-#include "ratelimit.h"
+
 #include "btrfs-util.h"
 #include "copy.h"
-#include "import-common.h"
 #include "export-raw.h"
+#include "import-common.h"
+#include "ratelimit.h"
+#include "string-util.h"
+#include "util.h"
 
 #define COPY_BUFFER_SIZE (16*1024)
 
index a623745f5f24d64d332e3468e9637ad5bb6dca3d..93f2fdbd44bd98f50ed09c97c975eac5c4471d2a 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/sendfile.h>
-
 #include "sd-daemon.h"
-#include "util.h"
-#include "ratelimit.h"
+
 #include "btrfs-util.h"
 #include "import-common.h"
-#include "export-tar.h"
 #include "process-util.h"
+#include "ratelimit.h"
+#include "string-util.h"
+#include "util.h"
+#include "export-tar.h"
 
 #define COPY_BUFFER_SIZE (16*1024)
 
index d34105e4ca187e682ca050a00815bb1ad62f3ea4..89e23899b18f03f0288b85b9134dc22ebb875da3 100644 (file)
@@ -30,6 +30,7 @@
 #include "import-util.h"
 #include "machine-image.h"
 #include "signal-util.h"
+#include "string-util.h"
 #include "verbs.h"
 
 static ImportCompressType arg_compress = IMPORT_COMPRESS_UNKNOWN;
index 5f7d25d063e63e2dca668cfb921e49b23a324617..b13e80584d82d9f9e7f9aa8dafc2da5616247212 100644 (file)
 
 #include "sd-daemon.h"
 #include "sd-event.h"
-#include "util.h"
-#include "path-util.h"
+
 #include "btrfs-util.h"
-#include "hostname-util.h"
 #include "copy.h"
-#include "mkdir.h"
-#include "rm-rf.h"
-#include "ratelimit.h"
+#include "hostname-util.h"
+#include "import-common.h"
+#include "import-compress.h"
 #include "machine-pool.h"
+#include "mkdir.h"
+#include "path-util.h"
 #include "qcow2-util.h"
-#include "import-compress.h"
-#include "import-common.h"
+#include "ratelimit.h"
+#include "rm-rf.h"
+#include "string-util.h"
+#include "util.h"
 #include "import-raw.h"
 
 struct RawImport {
index 5c288d438efb837499ae20b26a7b361422e864b7..0145dcb452287177c1d692442b3908d96e893d8f 100644 (file)
 
 #include "sd-daemon.h"
 #include "sd-event.h"
-#include "util.h"
-#include "path-util.h"
+
 #include "btrfs-util.h"
-#include "hostname-util.h"
 #include "copy.h"
-#include "mkdir.h"
-#include "rm-rf.h"
-#include "ratelimit.h"
+#include "hostname-util.h"
+#include "import-common.h"
+#include "import-compress.h"
 #include "machine-pool.h"
+#include "mkdir.h"
+#include "path-util.h"
+#include "process-util.h"
 #include "qcow2-util.h"
-#include "import-compress.h"
-#include "import-common.h"
+#include "ratelimit.h"
+#include "rm-rf.h"
+#include "string-util.h"
+#include "util.h"
 #include "import-tar.h"
-#include "process-util.h"
 
 struct TarImport {
         sd_event *event;
index 1c92312585e7a2bb00ae261a1beef6b4603f137e..bc0bc78924fac1b1d170ca4bb119281f9d5b7ee2 100644 (file)
@@ -30,6 +30,7 @@
 #include "import-util.h"
 #include "machine-image.h"
 #include "signal-util.h"
+#include "string-util.h"
 #include "verbs.h"
 
 static bool arg_force = false;
index 94d4438912e6f4e2aa3c2bf01e965cd2e81aec86..a79cc5825bad4185f092069069006c2375d06969 100644 (file)
@@ -30,6 +30,7 @@
 #include "rm-rf.h"
 #include "signal-util.h"
 #include "siphash24.h"
+#include "string-util.h"
 #include "strv.h"
 #include "util.h"
 #include "pull-common.h"
index 84211d282b616bc76bfcae924bddd317952a21a9..ea31d116411b4994935bfcd042ef1dba8a68236d 100644 (file)
 #include <sys/prctl.h>
 
 #include "sd-daemon.h"
-#include "json.h"
-#include "strv.h"
+
+#include "aufs-util.h"
 #include "btrfs-util.h"
-#include "utf8.h"
+#include "curl-util.h"
+#include "hostname-util.h"
+#include "import-common.h"
+#include "import-util.h"
+#include "json.h"
 #include "mkdir.h"
-#include "rm-rf.h"
 #include "path-util.h"
-#include "import-util.h"
-#include "curl-util.h"
-#include "aufs-util.h"
-#include "pull-job.h"
+#include "process-util.h"
 #include "pull-common.h"
-#include "import-common.h"
 #include "pull-dkr.h"
-#include "process-util.h"
-#include "hostname-util.h"
+#include "pull-job.h"
+#include "rm-rf.h"
+#include "string-util.h"
+#include "strv.h"
+#include "utf8.h"
 
 typedef enum DkrProgress {
         DKR_SEARCHING,
index 42939f21045d66c3d19829cfa130fba48e1c81e3..f8b597c9c38284fcc8a27e3a7a90dd84135e6aac 100644 (file)
@@ -21,8 +21,9 @@
 
 #include <sys/xattr.h>
 
-#include "strv.h"
 #include "machine-pool.h"
+#include "string-util.h"
+#include "strv.h"
 #include "pull-job.h"
 
 PullJob* pull_job_unref(PullJob *j) {
index 3e13f4ea9a61984dc39ee4cb8225cb6efab634a0..a8b2c245074fa420821a1086ca61a4dfee9a2e16 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/xattr.h>
-#include <linux/fs.h>
 #include <curl/curl.h>
+#include <linux/fs.h>
+#include <sys/xattr.h>
 
 #include "sd-daemon.h"
-#include "utf8.h"
-#include "strv.h"
-#include "copy.h"
+
 #include "btrfs-util.h"
-#include "util.h"
+#include "copy.h"
+#include "curl-util.h"
+#include "hostname-util.h"
+#include "import-common.h"
+#include "import-util.h"
 #include "macro.h"
 #include "mkdir.h"
-#include "rm-rf.h"
 #include "path-util.h"
-#include "hostname-util.h"
-#include "import-util.h"
-#include "import-common.h"
-#include "curl-util.h"
-#include "qcow2-util.h"
-#include "pull-job.h"
 #include "pull-common.h"
+#include "pull-job.h"
+#include "qcow2-util.h"
+#include "rm-rf.h"
+#include "string-util.h"
+#include "strv.h"
+#include "utf8.h"
+#include "util.h"
 #include "pull-raw.h"
 
 typedef enum RawProgress {
index bd35f1b8428018150c147c76e5db3244a1a276e6..fb4d5bf512e1894b5964b4c290d2359aecb2b07b 100644 (file)
 #include <curl/curl.h>
 
 #include "sd-daemon.h"
-#include "utf8.h"
-#include "strv.h"
-#include "copy.h"
+
 #include "btrfs-util.h"
-#include "util.h"
+#include "copy.h"
+#include "curl-util.h"
+#include "hostname-util.h"
+#include "import-common.h"
+#include "import-util.h"
 #include "macro.h"
 #include "mkdir.h"
-#include "rm-rf.h"
 #include "path-util.h"
 #include "process-util.h"
-#include "hostname-util.h"
-#include "import-util.h"
-#include "import-common.h"
-#include "curl-util.h"
-#include "pull-job.h"
 #include "pull-common.h"
+#include "pull-job.h"
+#include "rm-rf.h"
+#include "string-util.h"
+#include "strv.h"
+#include "utf8.h"
+#include "util.h"
 #include "pull-tar.h"
 
 typedef enum TarProgress {
index 29e9424b52ddeb6b1cca476f5bb5d05b6ae5d11c..73d5f391c253e2abfeaf5401180c487825cfa812 100644 (file)
@@ -31,6 +31,7 @@
 #include "pull-raw.h"
 #include "pull-tar.h"
 #include "signal-util.h"
+#include "string-util.h"
 #include "verbs.h"
 
 static bool arg_force = false;
index 2e0f78701a5a9a1214b4f4e681d0ded6ffa001a1..e9bca39a20085077537efa8b18c9fe32b1bdbbc4 100644 (file)
@@ -19,8 +19,9 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "journal-remote-parse.h"
 #include "journald-native.h"
+#include "string-util.h"
+#include "journal-remote-parse.h"
 
 #define LINE_CHUNK 8*1024u
 
index 0fcd98766480a79757b834667f0dee74f681dd9e..27385d9b9438146bc887d412c29e5c097ef4f33c 100644 (file)
@@ -44,6 +44,7 @@
 #include "macro.h"
 #include "signal-util.h"
 #include "socket-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "journal-remote.h"
 
index 92ce56805a6060bb7b07cd169fcb911067a224bf..471a8cad49413d62aa0bff7611361e4fca239ab7 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <curl/curl.h>
 #include <fcntl.h>
 #include <getopt.h>
 #include <stdio.h>
 #include <sys/stat.h>
-#include <curl/curl.h>
 
 #include "sd-daemon.h"
 
@@ -34,6 +34,7 @@
 #include "mkdir.h"
 #include "sigbus.h"
 #include "signal-util.h"
+#include "string-util.h"
 #include "util.h"
 #include "journal-upload.h"
 
index 8a11fba04441953d7242c87e1e480920a295cf3e..df068a089caabfa10ece31ced92cfda9a3fbbe7d 100644 (file)
 #include <stdio.h>
 #include <string.h>
 
-#include "microhttpd-util.h"
-#include "log.h"
-#include "macro.h"
-#include "util.h"
-#include "strv.h"
-
 #ifdef HAVE_GNUTLS
 #include <gnutls/gnutls.h>
 #include <gnutls/x509.h>
 #endif
 
+#include "log.h"
+#include "macro.h"
+#include "string-util.h"
+#include "strv.h"
+#include "util.h"
+#include "microhttpd-util.h"
+
 void microhttpd_logger(void *arg, const char *fmt, va_list ap) {
         char *f;
 
index f9b279d7de8ddb8e31a672f32e322199c78ebdf4..7074552a15031bba30bae347750a11ace090ccac 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "sd-journal.h"
 
+#include "string-util.h"
 #include "util.h"
 
 static char *arg_identifier = NULL;
index 4c43500ef5f320a045761d3c7308df2a713fb6ca..32b851aea38e8ab6fee136abeabc41de601d43e8 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <errno.h>
 #include <fcntl.h>
+#include <locale.h>
 #include <stdio.h>
-#include <unistd.h>
-#include <errno.h>
 #include <string.h>
 #include <sys/mman.h>
-#include <locale.h>
+#include <unistd.h>
 
-#include "util.h"
-#include "log.h"
-#include "sparse-endian.h"
 #include "sd-id128.h"
-#include "hashmap.h"
-#include "strv.h"
-#include "strbuf.h"
+
+#include "catalog.h"
 #include "conf-files.h"
+#include "hashmap.h"
+#include "log.h"
 #include "mkdir.h"
-#include "catalog.h"
 #include "siphash24.h"
+#include "sparse-endian.h"
+#include "strbuf.h"
+#include "string-util.h"
+#include "strv.h"
+#include "util.h"
 
 const char * const catalog_file_dirs[] = {
         "/usr/local/lib/systemd/catalog/",
index 8c92e26edd73aef09ad95f90766f3e68cf51b174..46a54104821eb61f9be7ed1b14faef51e43d09b1 100644 (file)
@@ -21,8 +21,8 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 #include <sys/mman.h>
+#include <unistd.h>
 
 #ifdef HAVE_XZ
 #  include <lzma.h>
 #  include <lz4frame.h>
 #endif
 
-#include "compress.h"
+#include "journal-def.h"
 #include "macro.h"
-#include "util.h"
 #include "sparse-endian.h"
-#include "journal-def.h"
+#include "string-util.h"
+#include "util.h"
+#include "compress.h"
 
 #ifdef HAVE_LZ4
 DEFINE_TRIVIAL_CLEANUP_FUNC(LZ4F_compressionContext_t, LZ4F_freeCompressionContext);
index efe418615a6cd26c9bf5217e65bc4d15c7ecc8cd..ba9994ac47dd1bf0752392d398d7c4dbf16ed513 100644 (file)
 
 #include <sys/statvfs.h>
 
-#include "util.h"
-#include "time-util.h"
 #include "hashmap.h"
 #include "macro.h"
-
+#include "string-util.h"
+#include "time-util.h"
+#include "util.h"
 #include "coredump-vacuum.h"
 
 #define DEFAULT_MAX_USE_LOWER (uint64_t) (1ULL*1024ULL*1024ULL)           /* 1 MiB */
index e20a73c159b71c3db0015e49f2ec43fd2f379051..5c1badd66da96115a919dc6cc2b408a13cbaca2b 100644 (file)
@@ -49,6 +49,7 @@
 #include "process-util.h"
 #include "special.h"
 #include "stacktrace.h"
+#include "string-util.h"
 #include "strv.h"
 #include "util.h"
 
index 97a721c114062593ae69d12524536b137ed3e348..80f692e044dff344cb018af0f3d486f3606a61ae 100644 (file)
@@ -38,6 +38,7 @@
 #include "set.h"
 #include "sigbus.h"
 #include "signal-util.h"
+#include "string-util.h"
 #include "terminal-util.h"
 #include "util.h"
 
index 1071c6d6d73dfa34df64f026266b82ba08b53f1b..f0962faeb5150d54dfc7df79a37862e7e6b31d19 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/mman.h>
 #include <errno.h>
-#include <sys/uio.h>
-#include <unistd.h>
-#include <sys/statvfs.h>
 #include <fcntl.h>
-#include <stddef.h>
 #include <linux/fs.h>
+#include <stddef.h>
+#include <sys/mman.h>
+#include <sys/statvfs.h>
+#include <sys/uio.h>
+#include <unistd.h>
 
 #include "btrfs-util.h"
-#include "journal-def.h"
-#include "journal-file.h"
+#include "compress.h"
 #include "journal-authenticate.h"
+#include "journal-def.h"
 #include "lookup3.h"
-#include "compress.h"
 #include "random-util.h"
+#include "string-util.h"
+#include "journal-file.h"
 
 #define DEFAULT_DATA_HASH_TABLE_SIZE (2047ULL*sizeof(HashItem))
 #define DEFAULT_FIELD_HASH_TABLE_SIZE (333ULL*sizeof(HashItem))
index b51ecdb600a5a4c39793a6dc0b47f78b8113be3c..1221799c1d6a3b2d32619785d15ddf0b4104a615 100644 (file)
 #include <inttypes.h>
 #include <stdbool.h>
 
-#include "systemd/sd-id128.h"
+#include "sd-id128.h"
+#include "sd-journal.h"
 
+#include "hashmap.h"
 #include "journal-def.h"
+#include "journal-file.h"
 #include "list.h"
-#include "hashmap.h"
 #include "set.h"
-#include "journal-file.h"
-#include "sd-journal.h"
 
 typedef struct Match Match;
 typedef struct Location Location;
index dc1b2105dd1b2df862b84f2132ffc53be6a2e1d8..79ef5b13d2db63bfa169251f15654c9003f2747a 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/socket.h>
-#include <sys/un.h>
 #include <errno.h>
-#include <stddef.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <printf.h>
+#include <stddef.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <unistd.h>
 
 #define SD_JOURNAL_SUPPRESS_LOCATION
 
 #include "sd-journal.h"
-#include "util.h"
-#include "socket-util.h"
+
 #include "memfd-util.h"
+#include "socket-util.h"
+#include "string-util.h"
+#include "util.h"
 
 #define SNDBUF_SIZE (8*1024*1024)
 
index c7ecd360b9317a29d5c8f0a3e9de0c7b48402ef8..692b875fae37299e1acf57a7640ba85d8ec93a76 100644 (file)
 #include <sys/stat.h>
 #include <unistd.h>
 
+#include "sd-id128.h"
+
 #include "journal-def.h"
 #include "journal-file.h"
-#include "journal-vacuum.h"
-#include "sd-id128.h"
+#include "string-util.h"
 #include "util.h"
 
+#include "journal-vacuum.h"
+
 struct vacuum_info {
         uint64_t usage;
         char *filename;
index fe8ae194c9d145cc81a24b6ccd9b87b0f1fe3531..58778a697af6c0263f4dd9baa4d9c9b415dcb2d8 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include "audit-type.h"
 #include "missing.h"
+#include "string-util.h"
 #include "journald-audit.h"
-#include "audit-type.h"
 
 typedef struct MapField {
         const char *audit_field;
index 9ed368b586ac5223aa902beaec38272cc8e35a9f..a8be704716a960725f5d2cb7cc0dfef8a5ef541e 100644 (file)
@@ -33,6 +33,7 @@
 #include "journald-server.h"
 #include "journald-syslog.h"
 #include "process-util.h"
+#include "string-util.h"
 #include "journald-kmsg.h"
 
 void server_forward_kmsg(
index 3e8a7a05f617d5810bb786675ac3a93f399d665a..7a514b2848f0cdb7fef5fbd631ed0116ee42fe67 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <unistd.h>
 #include <stddef.h>
 #include <sys/epoll.h>
 #include <sys/mman.h>
+#include <unistd.h>
 
-#include "socket-util.h"
-#include "path-util.h"
-#include "selinux-util.h"
-#include "journald-server.h"
-#include "journald-native.h"
-#include "journald-kmsg.h"
 #include "journald-console.h"
+#include "journald-kmsg.h"
+#include "journald-server.h"
 #include "journald-syslog.h"
 #include "journald-wall.h"
 #include "memfd-util.h"
+#include "path-util.h"
+#include "selinux-util.h"
+#include "socket-util.h"
+#include "string-util.h"
+#include "journald-native.h"
 
 bool valid_user_field(const char *p, size_t l, bool allow_protected) {
         const char *a;
index 8afd493b50f6d60917515568949ea54082fe2a58..6e9557c06e6aa554b35b93a5bb8a862dda2c0cb5 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <string.h>
 #include <errno.h>
+#include <string.h>
 
-#include "journald-rate-limit.h"
-#include "list.h"
-#include "util.h"
 #include "hashmap.h"
+#include "list.h"
 #include "random-util.h"
+#include "string-util.h"
+#include "util.h"
+#include "journald-rate-limit.h"
 
 #define POOLS_MAX 5
 #define BUCKETS_MAX 127
index 140d40667eb2b4bd463a10a2e228688c95fdb2ba..2dfd3093100f93e65b340f984118d6155490104f 100644 (file)
@@ -19,7 +19,6 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <linux/sockios.h>
 #ifdef HAVE_SELINUX
 #include <selinux/selinux.h>
 #endif
@@ -27,6 +26,7 @@
 #include <sys/mman.h>
 #include <sys/signalfd.h>
 #include <sys/statvfs.h>
+#include <linux/sockios.h>
 
 #include "libudev.h"
 #include "sd-daemon.h"
 #include "formats-util.h"
 #include "hashmap.h"
 #include "hostname-util.h"
-#include "missing.h"
-#include "mkdir.h"
-#include "process-util.h"
-#include "rm-rf.h"
-#include "selinux-util.h"
-#include "signal-util.h"
-#include "socket-util.h"
 #include "journal-authenticate.h"
 #include "journal-file.h"
 #include "journal-internal.h"
 #include "journald-kmsg.h"
 #include "journald-native.h"
 #include "journald-rate-limit.h"
-#include "journald-server.h"
 #include "journald-stream.h"
 #include "journald-syslog.h"
+#include "missing.h"
+#include "mkdir.h"
+#include "process-util.h"
+#include "rm-rf.h"
+#include "selinux-util.h"
+#include "signal-util.h"
+#include "socket-util.h"
+#include "string-util.h"
+#include "journald-server.h"
 
 #define USER_JOURNALS_MAX 1024
 
index 0c4b82f80d53a83b11b5038484c1d8c9d2b5439a..e06be6267f77a11d9547edd285b990c7b089009a 100644 (file)
@@ -19,8 +19,8 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <unistd.h>
 #include <stddef.h>
+#include <unistd.h>
 
 #ifdef HAVE_SELINUX
 #include <selinux/selinux.h>
@@ -39,6 +39,7 @@
 #include "mkdir.h"
 #include "selinux-util.h"
 #include "socket-util.h"
+#include "string-util.h"
 #include "journald-stream.h"
 
 #define STDOUT_STREAMS_MAX 4096
index ffba451955fd5833031ac328af44e038894bfeda..fc69cd7d9e1301513e06be3c034c4fe81272cce6 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <unistd.h>
 #include <stddef.h>
 #include <sys/epoll.h>
+#include <unistd.h>
 
-#include "systemd/sd-messages.h"
-#include "socket-util.h"
-#include "selinux-util.h"
-#include "journald-server.h"
-#include "journald-syslog.h"
-#include "journald-kmsg.h"
+#include "sd-messages.h"
+
+#include "formats-util.h"
 #include "journald-console.h"
+#include "journald-kmsg.h"
+#include "journald-server.h"
 #include "journald-wall.h"
-#include "formats-util.h"
 #include "process-util.h"
+#include "selinux-util.h"
+#include "socket-util.h"
+#include "string-util.h"
+#include "journald-syslog.h"
 
 /* Warn once every 30s if we missed syslog message */
 #define WARN_FORWARD_SYSLOG_MISSED_USEC (30 * USEC_PER_SEC)
index 7863766ae7f689d67f67535ac64b70aae54afbdb..5284914941f3091140cf43fc8f905cd4d979aa79 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "utmp-wtmp.h"
-#include "journald-server.h"
-#include "journald-wall.h"
 #include "formats-util.h"
+#include "journald-server.h"
 #include "process-util.h"
+#include "string-util.h"
+#include "utmp-wtmp.h"
+#include "journald-wall.h"
 
 void server_forward_wall(
                 Server *s,
index 13fa9b52fc49cf59e6f2a61cd715da0b8ce4713b..442e352ae226b90321ff3e5db4a0925e1f8a2320 100644 (file)
 
 #include <errno.h>
 #include <fcntl.h>
+#include <linux/magic.h>
+#include <poll.h>
 #include <stddef.h>
-#include <unistd.h>
 #include <sys/inotify.h>
-#include <poll.h>
 #include <sys/vfs.h>
-#include <linux/magic.h>
+#include <unistd.h>
 
 #include "sd-journal.h"
+
+#include "catalog.h"
+#include "compress.h"
+#include "fileio.h"
+#include "formats-util.h"
+#include "hashmap.h"
+#include "hostname-util.h"
 #include "journal-def.h"
 #include "journal-file.h"
-#include "hashmap.h"
+#include "journal-internal.h"
 #include "list.h"
-#include "strv.h"
-#include "path-util.h"
 #include "lookup3.h"
-#include "compress.h"
-#include "journal-internal.h"
 #include "missing.h"
-#include "catalog.h"
+#include "path-util.h"
 #include "replace-var.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "hostname-util.h"
+#include "string-util.h"
+#include "strv.h"
 
 #define JOURNAL_FILES_MAX 7168
 
index 98a54ff269f112d5e9e3042fc416f3e791467469..c4ba9e38903a0b29329b3d691c4e17da2717a3f7 100644 (file)
 #include <dwarf.h>
 #include <elfutils/libdwfl.h>
 
-#include "util.h"
+#include "formats-util.h"
 #include "macro.h"
+#include "string-util.h"
+#include "util.h"
 #include "stacktrace.h"
-#include "formats-util.h"
 
 #define FRAMES_MAX 64
 #define THREADS_MAX 64
index dbfdea609dc7751a8f0522e9496d4eed652e7a85..222d6cc72a65841777137b0d6cb72788f9b1cbb5 100644 (file)
 #include <errno.h>
 #include <fcntl.h>
 
+#include "sd-messages.h"
+
 #include "util.h"
 #include "log.h"
 #include "macro.h"
-#include "sd-messages.h"
 #include "catalog.h"
+#include "string-util.h"
 
 static const char *catalog_dirs[] = {
         CATALOG_DIR,
index 782b85db261a1a50d357bd706fcf881f1bb4a206..0a9ab7f52ca0a979adbb8c5aaeba2ed9c0334151 100644 (file)
 ***/
 
 #include "compress.h"
-#include "util.h"
 #include "macro.h"
 #include "random-util.h"
+#include "string-util.h"
+#include "util.h"
 
 typedef int (compress_t)(const void *src, uint64_t src_size, void *dst, size_t *dst_size);
 typedef int (decompress_t)(const void *src, uint64_t src_size,
index cde2025ae951e6ea0ae85fb7479a4b2fce55302d..040c7d58fb5150eb6d2c504a4ef9cea37bc0b3ea 100644 (file)
@@ -21,8 +21,9 @@
 
 #include <stdio.h>
 
-#include "log.h"
 #include "sd-journal.h"
+
+#include "log.h"
 #include "macro.h"
 #include "journal-internal.h"
 
index 2d4f531e9bf7b521775c89cde4b68fbe5d7799fc..6061623ae77305d3c85a4ebbfdfc8a7eb7b2fa83 100644 (file)
 #include <fcntl.h>
 
 #include "sd-journal.h"
-#include "macro.h"
+
 #include "journal-file.h"
 #include "journal-internal.h"
+#include "macro.h"
+#include "string-util.h"
 
 int main(int argc, char *argv[]) {
         _cleanup_free_ char *fn = NULL;
index a3187053c9c62993a82972ddd80f6fc33dc3b0a0..476477055af769edcc4ded4f19df568b85ae63b2 100644 (file)
 
 #include <stdio.h>
 
-#include "systemd/sd-journal.h"
+#include "sd-journal.h"
 
 #include "journal-internal.h"
-#include "util.h"
 #include "log.h"
+#include "string-util.h"
+#include "util.h"
 
 int main(int argc, char *argv[]) {
         _cleanup_journal_close_ sd_journal*j;
index c99ca0654bb732c32648855214477672428eedc9..de942c50cc82c3f614cb36fab52068d39e38d672 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "journald-syslog.h"
 #include "macro.h"
+#include "string-util.h"
 
 static void test_syslog_parse_identifier(const char* str,
                                          const char *ident, const char*pid, int ret) {
index 7d9cad2a708edbe2cc7d2ad2c6a6847ad5b0a6b0..51ee7bcce471dffa360daf3a963e64365b93db70 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-
-#include "sd-id128.h"
 #include "libudev.h"
-#include "udev-util.h"
-
-#include "virt.h"
-#include "sparse-endian.h"
-#include "siphash24.h"
+#include "sd-id128.h"
 
-#include "dhcp6-protocol.h"
 #include "dhcp-identifier.h"
+#include "dhcp6-protocol.h"
 #include "network-internal.h"
+#include "siphash24.h"
+#include "sparse-endian.h"
+#include "udev-util.h"
+#include "virt.h"
 
 #define SYSTEMD_PEN 43793
 #define HASH_KEY SD_ID128_MAKE(80,11,8c,c2,fe,4a,03,ee,3e,d6,0c,6f,36,39,14,09)
@@ -58,7 +56,6 @@ int dhcp_identifier_set_duid_en(struct duid *duid, size_t *len) {
         return 0;
 }
 
-
 int dhcp_identifier_set_iaid(int ifindex, uint8_t *mac, size_t mac_len, void *_id) {
         /* name is a pointer to memory in the udev_device struct, so must
            have the same scope */
index 95117915f46f0627c44966fa8b238135b4fa036c..2291736f8b05f6af3a9863bc925613748e1250fd 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include "sd-id128.h"
 
 #include "macro.h"
 #include "sparse-endian.h"
 #include "unaligned.h"
-#include "sd-id128.h"
 
 /* RFC 3315 section 9.1:
  *      A DUID can be no more than 128 octets long (not including the type code).
index df6f882af5a14cbf19dfdf085f216d269697da8e..a5daaa543a8ee8040cd3ea8308ebbc1e3cfcaa4f 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdint.h>
 #include <linux/if_packet.h>
-#include <net/if_arp.h>
 #include <net/ethernet.h>
-
-#include "socket-util.h"
+#include <net/if_arp.h>
+#include <stdint.h>
 
 #include "sd-dhcp-client.h"
+
 #include "dhcp-protocol.h"
+#include "socket-util.h"
 
 int dhcp_network_bind_raw_socket(int index, union sockaddr_union *link,
                                  uint32_t xid, const uint8_t *mac_addr,
index eeff74fbb9894d850657a19076768e6483ca3ac8..ecc220f2f67616805ece792197fc0fee2bfccaf9 100644 (file)
 #include <net/ethernet.h>
 #include <netinet/in.h>
 
-#include "sparse-endian.h"
 #include "sd-event.h"
+
 #include "list.h"
 #include "macro.h"
+#include "sparse-endian.h"
 
 typedef struct DHCP6Address DHCP6Address;
 
index 4012cd483b3b0aae94551e8c1cc2eca4234d07f4..70061e914f343c065263d1577ef60f1e3f0377b9 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "lldp-internal.h"
 #include "sd-lldp.h"
 
+#include "lldp-internal.h"
+
 /* We store maximum 1K chassis entries */
 #define LLDP_MIB_MAX_CHASSIS 1024
 
index 284cc6720e2db0ee5fa06ef82a2f3cb598fba0ba..5d19fa0fea3a1ded1ff71fd239470695fe8ef21d 100644 (file)
 
 #pragma once
 
-#include "log.h"
+#include "sd-event.h"
+
 #include "list.h"
 #include "lldp-tlv.h"
+#include "log.h"
 #include "prioq.h"
-#include "sd-event.h"
 
 typedef struct lldp_neighbour_port lldp_neighbour_port;
 typedef struct lldp_chassis lldp_chassis;
index faf14fe6a222431360bcb64730a35a91070e29f1..39551b576166c3d7bd451f88081a9dfe66b3af1d 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <netinet/ether.h>
-#include <linux/if.h>
 #include <arpa/inet.h>
+#include <linux/if.h>
+#include <netinet/ether.h>
 
-#include "strv.h"
-#include "siphash24.h"
+#include "sd-ndisc.h"
+
+#include "condition.h"
+#include "conf-parser.h"
 #include "dhcp-lease-internal.h"
 #include "log.h"
+#include "siphash24.h"
+#include "string-util.h"
+#include "strv.h"
 #include "utf8.h"
 #include "util.h"
-#include "conf-parser.h"
-#include "condition.h"
 #include "network-internal.h"
-#include "sd-ndisc.h"
 
 const char *net_get_name(struct udev_device *device) {
         const char *name, *field;
index 28e012afcaac021afbbcb29698247eec81cc5fe9..a6d6a176e419aed4fdd8bf31096434a3cfd4a51f 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
 #include <errno.h>
-#include <string.h>
-#include <stdio.h>
 #include <net/ethernet.h>
 #include <net/if_arp.h>
-#include <linux/if_infiniband.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <sys/ioctl.h>
+#include <linux/if_infiniband.h>
 
-#include "util.h"
-#include "random-util.h"
-#include "async.h"
+#include "sd-dhcp-client.h"
 
-#include "dhcp-protocol.h"
+#include "async.h"
+#include "dhcp-identifier.h"
 #include "dhcp-internal.h"
 #include "dhcp-lease-internal.h"
-#include "dhcp-identifier.h"
-#include "sd-dhcp-client.h"
+#include "dhcp-protocol.h"
+#include "random-util.h"
+#include "string-util.h"
+#include "util.h"
 
 #define MAX_CLIENT_ID_LEN (sizeof(uint32_t) + MAX_DUID_LEN)  /* Arbitrary limit */
 #define MAX_MAC_ADDR_LEN CONST_MAX(INFINIBAND_ALEN, ETH_ALEN)
index df3d8e6e3c7ce95d10ded41106f5f1ec31dd04e5..bc01b5b53544d1f79b67d9a2a82c12228025e33c 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
+#include <arpa/inet.h>
 #include <errno.h>
-#include <string.h>
 #include <stdio.h>
-#include <arpa/inet.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "sd-dhcp-lease.h"
 
+#include "dhcp-lease-internal.h"
+#include "dhcp-protocol.h"
+#include "dns-domain.h"
 #include "fileio.h"
-#include "unaligned.h"
-#include "in-addr-util.h"
 #include "hostname-util.h"
-#include "dns-domain.h"
+#include "in-addr-util.h"
 #include "network-internal.h"
-#include "dhcp-protocol.h"
-#include "dhcp-lease-internal.h"
-#include "sd-dhcp-lease.h"
+#include "unaligned.h"
 
 int sd_dhcp_lease_get_address(sd_dhcp_lease *lease, struct in_addr *addr) {
         assert_return(lease, -EINVAL);
index d27bb561cacbf01333b44f296de95d20ed72fed5..39afffc72c15ae6458e6c281cbe77574a134353b 100644 (file)
 
 #include <sys/ioctl.h>
 
-#include "in-addr-util.h"
-#include "siphash24.h"
-
 #include "sd-dhcp-server.h"
-#include "dhcp-server-internal.h"
+
 #include "dhcp-internal.h"
+#include "dhcp-server-internal.h"
+#include "in-addr-util.h"
+#include "siphash24.h"
+#include "string-util.h"
 
 #define DHCP_DEFAULT_LEASE_TIME_USEC USEC_PER_HOUR
 #define DHCP_MAX_LEASE_TIME_USEC (USEC_PER_HOUR*12)
index 9cd4bd30329ef6094492f1e5ba1ff95b1c999244..cb8b0713f4e20ea39d8a75b2ade50645e4d71d30 100644 (file)
 #include <sys/ioctl.h>
 #include <linux/if_infiniband.h>
 
-#include "udev.h"
-#include "udev-util.h"
-#include "util.h"
-#include "random-util.h"
-
-#include "network-internal.h"
 #include "sd-dhcp6-client.h"
-#include "dhcp6-protocol.h"
+
+#include "dhcp-identifier.h"
 #include "dhcp6-internal.h"
 #include "dhcp6-lease-internal.h"
-#include "dhcp-identifier.h"
+#include "dhcp6-protocol.h"
+#include "network-internal.h"
+#include "random-util.h"
+#include "util.h"
 
 #define MAX_MAC_ADDR_LEN INFINIBAND_ALEN
 
index 95b96bfd52836260af25b22d4558b74000c59900..ae9805bfaa47c2db1b7e6482bcc827f9fab8995b 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
+#include "sd-ipv4acd.h"
+
+#include "arp-util.h"
 #include "event-util.h"
 #include "in-addr-util.h"
 #include "list.h"
-#include "refcnt.h"
 #include "random-util.h"
+#include "refcnt.h"
 #include "siphash24.h"
 #include "util.h"
 
-#include "arp-util.h"
-#include "sd-ipv4acd.h"
-
 /* Constants from the RFC */
 #define PROBE_WAIT 1
 #define PROBE_NUM 3
index 57bd337a9af20041fb389f77880928885dd1af25..0d025768a91095705421d78d5ad4a68c2920d58f 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
+#include <arpa/inet.h>
 #include <errno.h>
-#include <string.h>
 #include <stdio.h>
-#include <arpa/inet.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "sd-ipv4acd.h"
+#include "sd-ipv4ll.h"
 
 #include "event-util.h"
 #include "in-addr-util.h"
@@ -33,9 +36,6 @@
 #include "sparse-endian.h"
 #include "util.h"
 
-#include "sd-ipv4acd.h"
-#include "sd-ipv4ll.h"
-
 #define IPV4LL_NETWORK 0xA9FE0000L
 #define IPV4LL_NETMASK 0xFFFF0000L
 
index 06949a1e8303ead8a9fe4728de3c130551b9464f..b73673c55cdba5e3e2129fa57bdf4e1cf4c4315d 100644 (file)
 
 #include <arpa/inet.h>
 
-#include "siphash24.h"
-#include "hashmap.h"
-
-#include "lldp-tlv.h"
-#include "lldp-port.h"
 #include "sd-lldp.h"
-#include "prioq.h"
+
+#include "hashmap.h"
 #include "lldp-internal.h"
+#include "lldp-port.h"
+#include "lldp-tlv.h"
 #include "lldp-util.h"
+#include "prioq.h"
+#include "siphash24.h"
+#include "string-util.h"
 
 typedef enum LLDPAgentRXState {
         LLDP_AGENT_RX_WAIT_PORT_OPERATIONAL = 4,
index a36166207285efe34d95186bc49ef629fb3af96d..ca4bb6325b481816f5d05ece166d1e7102021fde 100644 (file)
 ***/
 
 #include <netinet/icmp6.h>
+#include <netinet/in.h>
 #include <netinet/ip6.h>
-#include <string.h>
 #include <stdbool.h>
-#include <netinet/in.h>
+#include <string.h>
 #include <sys/ioctl.h>
 
+#include "sd-ndisc.h"
+
 #include "async.h"
+#include "icmp6-util.h"
 #include "list.h"
 #include "socket-util.h"
 
-#include "icmp6-util.h"
-#include "sd-ndisc.h"
-
 #define NDISC_ROUTER_SOLICITATION_INTERVAL      4 * USEC_PER_SEC
 #define NDISC_MAX_ROUTER_SOLICITATIONS          3
 
index cd5a204f8c615260c37fd00b39642adcd9782498..87e3ce4b1da53127d813051aed481262e75abdc9 100644 (file)
 
 /* See RFC 2516 */
 
-#include <sys/ioctl.h>
-#include <linux/ppp_defs.h>
-#include <linux/ppp-ioctl.h>
 #include <net/if.h>
 #include <netinet/in.h>
+#include <sys/ioctl.h>
 #include <linux/if_pppox.h>
+#include <linux/ppp-ioctl.h>
+#include <linux/ppp_defs.h>
 
 #include "sd-pppoe.h"
 
+#include "async.h"
 #include "event-util.h"
-
-#include "util.h"
 #include "random-util.h"
 #include "socket-util.h"
-#include "async.h"
+#include "string-util.h"
 #include "utf8.h"
+#include "util.h"
 
 #define PPPOE_MAX_PACKET_SIZE 1484
 #define PPPOE_MAX_PADR_RESEND 16
index c112ec813467697a55a6775dff5d0af83e7a52dd..41c817e3d3b551b8e62be7e60f2d35bde547e7d8 100644 (file)
 #include <sys/socket.h>
 #include <unistd.h>
 
-#include "util.h"
+#include "sd-dhcp-client.h"
 #include "sd-event.h"
-#include "event-util.h"
 
 #include "dhcp-identifier.h"
-#include "dhcp-protocol.h"
 #include "dhcp-internal.h"
-#include "sd-dhcp-client.h"
+#include "dhcp-protocol.h"
+#include "event-util.h"
+#include "util.h"
 
 static uint8_t mac_addr[] = {'A', 'B', 'C', '1', '2', '3'};
 
index c3bcb9cb4b0aff39fadee1bbc0131a553d36fe9a..1a5c8c460539e8e4cfb924cde8f88e23eb3f92c7 100644 (file)
 
 #include <errno.h>
 
+#include "sd-dhcp-server.h"
 #include "sd-event.h"
-#include "event-util.h"
 
-#include "sd-dhcp-server.h"
 #include "dhcp-server-internal.h"
+#include "event-util.h"
 
 static void test_pool(struct in_addr *address, unsigned size, int ret) {
         _cleanup_dhcp_server_unref_ sd_dhcp_server *server = NULL;
index 0c131a9897d80a7006e19a77b21680cc5251ffd6..fdf8d2ef898d309c2dd55c641d8c5a7d68de4bc9 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <net/ethernet.h>
 #include <stdbool.h>
 #include <stdio.h>
-#include <sys/types.h>
 #include <sys/socket.h>
+#include <sys/types.h>
 #include <unistd.h>
-#include <net/ethernet.h>
 
-#include "socket-util.h"
-#include "macro.h"
+#include "sd-dhcp6-client.h"
 #include "sd-event.h"
-#include "event-util.h"
-#include "virt.h"
 
-#include "sd-dhcp6-client.h"
-#include "dhcp6-protocol.h"
 #include "dhcp6-internal.h"
 #include "dhcp6-lease-internal.h"
+#include "dhcp6-protocol.h"
+#include "event-util.h"
+#include "macro.h"
+#include "socket-util.h"
+#include "virt.h"
 
 static struct ether_addr mac_addr = {
         .ether_addr_octet = {'A', 'B', 'C', '1', '2', '3'}
index dd2e44e7a3d4e0bff26dd939681eb89c5a470fbc..08421c3575162acc356cb567d23fc93e1e33fcc6 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
 #include <errno.h>
+#include <net/if.h>
+#include <stdlib.h>
 #include <unistd.h>
-
 #include <linux/veth.h>
-#include <net/if.h>
 
 #include "sd-event.h"
-#include "sd-netlink.h"
 #include "sd-ipv4ll.h"
+#include "sd-netlink.h"
 
-#include "util.h"
 #include "event-util.h"
-#include "netlink-util.h"
 #include "in-addr-util.h"
+#include "netlink-util.h"
+#include "string-util.h"
+#include "util.h"
 
 static void ll_handler(sd_ipv4ll *ll, int event, void *userdata) {
         _cleanup_free_ char *address = NULL;
index b67a9f17d748b6a65f93c2853f0675ce2e4fca29..3958a98a368fa999ccde065734f76a8f2a03cd1b 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
 #include <assert.h>
 #include <errno.h>
 #include <stdio.h>
-#include <sys/types.h>
+#include <stdlib.h>
 #include <sys/socket.h>
+#include <sys/types.h>
 #include <unistd.h>
 
-#include "util.h"
-#include "socket-util.h"
-#include "event-util.h"
-
 #include "sd-ipv4ll.h"
+
 #include "arp-util.h"
+#include "event-util.h"
+#include "socket-util.h"
+#include "util.h"
 
 static bool verbose = false;
 static bool extended = false;
index e57102a57601a336d93f6e65fea545259cbec7be..4e84caa4b074fce2bd61ec16f89c199fb7247e74 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <arpa/inet.h>
+#include <net/ethernet.h>
 #include <stdio.h>
 #include <string.h>
-#include <net/ethernet.h>
-#include <arpa/inet.h>
 
-#include "sd-lldp.h"
 #include "sd-event.h"
+#include "sd-lldp.h"
+
 #include "event-util.h"
-#include "macro.h"
-#include "lldp.h"
-#include "lldp-tlv.h"
 #include "lldp-network.h"
+#include "lldp-tlv.h"
+#include "lldp.h"
+#include "macro.h"
+#include "string-util.h"
 
 #define TEST_LLDP_PORT "em1"
 #define TEST_LLDP_TYPE_SYSTEM_NAME "systemd-lldp"
index 765198e46cf506103f7b82152e43130e8bb86add..44eab94e8be5cef0e425457fba2f5b0dd22ddf63 100644 (file)
 
 #include <netinet/icmp6.h>
 
-#include "socket-util.h"
+#include "sd-ndisc.h"
 
 #include "icmp6-util.h"
-#include "sd-ndisc.h"
+#include "socket-util.h"
 
 static struct ether_addr mac_addr = {
         .ether_addr_octet = {'A', 'B', 'C', '1', '2', '3'}
index aeb48bedd13cc3a5603e6a1e2c48661b397a76d1..e68207ae07e2830e14c453d149cea1f6bfbea4ae 100644 (file)
 #include <stddef.h>
 #include <errno.h>
 
-#include "strv.h"
 #include "sd-bus.h"
+
+#include "bus-bloom.h"
 #include "bus-internal.h"
 #include "bus-message.h"
-#include "bus-control.h"
-#include "bus-bloom.h"
 #include "bus-util.h"
 #include "capability.h"
+#include "string-util.h"
+#include "strv.h"
+#include "bus-control.h"
 
 _public_ int sd_bus_get_unique_name(sd_bus *bus, const char **unique) {
         int r;
index af5f7da11c0ebada9fb46dd3af097af6a6fa5e0f..0afafc2942de9031a6d9feae62b605f0624b11bc 100644 (file)
@@ -22,8 +22,9 @@
 #include "bus-internal.h"
 #include "bus-message.h"
 #include "bus-signature.h"
-#include "bus-util.h"
 #include "bus-type.h"
+#include "bus-util.h"
+#include "string-util.h"
 
 _public_ int sd_bus_emit_signal(
                 sd_bus *bus,
index 3e8cb0b7d0ded0cb1a5603f92860079a07ec01ac..92978da09c8b46d84cac5556d22c557f5321b2eb 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
 #include <linux/capability.h>
+#include <stdlib.h>
 
-#include "util.h"
-#include "formats-util.h"
-#include "process-util.h"
-#include "terminal-util.h"
-#include "capability.h"
-#include "cgroup-util.h"
-#include "fileio.h"
 #include "audit.h"
+#include "bus-creds.h"
+#include "bus-label.h"
 #include "bus-message.h"
 #include "bus-util.h"
+#include "capability.h"
+#include "cgroup-util.h"
+#include "fileio.h"
+#include "formats-util.h"
+#include "process-util.h"
+#include "string-util.h"
 #include "strv.h"
-#include "bus-creds.h"
-#include "bus-label.h"
+#include "terminal-util.h"
+#include "util.h"
 
 enum {
         CAP_OFFSET_INHERITABLE = 0,
index 8833b9c677aa0de68b80d676b82d613df54658a8..cd7fcc7c80b2d2029026868f34ea4519ce3901d8 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "util.h"
-#include "capability.h"
-#include "strv.h"
-#include "macro.h"
+#include "bus-internal.h"
+#include "bus-message.h"
+#include "bus-type.h"
 #include "cap-list.h"
+#include "capability.h"
 #include "formats-util.h"
+#include "macro.h"
+#include "string-util.h"
+#include "strv.h"
 #include "terminal-util.h"
-
-#include "bus-message.h"
-#include "bus-internal.h"
-#include "bus-type.h"
+#include "util.h"
 #include "bus-dump.h"
 
 static char *indent(unsigned level, unsigned flags) {
index 64a5a972aef719637fdf9e527eb094ae3797bdea..831ceb86b9f26abb3107c110f3235f9404df5497 100644 (file)
 ***/
 
 #include <errno.h>
-#include <stdlib.h>
 #include <stdarg.h>
 #include <stdbool.h>
-#include <string.h>
 #include <stdio.h>
-
-#include "util.h"
-#include "errno-list.h"
+#include <stdlib.h>
+#include <string.h>
 
 #include "sd-bus.h"
+
+#include "errno-list.h"
+#include "string-util.h"
+#include "util.h"
 #include "bus-error.h"
 
 BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_standard_errors[] = {
index fea796cd30483d01c7984a010f9072030fe120d1..486a8cf8de40bf8db2d4dcec50fa4e9e4e2ddc38 100644 (file)
@@ -19,8 +19,9 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "bus-message.h"
 #include "bus-internal.h"
+#include "bus-message.h"
+#include "string-util.h"
 
 bool object_path_is_valid(const char *p) {
         const char *q;
index e399701beb10006cc7b1d25061526921474deb0a..5fc0926f06f406046568ac991a3ce5a42406cc1f 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/socket.h>
 #include <pthread.h>
-
-#include "hashmap.h"
-#include "prioq.h"
-#include "list.h"
-#include "util.h"
-#include "refcnt.h"
-#include "socket-util.h"
+#include <sys/socket.h>
 
 #include "sd-bus.h"
+
 #include "bus-error.h"
-#include "bus-match.h"
 #include "bus-kernel.h"
+#include "bus-match.h"
+#include "hashmap.h"
 #include "kdbus.h"
+#include "list.h"
+#include "prioq.h"
+#include "refcnt.h"
+#include "socket-util.h"
+#include "util.h"
 
 struct reply_callback {
         sd_bus_message_handler_t callback;
index 3149a5639758f213c15057c38afd8c157cb3a4ba..7ad5474439dc35316cded2b394ee684a6021ff70 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "util.h"
-#include "bus-introspect.h"
-#include "bus-signature.h"
 #include "bus-internal.h"
 #include "bus-protocol.h"
+#include "bus-signature.h"
+#include "string-util.h"
+#include "util.h"
+#include "bus-introspect.h"
 
 int introspect_begin(struct introspect *i, bool trusted) {
         assert(i);
index 570d35c7ad41bb60f4ca41ee71653be82cdbc674..32246cbf59c453bb4beb81e0e4b2c47fa9fc2a74 100644 (file)
 #include <libgen.h>
 #undef basename
 
-#include "util.h"
-#include "strv.h"
-#include "memfd-util.h"
+#include "bus-bloom.h"
+#include "bus-internal.h"
+#include "bus-label.h"
+#include "bus-message.h"
+#include "bus-util.h"
 #include "capability.h"
 #include "fileio.h"
 #include "formats-util.h"
-
-#include "bus-internal.h"
-#include "bus-message.h"
+#include "memfd-util.h"
+#include "string-util.h"
+#include "strv.h"
+#include "util.h"
 #include "bus-kernel.h"
-#include "bus-bloom.h"
-#include "bus-util.h"
-#include "bus-label.h"
 
 #define UNIQUE_NAME_MAX (3+DECIMAL_STR_MAX(uint64_t))
 
index 7234e7926ac9e098b4e3ee2e43654cda0a644e7a..efab756ef4a79810f482b2a63c8a9dbb8d9a25f4 100644 (file)
 
 #include "bus-internal.h"
 #include "bus-message.h"
-#include "bus-match.h"
 #include "bus-util.h"
+#include "string-util.h"
 #include "strv.h"
+#include "bus-match.h"
 
 /* Example:
  *
index 53ee0463ca2527801c43ff5c43a512bb689b573b..bc85af3ec09e628c14d054f7478ff10d3b4bdcd5 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "hashmap.h"
-
 #include "sd-bus.h"
 
+#include "hashmap.h"
+
 enum bus_match_node_type {
         BUS_MATCH_ROOT,
         BUS_MATCH_VALUE,
index 72e2b9f785cacbd59119aba491556906d26b2863..0e35b3a358eac86609580be3c57e30ae99d9f971 100644 (file)
 #include <fcntl.h>
 #include <sys/mman.h>
 
-#include "util.h"
-#include "utf8.h"
-#include "strv.h"
-#include "time-util.h"
-#include "memfd-util.h"
-
 #include "sd-bus.h"
-#include "bus-message.h"
+
+#include "bus-gvariant.h"
 #include "bus-internal.h"
-#include "bus-type.h"
 #include "bus-signature.h"
-#include "bus-gvariant.h"
+#include "bus-type.h"
 #include "bus-util.h"
+#include "memfd-util.h"
+#include "string-util.h"
+#include "strv.h"
+#include "time-util.h"
+#include "utf8.h"
+#include "util.h"
+#include "bus-message.h"
 
 static int message_append_basic(sd_bus_message *m, char type, const void *p, const void **stored);
 
index ff250034618d754fd65646e5ba6f67d4aa187306..4c91dbae09b0083de2f6f3d09385a4b83fe44188 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdbool.h>
 #include <byteswap.h>
+#include <stdbool.h>
 #include <sys/socket.h>
 
-#include "macro.h"
 #include "sd-bus.h"
-#include "time-util.h"
+
 #include "bus-creds.h"
 #include "bus-protocol.h"
+#include "macro.h"
+#include "time-util.h"
 
 struct bus_container {
         char enclosing;
index 728f20447a8405bfd45900cfbde56fe88e8fbfd5..d3679800b5f70d036f32b753076445e7b92eb257 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "strv.h"
-#include "set.h"
 #include "bus-internal.h"
+#include "bus-introspect.h"
 #include "bus-message.h"
-#include "bus-type.h"
 #include "bus-signature.h"
-#include "bus-introspect.h"
-#include "bus-util.h"
 #include "bus-slot.h"
+#include "bus-type.h"
+#include "bus-util.h"
+#include "set.h"
+#include "string-util.h"
+#include "strv.h"
 #include "bus-objects.h"
 
 static int node_vtable_get_userdata(
index b149ea16daa2efc3cf271f71cdc19890d7f3223a..63f10eba2c9e52c072038ed6a0fb606a51abc490 100644 (file)
 ***/
 
 #include "sd-bus.h"
+
 #include "bus-control.h"
 #include "bus-objects.h"
+#include "string-util.h"
 #include "bus-slot.h"
 
 sd_bus_slot *bus_slot_allocate(
index d0b1e3d7dc69873c8e6a727ae9198c903df0e7b1..e4994b491f1b0ea4d0c446f2f4c5e82b0e8e6464 100644 (file)
 ***/
 
 #include <endian.h>
+#include <poll.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <poll.h>
 
+#include "sd-bus.h"
 #include "sd-daemon.h"
-#include "util.h"
+
+#include "bus-internal.h"
+#include "bus-message.h"
+#include "formats-util.h"
 #include "macro.h"
 #include "missing.h"
-#include "utf8.h"
-#include "formats-util.h"
 #include "signal-util.h"
-
-#include "sd-bus.h"
+#include "string-util.h"
+#include "utf8.h"
+#include "util.h"
 #include "bus-socket.h"
-#include "bus-internal.h"
-#include "bus-message.h"
 
 #define SNDBUF_SIZE (8*1024*1024)
 
index 581574ab73183b98344814d9cbcbe5f05ddb7bd4..ad89e6c91171067b2bbc249d5348a532e4e2201d 100644 (file)
 
 #include <stdbool.h>
 
-#include "macro.h"
 #include "sd-bus.h"
 
+#include "macro.h"
+
 bool bus_type_is_valid(char c) _const_;
 bool bus_type_is_valid_in_signature(char c) _const_;
 bool bus_type_is_basic(char c) _const_;
index abe482fc46d52af716024cade4b27a6f91541a7f..5604db971616e378f95ce3c7c7b3c195e0bc945a 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include "sd-bus.h"
+
+#include "string-util.h"
 #include "util.h"
 #include "xml.h"
-#include "sd-bus-vtable.h"
-
 #include "busctl-introspect.h"
 
 #define NODE_DEPTH_MAX 16
index a23f7257fa744e50b56223ebbdab16416e827005..2fb483171e132bc7bc0a0fb2edb7aa8b83eae928 100644 (file)
 #include <sys/mman.h>
 #include <pthread.h>
 
-#include "util.h"
-#include "macro.h"
-#include "strv.h"
-#include "missing.h"
-#include "def.h"
-#include "cgroup-util.h"
-#include "hostname-util.h"
-#include "bus-label.h"
-
 #include "sd-bus.h"
+
+#include "bus-container.h"
+#include "bus-control.h"
 #include "bus-internal.h"
-#include "bus-message.h"
-#include "bus-type.h"
-#include "bus-socket.h"
 #include "bus-kernel.h"
-#include "bus-control.h"
+#include "bus-label.h"
+#include "bus-message.h"
 #include "bus-objects.h"
-#include "bus-util.h"
-#include "bus-container.h"
 #include "bus-protocol.h"
-#include "bus-track.h"
 #include "bus-slot.h"
+#include "bus-socket.h"
+#include "bus-track.h"
+#include "bus-type.h"
+#include "bus-util.h"
+#include "cgroup-util.h"
+#include "def.h"
+#include "hostname-util.h"
+#include "macro.h"
+#include "missing.h"
+#include "string-util.h"
+#include "strv.h"
+#include "util.h"
 
 #define log_debug_bus_message(m)                                         \
         do {                                                             \
index d14110aa04e9951d3599bfeda1d145828b4245ea..4c7c58f57e3efe403c84f0ee447be3b873e0d0a1 100644 (file)
 
 #include <sys/wait.h>
 
-#include "def.h"
-#include "util.h"
-#include "time-util.h"
-
 #include "sd-bus.h"
-#include "bus-kernel.h"
+
 #include "bus-internal.h"
+#include "bus-kernel.h"
 #include "bus-util.h"
+#include "def.h"
+#include "time-util.h"
+#include "util.h"
 
 #define MAX_SIZE (2*1024*1024)
 
index 20f1b532b71c3e342c8f58806f57dcb6933f5f78..c6a81a18941d34c7272385324e259888470b0d1d 100644 (file)
 #include <unistd.h>
 #include <fcntl.h>
 
-#include "log.h"
-#include "util.h"
-#include "macro.h"
-#include "formats-util.h"
-
 #include "sd-bus.h"
+
 #include "bus-error.h"
-#include "bus-match.h"
 #include "bus-internal.h"
+#include "bus-match.h"
 #include "bus-util.h"
+#include "formats-util.h"
+#include "log.h"
+#include "macro.h"
+#include "util.h"
 
 static int match_callback(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
         log_info("Match triggered! interface=%s member=%s", strna(sd_bus_message_get_interface(m)), strna(sd_bus_message_get_member(m)));
index f58688059304e821be5be2495317eeaf9814eb9f..51aa0a9ad0e8a21a5d2660f13f78e05112b89a4b 100644 (file)
 #include <stdio.h>
 
 #include "sd-bus.h"
-#include "bus-util.h"
+
 #include "bus-internal.h"
 #include "bus-message.h"
+#include "bus-util.h"
 #include "refcnt.h"
 
 static void test_bus_new(void) {
index b078bdc5f6809c26fa82ab2166b549608a524264..f94da4cccd7340c49304338adba1499cbf765d2f 100644 (file)
 #include <glib.h>
 #endif
 
-#include "util.h"
-#include "macro.h"
 #include "sd-bus.h"
+
+#include "bus-dump.h"
 #include "bus-gvariant.h"
-#include "bus-util.h"
 #include "bus-internal.h"
 #include "bus-message.h"
-#include "bus-dump.h"
+#include "bus-util.h"
+#include "macro.h"
+#include "util.h"
 
 static void test_bus_gvariant_is_fixed_size(void) {
         assert_se(bus_gvariant_is_fixed_size("") > 0);
index f3d1099dd2d9a011815c090a1643af1e4132899f..02ccbd7260954de91b10f76495a8dc68636dfab3 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "util.h"
-#include "log.h"
-
 #include "sd-bus.h"
+
 #include "bus-kernel.h"
 #include "bus-util.h"
+#include "log.h"
+#include "util.h"
 
 static int test_match(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
         int *found = userdata;
index 6506eaab2e52e414e15735c8c21aad3de08dc465..436bc017a4f6c5020f295b524b7e2dbba4e9feb0 100644 (file)
 
 #include <fcntl.h>
 
-#include "util.h"
-#include "log.h"
-
 #include "sd-bus.h"
+
+#include "bus-dump.h"
 #include "bus-kernel.h"
 #include "bus-util.h"
-#include "bus-dump.h"
+#include "log.h"
+#include "util.h"
 
 int main(int argc, char *argv[]) {
         _cleanup_close_ int bus_ref = -1;
index ff6bba5988dec355c3ae8cd3215a5fb32f543226..b54d931c1cceb4257c94038239247548b6cd8aaf 100644 (file)
 #include <dbus/dbus.h>
 #endif
 
-#include "log.h"
-#include "util.h"
-
 #include "sd-bus.h"
-#include "bus-message.h"
-#include "bus-util.h"
+
 #include "bus-dump.h"
 #include "bus-label.h"
+#include "bus-message.h"
+#include "bus-util.h"
+#include "log.h"
+#include "util.h"
 
 static void test_bus_path_encode_unique(void) {
         _cleanup_free_ char *a = NULL, *b = NULL, *c = NULL, *d = NULL, *e = NULL;
index 0a35b750b39620bfc2eed5fa2d8f07a1dd8be70d..138db910ea4188f39d99d1e056660d7eb19b6b83 100644 (file)
 #include <stdlib.h>
 #include <pthread.h>
 
-#include "log.h"
-#include "util.h"
-#include "macro.h"
-#include "strv.h"
-
 #include "sd-bus.h"
+
+#include "bus-dump.h"
 #include "bus-internal.h"
 #include "bus-message.h"
 #include "bus-util.h"
-#include "bus-dump.h"
+#include "log.h"
+#include "macro.h"
+#include "strv.h"
+#include "util.h"
 
 struct context {
         int fds[2];
index aef768dc185fe9c05daca89be13670ce0d2e625e..ae04ff5b0d11c9758fc77526dc55f57638f8f98c 100644 (file)
 #include <fcntl.h>
 #include <stdlib.h>
 
-#include "util.h"
-#include "log.h"
-
 #include "sd-bus.h"
+
+#include "bus-dump.h"
 #include "bus-kernel.h"
 #include "bus-util.h"
-#include "bus-dump.h"
+#include "log.h"
+#include "util.h"
 
 typedef struct {
         const char *sender;
index 080d8eddb76ddc2fa4c939c13050cf6a5a3eefa7..5bf2c1ecf85354700fa4a58a99d713670f9d2594 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
 #include <pthread.h>
-
-#include "log.h"
-#include "util.h"
-#include "macro.h"
+#include <stdlib.h>
 
 #include "sd-bus.h"
+
 #include "bus-internal.h"
 #include "bus-util.h"
+#include "log.h"
+#include "macro.h"
+#include "util.h"
 
 struct context {
         int fds[2];
index 17c6188ca01cee5e565ed22ac3f09fca379f3774..92a810a7d8d52d0f33fc2301b712a3c493629dfb 100644 (file)
@@ -19,7 +19,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-
+#include "string-util.h"
 #include "log.h"
 #include "bus-signature.h"
 #include "bus-internal.h"
index 2d062fc9b5009eb61ee96360ea8be68ecf059c1a..42c95240d45989bc519e09f9a36b20368770c93d 100644 (file)
 
 #include <sys/mman.h>
 
-#include "util.h"
-#include "log.h"
-#include "memfd-util.h"
-
 #include "sd-bus.h"
-#include "bus-message.h"
-#include "bus-kernel.h"
+
 #include "bus-dump.h"
+#include "bus-kernel.h"
+#include "bus-message.h"
+#include "log.h"
+#include "memfd-util.h"
+#include "string-util.h"
+#include "util.h"
 
 #define FIRST_ARRAY 17
 #define SECOND_ARRAY 33
index ae534ba5b9420b3b8ddde060fff6341842234e57..bae37e803493b7a55718153c59edbd22c6fcb59c 100644 (file)
 #include <sys/un.h>
 #include <unistd.h>
 
+#include "sd-daemon.h"
+
 #include "path-util.h"
 #include "socket-util.h"
 #include "strv.h"
 #include "util.h"
 
-#include "sd-daemon.h"
-
 static void unsetenv_all(bool unset_environment) {
 
         if (!unset_environment)
index 45a4d12eb72c4060a09392d06913417856c0fc61..9379209a583abc87d3acefb4ee742cc3842dd264 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "util.h"
-#include "prioq.h"
-#include "strv.h"
-#include "set.h"
-
 #include "sd-device.h"
 
-#include "device-util.h"
 #include "device-enumerator-private.h"
+#include "device-util.h"
+#include "prioq.h"
+#include "set.h"
+#include "string-util.h"
+#include "strv.h"
+#include "util.h"
 
 #define DEVICE_ENUMERATE_MAX_DEPTH 256
 
index b5215cb9b5001c98d10e880db7bb766a633fb989..f6263121b64522d5f05df7b54b2be28015ae895e 100644 (file)
 ***/
 
 #include <ctype.h>
-#include <sys/types.h>
 #include <net/if.h>
-
-#include "util.h"
-#include "macro.h"
-#include "refcnt.h"
-#include "path-util.h"
-#include "strxcpyx.h"
-#include "fileio.h"
-#include "hashmap.h"
-#include "set.h"
-#include "strv.h"
-#include "mkdir.h"
+#include <sys/types.h>
 
 #include "sd-device.h"
 
-#include "device-util.h"
 #include "device-internal.h"
 #include "device-private.h"
+#include "device-util.h"
+#include "fileio.h"
+#include "hashmap.h"
+#include "macro.h"
+#include "mkdir.h"
+#include "path-util.h"
+#include "refcnt.h"
+#include "set.h"
+#include "string-util.h"
+#include "strv.h"
+#include "strxcpyx.h"
+#include "util.h"
 
 int device_add_property(sd_device *device, const char *key, const char *value) {
         int r;
index 49a7b66a2b1a02e96b3b6e5e69c34330322b2aab..d1f34efc2d6bce605465941610addc6380049e7a 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <inttypes.h>
+#include <stdbool.h>
+#include <sys/types.h>
+
+#include "sd-device.h"
+
 int device_new_from_nulstr(sd_device **ret, uint8_t *nulstr, size_t len);
 int device_new_from_strv(sd_device **ret, char **strv);
 
index e46546ed91e17d6338452588f1b33e4b0086d31f..ca42b4318e214060948c1188b0ea9b71786e5314 100644 (file)
 ***/
 
 #include <ctype.h>
-#include <sys/types.h>
 #include <net/if.h>
+#include <sys/types.h>
 
-#include "util.h"
-#include "macro.h"
-#include "path-util.h"
-#include "strxcpyx.h"
+#include "sd-device.h"
+
+#include "device-internal.h"
+#include "device-private.h"
+#include "device-util.h"
 #include "fileio.h"
 #include "hashmap.h"
+#include "macro.h"
+#include "path-util.h"
 #include "set.h"
+#include "string-util.h"
 #include "strv.h"
-
-#include "sd-device.h"
-
-#include "device-util.h"
-#include "device-private.h"
-#include "device-internal.h"
+#include "strxcpyx.h"
+#include "util.h"
 
 int device_new_aux(sd_device **ret) {
         _cleanup_device_unref_ sd_device *device = NULL;
index e7cad9be46e35bd8d207b3f4eefd1162afc9a6da..ae020340a590a240606769ee3eca92a0285aa1b6 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "util.h"
 #include "sd-event.h"
 
+#include "util.h"
+
 DEFINE_TRIVIAL_CLEANUP_FUNC(sd_event*, sd_event_unref);
 DEFINE_TRIVIAL_CLEANUP_FUNC(sd_event_source*, sd_event_source_unref);
 
index 1905ebfc731007aa70f6479add9ad51e5393a389..cab35e185e699c9edb550f336893fbc0d82be0b6 100644 (file)
 #include <sys/timerfd.h>
 #include <sys/wait.h>
 
-#include "sd-id128.h"
 #include "sd-daemon.h"
-#include "macro.h"
-#include "prioq.h"
+#include "sd-event.h"
+#include "sd-id128.h"
+
 #include "hashmap.h"
-#include "util.h"
-#include "time-util.h"
+#include "list.h"
+#include "macro.h"
 #include "missing.h"
+#include "prioq.h"
 #include "set.h"
-#include "list.h"
 #include "signal-util.h"
-
-#include "sd-event.h"
+#include "string-util.h"
+#include "time-util.h"
+#include "util.h"
 
 #define DEFAULT_ACCURACY_USEC (250 * USEC_PER_MSEC)
 
index ee020a29428ec9664d9091e9b3836230a660b95f..d366c6fa417944a0228ca4a489a229d057bc84e2 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "util.h"
-
 #include "sd-hwdb.h"
 
+#include "util.h"
+
 DEFINE_TRIVIAL_CLEANUP_FUNC(sd_hwdb*, sd_hwdb_unref);
 #define _cleanup_hwdb_unref_ _cleanup_(sd_hwdb_unrefp)
 
index f0316be659e83de953cb4362590633fb7bc356c9..4932c191993cfedadb2f418987c3f9fb36df8e28 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
 #include <errno.h>
-#include <string.h>
+#include <fnmatch.h>
 #include <inttypes.h>
+#include <stdio.h>
 #include <stdlib.h>
-#include <fnmatch.h>
+#include <string.h>
 #include <sys/mman.h>
 
 #include "sd-hwdb.h"
 
 #include "hashmap.h"
-#include "refcnt.h"
-
-#include "hwdb-util.h"
 #include "hwdb-internal.h"
+#include "hwdb-util.h"
+#include "refcnt.h"
+#include "string-util.h"
 
 struct sd_hwdb {
         RefCount n_ref;
index eb539ad318fdee7c8fa37123d7809c91d62225b0..a6dbc413ac7bab9d0e33a9a7cb9ba30eb530309e 100644 (file)
 #include <fcntl.h>
 #include <unistd.h>
 
-#include "util.h"
-#include "macro.h"
 #include "sd-id128.h"
+
+#include "macro.h"
 #include "random-util.h"
+#include "util.h"
 
 _public_ char *sd_id128_to_string(sd_id128_t id, char s[SD_ID128_STRING_MAX]) {
         unsigned n;
index db1fae2ebfa821f5bed3c274e0e0489b6d92b452..28f935aa66ad63a0589cb89cfc3e088d23eb0b6c 100644 (file)
@@ -25,6 +25,8 @@
 #include <sys/inotify.h>
 #include <unistd.h>
 
+#include "sd-login.h"
+
 #include "cgroup-util.h"
 #include "escape.h"
 #include "fileio.h"
@@ -32,9 +34,9 @@
 #include "hostname-util.h"
 #include "login-util.h"
 #include "macro.h"
+#include "string-util.h"
 #include "strv.h"
 #include "util.h"
-#include "sd-login.h"
 
 /* Error codes:
  *
index f734ce9eee5d9524e72daf6effd4e75a37fd5c01..014323321e8ab4247b63d2f76efc3dc21aa31523 100644 (file)
 #include <poll.h>
 #include <string.h>
 
-#include "systemd/sd-login.h"
+#include "sd-login.h"
 
-#include "util.h"
-#include "strv.h"
 #include "formats-util.h"
+#include "string-util.h"
+#include "strv.h"
+#include "util.h"
 
 static void test_login(void) {
         _cleanup_close_pair_ int pair[2] = { -1, -1 };
index b9cb80668dd8036a6a13dcba77201cb6aee45476..8519a4d523a848932c728439b4f67b479df6a260 100644 (file)
 
 #include <linux/netlink.h>
 
-#include "refcnt.h"
-#include "prioq.h"
-#include "list.h"
-
 #include "sd-netlink.h"
 
+#include "list.h"
 #include "netlink-types.h"
+#include "prioq.h"
+#include "refcnt.h"
 
 #define RTNL_DEFAULT_TIMEOUT ((usec_t) (25 * USEC_PER_SEC))
 
index cf693de5fbf3cb68779df2652fcb5fbe9148d6b5..80ad70cfeeec8cc19aa71c560a2ea5e75c4359a5 100644 (file)
 #include <stdbool.h>
 #include <unistd.h>
 
-#include "util.h"
-#include "socket-util.h"
+#include "sd-netlink.h"
+
 #include "formats-util.h"
-#include "refcnt.h"
 #include "missing.h"
-
-#include "sd-netlink.h"
-#include "netlink-util.h"
 #include "netlink-internal.h"
 #include "netlink-types.h"
+#include "netlink-util.h"
+#include "refcnt.h"
+#include "socket-util.h"
+#include "util.h"
 
 #define GET_CONTAINER(m, i) ((i) < (m)->n_containers ? (struct rtattr*)((uint8_t*)(m)->hdr + (m)->containers[i].offset) : NULL)
 #define PUSH_CONTAINER(m, new) (m)->container_offsets[(m)->n_containers ++] = (uint8_t*)(new) - (uint8_t*)(m)->hdr;
index e1b14c3ed2bb4a41b5cd28cd80efa2101d23abd5..68a4d3c0d1ca62b33bf9933f11e612e67119b4f3 100644 (file)
 #include <stdbool.h>
 #include <unistd.h>
 
-#include "util.h"
-#include "socket-util.h"
+#include "sd-netlink.h"
+
 #include "formats-util.h"
-#include "refcnt.h"
 #include "missing.h"
-
-#include "sd-netlink.h"
-#include "netlink-util.h"
 #include "netlink-internal.h"
 #include "netlink-types.h"
+#include "netlink-util.h"
+#include "refcnt.h"
+#include "socket-util.h"
+#include "util.h"
 
 int socket_open(int family) {
         int fd;
index 482ff6b1c2e4303d5eeced85b2fef8bc5913b4b3..6f9fd2993b1bd6a257a2d26200f45fac86665913 100644 (file)
@@ -19,7 +19,6 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-
 #include "sd-netlink.h"
 
 #include "netlink-util.h"
index 9df0aa28bfbe2d70e354c46e90254c96dc71dd4c..acc6c15ff312e41a679fc6f264ae99de60259e42 100644 (file)
@@ -21,9 +21,9 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include "sd-netlink.h"
 
 #include "util.h"
-#include "sd-netlink.h"
 
 int rtnl_message_new_synthetic_error(int error, uint32_t serial, sd_netlink_message **ret);
 uint32_t rtnl_message_get_serial(sd_netlink_message *m);
index 03049bd31f6db4e0235ebd5974cbf78de3b0243a..7cccb9b1d550532fea535b24e8bcffdd52c8ad20 100644 (file)
 #include <stdbool.h>
 #include <unistd.h>
 
-#include "util.h"
-#include "socket-util.h"
+#include "sd-netlink.h"
+
 #include "formats-util.h"
-#include "refcnt.h"
 #include "missing.h"
-
-#include "sd-netlink.h"
-#include "netlink-util.h"
 #include "netlink-internal.h"
 #include "netlink-types.h"
+#include "netlink-util.h"
+#include "refcnt.h"
+#include "socket-util.h"
+#include "util.h"
 
 int sd_rtnl_message_route_set_dst_prefixlen(sd_netlink_message *m, unsigned char prefixlen) {
         struct rtmsg *rtm;
index 5af28600bafacb9b74339fdb097e22b92a405cf1..2adc4499b6376d79ce30b9bf24826356e3b7a1ee 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/socket.h>
 #include <poll.h>
-
-#include "missing.h"
-#include "macro.h"
-#include "util.h"
-#include "hashmap.h"
+#include <sys/socket.h>
 
 #include "sd-netlink.h"
+
+#include "hashmap.h"
+#include "macro.h"
+#include "missing.h"
 #include "netlink-internal.h"
 #include "netlink-util.h"
+#include "util.h"
 
 static int sd_netlink_new(sd_netlink **ret) {
         _cleanup_netlink_unref_ sd_netlink *rtnl = NULL;
index c9cb415ca04265f379a87ebde2bf884070ebcc24..419a28725f3e8ce18b13d6d34792203b9f5fbc7b 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <netinet/ether.h>
 #include <net/if.h>
+#include <netinet/ether.h>
 
-#include "util.h"
-#include "macro.h"
 #include "sd-netlink.h"
-#include "socket-util.h"
-#include "netlink-util.h"
+
 #include "event-util.h"
+#include "macro.h"
 #include "missing.h"
+#include "netlink-util.h"
+#include "socket-util.h"
+#include "string-util.h"
+#include "util.h"
 
 static void test_message_link_bridge(sd_netlink *rtnl) {
         _cleanup_netlink_message_unref_ sd_netlink_message *message = NULL;
index 87d87359b857180cc40403952d40eb3e82e1af23..d330712aaf10b392c91e0a7e9e3431514bbc8c60 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <string.h>
 #include <errno.h>
-#include <sys/inotify.h>
 #include <poll.h>
+#include <string.h>
+#include <sys/inotify.h>
 
-#include "util.h"
+#include "sd-network.h"
+
+#include "fileio.h"
 #include "macro.h"
+#include "string-util.h"
 #include "strv.h"
-#include "fileio.h"
-#include "sd-network.h"
+#include "util.h"
 
 _public_ int sd_network_get_operational_state(char **state) {
         _cleanup_free_ char *s = NULL;
index 7363be27949c26c840df2c5dc144bf18c69eb7fe..927b6f8b2d667fce76e1888739b8ce841a9f540d 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "util.h"
+#include "sd-path.h"
+
 #include "architecture.h"
+#include "missing.h"
 #include "path-util.h"
+#include "string-util.h"
 #include "strv.h"
-#include "sd-path.h"
-#include "missing.h"
+#include "util.h"
 
 static int from_environment(const char *envname, const char *fallback, const char **ret) {
         assert(ret);
index 019cdaffe149573e699eeb5305c48565836d60f7..51a8a8af83ab837c92b63300296d2efead734adb 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "util.h"
 #include "sd-resolve.h"
 
+#include "util.h"
+
 DEFINE_TRIVIAL_CLEANUP_FUNC(sd_resolve*, sd_resolve_unref);
 DEFINE_TRIVIAL_CLEANUP_FUNC(sd_resolve_query*, sd_resolve_query_unref);
 
index 888b372c994841807d351577e4639f2e26387034..024ad9ead14675da0764cc149e2fb312ff42c16a 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <signal.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
 #include <errno.h>
+#include <poll.h>
+#include <pthread.h>
 #include <resolv.h>
+#include <signal.h>
 #include <stdint.h>
-#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <sys/prctl.h>
-#include <poll.h>
+#include <unistd.h>
+
+#include "sd-resolve.h"
 
-#include "util.h"
 #include "list.h"
-#include "socket-util.h"
 #include "missing.h"
 #include "resolve-util.h"
-#include "sd-resolve.h"
+#include "socket-util.h"
+#include "util.h"
 
 #define WORKERS_MIN 1U
 #define WORKERS_MAX 16U
index e8056529f54665513565a30c9a5e56723f443570..87e6e4704181d397ad479830559440be8b83b778 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <string.h>
-#include <sys/socket.h>
 #include <arpa/inet.h>
-#include <stdio.h>
+#include <errno.h>
 #include <netinet/in.h>
 #include <resolv.h>
-#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/socket.h>
 
-#include "socket-util.h"
 #include "sd-resolve.h"
-#include "resolve-util.h"
+
 #include "macro.h"
+#include "resolve-util.h"
+#include "socket-util.h"
+#include "string-util.h"
 
 static int getaddrinfo_handler(sd_resolve_query *q, int ret, const struct addrinfo *ai, void *userdata) {
         const struct addrinfo *i;
index 6f2aa6064c9a19afb5fb4bbabd227bad56d4acf6..381397cc5208905904935a5c316a1e92874ace71 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include "sd-utf8.h"
+
 #include "util.h"
 #include "utf8.h"
-#include "sd-utf8.h"
 
 _public_ const char *sd_utf8_is_valid(const char *s) {
         assert_return(s, NULL);
index aa36b8cb1229915a52acd353a13771c850cd4d8a..40d59201cf327b5e29d4df06689d4e2ce85be0ca 100644 (file)
 #pragma once
 
 #include "libudev.h"
-#include "libudev-private.h"
 #include "sd-device.h"
 
+#include "libudev-private.h"
+
 /**
  * udev_device:
  *
index 4b9c053b54e842991331f3e9f24253fc4dfd77e5..2d3e62410c5724a3e2684bf890912c577dbfcbf7 100644 (file)
 ***/
 
 #include "libudev.h"
-#include "libudev-private.h"
-#include "libudev-device-internal.h"
 
 #include "device-private.h"
+#include "libudev-device-internal.h"
+#include "libudev-private.h"
 
 int udev_device_tag_index(struct udev_device *udev_device, struct udev_device *udev_device_old, bool add) {
         sd_device *device_old = NULL;
index 9a8d6821073ca8b04b7d2c1e32e694e7aa010297..1e513f3ff7596eabb415c993ac4e7c9961d73423 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <stdbool.h>
-#include <errno.h>
-#include <string.h>
+#include <ctype.h>
 #include <dirent.h>
+#include <errno.h>
 #include <fcntl.h>
-#include <ctype.h>
+#include <linux/sockios.h>
 #include <net/if.h>
-#include <sys/stat.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
-#include <linux/sockios.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
+#include "libudev.h"
 #include "sd-device.h"
-#include "device-util.h"
-#include "device-private.h"
 
-#include "libudev.h"
-#include "libudev-private.h"
+#include "device-private.h"
+#include "device-util.h"
 #include "libudev-device-internal.h"
+#include "libudev-private.h"
 
 /**
  * SECTION:libudev-device
index df088946df119b61cb630398fa3c11a20e1e8eb9..56436772b07de724b722ed99caf97fe265506516 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <errno.h>
-#include <string.h>
 #include <dirent.h>
+#include <errno.h>
 #include <fnmatch.h>
 #include <stdbool.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <sys/stat.h>
 
 #include "libudev.h"
-#include "libudev-device-internal.h"
 #include "sd-device.h"
-#include "device-util.h"
-#include "device-enumerator-private.h"
 
+#include "device-enumerator-private.h"
+#include "device-util.h"
+#include "libudev-device-internal.h"
 
 /**
  * SECTION:libudev-enumerate
index 98951fb85b907aaeac22c131a9e10e1169241ced..6dc2b0533ee16a6ab237c66d8d3d52211e985465 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "libudev-private.h"
 #include "sd-hwdb.h"
+
 #include "hwdb-util.h"
+#include "libudev-private.h"
 
 /**
  * SECTION:libudev-hwdb
index 282aa2b0d9b040baef7642e005d4e0ccfbb58302..00472fedc9a499037f794faa04110e8f19f07d53 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <errno.h>
+#include <linux/filter.h>
+#include <linux/netlink.h>
+#include <poll.h>
+#include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <errno.h>
 #include <string.h>
-#include <poll.h>
 #include <sys/socket.h>
-#include <linux/netlink.h>
-#include <linux/filter.h>
+#include <unistd.h>
 
 #include "libudev.h"
+
+#include "formats-util.h"
 #include "libudev-private.h"
-#include "socket-util.h"
 #include "missing.h"
-#include "formats-util.h"
+#include "socket-util.h"
+#include "string-util.h"
 
 /**
  * SECTION:libudev-monitor
index c1785bf4c24ab5b6522daf269400f038e8ee6d9a..5f504962919582cf926fbb2c6a1c8af899a11314 100644 (file)
 #include <stdbool.h>
 
 #include "libudev.h"
+
 #include "macro.h"
-#include "util.h"
 #include "mkdir.h"
 #include "strxcpyx.h"
+#include "util.h"
 
 #define READ_END  0
 #define WRITE_END 1
index 4408bb59f6356f672cb1e8b59349c2bf1a256fd6..a614230df43c4ff5c77d3918d768b3aef4059b7c 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
-#include <stddef.h>
-#include <unistd.h>
+#include <ctype.h>
 #include <errno.h>
+#include <stddef.h>
+#include <stdlib.h>
 #include <string.h>
-#include <ctype.h>
+#include <unistd.h>
 
-#include "device-nodes.h"
 #include "libudev.h"
+
+#include "MurmurHash2.h"
+#include "device-nodes.h"
 #include "libudev-private.h"
 #include "utf8.h"
-#include "MurmurHash2.h"
 
 /**
  * SECTION:libudev-util
index ec15d2576b71e27a67ffb508f85a485e22dc631d..00605d01260f2715310cb6b754ef51be5ac9ce94 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <ctype.h>
+#include <stdarg.h>
+#include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <stddef.h>
-#include <stdarg.h>
 #include <string.h>
-#include <ctype.h>
 
 #include "libudev.h"
+
 #include "libudev-private.h"
 #include "missing.h"
+#include "string-util.h"
 
 /**
  * SECTION:libudev
index c325c7bc0cfc75d0c789838fa08bad618c250a4b..1acdc5aa22c43c7cb479e84c6754a2566c4c3661 100644 (file)
@@ -26,6 +26,7 @@
 #include "escape.h"
 #include "formats-util.h"
 #include "set.h"
+#include "string-util.h"
 #include "udev-util.h"
 #include "util.h"
 #include "logind-acl.h"
index ec09843a787fc20818a7284e61f01093ec022e49..93e9ed02eb6db461c5168059bbe3af6eab39482c 100644 (file)
@@ -23,7 +23,8 @@
 
 #include <sys/types.h>
 #include <stdbool.h>
-#include <libudev.h>
+
+#include "libudev.h"
 
 #ifdef HAVE_ACL
 
index ff98065371c5c996caf199eb19d67ade4cb72561..e9b424b5f64b949bb93bea032af863b8c76e02c7 100644 (file)
@@ -36,6 +36,7 @@ typedef enum HandleAction {
 } HandleAction;
 
 #include "logind.h"
+#include "logind-inhibit.h"
 
 int manager_handle_action(
                 Manager *m,
index f40e35a8cbbf60ffec2eb369fd7f3b24ddca6e7b..caa844e6014f4501bdb911d146826c5ea8e855f9 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <string.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <string.h>
 #include <sys/ioctl.h>
 #include <unistd.h>
 #include <linux/input.h>
 
 #include "sd-messages.h"
+
+#include "string-util.h"
 #include "util.h"
 #include "logind-button.h"
 
index 7c7dd3ecb219a39baac54b4fc7b96e85dea047da..5b247f48d6a456b4f9cddabc940a44beb242a318 100644 (file)
@@ -28,6 +28,7 @@
 #include "fileio.h"
 #include "formats-util.h"
 #include "mkdir.h"
+#include "string-util.h"
 #include "util.h"
 #include "logind-inhibit.h"
 
index 8d13a63688180d7b029cab930e272259a4e9e64d..757993a9531509dae7a0e9cb5da88d7167e2eaa7 100644 (file)
 ***/
 
 #include <errno.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
+#include <unistd.h>
 
 #include "sd-messages.h"
-#include "logind-seat.h"
+
+#include "formats-util.h"
 #include "logind-acl.h"
-#include "util.h"
 #include "mkdir.h"
-#include "formats-util.h"
+#include "string-util.h"
 #include "terminal-util.h"
+#include "util.h"
+#include "logind-seat.h"
 
 Seat *seat_new(Manager *m, const char *id) {
         Seat *s;
index 656f268dba4eae34440005ec6a870359e7fb2608..d4d9052d10c874358da9e7dd692692eaed696043 100644 (file)
 ***/
 
 #include <fcntl.h>
-#include <libudev.h>
 #include <linux/input.h>
 #include <string.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
 
+#include "libudev.h"
+
 #include "util.h"
 #include "missing.h"
 #include "bus-util.h"
index 8ac2aceb9b37b540d49a21db09aee093fb465428..6ce7e1fd78f5d0d3fd55261961affd5c7730260d 100644 (file)
 ***/
 
 #include <errno.h>
-#include <libudev.h>
 #include <fcntl.h>
 #include <string.h>
 #include <unistd.h>
 
+#include "libudev.h"
 #include "sd-daemon.h"
-#include "strv.h"
-#include "conf-parser.h"
-#include "bus-util.h"
+
 #include "bus-error.h"
-#include "udev-util.h"
+#include "bus-util.h"
+#include "conf-parser.h"
 #include "formats-util.h"
 #include "signal-util.h"
+#include "strv.h"
+#include "udev-util.h"
 #include "logind.h"
 
 static void manager_free(Manager *m);
index 7990da5a93db95255d7856f97e84a6b381630c8f..44e05d8b01a6412bf2f9c20e5f0b5b5608360a5e 100644 (file)
 ***/
 
 #include <stdbool.h>
-#include <libudev.h>
 
-#include "sd-event.h"
+#include "libudev.h"
 #include "sd-bus.h"
-#include "list.h"
+#include "sd-event.h"
+
 #include "hashmap.h"
+#include "list.h"
 #include "set.h"
 
 typedef struct Manager Manager;
 
+#include "logind-action.h"
+#include "logind-button.h"
 #include "logind-device.h"
 #include "logind-inhibit.h"
-#include "logind-button.h"
-#include "logind-action.h"
 
 struct Manager {
         sd_event *event;
index f38f06baf9dec578b42dbd298f52e7dd91c23f0d..32e53c0a11c1fc7d941df6baf9fd73d245de813a 100644 (file)
 
 #include <errno.h>
 #include <string.h>
-#include <libudev.h>
 
-#include "util.h"
-#include "sysfs-show.h"
+#include "libudev.h"
+
 #include "path-util.h"
-#include "udev-util.h"
+#include "string-util.h"
+#include "sysfs-show.h"
 #include "terminal-util.h"
+#include "udev-util.h"
+#include "util.h"
 
 static int show_sysfs_one(
                 struct udev *udev,
index 03516de916b02bd57afc9673bef0d7e463aa9bdc..f231e54cde885fca469d94861b8ef3b8d4ca2daf 100644 (file)
 
 #include <unistd.h>
 
-#include "macro.h"
-#include "util.h"
 #include "sd-bus.h"
+
 #include "bus-util.h"
+#include "macro.h"
+#include "util.h"
 
 static int inhibit(sd_bus *bus, const char *what) {
         _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
index b3e59bf9987c5c3c91b6e7946101ac168d15e93b..dac7a29ed193da0c39d2c7c925d1247341a73339 100644 (file)
 
 #include <stdbool.h>
 
-#include "list.h"
-#include "hashmap.h"
-#include "sd-event.h"
 #include "sd-bus.h"
+#include "sd-event.h"
+
+#include "hashmap.h"
+#include "list.h"
 
 typedef struct Manager Manager;
 
index b0a3add3e7d648d665e04b4d6d08940cc804b19a..4a58ce10823c529b80a92cb0787f8a28761baecc 100644 (file)
 
 #include <errno.h>
 #include <getopt.h>
+#include <libkmod.h>
 #include <limits.h>
 #include <string.h>
 #include <sys/stat.h>
-#include <libkmod.h>
 
 #include "conf-files.h"
 #include "log.h"
+#include "string-util.h"
 #include "strv.h"
 #include "util.h"
 
index c78b9444b6a7dba701aedeb04df629f50e76e26f..acb6b7ce240d11d805cf8729db655b203cb08c0c 100644 (file)
@@ -37,6 +37,7 @@
 #include "netlink-util.h"
 #include "pager.h"
 #include "socket-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "terminal-util.h"
 #include "util.h"
index b3450c1456644d433b34041988142a84b7491ac1..08e0b9a64b64d47ef16f0b5120e4f7d74827b319 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "networkd.h"
 #include "networkd-address-pool.h"
+#include "networkd.h"
 #include "set.h"
+#include "string-util.h"
 
 int address_pool_new(
                 Manager *m,
index 5d443e9b9bea3e55ebc062c9063d186483e64234..dcd7b482d38e765c152f29f8bb3c6fac88a5e121 100644 (file)
 #include "conf-parser.h"
 #include "firewall-util.h"
 #include "netlink-util.h"
+#include "networkd.h"
 #include "set.h"
+#include "string-util.h"
 #include "utf8.h"
 #include "util.h"
-
-#include "networkd.h"
 #include "networkd-address.h"
 
 int address_new(Address **ret) {
index 57c81cb6467518b00a0345e9df3b2ba08318af70..623359def62c9d6b5ba5c2d5900acfe8fa074641 100644 (file)
 #include <netinet/ether.h>
 #include <linux/if.h>
 
-#include "networkd-link.h"
-#include "network-internal.h"
-
 #include "sd-dhcp6-client.h"
 
+#include "network-internal.h"
+#include "networkd-link.h"
+
 static int dhcp6_lease_address_acquired(sd_dhcp6_client *client, Link *link);
 
 static int dhcp6_lease_information_acquired(sd_dhcp6_client *client,
index 5c92df4ca8d0221111404e184fb52cf481f01a72..2a69f1c16b665515d1b09cc2f1aa315082f14639 100644 (file)
 
 #include "sd-dhcp-client.h"
 #include "sd-dhcp-server.h"
-#include "sd-ipv4ll.h"
-#include "sd-ndisc.h"
 #include "sd-dhcp6-client.h"
+#include "sd-ipv4ll.h"
 #include "sd-lldp.h"
+#include "sd-ndisc.h"
 
 typedef struct Link Link;
 
index e0e1679edeedf0691af34ea54cc88c810f62f3ce..23d3aac694114f23b6ee371dd31431441e386a4f 100644 (file)
 #include <sys/socket.h>
 #include <linux/if.h>
 
-#include "sd-netlink.h"
 #include "sd-daemon.h"
+#include "sd-netlink.h"
 
-#include "conf-parser.h"
-#include "path-util.h"
-#include "libudev-private.h"
-#include "udev-util.h"
-#include "netlink-util.h"
 #include "bus-util.h"
+#include "conf-parser.h"
 #include "def.h"
-#include "virt.h"
-#include "set.h"
+#include "libudev-private.h"
 #include "local-addresses.h"
-
+#include "netlink-util.h"
 #include "networkd.h"
+#include "path-util.h"
+#include "set.h"
+#include "udev-util.h"
+#include "virt.h"
 
 /* use 8 MB for receive socket kernel queue. */
 #define RCVBUF_SIZE    (8*1024*1024)
index 637c29973e8346765f94721ec755c226c549db8d..33e692f97f736fd8bec2213548c0be8775c7aa7d 100644 (file)
 #include <netinet/ether.h>
 #include <linux/if.h>
 
-#include "networkd-link.h"
-
 #include "sd-ndisc.h"
 
+#include "networkd-link.h"
+
 static void ndisc_router_handler(sd_ndisc *nd, int event, void *userdata) {
         Link *link = userdata;
 
index bcaba57937a8dbb8ed3728fa1d0dc7555115e4d4..f66c88c35e7db6c89cff7da5588e63b047144b92 100644 (file)
 #include <netinet/ether.h>
 #include <linux/if_bonding.h>
 
-#include "conf-parser.h"
 #include "sd-netlink.h"
-#include "networkd-netdev-bond.h"
+
+#include "conf-parser.h"
 #include "missing.h"
+#include "string-util.h"
+#include "networkd-netdev-bond.h"
 
 /*
  * Number of seconds between instances where the bonding
index c9b7fa96e27977913ffa80fcb6470d70ec2674e4..bbc46062581d8c62aa18866ae00378753ff65fac 100644 (file)
 #include <linux/ip6_tunnel.h>
 
 #include "sd-netlink.h"
-#include "networkd-netdev-tunnel.h"
+
+#include "conf-parser.h"
+#include "missing.h"
 #include "networkd-link.h"
+#include "string-util.h"
 #include "util.h"
-#include "missing.h"
-#include "conf-parser.h"
+#include "networkd-netdev-tunnel.h"
 
 #define DEFAULT_TNL_HOP_LIMIT   64
 #define IP6_FLOWINFO_FLOWLABEL  htonl(0x000FFFFF)
index 3d4865a780b98f435c33125ff98277a55e39fc8f..d9ccc19d3d0cfcdf178bde996e593affc1aa186e 100644 (file)
 #include "conf-files.h"
 #include "conf-parser.h"
 #include "list.h"
-#include "siphash24.h"
 #include "netlink-util.h"
 #include "network-internal.h"
-
 #include "networkd.h"
+#include "siphash24.h"
+#include "string-util.h"
 #include "networkd-netdev.h"
 
 const NetDevVTable * const netdev_vtable[_NETDEV_KIND_MAX] = {
index 5717a153273ef21061981e29836be563ba679a92..2199b93baae96dd2d9c0e60720f308ae12d05129 100644 (file)
@@ -19,9 +19,9 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "strv.h"
-
 #include "networkd.h"
+#include "string-util.h"
+#include "strv.h"
 
 static int property_get_ether_addrs(
                 sd_bus *bus,
index 97ada568665e2145224c08ad0bebffbb67500e64..9f9a6911e3248e7913278fad43275bb58fa9a0b2 100644 (file)
 
 #include "conf-files.h"
 #include "conf-parser.h"
-#include "util.h"
-#include "hostname-util.h"
 #include "dns-domain.h"
+#include "hostname-util.h"
 #include "network-internal.h"
-
 #include "networkd.h"
+#include "string-util.h"
+#include "util.h"
 #include "networkd-network.h"
 
 static int network_load_one(Manager *manager, const char *filename) {
index aa4ec230abcf4593b5ad5b08c07352f82a097231..fcca6790936d194fd3febbb39716308c655a0019 100644 (file)
@@ -22,9 +22,9 @@
 #include "conf-parser.h"
 #include "in-addr-util.h"
 #include "netlink-util.h"
-#include "util.h"
-
 #include "networkd.h"
+#include "string-util.h"
+#include "util.h"
 #include "networkd-route.h"
 
 int route_new(Route **ret) {
index dde6b327ed927d9f67fbd55d263da48b7f24a671..4e4a4bbd5885a54e34d76994b50991b54674237c 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "util.h"
 #include "conf-parser.h"
-
 #include "networkd-util.h"
+#include "string-util.h"
+#include "util.h"
 
 const char *address_family_boolean_to_string(AddressFamilyBoolean b) {
         if (b == ADDRESS_FAMILY_YES ||
index cacb4c257e5440379dfcb5ba1b1b7f51d5a5b768..cc4b46d5b07a190e03a44aab8abbe87caf0a0630 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-
 #include "sd-network.h"
 
 #include "networkd-wait-online-link.h"
+#include "string-util.h"
 
 int link_new(Manager *m, Link **ret, int ifindex, const char *ifname) {
         _cleanup_(link_freep) Link *l = NULL;
index 805ea1a6277663d5badc6a09c80c34fb3170f9ed..288e0a43166866a600f6031204d75a96105c329f 100644 (file)
@@ -30,6 +30,7 @@
 #include "env-util.h"
 #include "formats-util.h"
 #include "log.h"
+#include "string-util.h"
 #include "strv.h"
 #include "util.h"
 
index c0e9ccd7a44596e530d8010917540401c1f0873e..9e1f58f730fbfd9c9bb5311f52b22435c5f9d962 100644 (file)
 
 #include <sys/mount.h>
 
-#include "util.h"
-#include "strv.h"
-#include "mkdir.h"
-#include "fileio.h"
 #include "cgroup-util.h"
-
+#include "fileio.h"
+#include "mkdir.h"
+#include "string-util.h"
+#include "strv.h"
+#include "util.h"
 #include "nspawn-cgroup.h"
 
 int chown_cgroup(pid_t pid, uid_t uid_shift) {
index 3658f45381b4dce6f621e03c05fc482c092a75e5..1081a38c580a776cb4406b441f471a13a1634ce8 100644 (file)
 
 #include "sd-netlink.h"
 
-#include "util.h"
-#include "in-addr-util.h"
 #include "firewall-util.h"
+#include "in-addr-util.h"
 #include "local-addresses.h"
 #include "netlink-util.h"
-
+#include "string-util.h"
+#include "util.h"
 #include "nspawn-expose-ports.h"
 
 int expose_port_parse(ExposePort **l, const char *s) {
index 02de2541c485125cdffb1fae7536f2c72f3f16b5..25457fd62d6ceec9e30fb0f6e54ca521e92984f9 100644 (file)
@@ -19,8 +19,8 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <linux/magic.h>
 #include <sys/mount.h>
+#include <linux/magic.h>
 
 #include "cgroup-util.h"
 #include "escape.h"
@@ -29,9 +29,9 @@
 #include "path-util.h"
 #include "rm-rf.h"
 #include "set.h"
+#include "string-util.h"
 #include "strv.h"
 #include "util.h"
-
 #include "nspawn-mount.h"
 
 CustomMount* custom_mount_add(CustomMount **l, unsigned *n, CustomMountType t) {
index 74abe5379a5d1d2d1d3a8f83091efb7ed07765a4..4af18a4e94e2bbf762392a2ad729e18a09a0748c 100644 (file)
 #include <linux/veth.h>
 #include <net/if.h>
 
+#include "libudev.h"
 #include "sd-id128.h"
 #include "sd-netlink.h"
-#include "libudev.h"
 
-#include "util.h"
 #include "ether-addr-util.h"
-#include "siphash24.h"
 #include "netlink-util.h"
+#include "siphash24.h"
+#include "string-util.h"
 #include "udev-util.h"
-
+#include "util.h"
 #include "nspawn-network.h"
 
 #define HOST_HASH_KEY SD_ID128_MAKE(1a,37,6f,c7,46,ec,45,0b,ad,a3,d5,31,06,60,5d,b1)
index eda7f62900ab75e83e75798bcd5fca02f7a09537..b6d18574e868d38d443563c3ff51fcdb551e5376 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <grp.h>
 #include <sys/types.h>
 #include <unistd.h>
-#include <grp.h>
 
-#include "util.h"
-#include "signal-util.h"
 #include "mkdir.h"
 #include "process-util.h"
-
+#include "signal-util.h"
+#include "string-util.h"
+#include "util.h"
 #include "nspawn-setuid.h"
 
 static int spawn_getent(const char *database, const char *key, pid_t *rpid) {
index 1a2e4b184b4fc1eb3a2571f89edadc055fe851a8..8ef6cfd731d7776891dbbd7416bd0cd47552c7c7 100644 (file)
 #include "missing.h"
 #include "mkdir.h"
 #include "netlink-util.h"
+#include "nspawn-cgroup.h"
+#include "nspawn-expose-ports.h"
+#include "nspawn-mount.h"
+#include "nspawn-network.h"
+#include "nspawn-register.h"
+#include "nspawn-settings.h"
+#include "nspawn-setuid.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "ptyfwd.h"
 #include "seccomp-util.h"
 #endif
 #include "signal-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "terminal-util.h"
 #include "udev-util.h"
 #include "util.h"
 
-#include "nspawn-cgroup.h"
-#include "nspawn-expose-ports.h"
-#include "nspawn-mount.h"
-#include "nspawn-network.h"
-#include "nspawn-register.h"
-#include "nspawn-settings.h"
-#include "nspawn-setuid.h"
-
 typedef enum ContainerStatus {
         CONTAINER_TERMINATED,
         CONTAINER_REBOOTED
index 0dca8914479b1e7532e2db608c133ec55a90863e..009a9ad886e70f858f8bf3479004a4c1877c9bd0 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <nss.h>
-#include <netdb.h>
 #include <errno.h>
-#include <string.h>
 #include <net/if.h>
+#include <netdb.h>
+#include <nss.h>
 #include <stdlib.h>
+#include <string.h>
 
+#include "hostname-util.h"
 #include "local-addresses.h"
 #include "macro.h"
 #include "nss-util.h"
-#include "hostname-util.h"
+#include "string-util.h"
 #include "util.h"
 
 /* We use 127.0.0.2 as IPv4 address. This has the advantage over
index 604130ed250551497dbdb72e03be99c558603e47..d05a32290b97b93d5f78792b7d0db0e03261ea1b 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <nss.h>
 #include <netdb.h>
+#include <nss.h>
 
 #include "sd-bus.h"
 #include "sd-login.h"
-#include "macro.h"
-#include "util.h"
-#include "nss-util.h"
-#include "bus-util.h"
+
 #include "bus-common-errors.h"
-#include "in-addr-util.h"
+#include "bus-util.h"
 #include "hostname-util.h"
+#include "in-addr-util.h"
+#include "macro.h"
+#include "nss-util.h"
+#include "string-util.h"
+#include "util.h"
 
 NSS_GETHOSTBYNAME_PROTOTYPES(mymachines);
 NSS_GETPW_PROTOTYPES(mymachines);
index ef5eb7b4cfeef8def9085741616f6976d331b588..ed59a71e3d3acd810d8288c9179b81f5fbd5fa99 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <nss.h>
-#include <netdb.h>
+#include <dlfcn.h>
 #include <errno.h>
-#include <string.h>
+#include <netdb.h>
+#include <nss.h>
 #include <stdlib.h>
-#include <dlfcn.h>
+#include <string.h>
 
 #include "sd-bus.h"
-#include "bus-util.h"
+
 #include "bus-common-errors.h"
+#include "bus-util.h"
+#include "in-addr-util.h"
 #include "macro.h"
 #include "nss-util.h"
+#include "string-util.h"
 #include "util.h"
-#include "in-addr-util.h"
 
 NSS_GETHOSTBYNAME_PROTOTYPES(resolve);
 NSS_GETHOSTBYADDR_PROTOTYPES(resolve);
index 73b7bd2c01c485c2779879bde648ccc918fed4ea..97e8323de13f0a9c1e7667febc69d8cea9089307 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "log.h"
 #include "macro.h"
+#include "string-util.h"
 #include "util.h"
 
 static const char *arg_suffix = NULL;
index cf6a2394029d3e7272967c645243c0a92aa35345..a2a035f4f1e92eb5f658d8f69d9d07a72015a0df 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
-#include <stdbool.h>
 #include <errno.h>
-#include <unistd.h>
+#include <stdbool.h>
+#include <stdio.h>
 #include <sys/prctl.h>
+#include <unistd.h>
 
-#include "util.h"
 #include "process-util.h"
 #include "signal-util.h"
+#include "string-util.h"
+#include "util.h"
 
 static bool arg_skip = false;
 static bool arg_force = false;
index f4778fc16a7d04e938da87478baedf46a1935e63..a21a0fb916ce035e15a25a7a63aa237fefcc6686 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <unistd.h>
-#include <fcntl.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <string.h>
 #include <sys/stat.h>
+#include <unistd.h>
 
 #include "log.h"
-#include "util.h"
 #include "mkdir.h"
+#include "string-util.h"
+#include "util.h"
 
 #define POOL_SIZE_MIN 512
 
index d4e6ba4bf91a297171df17e2532514415e5f4399..1007de395948acc47a6471834b78ce3e962aeceb 100644 (file)
@@ -25,8 +25,9 @@
 #include <unistd.h>
 
 #include "log.h"
-#include "util.h"
 #include "mkdir.h"
+#include "string-util.h"
+#include "util.h"
 
 #ifndef RC_LOCAL_SCRIPT_PATH_START
 #define RC_LOCAL_SCRIPT_PATH_START "/etc/rc.d/rc.local"
index 534cf729b9de373f23c420e1ecc3139a17790cee..61deafe7285f1325083b9a5d2592aa1e0c3c341a 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/socket.h>
-#include <string.h>
 #include <errno.h>
-#include <sys/un.h>
 #include <stddef.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/un.h>
 
 #include "log.h"
 #include "macro.h"
+#include "string-util.h"
 #include "util.h"
 
 static int send_on_socket(int fd, const char *socket_name, const void *packet, size_t size) {
index cc8d5fa76a2cd0cd261cae75b8028a6adeb031c5..aca0d891c6b0bc5ae1ada1d9c04596607acd03e4 100644 (file)
@@ -20,7 +20,7 @@
  ***/
 
 #include "conf-parser.h"
-
+#include "string-util.h"
 #include "resolved-conf.h"
 
 int manager_parse_dns_server(Manager *m, DnsServerType type, const char *string) {
index 89b9b0e1ea034fcd90844b13f98197648d81ca57..e1a2865007a15c44ab9c3e00f4b80bca094e36ee 100644 (file)
@@ -19,8 +19,9 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "resolved-dns-answer.h"
 #include "dns-domain.h"
+#include "resolved-dns-answer.h"
+#include "string-util.h"
 
 DnsAnswer *dns_answer_new(unsigned n) {
         DnsAnswer *a;
index 2bc8cc16397ad2d1f4c0c76ca76e849381dea344..c8f591d00545c8595ed32161be662f1e07c5abff 100644 (file)
 
 #include <math.h>
 
-#include "strv.h"
-
 #include "dns-domain.h"
-#include "resolved-dns-rr.h"
-#include "resolved-dns-packet.h"
 #include "dns-type.h"
+#include "resolved-dns-packet.h"
+#include "string-util.h"
+#include "strv.h"
+#include "resolved-dns-rr.h"
 
 DnsResourceKey* dns_resource_key_new(uint16_t class, uint16_t type, const char *name) {
         DnsResourceKey *k;
index 8a59bd1c3ceb056a62a577d67e32092bd1a55f74..8a6086a4de88789528bff0404837346ee9171218 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "list.h"
-
-#include "resolved-dns-zone.h"
 #include "dns-domain.h"
+#include "list.h"
 #include "resolved-dns-packet.h"
+#include "resolved-dns-zone.h"
+#include "string-util.h"
 
 /* Never allow more than 1K entries */
 #define ZONE_MAX 1024
index b9fd8e3dbcdba47f8d89365358398e652c1b4447..43a3b61b08a8ee5ffd6b9d4dd5d0dd239bc83b5d 100644 (file)
 #include <net/if.h>
 
 #include "sd-network.h"
-#include "strv.h"
+
 #include "missing.h"
 #include "resolved-link.h"
+#include "string-util.h"
+#include "strv.h"
 
 int link_new(Manager *m, Link **ret, int ifindex) {
         _cleanup_(link_freep) Link *l = NULL;
index de924e3ed95e3cb9591c946d6fc33db6c5ee92b7..b410e40308010caca87ecf9930c54dfbe865769f 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
  ***/
 
+#include <netinet/in.h>
+#include <poll.h>
 #include <resolv.h>
 #include <sys/ioctl.h>
-#include <poll.h>
-#include <netinet/in.h>
 
-#include "netlink-util.h"
-#include "network-internal.h"
-#include "socket-util.h"
 #include "af-list.h"
-#include "utf8.h"
+#include "dns-domain.h"
 #include "fileio-label.h"
+#include "hostname-util.h"
+#include "netlink-util.h"
+#include "network-internal.h"
 #include "ordered-set.h"
 #include "random-util.h"
-#include "hostname-util.h"
-
-#include "dns-domain.h"
-#include "resolved-conf.h"
 #include "resolved-bus.h"
-#include "resolved-manager.h"
+#include "resolved-conf.h"
 #include "resolved-llmnr.h"
+#include "resolved-manager.h"
+#include "socket-util.h"
+#include "string-util.h"
+#include "utf8.h"
 
 #define SEND_TIMEOUT_USEC (200 * USEC_PER_MSEC)
 
index d66f71772e391dd2e232e667b68c2f68d291b6f0..ece778b8efc2593c5eb1a4a9942807a6f1b5dde5 100644 (file)
@@ -28,6 +28,7 @@
 #include "escape.h"
 #include "fileio.h"
 #include "mkdir.h"
+#include "string-util.h"
 #include "udev-util.h"
 #include "util.h"
 
index bd8c9887515d79ec817751ca50fda6db6cbbdbd9..47295ae3795b1be9b9ac8604eeb21b99fd40ad38 100644 (file)
 #include <errno.h>
 #include <stdbool.h>
 
-#include "acl-util.h"
-#include "util.h"
+#include "string-util.h"
 #include "strv.h"
+#include "util.h"
+#include "acl-util.h"
 
 int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry) {
         acl_entry_t i;
index 8e72e7a36a7e3adb3887b56dad4a8c8a53de6e1a..e5efcd77b6601bc68668576323d170f5be138e39 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <sys/utsname.h>
 
+#include "string-util.h"
 #include "architecture.h"
 
 int uname_architecture(void) {
index ddf42f11e1f526ab3e97fb5e6e0e35ca3259a0bb..4bf87576f2230e3b140f4e50f6bda7993d0e4ff5 100644 (file)
@@ -38,6 +38,7 @@
 #include "random-util.h"
 #include "signal-util.h"
 #include "socket-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "terminal-util.h"
 #include "util.h"
index 48492ed13d2d459c3e71435b1c6a70db637483c8..f2796c6d64d890086eabc3689b1a684470ee9424 100644 (file)
 ***/
 
 #include <errno.h>
-#include <sys/stat.h>
 #include <stdlib.h>
+#include <sys/stat.h>
 #include <unistd.h>
 
-#include "base-filesystem.h"
 #include "log.h"
 #include "macro.h"
+#include "string-util.h"
 #include "util.h"
+#include "base-filesystem.h"
 
 typedef struct BaseFilesystem {
         const char *dir;
index 13af8bfcce1f0ac6741acdd2c3fc544a817f8d3f..bc7788475180bed9776380900e4c8f9dcdd70d1c 100644 (file)
 #include "path-util.h"
 #include "set.h"
 #include "signal-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "unit-name.h"
 #include "utf8.h"
 #include "util.h"
-
 #include "bus-util.h"
 
 static int name_owner_change_callback(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
index fd70842b9ed41638741d5b5d14cbe028e7167b0d..3925c10fde4d8df3a29d141d7a87553007d2ae7d 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "sd-event.h"
 #include "sd-bus.h"
+#include "sd-event.h"
+
 #include "hashmap.h"
 #include "install.h"
+#include "string-util.h"
 #include "time-util.h"
 
 typedef enum BusTransport {
index 31b4f6c684a9d7fa82aab08e4f3858e85f04d081..57b7aeb228216b990ef1c32284f680402059c8fe 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
-#include <string.h>
 #include <dirent.h>
 #include <errno.h>
+#include <stdio.h>
+#include <string.h>
 
-#include "util.h"
+#include "cgroup-util.h"
 #include "formats-util.h"
-#include "process-util.h"
 #include "macro.h"
 #include "path-util.h"
-#include "cgroup-util.h"
-#include "cgroup-show.h"
+#include "process-util.h"
+#include "string-util.h"
 #include "terminal-util.h"
+#include "util.h"
+#include "cgroup-show.h"
 
 static int compare(const void *a, const void *b) {
         const pid_t *p = a, *q = b;
index d1cdb151b20fd112fcca7feab2d0410a2044199b..baf4bc0b871a2c46657d5c49e410b3ed92bebbb8 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <dirent.h>
+#include <fcntl.h>
+#include <mqueue.h>
 #include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/sem.h>
 #include <sys/msg.h>
+#include <sys/sem.h>
+#include <sys/shm.h>
 #include <sys/stat.h>
-#include <fcntl.h>
-#include <dirent.h>
-#include <mqueue.h>
 
-#include "util.h"
 #include "formats-util.h"
+#include "string-util.h"
 #include "strv.h"
+#include "util.h"
 #include "clean-ipc.h"
 
 static int clean_sysvipc_shm(uid_t delete_uid) {
index 6987cf71207cac95e1301f2c54839edf06e6ae62..255643654233b590adc9e868b977dbaea6fca016 100644 (file)
@@ -37,6 +37,7 @@
 #include "path-util.h"
 #include "selinux-util.h"
 #include "smack-util.h"
+#include "string-util.h"
 #include "util.h"
 #include "virt.h"
 #include "condition.h"
index c282fb1231bab04953ec4a90304b79f074dab07e..3f2e34c2e31aa5a1bdeb41b28942ba8e6765d1ea 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <string.h>
-#include <stdio.h>
 #include <errno.h>
+#include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include "sd-messages.h"
+
 #include "conf-files.h"
-#include "util.h"
-#include "macro.h"
-#include "strv.h"
 #include "log.h"
-#include "utf8.h"
+#include "macro.h"
 #include "path-util.h"
 #include "signal-util.h"
+#include "string-util.h"
+#include "strv.h"
+#include "utf8.h"
+#include "util.h"
 #include "conf-parser.h"
 
 int config_item_table_lookup(
index 5680f01bd91ded78a632c107645458685d905077..d4df9d2acbaeff724530d6906e7d8451b354803d 100644 (file)
@@ -24,6 +24,7 @@
 #include <stringprep.h>
 #endif
 
+#include "string-util.h"
 #include "dns-domain.h"
 
 int dns_label_unescape(const char **name, char *dest, size_t sz) {
index 5e0436a55d807bcb7c71bab90b7a51d8001bb08e..52ea8086fee6dd9da95ad954d734f73d8ea4cb18 100644 (file)
@@ -23,6 +23,7 @@
 #include "escape.h"
 #include "fileio-label.h"
 #include "mkdir.h"
+#include "string-util.h"
 #include "strv.h"
 #include "util.h"
 #include "dropin.h"
index c065adcfdfa5468a7907f72391d8cfdb82d1138f..bdfc13e3cd08bd4c4dd8cda446595d9b5760318d 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "fstab-util.h"
 #include "path-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "util.h"
+#include "fstab-util.h"
 
 bool fstab_is_mount_point(const char *mount) {
         _cleanup_endmntent_ FILE *f = NULL;
index 264a54fb9432e04f02e688a30369a69a98fe0e85..b52b9623fa205406ce39e47068a20f62f09845de 100644 (file)
@@ -28,6 +28,7 @@
 #include "mkdir.h"
 #include "path-util.h"
 #include "special.h"
+#include "string-util.h"
 #include "unit-name.h"
 #include "util.h"
 #include "generator.h"
index 56388d5dd60b699893286d03eaecbcfd8f30a25d..c4c66c847d503ac0de4fbd253d1636e53edd75d2 100644 (file)
@@ -20,6 +20,7 @@
 ***/
 
 #include "btrfs-util.h"
+#include "string-util.h"
 #include "util.h"
 #include "import-util.h"
 
index 238433c808074570c849eb85d11e193d2979f476..5368623b74c5a429fe35a9bdc47ff7d45b038540 100644 (file)
 
 #include <errno.h>
 #include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
 #include <fnmatch.h>
+#include <string.h>
+#include <unistd.h>
 
-#include "util.h"
-#include "mkdir.h"
+#include "conf-files.h"
+#include "conf-parser.h"
 #include "hashmap.h"
-#include "set.h"
-#include "path-util.h"
+#include "install-printf.h"
+#include "mkdir.h"
 #include "path-lookup.h"
+#include "path-util.h"
+#include "set.h"
+#include "special.h"
+#include "string-util.h"
 #include "strv.h"
 #include "unit-name.h"
+#include "util.h"
 #include "install.h"
-#include "conf-parser.h"
-#include "conf-files.h"
-#include "install-printf.h"
-#include "special.h"
 
 typedef struct {
         OrderedHashmap *will_install;
index dbc07aa7ad93b2896e8b78771e857ff3b32ab295..cb4a0d2172bf46a6b9d068f45ecef8571a605ac7 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <time.h>
 #include <errno.h>
-#include <sys/socket.h>
-#include <string.h>
 #include <fcntl.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <time.h>
 
-#include "logs-show.h"
-#include "log.h"
-#include "util.h"
-#include "utf8.h"
+#include "formats-util.h"
 #include "hashmap.h"
+#include "hostname-util.h"
 #include "journal-internal.h"
-#include "formats-util.h"
+#include "log.h"
 #include "process-util.h"
+#include "string-util.h"
 #include "terminal-util.h"
-#include "hostname-util.h"
+#include "utf8.h"
+#include "util.h"
+#include "logs-show.h"
 
-/* up to three lines (each up to 100 characters),
-   or 300 characters, whichever is less */
+/* up to three lines (each up to 100 characters) or 300 characters, whichever is less */
 #define PRINT_LINE_THRESHOLD 3
 #define PRINT_CHAR_THRESHOLD 300
 
index 8ed3ad7f44a3c05dacbf5d085cd77c573a96d8e2..8261d8709192fec845fec9bf589914c60c4bb5a1 100644 (file)
@@ -28,9 +28,9 @@
 #include "mkdir.h"
 #include "path-util.h"
 #include "rm-rf.h"
+#include "string-util.h"
 #include "strv.h"
 #include "utf8.h"
-
 #include "machine-image.h"
 
 static const char image_search_path[] =
index 1da7d0815f48dd2b6bee36d7bc3a5a495549e3f7..597680ef5f33a020cda1597411c3533ca17febbf 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <sys/mount.h>
 #include <sys/prctl.h>
-#include <sys/vfs.h>
 #include <sys/statvfs.h>
-#include <sys/mount.h>
+#include <sys/vfs.h>
 
-#include "util.h"
-#include "process-util.h"
+#include "btrfs-util.h"
 #include "lockfile-util.h"
 #include "mkdir.h"
-#include "btrfs-util.h"
 #include "path-util.h"
+#include "process-util.h"
 #include "signal-util.h"
+#include "string-util.h"
+#include "util.h"
 #include "machine-pool.h"
 
 #define VAR_LIB_MACHINES_SIZE_START (1024UL*1024UL*500UL)
index d8f0fb404db354640be51faaa7c45b7aacffb0a7..b82b5263096a38fd535914a761bec2ca8587e168 100644 (file)
 
 #include <fcntl.h>
 #include <stdlib.h>
-#include <unistd.h>
 #include <string.h>
 #include <sys/prctl.h>
+#include <unistd.h>
 
-#include "pager.h"
-#include "util.h"
-#include "process-util.h"
+#include "copy.h"
 #include "macro.h"
-#include "terminal-util.h"
+#include "process-util.h"
 #include "signal-util.h"
-#include "copy.h"
+#include "string-util.h"
+#include "terminal-util.h"
+#include "util.h"
+#include "pager.h"
 
 static pid_t pager_pid = 0;
 
index 897dc9065f93245400194bee01b9ce818024433b..1e63c7204745dad8adae5210b85a64e265bc3741 100644 (file)
@@ -27,8 +27,9 @@
 #include "util.h"
 #include "strv.h"
 #include "path-util.h"
-#include "path-lookup.h"
 #include "install.h"
+#include "string-util.h"
+#include "path-lookup.h"
 
 int user_config_home(char **config_home) {
         const char *e;
index d73a74912e385385c8ad808cb61a0835a380d9f8..c518cf83ec4084a6885c5e3fe07336d0efcd5e08 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <seccomp.h>
 
+#include "string-util.h"
 #include "util.h"
 #include "seccomp-util.h"
 
index 3dedbd1f6269db89a72569a466b9ce7a4296300d..e69300b1db88e3a5e27cb77135f2ff431e3c35c9 100644 (file)
 #include <stdio.h>
 
 #include "conf-parser.h"
-#include "sleep-config.h"
 #include "fileio.h"
 #include "log.h"
+#include "string-util.h"
 #include "strv.h"
 #include "util.h"
+#include "sleep-config.h"
 
 #define USE(x, y) do{ (x) = (y); (y) = NULL; } while(0)
 
index 85bd477f2dedc174dcbd7defc6f5bbfec70319a2..610aec0df5bdcdcfa889bd54d82ba70104c21af1 100644 (file)
 #include <string.h>
 #include <sys/utsname.h>
 
+#include "hostname-util.h"
 #include "macro.h"
+#include "string-util.h"
 #include "util.h"
-#include "hostname-util.h"
 #include "specifier.h"
 
 /*
index b12189cd10c7a195f98de5e0eaea9d4599f119fe..205a2e144954f01856d2db6fbec3ad605de5aea3 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/stat.h>
-#include <stdbool.h>
 #include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
 #include <string.h>
 #include <sys/mount.h>
+#include <sys/stat.h>
 #include <unistd.h>
-#include <fcntl.h>
 
-#include "util.h"
-#include "path-util.h"
-#include "mkdir.h"
-#include "rm-rf.h"
 #include "base-filesystem.h"
 #include "missing.h"
+#include "mkdir.h"
+#include "path-util.h"
+#include "rm-rf.h"
+#include "string-util.h"
+#include "util.h"
 #include "switch-root.h"
 
 int switch_root(const char *new_root, const char *oldroot, bool detach_oldroot,  unsigned long mountflags) {
index b2cab948efb22c97033e6b540db9321f479be700..21cb82ea1cc45bc1800802987b0e4f09dd70b1ed 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "fileio.h"
 #include "log.h"
+#include "string-util.h"
 #include "util.h"
 #include "sysctl-util.h"
 
index 63f1e4ca6fdb02775e23691fe70de1d896ab0cdb..235f10d1a6ef436c1ea3e63822950fed88ee0ed7 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <utmpx.h>
 #include <errno.h>
+#include <fcntl.h>
+#include <poll.h>
 #include <string.h>
 #include <sys/utsname.h>
-#include <fcntl.h>
 #include <unistd.h>
-#include <poll.h>
+#include <utmpx.h>
 
+#include "hostname-util.h"
 #include "macro.h"
 #include "path-util.h"
+#include "string-util.h"
 #include "terminal-util.h"
-#include "hostname-util.h"
 #include "utmp-wtmp.h"
 
 int utmp_get_runlevel(int *runlevel, int *previous) {
index 1ba66eb9981078111bab166271f195749b7701c8..b92b77c381996d308a09deed8f1ee215058ad387 100644 (file)
@@ -30,6 +30,7 @@
 #include "fileio.h"
 #include "log.h"
 #include "sleep-config.h"
+#include "string-util.h"
 #include "strv.h"
 #include "util.h"
 
index 73c04fdfc089932fa8d74cf4186c0a0fc245d32d..521dbb2840d5da9c4d16dd972538c38702e83265 100644 (file)
@@ -38,6 +38,7 @@
 #include "path-util.h"
 #include "set.h"
 #include "socket-util.h"
+#include "string-util.h"
 #include "util.h"
 
 #define BUFFER_SIZE (256 * 1024)
index ee34209a30ff99c46915a532e21714302a8d1e9e..e247264a8385a4813210097dc6d4be1bb4c907e4 100644 (file)
@@ -32,6 +32,7 @@
 #include "hashmap.h"
 #include "log.h"
 #include "path-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "sysctl-util.h"
 #include "util.h"
index 00045150f61b30c333c1c13da2e563911357b861..794aa1a0c7fcb6f1a6b04e1e57b2aea295689170 100644 (file)
@@ -23,6 +23,7 @@
 #include <unistd.h>
 
 #include "log.h"
+#include "string-util.h"
 #include "util.h"
 
 /*
index 90c35ef3f6aef593d11020dcabfdd9d5ebfa1036..e95d758815315378cdce5ad5876816200b4ebbbf 100644 (file)
@@ -23,6 +23,7 @@
 ***/
 
 #include <net/ethernet.h>
+#include <stdbool.h>
 
 #include "sd-event.h"
 
index 30d9dedf2c5c22d5088ee50885e116136807a15d..e9abdf349f028244f46dc1f1dfa0a3f69493b4cc 100644 (file)
@@ -22,6 +22,8 @@
 
 #pragma once
 
+#include <net/ethernet.h>
+
 #include "sd-event.h"
 
 enum {
index 238b1086b255b8111d0deac02467d2f895ba16d6..4c88f28e289304e2341ee768716dc1935ffdb18b 100644 (file)
 #include "hashmap.h"
 #include "path-util.h"
 #include "selinux-util.h"
+#include "smack-util.h"
 #include "specifier.h"
+#include "string-util.h"
 #include "strv.h"
 #include "uid-range.h"
 #include "utf8.h"
 #include "util.h"
-#include "smack-util.h"
 
 typedef enum ItemType {
         ADD_USER = 'u',
index 964750076add59afc06b3ace8d310726b03105f8..4d1ecaff40ccf971ff2d768b2b257f7b018d67fe 100644 (file)
 #include <stdio.h>
 #include <unistd.h>
 
-#include "util.h"
+#include "hashmap.h"
+#include "install.h"
+#include "log.h"
 #include "mkdir.h"
-#include "strv.h"
-#include "path-util.h"
 #include "path-lookup.h"
-#include "log.h"
-#include "unit-name.h"
-#include "special.h"
-#include "hashmap.h"
+#include "path-util.h"
 #include "set.h"
-#include "install.h"
+#include "special.h"
+#include "string-util.h"
+#include "strv.h"
+#include "unit-name.h"
+#include "util.h"
 
 typedef enum RunlevelType {
         RUNLEVEL_UP,
index d69104f54009d573e97df12dfa5e48f01c31e2c1..aeaa0929b16648b7abc1e5e8044cd8581890e8ba 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/socket.h>
 #include <string.h>
+#include <sys/socket.h>
 
 #include "macro.h"
+#include "string-util.h"
 #include "util.h"
 
 static const struct af_name* lookup_af(register const char *str, register unsigned int len);
 
+#include "af-from-name.h"
 #include "af-list.h"
 #include "af-to-name.h"
-#include "af-from-name.h"
 
 int main(int argc, const char *argv[]) {
 
@@ -45,4 +46,4 @@ int main(int argc, const char *argv[]) {
         assert_se(af_from_name("huddlduddl") == AF_UNSPEC);
 
         return 0;
-}
\ No newline at end of file
+}
index d7c8eaa4a9e55461994b9bb0f8f07d145d55e922..f3989ad201ac42b132cbd68c9ed894a54d83249c 100644 (file)
 #include <string.h>
 
 #include "macro.h"
+#include "string-util.h"
 #include "util.h"
 
 static const struct arphrd_name* lookup_arphrd(register const char *str, register unsigned int len);
 
+#include "arphrd-from-name.h"
 #include "arphrd-list.h"
 #include "arphrd-to-name.h"
-#include "arphrd-from-name.h"
 
 int main(int argc, const char *argv[]) {
 
@@ -45,4 +46,4 @@ int main(int argc, const char *argv[]) {
         assert_se(arphrd_from_name("huddlduddl") == 0);
 
         return 0;
-}
\ No newline at end of file
+}
index 60d1258a9b44d4583e03038d4060866b85fb19cc..b772e319636af924462e1db6dc4f0bebb8b9d81d 100644 (file)
@@ -25,6 +25,7 @@
 #include "fileio.h"
 #include "util.h"
 #include "btrfs-util.h"
+#include "string-util.h"
 
 int main(int argc, char *argv[]) {
         BtrfsQuotaInfo quota;
index ad36ef19b0e80d67d1e8af19b881a9977b8d0692..12f366a34c8bd3441f82590188820b112efa3115 100644 (file)
@@ -22,6 +22,7 @@
 #include <string.h>
 
 #include "calendarspec.h"
+#include "string-util.h"
 #include "util.h"
 
 static void test_one(const char *input, const char *output) {
index 4ecf09a29e0df0712da8f438001dbcae1c68b3aa..267dda651d8ed9bf520befb9ce842a21faf3766f 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-
 #include "util.h"
 #include "cgroup-util.h"
 #include "test-helper.h"
 #include "formats-util.h"
 #include "process-util.h"
+#include "string-util.h"
 
 static void check_p_d_u(const char *path, int code, const char *result) {
         _cleanup_free_ char *unit = NULL;
index 37b1c3554aa1116839a6df77e914278ee7b7a694..c20a29ba1f83ff7d671d5a0e8379891b2ef99949 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <unistd.h>
 #include <string.h>
+#include <unistd.h>
 
 #include "cgroup-util.h"
 #include "path-util.h"
+#include "string-util.h"
 #include "util.h"
 
 int main(int argc, char*argv[]) {
index b788c9532d97e4a1a84f7a9d6daf5e9adee3ea13..91a27138eb26c453a0c63285179b4aa106af7c3f 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "condition.h"
-#include "macro.h"
-#include "util.h"
-#include "log.h"
-#include "architecture.h"
 #include "sd-id128.h"
-#include "selinux-util.h"
+
+#include "apparmor-util.h"
+#include "architecture.h"
 #include "audit.h"
+#include "condition.h"
+#include "hostname-util.h"
 #include "ima-util.h"
-#include "apparmor-util.h"
+#include "log.h"
+#include "macro.h"
+#include "selinux-util.h"
 #include "smack-util.h"
-#include "hostname-util.h"
+#include "util.h"
 
 static void test_condition_test_path(void) {
         Condition *condition;
index 01ece022c12667d7e4b6f658a0f38fba1495f1bb..30ba5364c449e83b62fc8c1b4411df5ecfdea7a2 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
 #include <stdarg.h>
+#include <stdio.h>
 
 #include "conf-files.h"
 #include "macro.h"
+#include "rm-rf.h"
+#include "string-util.h"
 #include "strv.h"
 #include "util.h"
-#include "rm-rf.h"
 
 static void setup_test_dir(char *tmp_dir, const char *files, ...) {
         va_list ap;
index 463906d3046ea1c779fa1c19bd4f1ea87249f714..b3a4c403394fedfdf1e3e6e7f6456aa1dd6e67e1 100644 (file)
 ***/
 
 #include "conf-parser.h"
+#include "log.h"
 #include "macro.h"
-#include "util.h"
+#include "string-util.h"
 #include "strv.h"
-#include "log.h"
+#include "util.h"
 
 static void test_config_parse_path_one(const char *rvalue, const char *expected) {
         char *path = NULL;
index a03a68bd43778353cdd52580b4813f9a536dfee3..000d407db1c8b39706919d9798004be436d1c3e7 100644 (file)
 #include <unistd.h>
 
 #include "copy.h"
-#include "path-util.h"
 #include "fileio.h"
+#include "macro.h"
 #include "mkdir.h"
+#include "path-util.h"
+#include "rm-rf.h"
+#include "string-util.h"
 #include "strv.h"
-#include "macro.h"
 #include "util.h"
-#include "rm-rf.h"
 
 static void test_copy_file(void) {
         _cleanup_free_ char *buf = NULL;
index bd1b2781df47cc08cd5bdac822c925aeab43c209..8d78ab89d043826d40549bf50eededc918de2b18 100644 (file)
@@ -22,6 +22,7 @@
 #include <string.h>
 
 #include "util.h"
+#include "string-util.h"
 
 static void test_should_pass(const char *p) {
         usec_t t, q;
index 59ba4be0875f7b98587d77ef01273b9aae877822..1c745d6e5b45a294fe6101096dd3863205aaf200 100644 (file)
@@ -22,6 +22,7 @@
 #include <sys/types.h>
 
 #include "device-nodes.h"
+#include "string-util.h"
 #include "util.h"
 
 /* helpers for test_encode_devnode_name */
index 2193eb6f7df500f0ae8e32117069d528074b17eb..1a8541e1cc1ba8f56cbbecf839aad32b7bff28eb 100644 (file)
@@ -19,8 +19,9 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
  ***/
 
-#include "macro.h"
 #include "dns-domain.h"
+#include "macro.h"
+#include "string-util.h"
 
 static void test_dns_label_unescape_one(const char *what, const char *expect, size_t buffer_sz, int ret) {
         char buffer[buffer_sz];
index 27df9089c38da9ac5cf209c27400bda451ef9701..033d5af7191f15b8edb84f0c62f6de6b4f386980 100644 (file)
 
 #include <stdio.h>
 
-#include "util.h"
-#include "terminal-util.h"
 #include "def.h"
+#include "string-util.h"
+#include "terminal-util.h"
+#include "util.h"
 
 static void test_one(const char *p) {
         _cleanup_free_ char *t;
index 110223f3b85d63920f8be4471d6d71df376fb37b..c1315bbf9ff8c3120779d2697d02942044d69a71 100644 (file)
 
 #include <string.h>
 
-#include "util.h"
-#include "strv.h"
 #include "env-util.h"
+#include "string-util.h"
+#include "strv.h"
+#include "util.h"
 
 static void test_strv_env_delete(void) {
         _cleanup_strv_free_ char **a = NULL, **b = NULL, **c = NULL, **d = NULL;
index ad547822e7d83080d42d6d19d285ec282d6de46c..a72e84bc66799cd8be7a76b290c497b201efd686 100644 (file)
@@ -30,6 +30,7 @@
 #include "env-util.h"
 #include "def.h"
 #include "ctype.h"
+#include "string-util.h"
 
 static void test_parse_env_file(void) {
         char    t[] = "/tmp/test-fileio-in-XXXXXX",
index 50e5dee0a71c62070c6563a0924b8fc006a4872f..b02f3a6e7c96b640408ba641e2afcbc634fd77c7 100644 (file)
@@ -20,8 +20,9 @@
 ***/
 
 #include "fstab-util.h"
-#include "util.h"
 #include "log.h"
+#include "string-util.h"
+#include "util.h"
 
 /*
 int fstab_filter_options(const char *opts, const char *names,
index c691f577c6034e7179bb01a7138361b20a1ee08c..2da64469617f4b876e59565466313e81ab371082 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include "hashmap.h"
+#include "string-util.h"
 #include "strv.h"
 #include "util.h"
-#include "hashmap.h"
 
 void test_hashmap_funcs(void);
 
index 6f5ef2615e30ad6a78b3b01616fde2e469bcd644..ac8f4ecc6868a73fca3d576ed2a2f614eb89392c 100644 (file)
@@ -24,6 +24,7 @@
 #include "util.h"
 #include "fileio.h"
 #include "hostname-util.h"
+#include "string-util.h"
 
 static void test_hostname_is_valid(void) {
         assert_se(hostname_is_valid("foobar", false));
index a6a0cd77a1dce3475818f05c3d8d8a5b73f69d74..2c8ba70ffb8b169954db60fadc6d73d82bdcf3e6 100644 (file)
 
 #include <string.h>
 
-#include "systemd/sd-id128.h"
+#include "sd-daemon.h"
+#include "sd-id128.h"
 
-#include "util.h"
 #include "macro.h"
-#include "sd-daemon.h"
+#include "string-util.h"
+#include "util.h"
 
 #define ID128_WALDI SD_ID128_MAKE(01, 02, 03, 04, 05, 06, 07, 08, 09, 0a, 0b, 0c, 0d, 0e, 0f, 10)
 #define STR_WALDI "0102030405060708090a0b0c0d0e0f10"
index 1058c583c36a88b5ab9b4ed1d526da21cf727335..ba4d75c0c8c30e4a0ce4e9592cd5bf127d44a84a 100644 (file)
@@ -21,8 +21,9 @@
 
 #include <math.h>
 
-#include "util.h"
 #include "json.h"
+#include "string-util.h"
+#include "util.h"
 
 static void test_one(const char *data, ...) {
         void *state = NULL;
index 34c49b969a8cf8f21167d0234661e5a976702f0e..350eaf734dd1d040829707aea5aafd06e0c452c6 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
-#include <unistd.h>
 #include <getopt.h>
+#include <stdio.h>
 #include <sys/epoll.h>
+#include <unistd.h>
 
 #include "libudev.h"
+
+#include "string-util.h"
 #include "udev-util.h"
 #include "util.h"
 
index 7d7e08dc5d1480a0b0e7b6cb8f0d1be3f9486e83..de11443c7a4a74b7451d662e4f1fb0acf93252fe 100644 (file)
@@ -22,8 +22,9 @@
 #include <sys/socket.h>
 
 #include "namespace.h"
-#include "util.h"
 #include "process-util.h"
+#include "string-util.h"
+#include "util.h"
 
 static void test_tmpdir(const char *id, const char *A, const char *B) {
         _cleanup_free_ char *a, *b;
index 2879d7450f085434972d0ff8a0a574a7dcfa7209..a1e8774063ce6e73f35342a2eae2c2d414923195 100644 (file)
 ***/
 
 #include <arpa/inet.h>
-#include <net/if.h>
+#include <libkmod.h>
 #include <linux/ip.h>
+#include <net/if.h>
 #include <linux/if_tunnel.h>
-#include <libkmod.h>
 
-#include "util.h"
-#include "macro.h"
 #include "sd-netlink.h"
 
+#include "macro.h"
+#include "util.h"
+
 static int load_module(const char *mod_name) {
         struct kmod_ctx *ctx;
         struct kmod_list *list = NULL, *l;
index aa4bac6cdd93575a338afefcc9532654a6f57e2a..92ffa65925736d385b357a1bcd47c760b9a2aa59 100644 (file)
 
 #include <sys/stat.h>
 
-#include "path-lookup.h"
 #include "log.h"
-#include "strv.h"
+#include "path-lookup.h"
 #include "rm-rf.h"
+#include "string-util.h"
+#include "strv.h"
 
 static void test_paths(ManagerRunningAs running_as, bool personal) {
         char template[] = "/tmp/test-path-lookup.XXXXXXX";
index a930196a6c722bc4f32a6dbbeec67a4708c7a3cb..2977487c883c7700534d65b3752a8dd9c61d11db 100644 (file)
 ***/
 
 #include <stdio.h>
-#include <unistd.h>
 #include <sys/mount.h>
+#include <unistd.h>
 
-#include "path-util.h"
-#include "util.h"
 #include "macro.h"
-#include "strv.h"
+#include "path-util.h"
 #include "rm-rf.h"
+#include "string-util.h"
+#include "strv.h"
+#include "util.h"
 
 #define test_path_compare(a, b, result) {                 \
                 assert_se(path_compare(a, b) == result);  \
index 676c9f17932ab94a6812792455917c4d0ba68b5c..19796bd6cb7534fd9ed5afcc45ce229d9c500398 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
 #include <stdbool.h>
+#include <stdio.h>
 
-#include "unit.h"
-#include "manager.h"
-#include "util.h"
 #include "macro.h"
-#include "strv.h"
+#include "manager.h"
 #include "mkdir.h"
 #include "rm-rf.h"
+#include "string-util.h"
+#include "strv.h"
+#include "unit.h"
+#include "util.h"
 
 typedef void (*test_function_t)(Manager *m);
 
index eb0f443a4385fc37fabf093da22fed128c6463bf..16a7148b19fd6be7fadb810b63e0bdb49a3fd748 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/types.h>
 #include <sys/wait.h>
 #include <unistd.h>
 
-#include "process-util.h"
 #include "log.h"
-#include "util.h"
 #include "macro.h"
-#include "virt.h"
+#include "process-util.h"
+#include "string-util.h"
 #include "terminal-util.h"
+#include "util.h"
+#include "virt.h"
 
 static void test_get_process_comm(void) {
         struct stat st;
index b1d42d77fd95add611f5899d3c9f28404ca0e651..2de2091561d0b7e5a1258539f31b994851b48c55 100644 (file)
 
 #include <string.h>
 
-#include "util.h"
 #include "macro.h"
 #include "replace-var.h"
+#include "string-util.h"
+#include "util.h"
 
 static char *lookup(const char *variable, void *userdata) {
         return strjoin("<<<", variable, ">>>", NULL);
index 2c18090ae55e03aa2d0b097b3b2cec34abbba646..ba1c7e6877942dac436181a341972833fb5f0e32 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "socket-util.h"
+#include "async.h"
 #include "in-addr-util.h"
-#include "util.h"
-#include "macro.h"
 #include "log.h"
-#include "async.h"
+#include "macro.h"
+#include "socket-util.h"
+#include "string-util.h"
+#include "util.h"
 
 static void test_socket_address_parse(void) {
         SocketAddress a;
index 4ec648ae66c4c5ac91653e910b476f65900d8bd6..1d8eda0c15583122cc1221288db496cf70ecaebb 100644 (file)
@@ -23,6 +23,7 @@
 #include <string.h>
 
 #include "strbuf.h"
+#include "string-util.h"
 #include "strv.h"
 #include "util.h"
 
index 6cec8768b115dcba6c1879e594b4e8245ecee767..10fc98ced55b9d4054509909e8fc26b0c216673c 100644 (file)
@@ -21,8 +21,9 @@
 
 #include <stdio.h>
 
-#include "util.h"
+#include "string-util.h"
 #include "terminal-util.h"
+#include "util.h"
 
 int main(int argc, char *argv[]) {
         char *p;
index 623c9265210c1f1b4aeb0e66ce679977b19e3d2d..c676893719a3258eb3636cfca1eb27392a57cc6d 100644 (file)
 
 #include <string.h>
 
-#include "util.h"
 #include "specifier.h"
+#include "string-util.h"
 #include "strv.h"
+#include "util.h"
 
 static void test_specifier_printf(void) {
         static const Specifier table[] = {
index 858a4081da84c5dd4f0d1ea0562dff74b17fff72..e411d479ab81c3a17228620086b85064490bece5 100644 (file)
@@ -21,8 +21,9 @@
 
 #include <string.h>
 
-#include "util.h"
+#include "string-util.h"
 #include "strxcpyx.h"
+#include "util.h"
 
 static void test_strpcpy(void) {
         char target[25];
index 221dd67eb2f139346370cc21bdd68af34f30261b..ab255c7c8300429ff935fbefdaff9458e3f1b2c5 100644 (file)
 ***/
 
 #include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
 
-#include "util.h"
 #include "formats-util.h"
+#include "string-util.h"
+#include "util.h"
 
 int main(int argc, char** argv) {
         const char *p = argv[1] ?: "/tmp";
index 2b765a3e90412d37f7929e375a5027bb24eea264..3b9f71e3a265d5ab1e7b43f18f84d2dbd781f338 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
-#include <stdlib.h>
 #include <errno.h>
-#include <unistd.h>
 #include <sched.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <sys/mount.h>
 #include <sys/signalfd.h>
+#include <unistd.h>
 
 #include "missing.h"
 #include "selinux-util.h"
 #include "signal-util.h"
-#include "udev.h"
+#include "string-util.h"
 #include "udev-util.h"
+#include "udev.h"
 
 static int fake_filesystems(void) {
         static const struct fakefs {
index 8358789e6f00b86defad436bddee1a7de3fc2ada..e4573956a5a2c40b6d226235de2d9177770f6e78 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
+#include <fcntl.h>
 #include <stddef.h>
+#include <stdio.h>
 #include <string.h>
 #include <unistd.h>
-#include <fcntl.h>
 
-#include "install.h"
-#include "install-printf.h"
-#include "specifier.h"
-#include "util.h"
-#include "macro.h"
+#include "fileio.h"
 #include "hashmap.h"
+#include "hostname-util.h"
+#include "install-printf.h"
+#include "install.h"
 #include "load-fragment.h"
+#include "macro.h"
+#include "specifier.h"
+#include "string-util.h"
 #include "strv.h"
-#include "fileio.h"
 #include "test-helper.h"
-#include "hostname-util.h"
+#include "util.h"
 
 static int test_unit_file_get_set(void) {
         int r;
index e5405fb7f3b7d139971b40de2cf08ef95292cd6b..5aff771af58deb59b297cd98b3d1b2b6518902ee 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <pwd.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <pwd.h>
 
+#include "hostname-util.h"
+#include "macro.h"
 #include "manager.h"
-#include "unit.h"
+#include "path-util.h"
+#include "specifier.h"
+#include "string-util.h"
+#include "test-helper.h"
 #include "unit-name.h"
 #include "unit-printf.h"
-#include "specifier.h"
+#include "unit.h"
 #include "util.h"
-#include "macro.h"
-#include "path-util.h"
-#include "test-helper.h"
-#include "hostname-util.h"
 
 static void test_unit_name_is_valid(void) {
         assert_se(unit_name_is_valid("foo.service", UNIT_NAME_ANY));
index 346f8524c620c4fbdda4337b8db4489cbab15d00..a8e15b7cf12eab75dd387b5e4b5fc88a4962cb10 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "utf8.h"
 #include "util.h"
+#include "string-util.h"
 
 static void test_utf8_is_printable(void) {
         assert_se(utf8_is_printable("ascii is valid\tunicode", 22));
index 10bbb17b148d1b4d98dbf712bc284cf1882734e0..49a30601bc5df6e19caaa3d8e8e29ee6bfa0f3bd 100644 (file)
@@ -40,6 +40,7 @@
 #include "process-util.h"
 #include "rm-rf.h"
 #include "signal-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "util.h"
 #include "virt.h"
index ea109fbde0c57cc599709342fd1ae5e1b96e22e6..93b0e7c3fbb447878f8ecaed096fd115d047eed1 100644 (file)
@@ -21,8 +21,9 @@
 
 #include <stdarg.h>
 
-#include "xml.h"
+#include "string-util.h"
 #include "util.h"
+#include "xml.h"
 
 static void test_one(const char *data, ...) {
         void *state = NULL;
index 28ad378a9383f9fec2178d5769ecf1f3ca28291f..28e0636604fab722d59ed32ba356efd83d6bf127 100644 (file)
@@ -19,7 +19,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-
+#include "string-util.h"
 #include "timesyncd-manager.h"
 #include "timesyncd-server.h"
 #include "timesyncd-conf.h"
index 40e0fd31fedf0918b3d355dc83e4ac46139c20a1..2964aa7652083e83167eefc68c47fe13ec8a446b 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
 #include <errno.h>
-#include <time.h>
 #include <math.h>
 #include <netinet/in.h>
 #include <netinet/ip.h>
+#include <resolv.h>
+#include <stdlib.h>
+#include <sys/socket.h>
 #include <sys/timerfd.h>
 #include <sys/timex.h>
-#include <sys/socket.h>
-#include <resolv.h>
 #include <sys/types.h>
+#include <time.h>
+
+#include "sd-daemon.h"
 
-#include "missing.h"
-#include "util.h"
-#include "sparse-endian.h"
-#include "log.h"
-#include "socket-util.h"
 #include "list.h"
+#include "log.h"
+#include "missing.h"
+#include "network-util.h"
 #include "ratelimit.h"
+#include "socket-util.h"
+#include "sparse-endian.h"
+#include "string-util.h"
 #include "strv.h"
-#include "sd-daemon.h"
-#include "network-util.h"
+#include "time-util.h"
 #include "timesyncd-conf.h"
+#include "util.h"
 #include "timesyncd-manager.h"
-#include "time-util.h"
 
 #ifndef ADJ_SETOFFSET
 #define ADJ_SETOFFSET                   0x0100  /* add 'time' to current time */
index ba9f82553be4853f45fb52d1360f83aa122ef769..d81382528f3854cd10477972957473bdcaa120c5 100644 (file)
@@ -55,6 +55,7 @@
 #include "selinux-util.h"
 #include "set.h"
 #include "specifier.h"
+#include "string-util.h"
 #include "strv.h"
 #include "util.h"
 
index 8423364046693164f02d0bc27fae78cc9065a282..d9b6cb3524f5e87d2aa6716509b43fe1dc16afcd 100644 (file)
@@ -40,6 +40,7 @@
 #include "process-util.h"
 #include "signal-util.h"
 #include "socket-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "terminal-util.h"
 #include "util.h"
index 1d1798dd10f2a4ef7ba77e869a30d6a156ae29d4..7acd7b4e928ab76d5cabb4086de3f97465ded854 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
-#include <fcntl.h>
 #include <ctype.h>
-#include <string.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <getopt.h>
+#include <linux/bsg.h>
+#include <linux/hdreg.h>
 #include <scsi/scsi.h>
-#include <scsi/sg.h>
 #include <scsi/scsi_ioctl.h>
+#include <scsi/sg.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <sys/ioctl.h>
-#include <sys/types.h>
 #include <sys/stat.h>
-#include <linux/hdreg.h>
-#include <linux/bsg.h>
+#include <sys/types.h>
+#include <unistd.h>
 
 #include "libudev.h"
+
 #include "libudev-private.h"
-#include "udev-util.h"
 #include "log.h"
+#include "udev-util.h"
 
 #define COMMAND_TIMEOUT_MSEC (30 * 1000)
 
index 001bae7a245ddcda497b48045774a97f164f3fce..72f284f71082cf51da598a0da1db88f8c53ed412 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <stdio.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <limits.h>
-#include <fcntl.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <getopt.h>
-#include <time.h>
+#include <limits.h>
+#include <linux/cdrom.h>
 #include <scsi/sg.h>
-#include <sys/types.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <sys/time.h>
-#include <sys/ioctl.h>
-#include <linux/cdrom.h>
+#include <sys/types.h>
+#include <time.h>
+#include <unistd.h>
 
 #include "libudev.h"
+
 #include "libudev-private.h"
 #include "random-util.h"
 
index b3a1f0bca1f987ff934ea8a3b17b5c6ae8a493b3..b234792e237046e82994076a32d38bdf9e264378 100644 (file)
  *
  */
 
-#include <stdio.h>
-#include <stddef.h>
 #include <errno.h>
 #include <getopt.h>
+#include <stddef.h>
+#include <stdio.h>
 
 #include "libudev-private.h"
 #include "macro.h"
+#include "string-util.h"
 
 #define BUFSIZE 16
 #define UDEV_ALARM_TIMEOUT 180
index 4b8c5053a4f25f8e7362c09707604723770a8068..c308f898ea26eb8ae61d9d819e95415c581d9626 100644 (file)
 #include <netinet/ether.h>
 #include <linux/netdevice.h>
 
+#include "sd-netlink.h"
 
-#include "missing.h"
-#include "link-config.h"
+#include "conf-files.h"
+#include "conf-parser.h"
 #include "ethtool-util.h"
-
 #include "libudev-private.h"
-#include "sd-netlink.h"
-#include "util.h"
+#include "link-config.h"
 #include "log.h"
-#include "strv.h"
-#include "path-util.h"
-#include "conf-parser.h"
-#include "conf-files.h"
+#include "missing.h"
 #include "netlink-util.h"
 #include "network-internal.h"
+#include "path-util.h"
 #include "random-util.h"
+#include "string-util.h"
+#include "strv.h"
+#include "util.h"
 
 struct link_config_ctx {
         LIST_HEAD(link_config, links);
index c52db2ce5549f044d1daf7ccdcb3d269e6c03c05..4fcbee8b926c18a605f35499d74804bf117a0a73 100644 (file)
 
 #pragma once
 
-#include "ethtool-util.h"
+#include "libudev.h"
+
 #include "condition.h"
+#include "ethtool-util.h"
 #include "list.h"
-#include "libudev.h"
 
 typedef struct link_config_ctx link_config_ctx;
 typedef struct link_config link_config;
index adb91869df0be7403daad3f5eb4d1ebcfad8391a..cbf9478e72f043d2840278f1202c313a3480e858 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <getopt.h>
+#include <signal.h>
 #include <stdarg.h>
 #include <stdbool.h>
-#include <unistd.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
-#include <ctype.h>
-#include <getopt.h>
 #include <sys/stat.h>
+#include <unistd.h>
 
 #include "libudev.h"
+
 #include "libudev-private.h"
 #include "scsi_id.h"
+#include "string-util.h"
 #include "udev-util.h"
 
 static const struct option options[] = {
index de3b4f75816635afdaa39b960668dc185eabe897..c7ef783684b88ac8d744dde0bfd89e907df018c6 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <stdio.h>
 #include <errno.h>
-#include <string.h>
 #include <fcntl.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <time.h>
 #include <inttypes.h>
+#include <linux/bsg.h>
+#include <linux/types.h>
 #include <scsi/scsi.h>
 #include <scsi/sg.h>
-#include <linux/types.h>
-#include <linux/bsg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <time.h>
+#include <unistd.h>
 
 #include "libudev.h"
+
 #include "libudev-private.h"
+#include "random-util.h"
 #include "scsi.h"
 #include "scsi_id.h"
-#include "random-util.h"
+#include "string-util.h"
 
 /*
  * A priority based list of id, naa, and binary/ascii for the identifier
index b8066ea6e9c40fef5be6987a2fbd3c9be657b7f0..004ddb023f3b337d886453c8cee60cdab340a8e4 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <blkid/blkid.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <getopt.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <sys/stat.h>
-#include <blkid/blkid.h>
 
 #include "sd-id128.h"
-#include "gpt.h"
+
 #include "efivars.h"
+#include "gpt.h"
+#include "string-util.h"
 #include "udev.h"
 
 static void print_property(struct udev_device *dev, bool test, const char *name, const char *value) {
index 3352821567e405723ab6287bd0dbf4decca48bb3..ce1a0c38823a1262a958cf22b04fb38765bd2c04 100644 (file)
@@ -17,8 +17,8 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
 #include <fcntl.h>
+#include <stdlib.h>
 #include <sys/ioctl.h>
 
 #ifdef HAVE_LINUX_BTRFS_H
@@ -26,6 +26,7 @@
 #endif
 
 #include "missing.h"
+#include "string-util.h"
 #include "udev.h"
 
 static int builtin_btrfs(struct udev_device *dev, int argc, char *argv[], bool test) {
index 72109d93d2129c52b11da7fefe67832b0e3ff94d..97a5a9c77f1155fcd976ff3e1de4b3845954467b 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
-#include <stdlib.h>
 #include <fnmatch.h>
 #include <getopt.h>
+#include <stdio.h>
+#include <stdlib.h>
 
-#include "udev.h"
 #include "sd-hwdb.h"
 
 #include "hwdb-util.h"
+#include "string-util.h"
 #include "udev-util.h"
+#include "udev.h"
 
 static sd_hwdb *hwdb;
 
index e3fa4bc162cd4e1ffdb5cb787dafa21851aa5241..f36f719a947b3a632569fe01b694b38a6dca7fa0 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <errno.h>
+#include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdarg.h>
-#include <unistd.h>
 #include <string.h>
-#include <errno.h>
+#include <unistd.h>
 #include <linux/limits.h>
 #include <linux/input.h>
 
+#include "string-util.h"
 #include "udev.h"
 #include "util.h"
 
index d63a8e2760e35768ccdacc827c419724e5607399..ce534ae0f90df3cce86f0931c9879291f4dc3aa6 100644 (file)
 ***/
 
 #include <stdio.h>
-#include <string.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/ioctl.h>
 #include <linux/input.h>
 
+#include "string-util.h"
 #include "udev.h"
 
 static const struct key *keyboard_lookup_key(const char *str, unsigned len);
index 81e78a8aa30e93ed99595b6a718371757b867246..9665f678fd5862fb643611d7f8918d6bf5661a99 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <libkmod.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
 
+#include "string-util.h"
 #include "udev.h"
 
 static struct kmod_ctx *ctx = NULL;
index 589f1f7822609c9897ee199c11238b1806878180..bb721d6f0dc08152f5ffea8f7ce4064c28d7aa3a 100644 (file)
  *   ID_NET_NAME_PATH=enp0s29u1u2
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <string.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <net/if.h>
 #include <net/if_arp.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 #include <linux/pci_regs.h>
 
-#include "udev.h"
 #include "fileio.h"
+#include "string-util.h"
+#include "udev.h"
 
 enum netname_type{
         NET_UNDEF,
index 01e2c659ae13bab30b384f0ae0984c7bcc1c1428..2c40988c7aaa7830746812fb3a5273abc2e89d1f 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <unistd.h>
-#include <string.h>
 #include <ctype.h>
-#include <fcntl.h>
-#include <errno.h>
 #include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
 #include <getopt.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 
+#include "string-util.h"
 #include "udev.h"
 
 _printf_(2,3)
index d309dc31cb79f843441f5ca22ddb0bafdaa69984..c7d47891a72f78ffc628ea0960cb110960212995 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdarg.h>
-#include <unistd.h>
 #include <string.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include <errno.h>
+#include <unistd.h>
 
+#include "string-util.h"
 #include "udev.h"
 
 static void set_usb_iftype(char *to, int if_class_num, size_t len) {
index 4f625251d66197f97465360498801d9e1dd95a90..e6b36f124fdff21cf1e7285caf322016c42dd0b7 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <getopt.h>
 #include <stdio.h>
 #include <string.h>
-#include <getopt.h>
 
+#include "string-util.h"
 #include "udev.h"
 
 static bool initialized;
index 1e34cbc2f53857f52c85aebc3af91e1aada200e3..49a45811a6375d09c4fc854a8da8d1bb650223b2 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
 #include <ctype.h>
-#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
 #include <net/if.h>
-#include <sys/prctl.h>
 #include <poll.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <sys/epoll.h>
-#include <sys/wait.h>
+#include <sys/prctl.h>
 #include <sys/signalfd.h>
+#include <sys/wait.h>
+#include <unistd.h>
 
-#include "netlink-util.h"
 #include "event-util.h"
 #include "formats-util.h"
+#include "netlink-util.h"
 #include "process-util.h"
 #include "signal-util.h"
+#include "string-util.h"
 #include "udev.h"
 
 typedef struct Spawn {
index e730fb45f15938fa3c1c43e4f94d5a0adee69d9d..4ed6416ecdf4f7023b3dec9afee578e215157604 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <string.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <stdbool.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
 #include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
 #include <sys/stat.h>
+#include <unistd.h>
 
-#include "udev.h"
-#include "smack-util.h"
-#include "selinux-util.h"
 #include "formats-util.h"
+#include "selinux-util.h"
+#include "smack-util.h"
+#include "string-util.h"
+#include "udev.h"
 
 static int node_symlink(struct udev_device *dev, const char *node, const char *slink) {
         struct stat stats;
index 62db0016ebdde4c6f7406739545faae72d98412a..c8abac7fefa2aa256c3cf4822217691a367dce44 100644 (file)
 #include "escape.h"
 #include "path-util.h"
 #include "strbuf.h"
+#include "string-util.h"
 #include "strv.h"
 #include "sysctl-util.h"
-#include "util.h"
 #include "udev.h"
+#include "util.h"
 
 #define PREALLOC_TOKEN          2048
 
index d17fc8c1ea717c4b9cdb3b80ea6ab1211e3cb218..1f9c8120c0add2c43cf379862cc3bd3cc15ce462 100644 (file)
 
 #pragma once
 
-#include <sys/types.h>
 #include <sys/param.h>
+#include <sys/types.h>
 
-#include "macro.h"
-#include "sd-netlink.h"
 #include "libudev.h"
-#include "libudev-private.h"
-#include "util.h"
+#include "sd-netlink.h"
+
 #include "label.h"
+#include "libudev-private.h"
+#include "macro.h"
 #include "strv.h"
+#include "util.h"
 
 struct udev_event {
         struct udev *udev;
index 00609e31b52202d4af5ef76d5c32a07fc1c473de..f9509ad6406683cbc3ebdabdf7f49077fe2aa8ce 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
+#include <ctype.h>
 #include <getopt.h>
+#include <stdlib.h>
 #include <string.h>
-#include <ctype.h>
 
-#include "util.h"
-#include "strbuf.h"
 #include "conf-files.h"
-
-#include "udev.h"
 #include "hwdb-internal.h"
 #include "hwdb-util.h"
+#include "strbuf.h"
+#include "string-util.h"
+#include "udev.h"
+#include "util.h"
 
 /*
  * Generic udev properties, key/value database based on modalias strings.
index b3d5565c48bf100ad4201ae8b5150b3b500b5ce3..911818eb00de48d6d268cf89f1a4ccc1223a255b 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <string.h>
-#include <stdio.h>
-#include <stddef.h>
 #include <ctype.h>
-#include <unistd.h>
 #include <dirent.h>
 #include <errno.h>
-#include <getopt.h>
 #include <fcntl.h>
+#include <getopt.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
 #include <sys/stat.h>
+#include <unistd.h>
 
-#include "udev.h"
+#include "string-util.h"
 #include "udev-util.h"
+#include "udev.h"
 #include "udevadm-util.h"
 
 static bool skip_attribute(const char *name) {
index 35a73494391f68f4209daaf3e26b9cb1dda70a65..0b180d03eb399abc772c1ab4413f2707d8915104 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <stdlib.h>
-#include <stddef.h>
-#include <stdio.h>
 #include <errno.h>
 #include <getopt.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
 
+#include "string-util.h"
 #include "udev.h"
 
 static void help(struct udev *udev) {
index d04e618d0d2a27c8d2f27f7dd5bfd7c875371b2b..ff427cf29217e125d96b0f9c3bd330847d823ec4 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <unistd.h>
 #include <errno.h>
-#include <signal.h>
 #include <getopt.h>
+#include <signal.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <sys/signalfd.h>
+#include <unistd.h>
 
-#include "udev.h"
+#include "string-util.h"
 #include "udev-util.h"
+#include "udev.h"
 
 static void help(void) {
 
index 7af9665f8a31da36459076aced0df87b3ecec598..9d52345d92316aef6fe8cef3e94e5226564c4c51 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <errno.h>
+#include <fcntl.h>
+#include <getopt.h>
 #include <stddef.h>
-#include <string.h>
 #include <stdio.h>
+#include <string.h>
 #include <unistd.h>
-#include <getopt.h>
-#include <errno.h>
-#include <fcntl.h>
 
-#include "udev.h"
+#include "string-util.h"
 #include "udev-util.h"
+#include "udev.h"
 #include "udevadm-util.h"
 #include "util.h"
 
index 3f0e45e26c9940793310e3971c13cc40c0142dc6..3539c1d6ab15a48088cca120518e9a0ba28657a2 100644 (file)
@@ -15,6 +15,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "string-util.h"
 #include "udevadm-util.h"
 
 struct udev_device *find_device(struct udev *udev,
index b86d8921f36a68c7a6865ce38cc2bab374d6a6c3..60f122ebdab69ece78f88c2130d1bf44ce84f2b3 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <stdio.h>
-#include <stddef.h>
 #include <errno.h>
 #include <getopt.h>
+#include <stddef.h>
+#include <stdio.h>
 
 #include "selinux-util.h"
+#include "string-util.h"
 #include "udev.h"
 
 static int adm_version(struct udev *udev, int argc, char *argv[]) {
index e4d2f477458d33ee0b2a05de35484a64bb1c68df..a3f0298ae7da03de27fb1eab3282d885f24d1c06 100644 (file)
@@ -54,6 +54,7 @@
 #include "process-util.h"
 #include "selinux-util.h"
 #include "signal-util.h"
+#include "string-util.h"
 #include "terminal-util.h"
 #include "udev-util.h"
 #include "udev.h"
index 7c736c44d25e45fc3ee746017537194fd7512f57..252cbdb26cf50ec8cde5ad1e91956a4d7ed3047f 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <unistd.h>
 #include <errno.h>
+#include <unistd.h>
 
+#include "fileio.h"
 #include "log.h"
+#include "string-util.h"
 #include "util.h"
-#include "fileio.h"
 
 int main(int argc, char*argv[]) {
 
index 6353579283fd3d87b304272f0813dd4e86a84454..b0c61cddc50e1a4db1393539ac227b3012345fb5 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
 #include <errno.h>
 #include <fcntl.h>
-#include <stdbool.h>
 #include <limits.h>
-#include <sys/ioctl.h>
-#include <linux/tiocl.h>
 #include <linux/kd.h>
+#include <linux/tiocl.h>
 #include <linux/vt.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
 
-#include "util.h"
-#include "log.h"
-#include "virt.h"
 #include "fileio.h"
+#include "log.h"
 #include "process-util.h"
-#include "terminal-util.h"
 #include "signal-util.h"
+#include "string-util.h"
+#include "terminal-util.h"
+#include "util.h"
+#include "virt.h"
 
 static bool is_vconsole(int fd) {
         unsigned char data[1];