mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
string-util: Add startswith_strv()
This is the function version of STARTSWITH_SET(). We also move STARTSWITH_SET() to string-util.h as it fits more there than in strv.h and reimplement it using startswith_strv().
This commit is contained in:
@@ -267,3 +267,8 @@ char *strdupspn(const char *a, const char *accept);
|
||||
char *strdupcspn(const char *a, const char *reject);
|
||||
|
||||
char *find_line_startswith(const char *haystack, const char *needle);
|
||||
|
||||
char *startswith_strv(const char *string, char **strv);
|
||||
|
||||
#define STARTSWITH_SET(p, ...) \
|
||||
startswith_strv(p, STRV_MAKE(__VA_ARGS__))
|
||||
|
||||
Reference in New Issue
Block a user