12 static const int StringSize = 4096;
23 void gui_init(gui_t *gui){
25 (gui->pipeStdin).Open();
28 gui->io->in_fd = STDIN_FILENO;
29 gui->io->out_fd = STDOUT_FILENO;
30 gui->io->name = "GUI";
37 // gui_get_non_blocking()
39 // this is only non_blocking on windows!
41 bool gui_get_non_blocking(gui_t * gui, char string[], int size) {
47 if (!io_get_line(gui->io,string,size)) { // EOF
48 my_log("POLYGLOT *** EOF from GUI ***\n");
53 if ((gui->pipeStdin).LineInput(string)) {
54 my_log("GUI->Adapter: %s\n", string);
66 void gui_get(gui_t * gui, char string[], int size) {
69 data_available=gui_get_non_blocking(gui, string, size);
81 void gui_send(gui_t * gui, const char format[], ...) {
84 char string[StringSize];
91 va_start(arg_list,format);
92 vsprintf(string,format,arg_list);
98 io_send(gui->io,"%s",string);
100 printf("%s\n",string);
102 my_log("Adapter->GUI: %s\n",string);