]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
strv: Move STRV_FOREACH() to strv-fundamental.h 37381/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 7 May 2025 19:43:39 +0000 (21:43 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 9 May 2025 09:33:33 +0000 (11:33 +0200)
src/basic/strv.h
src/basic/virt.c
src/boot/boot.c
src/fundamental/string-util-fundamental.h
src/fundamental/strv-fundamental.h [new file with mode: 0644]
src/sysupdate/sysupdate-pattern.c

index 08bcaea8b9bdff4c26e5603d95151d23ecbc4ccf..b7895cbf1b2c85e763d8c877b648af5969917ca8 100644 (file)
@@ -9,6 +9,7 @@
 #include "alloc-util.h"
 #include "hashmap.h"
 #include "memory-util.h"
+#include "strv-fundamental.h"
 
 typedef enum ExtractFlags ExtractFlags;
 
index e07cee72cf5b8259e20c807647b0365255f7a758..5717a1d2b41dcaaef2ef390be09461a7f7bc76c8 100644 (file)
@@ -24,6 +24,7 @@
 #include "stat-util.h"
 #include "string-table.h"
 #include "string-util.h"
+#include "strv.h"
 #include "virt.h"
 
 enum {
index 99d83f54628906d7a68459028a2bf9972463b190..0e24beff6a28f75735c228d41a0f9d9d20edce07 100644 (file)
@@ -29,6 +29,7 @@
 #include "secure-boot.h"
 #include "shim.h"
 #include "smbios.h"
+#include "strv-fundamental.h"
 #include "ticks.h"
 #include "tpm2-pcr.h"
 #include "uki.h"
index b523b6c8bf9467318d96b28aa39c616085f83f30..ff74a80a183a9001172c4b9f3f22bf49491ab647 100644 (file)
@@ -120,12 +120,6 @@ static inline void *memory_startswith(const void *p, size_t sz, const sd_char *t
         return (uint8_t*) p + n;
 }
 
-#define _STRV_FOREACH(s, l, i)                                          \
-        for (typeof(*(l)) *s, *i = (l); (s = i) && *i; i++)
-
-#define STRV_FOREACH(s, l)                      \
-        _STRV_FOREACH(s, l, UNIQ_T(i, UNIQ))
-
 static inline bool ascii_isdigit(sd_char a) {
         /* A pure ASCII, locale independent version of isdigit() */
         return a >= '0' && a <= '9';
diff --git a/src/fundamental/strv-fundamental.h b/src/fundamental/strv-fundamental.h
new file mode 100644 (file)
index 0000000..3abcdc4
--- /dev/null
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "macro-fundamental.h"
+
+#define _STRV_FOREACH(s, l, i)                                          \
+        for (typeof(*(l)) *s, *i = (l); (s = i) && *i; i++)
+
+#define STRV_FOREACH(s, l)                      \
+        _STRV_FOREACH(s, l, UNIQ_T(i, UNIQ))
index 1266bc7295a5fad1ee34b0ccc3a1834cec22f7cd..82b00d3d3b040e1c752961a13e3e3c9549c826b7 100644 (file)
@@ -8,6 +8,7 @@
 #include "path-util.h"
 #include "stdio-util.h"
 #include "string-util.h"
+#include "strv.h"
 #include "sysupdate-instance.h"
 #include "sysupdate-pattern.h"