summaryrefslogtreecommitdiff
path: root/src/libudev
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-24 22:58:24 +0200
committerLennart Poettering <lennart@poettering.net>2015-10-24 23:05:02 +0200
commit07630cea1f3a845c09309f197ac7c4f11edd3b62 (patch)
treeaf80c7221d1466fac79a7f3a57e0d63a96f464d4 /src/libudev
parent4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3 (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/libudev')
-rw-r--r--src/libudev/libudev-device-internal.h3
-rw-r--r--src/libudev/libudev-device-private.c4
-rw-r--r--src/libudev/libudev-device.c28
-rw-r--r--src/libudev/libudev-enumerate.c16
-rw-r--r--src/libudev/libudev-hwdb.c3
-rw-r--r--src/libudev/libudev-monitor.c18
-rw-r--r--src/libudev/libudev-private.h3
-rw-r--r--src/libudev/libudev-util.c13
-rw-r--r--src/libudev/libudev.c8
9 files changed, 52 insertions, 44 deletions
diff --git a/src/libudev/libudev-device-internal.h b/src/libudev/libudev-device-internal.h
index aa36b8cb12..40d59201cf 100644
--- a/src/libudev/libudev-device-internal.h
+++ b/src/libudev/libudev-device-internal.h
@@ -21,9 +21,10 @@
#pragma once
#include "libudev.h"
-#include "libudev-private.h"
#include "sd-device.h"
+#include "libudev-private.h"
+
/**
* udev_device:
*
diff --git a/src/libudev/libudev-device-private.c b/src/libudev/libudev-device-private.c
index 4b9c053b54..2d3e62410c 100644
--- a/src/libudev/libudev-device-private.c
+++ b/src/libudev/libudev-device-private.c
@@ -19,10 +19,10 @@
***/
#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;
diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c
index 9a8d682107..1e513f3ff7 100644
--- a/src/libudev/libudev-device.c
+++ b/src/libudev/libudev-device.c
@@ -18,29 +18,29 @@
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
diff --git a/src/libudev/libudev-enumerate.c b/src/libudev/libudev-enumerate.c
index df088946df..56436772b0 100644
--- a/src/libudev/libudev-enumerate.c
+++ b/src/libudev/libudev-enumerate.c
@@ -18,22 +18,22 @@
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
diff --git a/src/libudev/libudev-hwdb.c b/src/libudev/libudev-hwdb.c
index 98951fb85b..6dc2b0533e 100644
--- a/src/libudev/libudev-hwdb.c
+++ b/src/libudev/libudev-hwdb.c
@@ -17,9 +17,10 @@
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
diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c
index 282aa2b0d9..00472fedc9 100644
--- a/src/libudev/libudev-monitor.c
+++ b/src/libudev/libudev-monitor.c
@@ -17,22 +17,24 @@
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
diff --git a/src/libudev/libudev-private.h b/src/libudev/libudev-private.h
index c1785bf4c2..5f50496291 100644
--- a/src/libudev/libudev-private.h
+++ b/src/libudev/libudev-private.h
@@ -25,10 +25,11 @@
#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
diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c
index 4408bb59f6..a614230df4 100644
--- a/src/libudev/libudev-util.c
+++ b/src/libudev/libudev-util.c
@@ -17,18 +17,19 @@
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
diff --git a/src/libudev/libudev.c b/src/libudev/libudev.c
index ec15d2576b..00605d0126 100644
--- a/src/libudev/libudev.c
+++ b/src/libudev/libudev.c
@@ -17,16 +17,18 @@
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