]> git.sesse.net Git - pgn-extract/blobdiff - eco.c
Add code to dump out the ECO names by hash.
[pgn-extract] / eco.c
diff --git a/eco.c b/eco.c
index 6a0d9201a3e33b7f43b68fc94a2d7723bcdf1669..3d5bbca3361897fc963a72f38f60111da0e037d4 100644 (file)
--- a/eco.c
+++ b/eco.c
@@ -53,23 +53,24 @@ static unsigned maximum_half_moves = ECO_HALF_MOVE_LIMIT;
 #define ECO_TABLE_SIZE 4096
 static EcoLog **EcoTable;
 
-#if INCLUDE_UNUSED_FUNCTIONS
-static void
+void
 dumpEcoTable(void)
 {   unsigned ix;
     for(ix = 0; ix < ECO_TABLE_SIZE; ix++){
         if(EcoTable[ix] != NULL){
             EcoLog *entry = NULL;
             for(entry = EcoTable[ix]; entry != NULL; entry = entry->next){
-                fprintf(stderr,"%s %lu %lu ",entry->ECO_tag,
-                                entry->required_hash_value,
-                                entry->cumulative_hash_value);
+                printf("%u\t", (unsigned int)(entry->cumulative_hash_value));
+                printf("%s\t", entry->ECO_tag ? entry->ECO_tag : "");
+                printf("%s\t", entry->Opening_tag ? entry->Opening_tag : "");
+                printf("%s\t", entry->Variation_tag ? entry->Variation_tag : "");
+                printf("%s\n", entry->Sub_Variation_tag ? entry->Sub_Variation_tag : "");
             }
-            fprintf(stderr,"\n");
         }
     }
 }
 
+#if INCLUDE_UNUSED_FUNCTIONS
         /* Return at how many points this match works.
          *        required_hash_value
          *            cumulative_hash_value