19 static void sig_int(int dummy){
20 my_log("POLYGLOT *** SIGINT Received ***\n");
26 static void sig_pipe(int dummy){
27 my_log("POLYGLOT *** SIGPIPE Received ***\n");
33 static void sig_term(int dummy){
34 my_log("POLYGLOT *** SIGTERM Received ***\n");
41 void gui_init(gui_t *gui){
43 // the following is nice if the "GUI" is a console!
44 signal(SIGINT,sig_int);
46 signal(SIGTERM,sig_term);
49 signal(SIGPIPE,sig_pipe);
51 pipex_open(gui->pipex,"GUI",NULL,NULL);
55 // gui_get_non_blocking()
57 bool gui_get_non_blocking(gui_t * gui, char *string) {
62 if(pipex_eof(gui->pipex)){
64 return TRUE; // we never get here
66 return pipex_readln_nb(gui->pipex,string);
71 void gui_get(gui_t * gui, char *string) {
72 if(pipex_eof(gui->pipex)){
75 pipex_readln(gui->pipex,string);
81 void gui_send(gui_t * gui, const char format[], ...) {
83 char string[FormatBufferSize];
90 CONSTRUCT_ARG_STRING(format,string);
94 pipex_writeln(gui->pipex,string);