# HG changeset patch # User Tuomo Valkonen # Date 1136667714 -3600 # Node ID 50525dab6c8e681e067b04257f0948a53130d204 # Parent 8ae0f0aa5a16abda3d5c78af0abd888d2c2fbb64 *list_remove return true if the item was found (and removed). diff -r 8ae0f0aa5a16 -r 50525dab6c8e objlist.c --- a/objlist.c Sat May 14 22:23:20 2005 +0200 +++ b/objlist.c Sat Jan 07 22:01:54 2006 +0100 @@ -204,7 +204,7 @@ } -void objlist_remove(ObjList **objlist, Obj *obj) +bool objlist_remove(ObjList **objlist, Obj *obj) { ObjList *node=objlist_find_node(*objlist, obj); @@ -212,6 +212,8 @@ free_node(objlist, node); optimise(objlist); + + return (node!=NULL); } diff -r 8ae0f0aa5a16 -r 50525dab6c8e objlist.h --- a/objlist.h Sat May 14 22:23:20 2005 +0200 +++ b/objlist.h Sat Jan 07 22:01:54 2006 +0100 @@ -47,7 +47,7 @@ extern bool objlist_insert_first(ObjList **objlist, Obj *obj); extern bool objlist_reinsert_last(ObjList **objlist, Obj *obj); extern bool objlist_reinsert_first(ObjList **objlist, Obj *obj); -extern void objlist_remove(ObjList **objlist, Obj *obj); +extern bool objlist_remove(ObjList **objlist, Obj *obj); extern void objlist_clear(ObjList **objlist); extern void objlist_iter_init(ObjListIterTmp *state, ObjList *objlist); extern Obj *objlist_iter(ObjListIterTmp *state); diff -r 8ae0f0aa5a16 -r 50525dab6c8e ptrlist.c --- a/ptrlist.c Sat May 14 22:23:20 2005 +0200 +++ b/ptrlist.c Sat Jan 07 22:01:54 2006 +0100 @@ -107,12 +107,14 @@ } -void ptrlist_remove(PtrList **ptrlist, void *ptr) +bool ptrlist_remove(PtrList **ptrlist, void *ptr) { PtrList *node=ptrlist_find_node(*ptrlist, ptr); if(node!=NULL) free_node(ptrlist, node); + + return (node!=NULL); } diff -r 8ae0f0aa5a16 -r 50525dab6c8e ptrlist.h --- a/ptrlist.h Sat May 14 22:23:20 2005 +0200 +++ b/ptrlist.h Sat Jan 07 22:01:54 2006 +0100 @@ -45,7 +45,7 @@ extern bool ptrlist_insert_first(PtrList **ptrlist, void *ptr); extern bool ptrlist_reinsert_last(PtrList **ptrlist, void *ptr); extern bool ptrlist_reinsert_first(PtrList **ptrlist, void *ptr); -extern void ptrlist_remove(PtrList **ptrlist, void *ptr); +extern bool ptrlist_remove(PtrList **ptrlist, void *ptr); extern void ptrlist_clear(PtrList **ptrlist); extern void ptrlist_iter_init(PtrListIterTmp *state, PtrList *ptrlist); extern void *ptrlist_iter(PtrListIterTmp *state);