3 static winid_t mainwin = NULL;
7 /* Open the main window. */
8 mainwin = glk_window_open(0, 0, 0, wintype_TextBuffer, 1);
10 /* It's possible that the main window failed to open. There's
11 nothing we can do without it, so exit. */
17 for(i = 0; i < 256; i++)
18 buffer[i] = (char)glk_char_to_upper(i);
20 /*frefid_t f = glk_fileref_create_temp(fileusage_BinaryMode, 0);
24 char memorybuffer[100];
26 strid_t s = glk_stream_open_memory(memorybuffer, 100,
27 filemode_ReadWrite, 0);
28 glk_stream_set_current(s);
30 glk_put_string("Philip en Marijn zijn vet goed.\n");
31 glk_put_buffer(buffer, 256);
33 glk_stream_set_position(s, 0, seekmode_Start);
34 glk_set_window(mainwin);
35 glk_put_char( glk_get_char_stream(s) );
37 g_printerr("Line read: %d\n", glk_get_line_stream(s, buffer, 256));
38 glk_put_string(buffer);
39 int count = glk_get_buffer_stream(s, buffer, 256);
40 g_printerr("Buffer read: %d\n", count);
41 glk_put_buffer(buffer, count);
43 stream_result_t result;
44 glk_stream_close(s, &result);
46 g_printerr("Read count: %d\nWrite count: %d\n", result.readcount,
49 glk_fileref_destroy(f);