diff -r 817f90f58aec -r 55fcdff5bcea objlist.c --- a/objlist.c Sat Feb 26 21:58:19 2005 +0100 +++ b/objlist.c Sat Feb 26 22:09:33 2005 +0100 @@ -276,3 +276,49 @@ return TRUE; } + + +Obj *objlist_take_first(ObjList **objlist) +{ + ObjList *node; + Obj*obj; + + optimise(objlist); + + node=*objlist; + + if(node==NULL) + return NULL; + + obj=node->watch.obj; + + assert(obj!=NULL); + + free_node(objlist, node); + + return obj; +} + + +Obj *objlist_take_last(ObjList **objlist) +{ + ObjList *node; + Obj*obj; + + optimise(objlist); + + node=*objlist; + + if(node==NULL) + return NULL; + + node=node->prev; + + obj=node->watch.obj; + + assert(obj!=NULL); + + free_node(objlist, node); + + return obj; +}