diff options
author | midipix <writeonce@midipix.org> | 2016-12-20 20:53:41 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-12-27 04:40:56 -0500 |
commit | 26e14f4143ec690a120e197a3adf547145e4ce59 (patch) | |
tree | e9e8b522de5abb14230c5f8e0825452f0c7ccb4b /src/internal/ntux_nolibc_impl.h | |
parent | 70c49fc4ed3b2c3db68537f828c286241eeeee98 (diff) | |
download | ntux-26e14f4143ec690a120e197a3adf547145e4ce59.tar.bz2 ntux-26e14f4143ec690a120e197a3adf547145e4ce59.tar.xz |
create free-standing, libpsxscl-based project skeleton.
Diffstat (limited to 'src/internal/ntux_nolibc_impl.h')
-rw-r--r-- | src/internal/ntux_nolibc_impl.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/internal/ntux_nolibc_impl.h b/src/internal/ntux_nolibc_impl.h new file mode 100644 index 0000000..d048bd4 --- /dev/null +++ b/src/internal/ntux_nolibc_impl.h @@ -0,0 +1,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 |