From 12bc59ead5f6cb52ccdbfd87c470eb2f992aea64 Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 12 Mar 2023 10:39:38 +0100 Subject: [PATCH] libc: Add strspn, strcspn, and strtok declarations to string.h --- libc/include/string.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libc/include/string.h b/libc/include/string.h index feed91a8..b34d6504 100644 --- a/libc/include/string.h +++ b/libc/include/string.h @@ -47,6 +47,15 @@ extern "C" /* Return the human-readable description of an error number. */ char* strerror(int errnum); + /* Return the length of the initial segment of str which consists only of bytes in accept. */ + usize strspn(const char* str, const char* accept); + + /* Return the length of the initial segment of str which consists only of bytes not in reject. */ + usize strcspn(const char* str, const char* reject); + + /* Separate a string into several tokens. */ + char* strtok(char* str, const char* delim); + #ifdef __cplusplus } #endif