mirror of
https://github.com/systemd/systemd.git
synced 2026-08-04 15:10:33 +00:00
strv: Move STRV_FOREACH() to strv-fundamental.h
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "alloc-util.h"
|
||||
#include "hashmap.h"
|
||||
#include "memory-util.h"
|
||||
#include "strv-fundamental.h"
|
||||
|
||||
typedef enum ExtractFlags ExtractFlags;
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "stat-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "virt.h"
|
||||
|
||||
enum {
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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';
|
||||
|
||||
10
src/fundamental/strv-fundamental.h
Normal file
10
src/fundamental/strv-fundamental.h
Normal file
@@ -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))
|
||||
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user