Mercurial > repo
view src/ploki/IO.h @ 9717:9fec49b4918c
<oerjan> learn Ascii is the plural of ascius, "of or pertaining to southern countries, near the equator".
author | HackBot |
---|---|
date | Fri, 18 Nov 2016 02:32:30 +0000 |
parents | ac0403686959 |
children |
line wrap: on
line source
#ifndef IO_H_ #define IO_H_ #include "config.h" #include "Str.h" #include <stdio.h> typedef struct IO IO; enum io_flags { IO_BINARY = 1, IO_READ = 2 * IO_BINARY, IO_WRITE = 2 * IO_READ, IO_APPEND = 2 * IO_WRITE, IO_TRUNCATE = 2 * IO_APPEND, IO_BUFFERED = 2 * IO_TRUNCATE, IO_AUTOFLUSH = 2 * IO_BUFFERED }; enum io_whence { IOS_START = SEEK_SET, IOS_CUR = SEEK_CUR, IOS_END = SEEK_END }; void io_init(void); void io_end(void); const char *io_name(const IO *, String *); IO *io_enter(const char *, FILE *, enum io_flags); IO *io_open(const char *, enum io_flags); IO *io_incr(IO *); void io_decr(IO *); int io_close(IO *); ATTR_PURE int io_bufred(const IO *); void io_unbuffer(IO *); const char *io_bufptr(IO *); ATTR_PURE FILE *io_fp(const IO *); int io_flush(IO *); ATTR_PURE int io_err(const IO *); ATTR_PURE int io_eof(const IO *); int io_peek(IO *, size_t); int io_cmppeek(IO *, size_t, const void *, size_t); int io_xcmp(IO *, size_t, size_t, size_t); size_t io_read(IO *, String *, size_t); int io_getc(IO *); size_t io_getline(IO *, String *); size_t io_write(IO *, const String *); size_t io_write_m(IO *, const void *, size_t); size_t io_write_s(IO *, const char *); int io_putc(IO *, int); long io_tell(IO *); int io_seek(IO *, long, enum io_whence); void io_clearerr(IO *); #endif /* IO_H_ */