Update of /cvsroot/digraphanalysis/digraphanalysis/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5723
Modified Files:
alias.c list.h
Log Message:
misc
Index: alias.c
===================================================================
RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/alias.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** alias.c 14 May 2005 02:56:24 -0000 1.7
--- alias.c 17 May 2005 15:16:28 -0000 1.8
***************
*** 63,73 ****
struct alias *
! aliaslist_add(struct aliaslist *alias_list, struct alias *alias)
{
int i;
! struct aliaslink *alias_iter, *alias_link;
! alias_link = (struct aliaslink *) malloc(sizeof(struct aliaslink));
! alias_link->alias = alias;
if(LIST_EMPTY(alias_list))
--- 63,73 ----
struct alias *
! aliaslist_add(struct list *alias_list, struct alias *alias)
{
int i;
! struct listlink *alias_iter, *alias_link;
! alias_link = (struct listlink *) malloc(sizeof(struct listlink));
! alias_link->object = alias;
if(LIST_EMPTY(alias_list))
***************
*** 76,80 ****
LIST_FOREACH(alias_iter, alias_list, list)
{
! if((i = alias_compare(alias, alias_iter->alias)) < 0)
{
if(alias_iter == LIST_FIRST(alias_list))
--- 76,80 ----
LIST_FOREACH(alias_iter, alias_list, list)
{
! if((i = alias_compare(alias, alias_iter->object)) < 0)
{
if(alias_iter == LIST_FIRST(alias_list))
***************
*** 86,90 ****
else
if(i == 0)
! return alias_iter->alias;
else
if(LIST_NEXT(alias_iter, list) == NULL)
--- 86,90 ----
else
if(i == 0)
! return alias_iter->object;
else
if(LIST_NEXT(alias_iter, list) == NULL)
Index: list.h
===================================================================
RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/list.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** list.h 17 May 2005 14:30:26 -0000 1.4
--- list.h 17 May 2005 15:16:28 -0000 1.5
***************
*** 27,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
--- 27,61 ----
};
! /* This is LIST_HEAD(list, listlink); but with a function pointer embedded in
! * it for comparison of objects.
! */
! struct list
! {
! struct listlink *lh_first;
! (int) (*compare) (void *, void *);
! };
void *list_add(struct list *,
! void *);
int list_compare(struct list *,
struct list *);
! struct list *list_duplicate(struct list *);
void *list_find(struct list_t *,
! void *);
void list_free(struct list *);
struct list *list_intersection(struct list *,
struct list *);
struct list *list_merge(struct list *,
! struct list *);
! struct list *list_new((int) (*) (void *, void *));
void list_print(FILE *,
struct list *);
void list_remove(struct list *,
! void *);
unsigned int list_size(struct list *);
struct list *list_subtract(struct list *,
struct list *);
struct list *list_union(struct list *,
! struct list *);
#endif
|