Documentation: Fix sphinx configuration
[coreboot.git] / src / include / string.h
blob3cfa18d33cd0a69d2fd0c66559fda4b7df5b41d3
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef STRING_H
4 #define STRING_H
6 #include <stdarg.h>
7 #include <stddef.h>
8 #include <stdio.h>
10 /* Stringify a token */
11 #ifndef STRINGIFY
12 #define _STRINGIFY(x) #x
13 #define STRINGIFY(x) _STRINGIFY(x)
14 #endif
16 void *memcpy(void *dest, const void *src, size_t n);
17 void *memmove(void *dest, const void *src, size_t n);
18 void *memset(void *s, int c, size_t n);
19 int memcmp(const void *s1, const void *s2, size_t n);
20 void *memchr(const void *s, int c, size_t n);
21 char *strdup(const char *s);
22 char *strconcat(const char *s1, const char *s2);
23 size_t strnlen(const char *src, size_t max);
24 size_t strlen(const char *src);
25 char *strchr(const char *s, int c);
26 char *strncpy(char *to, const char *from, int count);
27 char *strcpy(char *dst, const char *src);
28 int strcmp(const char *s1, const char *s2);
29 int strncmp(const char *s1, const char *s2, int maxlen);
30 int strspn(const char *str, const char *spn);
31 int strcspn(const char *str, const char *spn);
32 char *strstr(const char *haystack, const char *needle);
33 char *strtok_r(char *str, const char *delim, char **ptr);
34 char *strtok(char *str, const char *delim);
35 long atol(const char *str);
37 /**
38 * Find a character in a string.
40 * @param s The string.
41 * @param c The character.
42 * @return A pointer to the last occurrence of the character in the
43 * string, or NULL if the character was not encountered within the string.
45 char *strrchr(const char *s, int c);
48 * Parses an unsigned integer and moves the input pointer forward to the first
49 * character that's not a valid digit. s and *s must not be NULL. Result
50 * undefined if it overruns the return type size.
52 unsigned int skip_atoi(char **s);
54 #endif /* STRING_H */