7 typedef struct zterp_io zterp_io;
9 #define ZTERP_IO_DATA 0x00
10 #define ZTERP_IO_SAVE 0x01
11 #define ZTERP_IO_TRANS 0x02
12 #define ZTERP_IO_INPUT 0x04
13 #define ZTERP_IO_RDONLY 0x08
14 #define ZTERP_IO_WRONLY 0x10
15 #define ZTERP_IO_APPEND 0x20
17 /* This variable controls whether the IO system writes UTF-8 or
18 * Latin-1; it is distinct from Glk’s Unicode setting.
19 * If this is set, transcripts will be written in UTF-8, and if
20 * Glk is not being used, screen output will be written in UTF-8.
22 extern int use_utf8_io;
24 zterp_io *zterp_io_open(const char *, int);
25 const zterp_io *zterp_io_stdin(void);
26 const zterp_io *zterp_io_stdout(void);
27 void zterp_io_close(zterp_io *);
28 int zterp_io_seek(const zterp_io *, long, int);
29 long zterp_io_tell(const zterp_io *);
30 size_t zterp_io_read(const zterp_io *, void *, size_t);
31 size_t zterp_io_write(const zterp_io *, const void *, size_t);
32 int zterp_io_read16(const zterp_io *, uint16_t *);
33 int zterp_io_read32(const zterp_io *, uint32_t *);
34 long zterp_io_getc(const zterp_io *);
35 void zterp_io_putc(const zterp_io *, uint16_t);
36 long zterp_io_readline(const zterp_io *, uint16_t *, size_t);
37 long zterp_io_filesize(const zterp_io *);
38 void zterp_io_flush(const zterp_io *);