3 /* model.c: Model program for Glk API, version 0.5.
4 Designed by Andrew Plotkin <erkyrath@eblong.com>
5 http://www.eblong.com/zarf/glk/index.html
6 This program is in the public domain.
9 /* This is a simple model of a text adventure which uses the Glk API.
10 It shows how to input a line of text, display results, maintain a
11 status window, write to a transcript file, and so on. */
13 /* This is the cleanest possible form of a Glk program. It includes only
14 "glk.h", and doesn't call any functions outside Glk at all. We even
15 define our own str_eq() and str_len(), rather than relying on the
16 standard libraries. */
18 /* We also define our own TRUE and FALSE and NULL. */
29 static winid_t mainwin = NULL;
31 /* Forward declarations */
34 /* The glk_main() function is called by the Glk system; it's the main entry
35 point for your program. */
38 /* Open the main window. */
39 mainwin = glk_window_open(0, 0, 0, wintype_TextBuffer, 1);
41 /* It's possible that the main window failed to open. There's
42 nothing we can do without it, so exit. */
46 /* Set the current output stream to print to it. */
47 glk_set_window(mainwin);
49 glk_put_string("Philip en Marijn zijn vet goed.\n");