summaryrefslogtreecommitdiffhomepage
path: root/src/internal/ntux_nolibc_impl.h
blob: d048bd4da843ad0ed5fa3eb4b2a2cf1230470be1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#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