diff options
author | anthk <anthk@texto-plano.xyz> | 2021-03-08 21:34:43 +0000 |
---|---|---|
committer | anthk <anthk@texto-plano.xyz> | 2021-03-08 21:34:43 +0000 |
commit | 712b0690da4b03842a954bfbd1f75925bb7b234e (patch) | |
tree | 0ccf9ff3d8406e658dea919da669ce9e6760627b /unixio.h | |
download | bwbasic-master.tar.gz |
Diffstat (limited to 'unixio.h')
-rw-r--r-- | unixio.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/unixio.h b/unixio.h new file mode 100644 index 0000000..bc0a86c --- /dev/null +++ b/unixio.h @@ -0,0 +1,41 @@ +/* written by Paul Edwards */ +/* released to the public domain */ + +#ifndef UNIXIO_INCLUDED +#define UNIXIO_INCLUDED + +#include <stddef.h> + +#define S_IFBLK 0x3000 +#define S_IFDIR 0x4000 +#define S_IFREG 0x8000 +#define S_IFMT 0xf000 + +#ifndef ENOENT +#define ENOENT 2002 +#endif +#ifndef ENOTDIR +#define ENOTDIR 2045 +#endif + +#define O_RDONLY 1 +#define O_WRONLY 2 +#define O_RDWR 4 +#define O_CREAT 0x100 +#define O_TRUNC 0x200 + +struct stat { + long st_size; + long st_mode; + long st_ino; + long st_dev; + long st_mtime; +}; + +int open(const char *fnm, int mode, ...); +int read(int fno, void *buf, size_t bytes); +int write(int fno, const void *buf, size_t bytes); +int close(int fno); +char *mktemp(char *s); + +#endif |