diff options
author | Taru Karttunen <taruti@taruti.net> | 2011-03-30 15:46:40 +0300 |
---|---|---|
committer | Taru Karttunen <taruti@taruti.net> | 2011-03-30 15:46:40 +0300 |
commit | e5888a1ffdae813d7575f5fb02275c6bb07e5199 (patch) | |
tree | d8d51eac403f07814b9e936eed0c9a79195e2450 /sys/src/ape/lib/ap/stdio/iolib.h |
Import sources from 2011-03-30 iso image
Diffstat (limited to 'sys/src/ape/lib/ap/stdio/iolib.h')
-rwxr-xr-x | sys/src/ape/lib/ap/stdio/iolib.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/sys/src/ape/lib/ap/stdio/iolib.h b/sys/src/ape/lib/ap/stdio/iolib.h new file mode 100755 index 000000000..3a5bd63a0 --- /dev/null +++ b/sys/src/ape/lib/ap/stdio/iolib.h @@ -0,0 +1,44 @@ +/* + * pANS stdio -- definitions + * The following names are defined in the pANS: + * FILE fpos_t _IOFBF _IOLBF _IONBF + * BUFSIZ EOF FOPEN_MAX FILENAME_MAX L_tmpnam + * SEEK_CUR SEEK_END SEEK_SET TMP_MAX stderr + * stdin stdout remove rename tmpfile + * tmpnam fclose fflush fopen freopen + * setbuf setvbuf fprintf fscanf printf + * scanf sprintf sscanf vfprintf vprintf + * vsprintf fgetc fgets fputc fputs + * getc getchar gets putc putchar + * puts ungetc fread fwrite fgetpos + * fseek fsetpos ftell rewind clearerr + * feof ferror perror + */ +#include <stdio.h> +#include <stdlib.h> +#include <sys/types.h> +#include <unistd.h> +#include <fcntl.h> + +/* + * Flag bits + */ +#define BALLOC 1 /* did stdio malloc fd->buf? */ +#define LINEBUF 2 /* is stream line buffered? */ +#define STRING 4 /* output to string, instead of file */ +#define APPEND 8 /* append mode output */ +/* + * States + */ +#define CLOSED 0 /* file not open */ +#define OPEN 1 /* file open, but no I/O buffer allocated yet */ +#define RDWR 2 /* open, buffer allocated, ok to read or write */ +#define RD 3 /* open, buffer allocated, ok to read but not write */ +#define WR 4 /* open, buffer allocated, ok to write but not read */ +#define ERR 5 /* open, but an uncleared error occurred */ +#define END 6 /* open, but at eof */ +char *strerror(int errno); +int _IO_setvbuf(FILE *); +FILE *_IO_sopenr(const char*); +FILE *_IO_sopenw(void); +char *_IO_sclose(FILE *); |