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.
41 When supplied with a NULL list argument, defaults to the exec port list.
47 // Look for a node with the name "Hello"
48 node = FindName (list, "Hello");
56 ******************************************************************************/
61 FindName supplied with a NULL list defaults to the exec port list
62 Changed in lists.c as well....
65 list
= &SysBase
->PortList
;
67 /* ASSERT(list != NULL); */
70 /* Look through the list */
71 for (node
=GetHead(list
); node
; node
=GetSucc(node
))
73 /* Only compare the names if this node has one. */
76 /* Check the node. If we found it, stop. */
77 if (!strcmp (node
->ln_Name
, name
))
83 If we found a node, this will contain the pointer to it. If we
84 didn't, this will be NULL (either because the list was
85 empty or because we tried all nodes in the list)