mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
string: Add strcspn()
Add an implementation of strcspn() which returns the number of initial characters that do not match any in a rejection list. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@ -76,6 +76,21 @@ extern __kernel_size_t strlen(const char *);
|
||||
#ifndef __HAVE_ARCH_STRNLEN
|
||||
extern __kernel_size_t strnlen(const char *,__kernel_size_t);
|
||||
#endif
|
||||
|
||||
#ifndef __HAVE_ARCH_STRCSPN
|
||||
/**
|
||||
* strcspn() - find span of string without given characters
|
||||
*
|
||||
* Calculates the length of the initial segment of @s which consists entirely
|
||||
* of bsytes not in reject.
|
||||
*
|
||||
* @s: string to search
|
||||
* @reject: strings which cause the search to halt
|
||||
* @return number of characters at the start of @s which are not in @reject
|
||||
*/
|
||||
size_t strcspn(const char *s, const char *reject);
|
||||
#endif
|
||||
|
||||
#ifndef __HAVE_ARCH_STRDUP
|
||||
extern char * strdup(const char *);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user