grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / exec / remove.c
bloba135ae5030bf6bb390ab5ecbd54217f52c943faf
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Remove a node from a list
6 Lang: english
7 */
9 #include <aros/debug.h>
11 /*****************************************************************************
13 NAME */
14 #include <exec/lists.h>
15 #include <proto/exec.h>
17 AROS_LH1I(void, Remove,
19 /* SYNOPSIS */
20 AROS_LHA(struct Node *, node, A1),
22 /* LOCATION */
23 struct ExecBase *, SysBase, 42, Exec)
25 /* FUNCTION
26 Remove a node from a list.
28 INPUTS
29 node - This node to be removed.
31 RESULT
33 NOTES
34 There is no need to specify the list but the node must be in
35 a list !
37 EXAMPLE
38 struct Node * node;
40 // Remove node
41 Remove (node);
43 BUGS
45 SEE ALSO
47 INTERNALS
49 ******************************************************************************/
51 AROS_LIBFUNC_INIT
54 Unfortunately, there is no (quick) check that the node
55 is in a list.
57 ASSERT(node != NULL);
60 Just bend the pointers around the node, ie. we make our
61 predecessor point to our successor and vice versa
63 node->ln_Pred->ln_Succ = node->ln_Succ;
64 node->ln_Succ->ln_Pred = node->ln_Pred;
66 AROS_LIBFUNC_EXIT
67 } /* Remove */