Thread: [digraphanalysis-cvs] digraphanalysis/src BSDmakefile, alias.c, alias.h, analysis.c, graph.c, graph.
Status: Planning
Brought to you by:
jbreker
|
From: Jeff B. <jb...@us...> - 2005-05-28 20:58:10
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32298/src Modified Files: BSDmakefile alias.c alias.h analysis.c graph.c graph.h list.c list.h main.c node.c node.h output.c Log Message: "bug" fixes :), we now work... almost Index: node.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/node.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** node.c 27 May 2005 14:24:45 -0000 1.14 --- node.c 28 May 2005 20:58:00 -0000 1.15 *************** *** 47,51 **** node->msd = 0; ! node->links = list_new(node_compare); return node; --- 47,51 ---- node->msd = 0; ! node->links = list_new(node_compare, node_print); return node; *************** *** 53,59 **** void ! node_print(FILE *filep, struct node *node) { ! fprintf(filep, "%s\n", node->uid); return; --- 53,59 ---- void ! node_print(FILE *filep, void *node) { ! fprintf(filep, "%s\n", ((struct node *) node)->uid); return; *************** *** 98,102 **** struct listlink *tmp_node; ! traversed_nodes = list_new(node_compare); last_known_size = 0; distance = 1; --- 98,102 ---- struct listlink *tmp_node; ! traversed_nodes = list_new(node_compare, node_print); last_known_size = 0; distance = 1; *************** *** 111,115 **** tmp_nodes = traversed_nodes; tmp_node = LIST_FIRST(tmp_nodes); ! traversed_nodes = list_new(node_compare); while(tmp_node != NULL) { --- 111,115 ---- tmp_nodes = traversed_nodes; tmp_node = LIST_FIRST(tmp_nodes); ! traversed_nodes = list_new(node_compare, node_print); while(tmp_node != NULL) { Index: list.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/list.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** list.c 24 May 2005 22:40:45 -0000 1.5 --- list.c 28 May 2005 20:58:00 -0000 1.6 *************** *** 67,71 **** struct list *ret_list; ! if((ret_list = list_new(list->compare)) != NULL) if(list_merge(ret_list, list) == NULL) { --- 67,71 ---- struct list *ret_list; ! if((ret_list = list_new(list->compare, list->print)) != NULL) if(list_merge(ret_list, list) == NULL) { *************** *** 84,88 **** struct listlink *list_link; ! ret_list = list_new(list->compare); LIST_FOREACH(list_link, list, list) --- 84,88 ---- struct listlink *list_link; ! ret_list = list_new(list->compare, list->print); LIST_FOREACH(list_link, list, list) *************** *** 144,148 **** struct list * ! list_new(int (*compare) (void *, void *)) { struct list *list; --- 144,148 ---- struct list * ! list_new(int (*compare) (void *, void *), void (*print) (FILE *, void *)) { struct list *list; *************** *** 153,156 **** --- 153,157 ---- list->compare = compare; + list->print = print; } *************** *** 235,239 **** struct list *ret_list; ! ret_list = list_new(list1->compare); LIST_FOREACH(iter, list1, list) --- 236,240 ---- struct list *ret_list; ! ret_list = list_new(list1->compare, list1->print); LIST_FOREACH(iter, list1, list) Index: node.h =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/node.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** node.h 24 May 2005 22:40:45 -0000 1.10 --- node.h 28 May 2005 20:58:00 -0000 1.11 *************** *** 36,40 **** void node_free(struct node *); struct node *node_new(char *); ! void node_print(FILE *, struct node *); #endif /* _NODE_H_ */ --- 36,40 ---- void node_free(struct node *); struct node *node_new(char *); ! void node_print(FILE *, void *); #endif /* _NODE_H_ */ Index: BSDmakefile =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/BSDmakefile,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BSDmakefile 17 May 2005 14:30:26 -0000 1.5 --- BSDmakefile 28 May 2005 20:58:00 -0000 1.6 *************** *** 15,18 **** --- 15,19 ---- # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + DEBUG= -g PROG= digraphanalysis SRCS= alias.c \ Index: list.h =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/list.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** list.h 27 May 2005 14:24:45 -0000 1.8 --- list.h 28 May 2005 20:58:00 -0000 1.9 *************** *** 51,55 **** struct list *list_merge(struct list *, struct list *); ! struct list *list_new(int (*) (void *, void *)); struct listlink *list_new_node(void *); void list_print(FILE *, --- 51,56 ---- struct list *list_merge(struct list *, struct list *); ! struct list *list_new(int (*) (void *, void *), ! void (*) (FILE *, void *)); struct listlink *list_new_node(void *); void list_print(FILE *, Index: alias.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/alias.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** alias.c 18 May 2005 01:46:55 -0000 1.9 --- alias.c 28 May 2005 20:58:00 -0000 1.10 *************** *** 66,67 **** --- 66,74 ---- } + void + alias_print(FILE *filep, void *alias) + { + fprintf(filep, " %s\n", ((struct alias *) alias)->name); + + return; + } Index: graph.h =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/graph.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** graph.h 27 May 2005 14:24:45 -0000 1.3 --- graph.h 28 May 2005 20:58:00 -0000 1.4 *************** *** 32,38 **** int graph_compare(void *, void *); struct graph *graph_new(struct list *, struct list *); ! ! struct graph *graphlist_add(struct list *, struct graph *); ! struct list *graphlist_new(); #endif /* _GRAPH_H_ */ --- 32,36 ---- int graph_compare(void *, void *); struct graph *graph_new(struct list *, struct list *); ! void graph_print(FILE *, void *); #endif /* _GRAPH_H_ */ Index: output.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/output.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** output.c 27 May 2005 14:24:45 -0000 1.6 --- output.c 28 May 2005 20:58:00 -0000 1.7 *************** *** 174,178 **** fprintf(filep, " Total: %u signature%s to this key from this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); ! nodes_we_link_to = list_new(node_compare); LIST_FOREACH(node_link, graph->node_list, list) if(list_find(((struct node *) node_link->object)->links, node) != NULL) --- 174,178 ---- fprintf(filep, " Total: %u signature%s to this key from this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); ! nodes_we_link_to = list_new(node_compare, node_print); LIST_FOREACH(node_link, graph->node_list, list) if(list_find(((struct node *) node_link->object)->links, node) != NULL) Index: alias.h =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/alias.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** alias.h 18 May 2005 01:46:55 -0000 1.7 --- alias.h 28 May 2005 20:58:00 -0000 1.8 *************** *** 33,36 **** --- 33,37 ---- void alias_free(struct alias *); struct alias *alias_new(char *, char *, struct node *); + void alias_print(FILE *, void *); #endif /* _ALIAS_H_ */ Index: graph.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/graph.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** graph.c 27 May 2005 14:24:45 -0000 1.6 --- graph.c 28 May 2005 20:58:00 -0000 1.7 *************** *** 48,50 **** } ! --- 48,55 ---- } ! void ! graph_print(FILE *filep, void *graph) ! { ! /* Iterate through nodelist, find the alias for the node and print both */ ! return; ! } Index: main.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/main.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** main.c 27 May 2005 14:24:45 -0000 1.14 --- main.c 28 May 2005 20:58:00 -0000 1.15 *************** *** 41,45 **** char *output_dir; ! graph = graph_new(list_new(alias_compare), list_new(node_compare)); output_dir = NULL; --- 41,45 ---- char *output_dir; ! graph = graph_new(list_new(alias_compare, alias_print), list_new(node_compare, alias_print)); output_dir = NULL; Index: analysis.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/analysis.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** analysis.c 27 May 2005 14:24:45 -0000 1.3 --- analysis.c 28 May 2005 20:58:00 -0000 1.4 *************** *** 71,75 **** /* Create the list, to add the msd sorted graphs to. */ ! graph_list = list_new(graph_compare); /* Iterate through our copy of the original graph's node list. --- 71,75 ---- /* Create the list, to add the msd sorted graphs to. */ ! graph_list = list_new(graph_compare, graph_print); /* Iterate through our copy of the original graph's node list. *************** *** 79,84 **** /* Create two new node lists. */ ! if(((node_list_msd1 = list_new(node_compare_msd)) == NULL) || ! ((node_list_msd2 = list_new(node_compare_msd)) == NULL)) return NULL; --- 79,84 ---- /* Create two new node lists. */ ! if(((node_list_msd1 = list_new(node_compare_msd, node_print)) == NULL) || ! ((node_list_msd2 = list_new(node_compare_msd, node_print)) == NULL)) return NULL; |