2021-01-13 03:22:11 +09:00
|
|
|
/* SPDX-License-Identifier: MIT */
|
|
|
|
|
|
|
|
#ifndef STRING_H
|
|
|
|
#define STRING_H
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
void *memcpy(void *s1, const void *s2, size_t n);
|
2021-01-29 20:03:23 +09:00
|
|
|
void *memmove(void *s1, const void *s2, size_t n);
|
2021-01-13 03:22:11 +09:00
|
|
|
int memcmp(const void *s1, const void *s2, size_t n);
|
|
|
|
void *memset(void *s, int c, size_t n);
|
2021-01-15 03:55:20 +09:00
|
|
|
void *memchr(const void *s, int c, size_t n);
|
2021-01-13 03:22:11 +09:00
|
|
|
char *strcpy(char *s1, const char *s2);
|
|
|
|
char *strncpy(char *s1, const char *s2, size_t n);
|
|
|
|
int strcmp(const char *s1, const char *s2);
|
2021-01-29 20:03:23 +09:00
|
|
|
int strncmp(const char *s1, const char *s2, size_t n);
|
2021-01-15 03:55:20 +09:00
|
|
|
size_t strlen(const char *s);
|
2021-03-08 01:31:14 +09:00
|
|
|
size_t strnlen(const char *s, size_t n);
|
2021-01-15 03:55:20 +09:00
|
|
|
char *strchr(const char *s, int c);
|
2021-01-29 20:03:23 +09:00
|
|
|
char *strrchr(const char *s, int c);
|
2024-09-23 23:20:27 +08:00
|
|
|
char *strstr(const char *s1, const char *s2);
|
2022-03-27 17:23:34 +09:00
|
|
|
long atol(const char *s);
|
2021-01-13 03:22:11 +09:00
|
|
|
|
2021-10-18 18:17:15 +09:00
|
|
|
static inline int tolower(int c)
|
|
|
|
{
|
|
|
|
if (c >= 'A' && c <= 'Z')
|
|
|
|
return c - 'A' + 'a';
|
|
|
|
else
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int toupper(int c)
|
|
|
|
{
|
|
|
|
if (c >= 'a' && c <= 'z')
|
|
|
|
return c - 'a' + 'A';
|
|
|
|
else
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
2021-01-13 03:22:11 +09:00
|
|
|
#endif
|