2020-03-12 11:15:34 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
|
2003-04-22 21:02:15 +02:00
|
|
|
#ifndef STRING_H
|
|
|
|
#define STRING_H
|
|
|
|
|
2020-03-12 11:15:34 +01:00
|
|
|
#include <stdarg.h>
|
2003-04-22 21:02:15 +02:00
|
|
|
#include <stddef.h>
|
2020-03-12 11:15:34 +01:00
|
|
|
#include <stdio.h>
|
2018-01-29 03:01:10 +01:00
|
|
|
|
2013-04-26 18:58:35 +02:00
|
|
|
/* Stringify a token */
|
|
|
|
#ifndef STRINGIFY
|
|
|
|
#define _STRINGIFY(x) #x
|
|
|
|
#define STRINGIFY(x) _STRINGIFY(x)
|
|
|
|
#endif
|
|
|
|
|
2008-08-01 13:39:35 +02:00
|
|
|
void *memcpy(void *dest, const void *src, size_t n);
|
|
|
|
void *memmove(void *dest, const void *src, size_t n);
|
|
|
|
void *memset(void *s, int c, size_t n);
|
|
|
|
int memcmp(const void *s1, const void *s2, size_t n);
|
2011-09-16 11:18:56 +02:00
|
|
|
void *memchr(const void *s, int c, size_t n);
|
2019-01-29 12:48:01 +01:00
|
|
|
char *strdup(const char *s);
|
|
|
|
char *strconcat(const char *s1, const char *s2);
|
2019-05-20 23:53:47 +02:00
|
|
|
size_t strnlen(const char *src, size_t max);
|
|
|
|
size_t strlen(const char *src);
|
|
|
|
char *strchr(const char *s, int c);
|
|
|
|
char *strncpy(char *to, const char *from, int count);
|
|
|
|
char *strcpy(char *dst, const char *src);
|
|
|
|
int strcmp(const char *s1, const char *s2);
|
|
|
|
int strncmp(const char *s1, const char *s2, int maxlen);
|
2019-06-13 02:42:19 +02:00
|
|
|
int strspn(const char *str, const char *spn);
|
|
|
|
int strcspn(const char *str, const char *spn);
|
|
|
|
long atol(const char *str);
|
2003-04-22 21:02:15 +02:00
|
|
|
|
2018-03-29 10:05:34 +02:00
|
|
|
/**
|
|
|
|
* Find a character in a string.
|
|
|
|
*
|
|
|
|
* @param s The string.
|
|
|
|
* @param c The character.
|
|
|
|
* @return A pointer to the last occurrence of the character in the
|
|
|
|
* string, or NULL if the character was not encountered within the string.
|
|
|
|
*/
|
2019-05-20 23:53:47 +02:00
|
|
|
char *strrchr(const char *s, int c);
|
2012-12-19 20:22:07 +01:00
|
|
|
|
2019-05-20 23:53:47 +02:00
|
|
|
/*
|
|
|
|
* Parses an unsigned integer and moves the input pointer forward to the first
|
|
|
|
* character that's not a valid digit. s and *s must not be NULL. Result
|
|
|
|
* undefined if it overruns the return type size.
|
|
|
|
*/
|
|
|
|
unsigned int skip_atoi(char **s);
|
2009-03-01 11:16:01 +01:00
|
|
|
|
2003-04-22 21:02:15 +02:00
|
|
|
#endif /* STRING_H */
|