10
#include <grass/gis.h>
11
#include <grass/raster.h>
14
* call a subroutine, but as a child process
15
* allowing interrupts for the child
18
int call(int (*function) (), char *msg)
27
sprintf(i_msg, "Hit %s %s\n", G_unctrl(interrupt_char), msg);
29
* make sure all graphics have gotten to the monitor
33
/* fork to create child */
41
/* parent just waits for child */
42
Curses_allow_interrupts(1);
44
Curses_write_window(PROMPT_WINDOW, 1, 1, i_msg);
45
while ((w = wait(&status)) != pid && w != -1) ;
46
Curses_allow_interrupts(0);
47
Curses_write_window(PROMPT_WINDOW, 1, 1, "\n");
50
/* child turns on interrupts and calls the function */
52
signal(SIGINT, SIG_DFL);