[digraphanalysis-cvs] digraphanalysis/src node.c,
Status: Planning
Brought to you by:
jbreker
|
From: Jeff B. <jb...@us...> - 2005-04-24 03:50:30
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22716 Modified Files: node.c Log Message: function implementations. Index: node.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/node.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** node.c 22 Apr 2005 14:58:32 -0000 1.6 --- node.c 24 Apr 2005 03:50:22 -0000 1.7 *************** *** 174,177 **** --- 174,186 ---- nodelist_intersection(struct nodelist *node_list1, struct nodelist *node_list2) { + struct nodelink *node_iter; + struct nodelist *node_list; + + node_list = nodelist_new(); + LIST_FOREACH(node_iter, node_list1, list) + if(nodelist_find(node_list2, node_iter->node) != NULL) + nodelist_add(node_list, node_iter->node); + + return node_list; } *************** *** 179,182 **** --- 188,197 ---- nodelist_merge(struct nodelist *node_list1, struct nodelist *node_list2) { + struct nodelink *node_iter; + + LIST_FOREACH(node_iter, node_list2, list) + nodelist_add(node_list1, node_iter->node); + + return node_list1; } *************** *** 205,208 **** --- 220,232 ---- nodelist_size(struct nodelist *node_list) { + struct nodelink *node_iter; + unsigned int size; + + size = 0; + + LIST_FOREACH(node_iter, node_list, list) + ++size; + + return size; } |