test.c (416B)
1 // Copyright 2023, Brian Swetland <swetland@frotz.net> 2 // Licensed under the Apache License, Version 2.0. 3 4 #include <tui.h> 5 #include <string.h> 6 7 void handle_line(char* line, unsigned len) { 8 if (len) { 9 tui_printf("? %s\n", line); 10 } 11 if (!strcmp(line, "exit")) { 12 tui_exit(); 13 exit(-1); 14 } 15 } 16 17 int main(int argc, char** argv) { 18 tui_init(); 19 while (tui_handle_event(handle_line) == 0) ; 20 tui_exit(); 21 return 0; 22 }