X-Git-Url: http://git.maemo.org/git/?p=scdataviz;a=blobdiff_plain;f=matdb.c;h=644eb4021623f573f4716c8a8adbcad67c8ded16;hp=995074c642a47001b033637779a39b7923a3d248;hb=b5cfdf4d4f01bf9f8def7d69fd58e254886ed2d5;hpb=1851b161c89d81370acea767bfd840187c119119 diff --git a/matdb.c b/matdb.c index 995074c..644eb40 100644 --- a/matdb.c +++ b/matdb.c @@ -27,15 +27,19 @@ 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); - 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) { - 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) {