HALF ECHO LEARN / REFERENCE COLLECTION

v262.2

src/fundamental/strv.h

Git blob: 0ede9c3b796a1cac05e018c25fb9a94915531b8d

Lines 1–16 of 16

/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
 
#include "macro.h"
#include "string-util.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))
 
static inline bool strv_isempty(sd_char * const *l) {
        return !l || !*l;
}