2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Remove the last node of a list
9 #include <aros/debug.h>
11 /*****************************************************************************
14 #include <exec/lists.h>
15 #include <proto/exec.h>
17 AROS_LH1I(struct Node
*, RemTail
,
20 AROS_LHA(struct List
*, list
, A0
),
23 struct ExecBase
*, SysBase
, 44, Exec
)
26 Remove the last node from a list.
29 list - Remove the node from this list
32 The node that has been removed.
40 // Remove node and return it
41 tail = RemTail (list);
49 ******************************************************************************/
55 Unfortunately, there is no (quick) check that the node
60 /* Get the last node of the list */
61 if ( (node
= GetTail (list
)) )
63 /* normal code to remove a node if there is one */
64 node
->ln_Pred
->ln_Succ
= node
->ln_Succ
;
65 node
->ln_Succ
->ln_Pred
= node
->ln_Pred
;
68 /* return it's address or NULL if there was no node */