2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Search for a node by name.
9 #include <aros/debug.h>
11 /*****************************************************************************
14 #include <exec/lists.h>
15 #include <proto/exec.h>
17 AROS_LH2I(struct Node
*, FindName
,
20 AROS_LHA(struct List
*, list
, A0
),
21 AROS_LHA(const UBYTE
*, name
, A1
),
24 struct ExecBase
*, SysBase
, 46, Exec
)
27 Look for a node with a certain name in a list.
30 list - Search this list.
31 name - This is the name to look for.
36 The search is case-sensitive, so "Hello" will not find a node
39 The list must contain complete Nodes and no MinNodes.
45 // Look for a node with the name "Hello"
46 node = FindName (list, "Hello");
54 ******************************************************************************/
62 /* Look through the list */
63 for (node
=GetHead(list
); node
; node
=GetSucc(node
))
65 /* Only compare the names if this node has one. */
68 /* Check the node. If we found it, stop. */
69 if (!strcmp (node
->ln_Name
, name
))
75 If we found a node, this will contain the pointer to it. If we
76 didn't, this will be NULL (either because the list was
77 empty or because we tried all nodes in the list)