diff --git a/best.c b/best.c index f5751c3..f96bb72 100644 --- a/best.c +++ b/best.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "lceb.h" static int target=0; @@ -12,13 +13,26 @@ static int bestops=MAXINT; static BEST bests[1024*10]; /* TODO: should be dynamic */ static int nbests=0; +static int sigint=0; #define DIFF(a, b) ((a)>(b)?(a)-(b):(b)-(a)) +void stopall() +{ + printf("SIGINT RECEIVED: aborting eval\n"); + sigint=1; +} + +int stopped() +{ + return sigint; +} + void set_target(n) int n; { target=n; + signal(SIGINT, stopall); } int check_best(res, nops, node, values, ops) @@ -104,7 +118,7 @@ void print_bests() for (i=0; i