* Seems to be coming along. Not convinced that the bowing conversions are right.
[scdataviz] / matdb.c
diff --git a/matdb.c b/matdb.c
index 995074c..644eb40 100644 (file)
--- a/matdb.c
+++ b/matdb.c
 static void print_property(gpointer key, gpointer value, gpointer user_data) {
   fprintf(stderr, "\t\t%s=%g:\n", (char*)key, *(double*)value);
 }
 static void print_property(gpointer key, gpointer value, gpointer user_data) {
   fprintf(stderr, "\t\t%s=%g:\n", (char*)key, *(double*)value);
 }
+static void print_inner_bowing(gpointer key, gpointer value, gpointer user_data) {
+  struct matdb_bowing *bowing = (struct matdb_bowing*)value;
+  fprintf(stderr, "\tbowing %s:%s[%s:%s]:\n", bowing->from->str, bowing->to->str, (char*)user_data, (char*)key);
+  g_hash_table_foreach(bowing->properties, &print_property, NULL);
+}
 static void print_material(gpointer key, gpointer value, gpointer user_data) {
   struct matdb_material *mat = (struct matdb_material*)value;
   fprintf(stderr, "\tmaterial %s(%s):\n", mat->name->str, (char*)key);
 static void print_material(gpointer key, gpointer value, gpointer user_data) {
   struct matdb_material *mat = (struct matdb_material*)value;
   fprintf(stderr, "\tmaterial %s(%s):\n", mat->name->str, (char*)key);
-  g_hash_table_foreach(mat->properties, print_property, NULL);
+  g_hash_table_foreach(mat->properties, &print_property, NULL);
 }
 static void print_bowing(gpointer key, gpointer value, gpointer user_data) {
 }
 static void print_bowing(gpointer key, gpointer value, gpointer user_data) {
-  struct matdb_bowing *bowing = (struct matdb_bowing*)value;
-  fprintf(stderr, "\tbowing %s:%s(%s):\n", bowing->from->str, bowing->to->str, (char*)key);
-  g_hash_table_foreach(bowing->properties, print_property, NULL);
+  GHashTable *ht = value;
+  g_hash_table_foreach(ht, &print_inner_bowing, key);
 }
 
 void print_matdb(const struct matdb *mdb) {
 }
 
 void print_matdb(const struct matdb *mdb) {