1 /* glkio.h -- make stdio calls use glk i/o instead */
4 typedef struct glk_stream_struct FILE;
13 #define fclose(f) (glk_stream_close(f, NULL), 0)
15 #define ferror(f) (0) /* No ferror() equivalent */
17 #define fgetc(f) (glk_get_char_stream(f))
19 #define fgets(a, n, f) (glk_get_line_stream(f, a, n))
21 #define fread(a,s,n,f) (glk_get_buffer_stream(f, (char *)a, s*n))
23 #define fwrite(a,s,n,f) (glk_put_buffer_stream(f, (char *)a, s*n), 0)
25 #define fprintf(f,s,a) (glk_put_string_stream(f, a), 0)
27 #define fputc(c, f) (glk_put_char_stream(f, (unsigned char)(c)), 0)
29 #define fputs(s, f) (glk_put_buffer_stream(f, s, strlen(s)), 0)
31 #define ftell(f) (glk_stream_get_position(f))
33 #define fseek(f, p, m) (glk_stream_set_position(f, p, m), 0)
36 #define SEEK_SET seekmode_Start
38 #define SEEK_CUR seekmode_Current
40 #define SEEK_END seekmode_End
42 FILE *frotzopenprompt(int flag);
43 FILE *frotzopen(char *filename, int flag);