Eerste import.
[rodin/chimara.git] / src / model.c
1 #include "glk.h"
2
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.
7 */
8
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. */
12
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. */
17
18 /* We also define our own TRUE and FALSE and NULL. */
19 #ifndef TRUE
20 #define TRUE 1
21 #endif
22 #ifndef FALSE
23 #define FALSE 0
24 #endif
25 #ifndef NULL
26 #define NULL 0
27 #endif
28
29 static winid_t mainwin = NULL;
30
31 /* Forward declarations */
32 void glk_main(void);
33
34 /* The glk_main() function is called by the Glk system; it's the main entry
35     point for your program. */
36 void glk_main(void)
37 {
38     /* Open the main window. */
39     mainwin = glk_window_open(0, 0, 0, wintype_TextBuffer, 1);
40     if (!mainwin) {
41         /* It's possible that the main window failed to open. There's
42             nothing we can do without it, so exit. */
43         return; 
44     }
45     
46     /* Set the current output stream to print to it. */
47     glk_set_window(mainwin);
48     
49     glk_put_string("Philip en Marijn zijn vet goed.\n");
50
51         /* Bye bye */
52         glk_exit();
53 }