summaryrefslogtreecommitdiffhomepage
path: root/src/internal/ptycon_nolibc_impl.h
blob: 7050c03b2aed491f863b63ce05698358bd8aae14 (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 PTYCON_NOLIBC_IMPL_H
#define PTYCON_NOLIBC_IMPL_H

#define isatty   ptyc_isatty
#define fileno   ptyc_fileno

#define fputs    ptyc_fputs
#define fprintf  ptyc_fprintf
#define sprintf  ptyc_sprintf
#define snprintf ptyc_snprintf

#define memcpy   ptyc_memcpy
#define memset   ptyc_memset

#define strcpy   ptyc_strcpy
#define strlen   ptyc_strlen
#define strcmp   ptyc_strcmp
#define strncmp  ptyc_strncmp
#define strchr   ptyc_strchr
#define strrchr  ptyc_strrchr

#define calloc	 ptyc_calloc
#define free	 ptyc_free

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

typedef struct ptyc_file FILE;

int	ptyc_isatty(int fildes);
int	ptyc_fileno(void * any);

int	ptyc_sprintf(char * str, const char * fmt, ...);
int	ptyc_snprintf(char * str, size_t n, const char * fmt, ...);
int	ptyc_fprintf(FILE *__restrict, const char *__restrict, ...);
int	ptyc_fputs(const char * str, FILE * file);

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

char *	ptyc_strcpy(char * dst, const char * src);
size_t	ptyc_strlen(const char * ch);
int	ptyc_strcmp(const char * a, const char * b);
int	ptyc_strncmp(const char * a, const char * b, size_t n);
char *	ptyc_strchr(const char * ch, int c);
char *	ptyc_strrchr(const char * ch, int c);

void *	ptyc_calloc(size_t n, size_t size);
void	ptyc_free(void *);

#endif