2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
5 Desc: Search for a node by name.
9 #include <aros/debug.h>
11 #include "exec_intern.h"
12 #include "exec_debug.h"
14 /*****************************************************************************
17 #include <exec/lists.h>
18 #include <proto/exec.h>
20 AROS_LH2I(struct Node
*, FindName
,
23 AROS_LHA(struct List
*, list
, A0
),
24 AROS_LHA(CONST_STRPTR
, name
, A1
),
27 struct ExecBase
*, SysBase
, 46, Exec
)
30 Look for a node with a certain name in a list.
33 list - Search this list.
34 name - This is the name to look for.
39 The search is case-sensitive, so "Hello" will not find a node
42 The list must contain complete Nodes and no MinNodes.
44 When supplied with a NULL list argument, defaults to the exec port list.
50 // Look for a node with the name "Hello"
51 node = FindName (list, "Hello");
59 ******************************************************************************/
64 FindName supplied with a NULL list defaults to the exec port list
65 Changed in lists.c as well....
69 #if defined(__AROSEXEC_SMP__)
70 bug("[EXEC] %s: called with NULL list!\n", __func__
);
72 list
= &SysBase
->PortList
;
75 /* ASSERT(list != NULL); */
78 /* Look through the list */
79 for (node
=GetHead(list
); node
; node
=GetSucc(node
))
81 /* Only compare the names if this node has one. */
84 /* Check the node. If we found it, stop. */
85 if (!strcmp (node
->ln_Name
, name
))
91 If we found a node, this will contain the pointer to it. If we
92 didn't, this will be NULL (either because the list was
93 empty or because we tried all nodes in the list)