Blob Blame History Raw
#ifndef NTUX_NOLIBC_IMPL_H
#define NTUX_NOLIBC_IMPL_H

#define isatty   ntux_isatty
#define fileno   ntux_fileno

#define fputs    ntux_fputs
#define fprintf  ntux_fprintf
#define sprintf  ntux_sprintf
#define snprintf ntux_snprintf

#define memcpy   ntux_memcpy
#define memset   ntux_memset

#define strcpy   ntux_strcpy
#define strlen   ntux_strlen
#define strcmp   ntux_strcmp
#define strncmp  ntux_strncmp
#define strchr   ntux_strchr
#define strrchr  ntux_strrchr

#define calloc	 ntux_calloc
#define free	 ntux_free

#define stdin	 (void *)0
#define stdout	 (void *)1
#define stderr	 (void *)2

typedef struct ntux_file FILE;

int	ntux_isatty(int fildes);
int	ntux_fileno(void * any);

int	ntux_sprintf(char * str, const char * fmt, ...);
int	ntux_snprintf(char * str, size_t n, const char * fmt, ...);
int	ntux_fprintf(FILE *__restrict, const char *__restrict, ...);
int	ntux_fputs(const char * str, FILE * file);

void *  ntux_memcpy(void * dst, const void * src, size_t n);
void *	memset(void * ch, int c, size_t n);

char *	ntux_strcpy(char * dst, const char * src);
size_t	ntux_strlen(const char * ch);
int	ntux_strcmp(const char * a, const char * b);
int	ntux_strncmp(const char * a, const char * b, size_t n);
char *	ntux_strchr(const char * ch, int c);
char *	ntux_strrchr(const char * ch, int c);

void *	ntux_calloc(size_t n, size_t size);
void	ntux_free(void *);

#endif