chiark / gitweb /
routesearch: give tableau its own debug flag
authorIan Jackson <ian@liberator.(none)>
Sat, 10 Oct 2009 12:21:08 +0000 (13:21 +0100)
committerIan Jackson <ian@liberator.(none)>
Sat, 10 Oct 2009 12:21:08 +0000 (13:21 +0100)
yarrg/rscommon.h
yarrg/rsmain.c

index b4e7803..5da0721 100644 (file)
@@ -10,6 +10,7 @@
    DF(search)                                  \
    DF(filter)                                  \
    DF(check)                                   \
+   DF(tableau)                                 \
    DF(lp)
 
 #define debug debug_file
index 545ece0..17e98a3 100644 (file)
@@ -12,6 +12,8 @@ int max_dist= -1;
 FILE *debug_file;
 FILE *output;
 
+DEBUG_DEFINE_SOME_DEBUGF(tableau,tabdebugf);
+
 
 #define CTR(x) int ctr_##x;
   COUNTER_LIST
@@ -83,7 +85,7 @@ int main(int argc, const char **argv) {
   setup_value();
   setup_search();
 
-  fprintf(stderr,"setup complete, starting search\n");
+  fprintf(output,"setup complete, starting search\n");
   
   arg= *argv++;
   if (!strcmp(arg,"specific")) {
@@ -120,30 +122,30 @@ int main(int argc, const char **argv) {
 
     int i, midarch, finarch;
     for (i=0; i<resultsix; i++) {
-      fprintf(stderr,"============== start #%d %s [PARTIAL] ==============\n",
-             i, argv[i]);
+      tabdebugf("============== start #%d %s [PARTIAL] ==============\n",
+               i, argv[i]);
       PotentialResult ***strat_resultsix= results[i];
       if (!strat_resultsix) continue;
-      fprintf(stderr,"  ");
+      tabdebugf("  ");
       for (midarch=0; midarch<narches; midarch++) {
-       fprintf(stderr,"|   mid %d  ",midarch);
+       tabdebugf("|   mid %d  ",midarch);
       }
-      fprintf(stderr,"\n");
+      tabdebugf("\n");
       for (finarch=0; finarch<narches; finarch++) {
        PotentialResult **strat_finarch= strat_resultsix[finarch];
        if (!strat_finarch) continue;
-       fprintf(stderr,"f%d",finarch);
+       tabdebugf("f%d",finarch);
        for (midarch=0; midarch<narches; midarch++) {
          PotentialResult *result= strat_finarch[midarch];
          if (!result) {
-           fprintf(stderr,"|          ");
+           tabdebugf("|          ");
          } else {
-           fprintf(stderr,"|%5d",(int)(result->absolute));
-           fprintf(stderr," ");
-           fprintf(stderr,"%4d",(int)(result->perleague));
+           tabdebugf("|%5d",(int)(result->absolute));
+           tabdebugf(" ");
+           tabdebugf("%4d",(int)(result->perleague));
          }
        }
-       fprintf(stderr,"\n");
+       tabdebugf("\n");
       }
     }