strv: add new macro STARTSWITH_SET()
authorLennart Poettering <lennart@poettering.net>
Fri, 23 Nov 2018 15:27:15 +0000 (16:27 +0100)
committerThe Plumber <50238977+systemd-rhel-bot@users.noreply.github.com>
Mon, 2 Nov 2020 18:05:19 +0000 (19:05 +0100)
commit50b103a982dfd6f1b2bf98bbc98a8063fa153e89
tree8a5d5d00f0401edec234c99852497c1694619aa0
parent87c22d3bb794118d25bc138108fd5bdd607365ef
strv: add new macro STARTSWITH_SET()

This is to startswith() what PATH_STARTSWITH_SET() is to
path_startswith().

Or in other words, checks if the specified string has any of the listed
prefixes, and if so, returns the remainder of the string.

(cherry picked from commit 52f1552073047195d51901f7e5a5a4fa3189034e)

Related: #1848373
src/basic/strv.h
src/test/test-strv.c