]> git.ipfire.org Git - thirdparty/shadow.git/commit
lib/string/strchr/: strrcspn(), stprcspn(): Add function and macro
authorAlejandro Colomar <alx@kernel.org>
Sat, 16 Nov 2024 13:33:34 +0000 (14:33 +0100)
committerSerge Hallyn <serge@hallyn.com>
Sun, 16 Feb 2025 19:22:51 +0000 (13:22 -0600)
commitc2a634efa78e5e9c92d68423afa761e6bc1b7130
treee4cb91fb50d0e17dd661ab6cbc63951511b5678d
parent7936241f425209b71ebc8986448c0c55069eb18c
lib/string/strchr/: strrcspn(), stprcspn(): Add function and macro

These APIs are to strrspn(), like strcspn() is to strspn().
They are like strcspn(3), but search from the end of the string.

The function is meant for internal use, and consistency with libc.
The macro is meant for normal use, since it returns a pointer,
which is what algorithms using this need.

See also strspn(3) and strcspn(3).

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