diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-10-24 22:58:24 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-10-24 23:05:02 +0200 |
commit | 07630cea1f3a845c09309f197ac7c4f11edd3b62 (patch) | |
tree | af80c7221d1466fac79a7f3a57e0d63a96f464d4 /src/login | |
parent | 4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3 (diff) |
util-lib: split our string related calls from util.[ch] into its own file string-util.[ch]
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.
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/logind-acl.c | 1 | ||||
-rw-r--r-- | src/login/logind-acl.h | 3 | ||||
-rw-r--r-- | src/login/logind-action.h | 1 | ||||
-rw-r--r-- | src/login/logind-button.c | 4 | ||||
-rw-r--r-- | src/login/logind-inhibit.c | 1 | ||||
-rw-r--r-- | src/login/logind-seat.c | 10 | ||||
-rw-r--r-- | src/login/logind-session-device.c | 3 | ||||
-rw-r--r-- | src/login/logind.c | 11 | ||||
-rw-r--r-- | src/login/logind.h | 11 | ||||
-rw-r--r-- | src/login/sysfs-show.c | 10 | ||||
-rw-r--r-- | src/login/test-inhibit.c | 5 |
11 files changed, 37 insertions, 23 deletions
diff --git a/src/login/logind-acl.c b/src/login/logind-acl.c index c325c7bc0c..1acdc5aa22 100644 --- a/src/login/logind-acl.c +++ b/src/login/logind-acl.c @@ -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" diff --git a/src/login/logind-acl.h b/src/login/logind-acl.h index ec09843a78..93e9ed02eb 100644 --- a/src/login/logind-acl.h +++ b/src/login/logind-acl.h @@ -23,7 +23,8 @@ #include <sys/types.h> #include <stdbool.h> -#include <libudev.h> + +#include "libudev.h" #ifdef HAVE_ACL diff --git a/src/login/logind-action.h b/src/login/logind-action.h index ff98065371..e9b424b5f6 100644 --- a/src/login/logind-action.h +++ b/src/login/logind-action.h @@ -36,6 +36,7 @@ typedef enum HandleAction { } HandleAction; #include "logind.h" +#include "logind-inhibit.h" int manager_handle_action( Manager *m, diff --git a/src/login/logind-button.c b/src/login/logind-button.c index f40e35a8cb..caa844e601 100644 --- a/src/login/logind-button.c +++ b/src/login/logind-button.c @@ -19,14 +19,16 @@ 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" diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c index 7c7dd3ecb2..5b247f48d6 100644 --- a/src/login/logind-inhibit.c +++ b/src/login/logind-inhibit.c @@ -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" diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c index 8d13a63688..757993a953 100644 --- a/src/login/logind-seat.c +++ b/src/login/logind-seat.c @@ -20,17 +20,19 @@ ***/ #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; diff --git a/src/login/logind-session-device.c b/src/login/logind-session-device.c index 656f268dba..d4d9052d10 100644 --- a/src/login/logind-session-device.c +++ b/src/login/logind-session-device.c @@ -20,12 +20,13 @@ ***/ #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" diff --git a/src/login/logind.c b/src/login/logind.c index 8ac2aceb9b..6ce7e1fd78 100644 --- a/src/login/logind.c +++ b/src/login/logind.c @@ -20,19 +20,20 @@ ***/ #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); diff --git a/src/login/logind.h b/src/login/logind.h index 7990da5a93..44e05d8b01 100644 --- a/src/login/logind.h +++ b/src/login/logind.h @@ -22,20 +22,21 @@ ***/ #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; diff --git a/src/login/sysfs-show.c b/src/login/sysfs-show.c index f38f06baf9..32e53c0a11 100644 --- a/src/login/sysfs-show.c +++ b/src/login/sysfs-show.c @@ -21,13 +21,15 @@ #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, diff --git a/src/login/test-inhibit.c b/src/login/test-inhibit.c index 03516de916..f231e54cde 100644 --- a/src/login/test-inhibit.c +++ b/src/login/test-inhibit.c @@ -21,10 +21,11 @@ #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; |