summaryrefslogtreecommitdiffhomepage
path: root/src/internal/ptycon_nolibc_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/ptycon_nolibc_impl.h')
-rw-r--r--src/internal/ptycon_nolibc_impl.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/internal/ptycon_nolibc_impl.h b/src/internal/ptycon_nolibc_impl.h
new file mode 100644
index 0000000..7050c03
--- /dev/null
+++ b/src/internal/ptycon_nolibc_impl.h
@@ -0,0 +1,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