]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/nulstr-util.h
update TODO
[thirdparty/systemd.git] / src / basic / nulstr-util.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 #include <stdbool.h>
5 #include <string.h>
6
7 #define NULSTR_FOREACH(i, l) \
8 for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1)
9
10 #define NULSTR_FOREACH_PAIR(i, j, l) \
11 for ((i) = (l), (j) = strchr((i), 0)+1; (i) && *(i); (i) = strchr((j), 0)+1, (j) = *(i) ? strchr((i), 0)+1 : (i))
12
13 bool nulstr_contains(const char *nulstr, const char *needle);