X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;ds=sidebyside;f=yarrg%2Frscommon.h;fp=yarrg%2Frscommon.h;h=b4e780362b5286b5a3fbe849f552f16ee9fd290a;hb=f6949486bad107662b74a0bed72e7041d633c794;hp=0a6f30697fb43d84cd3ab137c02f0fccfe55a751;hpb=471c46b451fbbeb4f8e69ba6d69093a4953c432f;p=ypp-sc-tools.db-test.git diff --git a/yarrg/rscommon.h b/yarrg/rscommon.h index 0a6f306..b4e7803 100644 --- a/yarrg/rscommon.h +++ b/yarrg/rscommon.h @@ -12,11 +12,13 @@ DF(check) \ DF(lp) -#define debug stdout -#define DEBUG_DEV "/dev/stdout" +#define debug debug_file #include "common.h" +extern FILE *debug_file; +#define DEBUG_DEV "/dev/stdout" /* just for glpk */ + #define COUNTER_LIST \ CTR(commodities_loaded) \ @@ -44,9 +46,9 @@ * chk1 and chk2 are blocks using sqe and int sqr; */ \ const char *sql_must_call_string= #call; \ int sqr; \ - if (DEBUGP(sql2)) fprintf(stderr,"SQL %s", sql_must_call_string); \ + if (DEBUGP(sql2)) fprintf(debug,"SQL %s", sql_must_call_string); \ sqr= (call); \ - if (DEBUGP(sql2)) fprintf(stderr," = %d\n", sqr); \ + if (DEBUGP(sql2)) fprintf(debug," = %d\n", sqr); \ if (sqr) sql_fatal("(unknown)", sqr, sql_must_call_string); \ }) \ @@ -131,6 +133,9 @@ extern char **archnames; extern int *islandid2arch; +extern FILE *output; + + #define NEW(ptr) ((ptr)= mmalloc(sizeof(*ptr))) #define MCALLOC(array, count) ((array)= mcalloc(sizeof(*(array)) * (count)))