1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 3 #ifndef STRING_H 4 #define STRING_H 5 6 #include <commonlib/bsd/string.h> 7 #include <stddef.h> 8 9 void *memcpy(void *dest, const void *src, size_t n); 10 void *memmove(void *dest, const void *src, size_t n); 11 void *memset(void *s, int c, size_t n); 12 int memcmp(const void *s1, const void *s2, size_t n); 13 void *memchr(const void *s, int c, size_t n); 14 char *strdup(const char *s); 15 char *strconcat(const char *s1, const char *s2); 16 size_t strnlen(const char *src, size_t max); 17 size_t strlen(const char *src); 18 char *strchr(const char *s, int c); 19 char *strncpy(char *to, const char *from, size_t count); 20 char *strcpy(char *dst, const char *src); 21 int strcmp(const char *s1, const char *s2); 22 int strncmp(const char *s1, const char *s2, size_t maxlen); 23 size_t strspn(const char *str, const char *spn); 24 size_t strcspn(const char *str, const char *spn); 25 char *strstr(const char *haystack, const char *needle); 26 char *strtok_r(char *str, const char *delim, char **ptr); 27 char *strtok(char *str, const char *delim); 28 long atol(const char *str); 29 30 /** 31 * Find a character in a string. 32 * 33 * @param s The string. 34 * @param c The character. 35 * @return A pointer to the last occurrence of the character in the 36 * string, or NULL if the character was not encountered within the string. 37 */ 38 char *strrchr(const char *s, int c); 39 40 #endif /* STRING_H */ 41