[digraphanalysis-cvs] digraphanalysis/src graph.c, graph.h, alias.c, list.h, main.c,
Status: Planning
Brought to you by:
jbreker
|
From: Jeff B. <jb...@us...> - 2005-04-18 14:53:43
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21524 Modified Files: alias.c list.h main.c Added Files: graph.c graph.h Log Message: interm commit (need to switch os's on my laptop sigh...) Index: list.h =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/list.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** list.h 14 Apr 2005 03:24:28 -0000 1.2 --- list.h 18 Apr 2005 14:53:29 -0000 1.3 *************** *** 21,31 **** #include <sys/queue.h> ! struct node_t { void *object; ! LIST_ENTRY(node_t) entries; }; ! LIST_HEAD(list_t, node_t); void *list_add_object(struct list_t *, void *, int (*)(void *, void *)); --- 21,31 ---- #include <sys/queue.h> ! struct listlink { void *object; ! LIST_ENTRY(listlink) list; }; ! LIST_HEAD(list, listlink); void *list_add_object(struct list_t *, void *, int (*)(void *, void *)); --- NEW FILE: graph.c --- /* $Id: graph.c,v 1.1 2005/04/18 14:53:29 jbreker Exp $ * * Copyright (C) 2005 Jeff Breker <jb...@sy...> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include <stdlib.h> #include "alias.h" #include "graph.h" #include "node.h" struct graph *graph_new(struct aliaslist *alias_list, struct nodelist *node_list) { struct graph *graph; if((graph = (struct graph *) malloc(sizeof(struct graph))) != NULL) { graph->alias_list = alias_list; graph->node_list = node_list; } return graph; } struct graphlist *graphlist_new() { struct graphlist *graphlist; if((graphlist = (struct graphlist *) malloc(sizeof(struct graphlist))) != NULL) LIST_INIT(graphlist); return graphlist; } Index: main.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/main.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** main.c 17 Apr 2005 03:05:58 -0000 1.4 --- main.c 18 Apr 2005 14:53:29 -0000 1.5 *************** *** 29,32 **** --- 29,33 ---- #include "alias.h" + #include "graph.h" #include "main.h" #include "node.h" Index: alias.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/alias.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** alias.c 15 Apr 2005 19:00:56 -0000 1.2 --- alias.c 18 Apr 2005 14:53:29 -0000 1.3 *************** *** 21,25 **** #include "alias.h" ! struct alias *alias_new(char *uid, char *name, struct node *node) { struct alias *alias; --- 21,35 ---- #include "alias.h" ! void ! alias_free(struct alias *alias) ! { ! free(uid); ! free(name); ! free(alias); ! alias = NULL; ! } ! ! struct alias * ! alias_new(char *uid, char *name, struct node *node) { struct alias *alias; *************** *** 48,52 **** } ! struct aliaslist *aliaslist_new() { struct aliaslist *list; --- 58,92 ---- } ! struct alias * ! aliaslist_add(struct aliaslist *alias_list, struct alias *alias) ! { ! ! } ! ! struct alias * ! aliaslist_find(struct aliaslist *alias_list, struct char *uid) ! { ! } ! ! void ! aliaslist_free(struct aliaslist *alias_list) ! { ! struct aliaslink *alias_link; ! ! FOREACH(alias_link, alias_list, list) ! { ! LIST_REMOVE(alias_link, list); ! alias_free(alias_link->alias); ! free(list); ! free(alias_link); ! alias_link = NULL; ! } ! free(alias_list); ! ! return; ! } ! ! struct aliaslist * ! aliaslist_new() { struct aliaslist *list; --- NEW FILE: graph.h --- /* $Id: graph.h,v 1.1 2005/04/18 14:53:29 jbreker Exp $ * * Copyright (C) 2005 Jeff Breker <jb...@sy...> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef _GRAPH_H_ #define _GRAPH_H_ #include <sys/queue.h> #include "alias.h" #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_ */ |