chiark / gitweb /
routesearch: give tableau its own debug flag
[ypp-sc-tools.web-live.git] / yarrg / rscommon.h
index 0a6f30697fb43d84cd3ab137c02f0fccfe55a751..5da0721dbec588b8d004e7d2c2f4110de01c238e 100644 (file)
    DF(search)                                  \
    DF(filter)                                  \
    DF(check)                                   \
+   DF(tableau)                                 \
    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 +47,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 +134,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)))