2 Copyright © 1997-98, The AROS Development Team. All rights reserved.
5 Desc: Demo of new OOP system
11 VOID
AddTail(struct List
*list
, struct Node
*node
)
16 node
->ln_Succ
= (struct Node
*)&list
->lh_Tail
;
17 node
->ln_Pred
= list
->lh_TailPred
;
19 list
->lh_TailPred
->ln_Succ
= node
;
20 list
->lh_TailPred
= node
;
24 struct Node
*FindName(struct List
*list
, STRPTR name
)
31 /* Look through the list */
32 for (node
=GetHead(list
); node
; node
=GetSucc(node
))
34 /* Only compare the names if this node has one. */
37 /* Check the node. If we found it, stop. */
38 if (!strcmp (node
->ln_Name
, name
))
44 If we found a node, this will contain the pointer to it. If we
45 didn't, this will be NULL (either because the list was
46 empty or because we tried all nodes in the list)
51 VOID
Remove(struct Node
*node
)
53 node
->ln_Pred
->ln_Succ
= node
->ln_Succ
;
54 node
->ln_Succ
->ln_Pred
= node
->ln_Pred
;