Blob Blame History Raw
#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_write(int, const void *, size_t);
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