]>
Commit | Line | Data |
---|---|---|
db9ecf05 | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
d8b4d14d LP |
2 | #pragma once |
3 | ||
4 | #include <stdbool.h> | |
5 | #include <string.h> | |
6 | ||
7 | #define NULSTR_FOREACH(i, l) \ | |
12e2b70f | 8 | for (typeof(*(l)) *(i) = (l); (i) && *(i); (i) = strchr((i), 0)+1) |
d8b4d14d LP |
9 | |
10 | #define NULSTR_FOREACH_PAIR(i, j, l) \ | |
12e2b70f | 11 | for (typeof(*(l)) *(i) = (l), *(j) = strchr((i), 0)+1; (i) && *(i); (i) = strchr((j), 0)+1, (j) = *(i) ? strchr((i), 0)+1 : (i)) |
d8b4d14d | 12 | |
533f11c5 AF |
13 | const char* nulstr_get(const char *nulstr, const char *needle); |
14 | ||
15 | static inline bool nulstr_contains(const char *nulstr, const char *needle) { | |
16 | return nulstr_get(nulstr, needle); | |
17 | } |