chiark / gitweb /
Debug improved
[ypp-sc-tools.db-live.git] / yarrg / rsvalue.c
index fe9c992acb4220ce9e15b5f7fb7bd1d93c7685f7..f399e3f51abcc00d1538d9173193ccc84712011b 100644 (file)
@@ -1,5 +1,9 @@
 /**/
 
+#include "rscommon.h"
+
+DEBUG_DEFINE_SOME_DEBUGF(sql,sql_dprintf);
+
 typedef struct {
   int commodid, src_price, src_qty, dst_price, dst_qty;
 } Trade;
@@ -9,8 +13,6 @@ typedef struct {
   Trade *trades;
 } IslandPair;
 
-#include "rscommon.h"
-
 static void ipair_gettrades(int si, int di) {
   char *stmt= masprintf
     ("SELECT\n"
@@ -27,7 +29,7 @@ static void ipair_gettrades(int si, int di) {
      " GROUP BY sell.commodid, sell.price, buy.price\n",
      si, di);
   
-  printf("SQL\n[\n%s\n]\n", stmt);
+  sql_dprintf("SQL\n[\n%s\n]\n", stmt);
 
   free(stmt);
 }