[digraphanalysis-cvs] digraphanalysis/src BSDmakefile, alias.h, graph.h, list.c, list.h, node.h,
Status: Planning
Brought to you by:
jbreker
|
From: Jeff B. <jb...@us...> - 2005-05-17 14:30:35
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28495 Modified Files: BSDmakefile alias.h graph.h list.c list.h node.h Log Message: Start using list for abstraction. Index: graph.h =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/graph.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** graph.h 18 Apr 2005 14:53:29 -0000 1.1 --- graph.h 17 May 2005 14:30:26 -0000 1.2 *************** *** 24,45 **** #include "node.h" - struct graphlink - { - void *graph; - LIST_ENTRY(graphlink) list; - }; - - LIST_HEAD(graphlist, graphlink); - struct graph { ! struct aliaslist *alias_list; ! struct nodelist *node_list; }; ! struct graph *graph_new(struct aliaslist *, struct nodelist *); ! struct graph *graphlist_add(struct graphlist *, struct graph *); ! struct graphlist *graphlist_new(); #endif /* _GRAPH_H_ */ --- 24,37 ---- #include "node.h" struct graph { ! struct list *alias_list; ! struct list *node_list; }; ! struct graph *graph_new(struct list *, struct list *); ! struct graph *graphlist_add(struct list *, struct graph *); ! struct list *graphlist_new(); #endif /* _GRAPH_H_ */ Index: alias.h =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/alias.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** alias.h 14 May 2005 02:56:24 -0000 1.5 --- alias.h 17 May 2005 14:30:26 -0000 1.6 *************** *** 23,34 **** #include "node.h" - struct aliaslink - { - void *alias; - LIST_ENTRY(aliaslink) list; - }; - - LIST_HEAD(aliaslist, aliaslink); - struct alias { --- 23,26 ---- *************** *** 38,50 **** }; ! int alias_compare(struct alias *, struct alias *); ! void alias_free(struct alias *); ! struct alias *alias_new(char *, char *, struct node *); ! struct alias *aliaslist_add(struct aliaslist *, struct alias *); ! struct aliaslist *aliaslist_duplicate(struct aliaslist *); ! struct alias *aliaslist_find(struct aliaslist *, char *); ! void aliaslist_free(struct aliaslist *); ! struct aliaslist *aliaslist_new(void); #endif /* _ALIAS_H_ */ --- 30,42 ---- }; ! int alias_compare(struct alias *, struct alias *); ! void alias_free(struct alias *); ! struct alias *alias_new(char *, char *, struct node *); ! struct alias *aliaslist_add(struct list *, struct alias *); ! struct list *aliaslist_duplicate(struct list *); ! struct alias *aliaslist_find(struct list *, char *); ! void aliaslist_free(struct list *); ! struct list *aliaslist_new(void); #endif /* _ALIAS_H_ */ Index: node.h =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/node.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** node.h 14 May 2005 02:56:24 -0000 1.8 --- node.h 17 May 2005 14:30:26 -0000 1.9 *************** *** 23,34 **** #include <stdio.h> - struct nodelink - { - void *node; - LIST_ENTRY(nodelink) list; - }; - - LIST_HEAD(nodelist, nodelink); - struct node { --- 23,26 ---- *************** *** 36,40 **** char *uiddir; float msd; ! struct nodelist *links; /* Other nodes that "sign" this node */ }; --- 28,32 ---- char *uiddir; float msd; ! struct list *links; /* Other nodes that "sign" this node */ }; *************** *** 46,63 **** void node_print(FILE *, struct node *); ! struct node *nodelist_add(struct nodelist *, struct node *); ! struct node *nodelist_add_msd(struct nodelist *, struct node *); ! int nodelist_compare(struct nodelist *, struct nodelist *); ! struct nodelist *nodelist_duplicate(struct nodelist *); ! struct node *nodelist_find(struct nodelist *, struct node *); ! void nodelist_free(struct nodelist *); ! struct nodelist *nodelist_intersection(struct nodelist *, struct nodelist *); ! struct nodelist *nodelist_merge(struct nodelist *, struct nodelist *); ! struct nodelist *nodelist_new(void); ! void nodelist_print(FILE *, struct nodelist *); ! struct node *nodelist_remove(struct nodelist *, struct node *); ! unsigned int nodelist_size(struct nodelist *); ! struct nodelist *nodelist_subtract(struct nodelist *, struct nodelist *); ! struct nodelist *nodelist_union(struct nodelist *, struct nodelist *); #endif /* _NODE_H_ */ --- 38,55 ---- void node_print(FILE *, struct node *); ! struct node *nodelist_add(struct list *, struct node *); ! struct node *nodelist_add_msd(struct list *, struct node *); ! int nodelist_compare(struct list *, struct list *); ! struct list *nodelist_duplicate(struct list *); ! struct node *nodelist_find(struct list *, struct node *); ! void nodelist_free(struct list *); ! struct list *nodelist_intersection(struct list *, struct list *); ! struct list *nodelist_merge(struct list *, struct list *); ! struct list *nodelist_new(void); ! void nodelist_print(FILE *, struct list *); ! struct node *nodelist_remove(struct list *, struct node *); ! unsigned int nodelist_size(struct list *); ! struct list *nodelist_subtract(struct list *, struct list *); ! struct list *nodelist_union(struct list *, struct list *); #endif /* _NODE_H_ */ Index: list.h =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/list.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** list.h 18 Apr 2005 14:53:29 -0000 1.3 --- list.h 17 May 2005 14:30:26 -0000 1.4 *************** *** 29,43 **** LIST_HEAD(list, listlink); ! void *list_add_object(struct list_t *, void *, int (*)(void *, void *)); ! struct list_t *list_duplicate(struct list_t *, int (*)(void *, void *)); ! void *list_find_object(struct list_t *, void *, int (*)(void *, void *)); ! void list_free(struct list_t *); ! struct list_t *list_merge_list(struct list_t *, struct list_t *, int (*)(void *, void *)); ! struct list_t *list_new(); ! struct node_t *list_new_node(void *); ! void list_remove(struct list_t *, void *, int (*)(void *, void *)); ! struct list_t *list_resort(struct list_t *, int (*)(void *, void *)); ! unsigned int list_size(struct list_t *); ! struct list_t *list_union(struct list_t *, struct list_t *, int (*)(void *, void *)); #endif --- 29,60 ---- LIST_HEAD(list, listlink); ! void *list_add(struct list *, ! void *, ! int (*)(void *, void *)); ! int list_compare(struct list *, ! struct list *); ! struct list *list_duplicate(struct list *, ! int (*)(void *, void *)); ! void *list_find(struct list_t *, ! void *, ! int (*)(void *, void *)); ! void list_free(struct list *); ! struct list *list_intersection(struct list *, ! struct list *); ! struct list *list_merge(struct list *, ! struct list *, ! int (*)(void *, void *)); ! struct list *list_new(void); ! void list_print(FILE *, ! struct list *); ! void list_remove(struct list *, ! void *, ! int (*)(void *, void *)); ! unsigned int list_size(struct list *); ! struct list *list_subtract(struct list *, ! struct list *); ! struct list *list_union(struct list *, ! struct list *, ! int (*)(void *, void *)); #endif Index: list.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/list.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** list.c 14 Apr 2005 03:24:28 -0000 1.2 --- list.c 17 May 2005 14:30:26 -0000 1.3 *************** *** 24,31 **** #include "list.h" ! /* Returns: ! * object that is in the list or NULL on error ! */ ! void *list_add_object(struct list_t *list, void *object, int (*compare)(void *, void *)) { int i; --- 24,29 ---- #include "list.h" ! void * ! list_add(struct list *list, void *object, int (*compare)(void *, void *)) { int i; Index: BSDmakefile =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/BSDmakefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BSDmakefile 17 May 2005 00:12:45 -0000 1.4 --- BSDmakefile 17 May 2005 14:30:26 -0000 1.5 *************** *** 20,23 **** --- 20,24 ---- graph.c \ input.c \ + list.c \ main.c \ node.c \ |