]> git.ipfire.org Git - thirdparty/shadow.git/commit
lib/string/strtok/: strsep2arr(), STRSEP2ARR(): Add APIs
authorAlejandro Colomar <alx@kernel.org>
Fri, 6 Dec 2024 20:15:10 +0000 (21:15 +0100)
committerAlejandro Colomar <foss+github@alejandro-colomar.es>
Sat, 7 Jun 2025 14:52:03 +0000 (16:52 +0200)
commit4e64ef699373c32e0336a53f2d6f0718279ddb5b
tree17e492abf7fe9093396eed21c7ed4386aca14693
parent3ee8692fd63778d9455fc0af2414a87c851078bc
lib/string/strtok/: strsep2arr(), STRSEP2ARR(): Add APIs

This API set implements the usual loop around strsep(3).

This one implements a loop where we are interested in an exact number of
fields.  I'll add another API set, strsep2ls() and STRSEP2LS(), which
will add a NULL terminator, for arbitrary numbers of fields.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/Makefile.am
lib/string/strtok/strsep2arr.c [new file with mode: 0644]
lib/string/strtok/strsep2arr.h [new file with mode: 0644]