X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=src%2Fmodel.c;h=2de9f9bf7aab40bf93275eae3502bce98ec9ff34;hb=4b452ca423971eea8b7f6c1d16b4567c11e71be3;hp=d3edd5ca38f223217865c5a547a0bfe8d203091c;hpb=65fae93f40acb49a7d18202bbf7fdac05cb12a19;p=projects%2Fchimara%2Fchimara.git diff --git a/src/model.c b/src/model.c index d3edd5c..2de9f9b 100644 --- a/src/model.c +++ b/src/model.c @@ -1,38 +1,7 @@ #include "glk.h" -/* model.c: Model program for Glk API, version 0.5. - Designed by Andrew Plotkin - http://www.eblong.com/zarf/glk/index.html - This program is in the public domain. -*/ - -/* This is a simple model of a text adventure which uses the Glk API. - It shows how to input a line of text, display results, maintain a - status window, write to a transcript file, and so on. */ - -/* This is the cleanest possible form of a Glk program. It includes only - "glk.h", and doesn't call any functions outside Glk at all. We even - define our own str_eq() and str_len(), rather than relying on the - standard libraries. */ - -/* We also define our own TRUE and FALSE and NULL. */ -#ifndef TRUE -#define TRUE 1 -#endif -#ifndef FALSE -#define FALSE 0 -#endif -#ifndef NULL -#define NULL 0 -#endif - static winid_t mainwin = NULL; -/* Forward declarations */ -void glk_main(void); - -/* The glk_main() function is called by the Glk system; it's the main entry - point for your program. */ void glk_main(void) { /* Open the main window. */ @@ -46,7 +15,20 @@ void glk_main(void) /* Set the current output stream to print to it. */ glk_set_window(mainwin); + unsigned char buffer[255]; + int i; + for(i = 0; i < 255; i++) + buffer[i] = glk_char_to_upper(i + 1); + glk_put_string("Philip en Marijn zijn vet goed.\n"); + glk_put_string(buffer); + + frefid_t f = glk_fileref_create_by_prompt(fileusage_TextMode, filemode_Write, 0); + if( glk_fileref_does_file_exist(f) ) + glk_put_string("\n\nFile exists!\n"); + else + glk_put_string("\n\nFile does not exist!\n"); + glk_fileref_destroy(f); /* Bye bye */ glk_exit();