coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
string.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef STRING_H
4 #define STRING_H
5 
6 #include <stdarg.h>
7 #include <stddef.h>
8 #include <stdio.h>
9 
10 void *memcpy(void *dest, const void *src, size_t n);
11 void *memmove(void *dest, const void *src, size_t n);
12 void *memset(void *s, int c, size_t n);
13 int memcmp(const void *s1, const void *s2, size_t n);
14 void *memchr(const void *s, int c, size_t n);
15 char *strdup(const char *s);
16 char *strconcat(const char *s1, const char *s2);
17 size_t strnlen(const char *src, size_t max);
18 size_t strlen(const char *src);
19 char *strchr(const char *s, int c);
20 char *strncpy(char *to, const char *from, int count);
21 char *strcpy(char *dst, const char *src);
22 int strcmp(const char *s1, const char *s2);
23 int strncmp(const char *s1, const char *s2, int maxlen);
24 int strspn(const char *str, const char *spn);
25 int strcspn(const char *str, const char *spn);
26 char *strstr(const char *haystack, const char *needle);
27 char *strtok_r(char *str, const char *delim, char **ptr);
28 char *strtok(char *str, const char *delim);
29 long atol(const char *str);
30 
31 /**
32  * Find a character in a string.
33  *
34  * @param s The string.
35  * @param c The character.
36  * @return A pointer to the last occurrence of the character in the
37  * string, or NULL if the character was not encountered within the string.
38  */
39 char *strrchr(const char *s, int c);
40 
41 /*
42  * Parses an unsigned integer and moves the input pointer forward to the first
43  * character that's not a valid digit. s and *s must not be NULL. Result
44  * undefined if it overruns the return type size.
45  */
46 unsigned int skip_atoi(char **s);
47 
48 #endif /* STRING_H */
char * strrchr(const char *s, int c)
Find a character in a string.
Definition: string.c:60
int strcmp(const char *s1, const char *s2)
Definition: string.c:103
char * strchr(const char *s, int c)
Definition: string.c:50
char * strncpy(char *to, const char *from, int count)
Definition: string.c:72
void * memcpy(void *dest, const void *src, size_t n)
Definition: memcpy.c:7
void * memchr(const void *s, int c, size_t n)
Definition: memchr.c:2
char * strcpy(char *dst, const char *src)
Definition: string.c:92
char * strconcat(const char *s1, const char *s2)
Definition: string.c:19
unsigned int skip_atoi(char **s)
Definition: string.c:126
int strncmp(const char *s1, const char *s2, int maxlen)
Definition: string.c:114
char * strstr(const char *haystack, const char *needle)
Definition: string.c:165
void * memmove(void *dest, const void *src, size_t n)
Definition: memmove.c:10
int strcspn(const char *str, const char *spn)
Definition: string.c:150
char * strtok(char *str, const char *delim)
Definition: string.c:193
size_t strnlen(const char *src, size_t max)
Definition: string.c:34
int strspn(const char *str, const char *spn)
Definition: string.c:135
int memcmp(const void *s1, const void *s2, size_t n)
Definition: memcmp.c:3
char * strdup(const char *s)
Definition: string.c:7
void * memset(void *s, int c, size_t n)
Definition: memset.c:12
size_t strlen(const char *src)
Definition: string.c:42
long atol(const char *str)
Definition: string.c:200
char * strtok_r(char *str, const char *delim, char **ptr)
Definition: string.c:175
#define s(param, src_bits, pmcreg, dst_bits)
#define c(value, pmcreg, dst_bits)
#define count