2019-07-16 21:11:44 +02:00
|
|
|
//---
|
|
|
|
// gint:std:string - a few <string.h> functions provided by gint
|
|
|
|
//---
|
|
|
|
|
|
|
|
#ifndef GINT_STD_STRING
|
|
|
|
#define GINT_STD_STRING
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
/* memcpy(): Copy a chunk of memory to a non-overlapping destination */
|
2021-04-27 14:46:07 +02:00
|
|
|
void *memcpy(void * __restrict dest, void const * __restrict src, size_t n);
|
2019-07-16 21:11:44 +02:00
|
|
|
|
|
|
|
/* memset(): Fill a chunk of memory with a single byte */
|
|
|
|
void *memset(void *dest, int byte, size_t n);
|
|
|
|
|
2021-04-20 12:19:24 +02:00
|
|
|
/* memcmp(): Compare two chunks of memory */
|
2020-07-04 15:05:28 +02:00
|
|
|
int memcmp(void const *s1, void const *s2, size_t n);
|
|
|
|
|
|
|
|
/* memmove(): Copy a chunk of memory to a possibly overlapping destination */
|
|
|
|
void *memmove(void *dest, void const *src, size_t n);
|
|
|
|
|
2019-07-16 21:11:44 +02:00
|
|
|
/* strlen(): Length of a NUL-terminated string */
|
|
|
|
size_t strlen(char const *str);
|
|
|
|
|
2019-09-19 15:59:38 +02:00
|
|
|
/* strncpy(): Copy a string with a size limit */
|
2019-07-16 21:11:44 +02:00
|
|
|
char *strncpy(char *dst, char const *src, size_t n);
|
|
|
|
|
2019-09-19 15:59:38 +02:00
|
|
|
/* strcat(): Concatenation a string to a pre-allocated space */
|
2019-07-19 15:06:24 +02:00
|
|
|
char *strcat(char *dest, const char *src);
|
|
|
|
|
2019-09-19 15:59:38 +02:00
|
|
|
/* strcmp(): Compare NUL-terminated strings */
|
|
|
|
int strcmp(char const *s1, char const *s2);
|
|
|
|
|
2021-02-15 16:43:42 +01:00
|
|
|
/* strchr(): Find the first occurrence of a character in a string */
|
|
|
|
char *strchr(char const *s, int c);
|
|
|
|
|
|
|
|
/* strrchr(): Find the last occurrence of a character in a string */
|
|
|
|
char *strrchr(char const *s, int c);
|
|
|
|
|
|
|
|
/* strchrnul(): Like strchr(), but returns end-of-string instead of NUL */
|
|
|
|
char *strchrnul(char const *s, int c);
|
|
|
|
|
2019-07-16 21:11:44 +02:00
|
|
|
#endif /* GINT_STD_STRING */
|