Thread: [digraphanalysis-cvs] digraphanalysis/src alias.c, graph.c, graph.h, node.c, output.c,
Status: Planning
Brought to you by:
jbreker
|
From: Jeff B. <jb...@us...> - 2005-09-13 20:03:59
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21772/src Modified Files: alias.c graph.c graph.h node.c output.c Log Message: implement graph_print Index: alias.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/alias.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** alias.c 28 May 2005 20:58:00 -0000 1.10 --- alias.c 13 Sep 2005 20:03:50 -0000 1.11 *************** *** 69,73 **** alias_print(FILE *filep, void *alias) { ! fprintf(filep, " %s\n", ((struct alias *) alias)->name); return; --- 69,73 ---- alias_print(FILE *filep, void *alias) { ! fprintf(filep, "%s", ((struct alias *) alias)->name); return; Index: graph.h =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/graph.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** graph.h 28 May 2005 20:58:00 -0000 1.4 --- graph.h 13 Sep 2005 20:03:50 -0000 1.5 *************** *** 32,36 **** int graph_compare(void *, void *); struct graph *graph_new(struct list *, struct list *); ! void graph_print(FILE *, void *); #endif /* _GRAPH_H_ */ --- 32,36 ---- int graph_compare(void *, void *); struct graph *graph_new(struct list *, struct list *); ! void graph_print(FILE *, struct graph *); #endif /* _GRAPH_H_ */ Index: output.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/output.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** output.c 7 Sep 2005 00:01:44 -0000 1.10 --- output.c 13 Sep 2005 20:03:50 -0000 1.11 *************** *** 61,65 **** FILE *filep; struct graph *graph; ! struct listlink *graph_link; int i; int j; --- 61,65 ---- FILE *filep; struct graph *graph; ! struct listlink *graph_link; int i; int j; *************** *** 173,177 **** fprintf(filep, "Signatures to this key:\n"); ! list_print(filep, node->links); tmp_size = list_size(node->links); fprintf(filep, " Total: %u signature%s to this key from this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); --- 173,177 ---- fprintf(filep, "Signatures to this key:\n"); ! graph_print(filep, graph_new(graph->alias_list, node->links)); tmp_size = list_size(node->links); fprintf(filep, " Total: %u signature%s to this key from this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); *************** *** 182,186 **** list_add(nodes_we_link_to, node_link->object); fprintf(filep, "Signatures from this key:\n"); ! list_print(filep, nodes_we_link_to); tmp_size = list_size(nodes_we_link_to); fprintf(filep, " Total: %u signature%s from this key to this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); --- 182,186 ---- list_add(nodes_we_link_to, node_link->object); fprintf(filep, "Signatures from this key:\n"); ! graph_print(filep, graph_new(graph->alias_list, nodes_we_link_to)); tmp_size = list_size(nodes_we_link_to); fprintf(filep, " Total: %u signature%s from this key to this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); *************** *** 190,194 **** tmp_nodelist = list_subtract(graph->node_list, list_union(node->links, nodes_we_link_to)); fprintf(filep, "This key has not signed, nor been signed by:\n"); ! list_print(filep, tmp_nodelist); tmp_size = list_size(tmp_nodelist); fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); --- 190,194 ---- tmp_nodelist = list_subtract(graph->node_list, list_union(node->links, nodes_we_link_to)); fprintf(filep, "This key has not signed, nor been signed by:\n"); ! graph_print(filep, graph_new(graph->alias_list, tmp_nodelist)); tmp_size = list_size(tmp_nodelist); fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); *************** *** 196,200 **** tmp_nodelist = list_subtract(node->links, nodes_we_link_to); fprintf(filep, "This key has not signed, but has been signed by:\n"); ! list_print(filep, tmp_nodelist); tmp_size = list_size(tmp_nodelist); fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); --- 196,200 ---- tmp_nodelist = list_subtract(node->links, nodes_we_link_to); fprintf(filep, "This key has not signed, but has been signed by:\n"); ! graph_print(filep, graph_new(graph->alias_list, tmp_nodelist)); tmp_size = list_size(tmp_nodelist); fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); *************** *** 203,207 **** tmp_nodelist = list_subtract(nodes_we_link_to, node->links); fprintf(filep, "This key has signed, but has not been signed by:\n"); ! list_print(filep, tmp_nodelist); tmp_size = list_size(tmp_nodelist); fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); --- 203,207 ---- tmp_nodelist = list_subtract(nodes_we_link_to, node->links); fprintf(filep, "This key has signed, but has not been signed by:\n"); ! graph_print(filep, graph_new(graph->alias_list, tmp_nodelist)); tmp_size = list_size(tmp_nodelist); fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); *************** *** 210,214 **** tmp_nodelist = list_intersection(node->links, nodes_we_link_to); fprintf(filep, "This key has signed and has been signed by:\n"); ! list_print(filep, tmp_nodelist); tmp_size = list_size(tmp_nodelist); fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); --- 210,214 ---- tmp_nodelist = list_intersection(node->links, nodes_we_link_to); fprintf(filep, "This key has signed and has been signed by:\n"); ! graph_print(filep, graph_new(graph->alias_list, tmp_nodelist)); tmp_size = list_size(tmp_nodelist); fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); Index: node.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/node.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** node.c 28 May 2005 20:58:00 -0000 1.15 --- node.c 13 Sep 2005 20:03:50 -0000 1.16 *************** *** 55,59 **** node_print(FILE *filep, void *node) { ! fprintf(filep, "%s\n", ((struct node *) node)->uid); return; --- 55,59 ---- node_print(FILE *filep, void *node) { ! fprintf(filep, "%s", ((struct node *) node)->uid); return; Index: graph.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/graph.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** graph.c 4 Sep 2005 22:50:21 -0000 1.8 --- graph.c 13 Sep 2005 20:03:50 -0000 1.9 *************** *** 50,56 **** void ! graph_print(FILE *filep, void *graph) { ! /* Iterate through nodelist, find the alias for the node and print both */ return; } --- 50,70 ---- void ! graph_print(FILE *filep, struct graph *graph) { ! struct listlink *iter; ! struct alias *alias; ! ! LIST_FOREACH(iter, graph->node_list, list) ! { ! alias = list_find(graph->alias_list, alias_new(((struct node *) iter->object)->uid, "", NULL)); ! ! fprintf(filep, " "); ! node_print(filep, iter->object); ! fprintf(filep, " "); ! alias_print(filep, alias); ! fprintf(filep, "\n"); ! ! } ! return; } |