+struct xy_properties {
+ GString *xprop;
+ GString *yprop;
+ Graph *graph;
+};
+
+static void put_mat_in_graph(gpointer key, gpointer value, gpointer user_data) {
+ struct xy_properties *propmap = user_data;
+ struct matdb_material *mat = value;
+ double *x, *y;
+ #ifdef DEBUG
+ fprintf(stderr, "put_mat_in_graph(%s) (x->%s, y->%s): ", (char*)key, propmap->xprop->str, propmap->yprop->str);
+ #endif
+ if(((x=g_hash_table_lookup(mat->properties, propmap->xprop->str)) != NULL)
+ && ((y=g_hash_table_lookup(mat->properties, propmap->yprop->str)) != NULL)) {
+ graph_add_point(propmap->graph, *x, *y);
+ #ifdef DEBUG
+ fprintf(stderr, "added (x->%s=%g, y->%s=%g)\n", propmap->xprop->str, *x, propmap->yprop->str, *y);
+ }else{
+ fprintf(stderr, "no such properties (x->%s, y->%s)\n", propmap->xprop->str, propmap->yprop->str);
+ #endif
+ }
+}
+