summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-device
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/libsystemd/sd-device
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/libsystemd/sd-device')
-rw-r--r--src/libsystemd/sd-device/device-enumerator.c12
-rw-r--r--src/libsystemd/sd-device/device-private.c26
-rw-r--r--src/libsystemd/sd-device/device-private.h6
-rw-r--r--src/libsystemd/sd-device/sd-device.c22
4 files changed, 36 insertions, 30 deletions
diff --git a/src/libsystemd/sd-device/device-enumerator.c b/src/libsystemd/sd-device/device-enumerator.c
index 45a4d12eb7..9379209a58 100644
--- a/src/libsystemd/sd-device/device-enumerator.c
+++ b/src/libsystemd/sd-device/device-enumerator.c
@@ -18,15 +18,15 @@
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
diff --git a/src/libsystemd/sd-device/device-private.c b/src/libsystemd/sd-device/device-private.c
index b5215cb9b5..f6263121b6 100644
--- a/src/libsystemd/sd-device/device-private.c
+++ b/src/libsystemd/sd-device/device-private.c
@@ -19,25 +19,25 @@
***/
#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;
diff --git a/src/libsystemd/sd-device/device-private.h b/src/libsystemd/sd-device/device-private.h
index 49a7b66a2b..d1f34efc2d 100644
--- a/src/libsystemd/sd-device/device-private.h
+++ b/src/libsystemd/sd-device/device-private.h
@@ -21,6 +21,12 @@
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);
diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c
index e46546ed91..ca42b4318e 100644
--- a/src/libsystemd/sd-device/sd-device.c
+++ b/src/libsystemd/sd-device/sd-device.c
@@ -19,23 +19,23 @@
***/
#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;