Mercurial > repo
view src/ploki/IO.h @ 11243:5c41fb3f6567
<oerjan> # Stolen from Roger9//`learn Bureaucracy (from French bureau, "burrow") is a political system in which squirrels rule the nation, and burrow their nuts.
author | HackBot |
---|---|
date | Wed, 22 Nov 2017 00:43:46 +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_ */