Declarations for the string core, stdio, stdlib, unistd, errno, sys/types, and the raw syscall interface; the FILE layout stays private in src/internal.h. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]>
33 lines
805 B
C
33 lines
805 B
C
/*
|
|
* string.h — memory and string operations.
|
|
*
|
|
* All functions here are real, tiny, and freestanding: no libc, no
|
|
* compiler builtins. They are the foundation everything else builds on.
|
|
*/
|
|
|
|
#ifndef _NULSL_STRING_H
|
|
#define _NULSL_STRING_H
|
|
|
|
#include <stddef.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
size_t strlen(const char *s);
|
|
int strcmp(const char *a, const char *b);
|
|
int strncmp(const char *a, const char *b, size_t n);
|
|
char *strcpy(char *dst, const char *src);
|
|
char *strncpy(char *dst, const char *src, size_t n);
|
|
|
|
void *memcpy(void *restrict dst, const void *restrict src, size_t n);
|
|
void *memmove(void *dst, const void *src, size_t n);
|
|
void *memset(void *dst, int c, size_t n);
|
|
int memcmp(const void *a, const void *b, size_t n);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* _NULSL_STRING_H */
|