X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=src%2Fmodel.c;h=b89dbc958bcf8f40f93da00bdf26712f64d6e76e;hb=5292406311d31682a850baf059cab01a6f0262b2;hp=f0af53f839e0cc5aea9f15c6743079b13056402c;hpb=2baac1a1aa285bc52da8feb92433144a1e50bcce;p=rodin%2Fchimara.git diff --git a/src/model.c b/src/model.c index f0af53f..b89dbc9 100644 --- a/src/model.c +++ b/src/model.c @@ -2,6 +2,11 @@ static winid_t mainwin = NULL; +void sayit(void) +{ + g_printerr("I'm the interrupt handler!\n"); +} + void glk_main(void) { /* Open the main window. */ @@ -52,11 +57,13 @@ void glk_main(void) glk_set_window(mainwin); - gchar buffer[256] = "blaat"; + glk_set_interrupt_handler(&sayit); + + gchar buffer[256]; event_t ev; while(1) { glk_put_string("prompt> "); - glk_request_line_event(mainwin, buffer, 256, 5); + glk_request_line_event(mainwin, buffer, 256, 0); glk_select(&ev); switch(ev.type) { default: @@ -67,7 +74,6 @@ void glk_main(void) printf("Var2: %d\n", ev.val2); } } - /* Bye bye */ glk_exit();