Device Information Library Functions diwalknode(3DEVINFO)
NAME
diwalknode - traverse libdevinfo device nodes
SYNOPSIS
cc [ flag... ] file... -ldevinfo [ library... ]
#include
int diwalknode(dinodet root, uintt flag, void *arg,
int (*nodecallback)(dinodet node, void *arg));
DESCRIPTION
The diwalknode() function visits all nodes in the subtree
rooted at root. For each node found, the caller-supplied
function nodecallback() is invoked. The return value of
nodecallback() specifies subsequent walking behavior.
PARAMETERS
arg Pointer to caller-specific data.
flag Specifies walking order, either DIWALKCLDFIRST
(depth first) or DIWALKSIBFIRST (breadth first).
DIWALKCLDFIRST is the default.
node The node being visited.
root The handle to the root node of the subtree to visit.
RETURN VALUES
Upon successful completion, diwalknode() returns 0. Other-
wise, -1 is returned and errno is set to indicate the error.
The nodecallback() function can return one of the follow-
ing:
DIWALKCONTINUE Continue walking.
DIWALKPRUNESIB Continue walking, but skip siblings
and their child nodes.
DIWALKPRUNECHILD Continue walking, but skip subtree
rooted at current node.
SunOS 5.11 Last change: 16 Jan 2009 1
Device Information Library Functions diwalknode(3DEVINFO)
DIWALKTERMINATE Terminate the walk immediately.
ERORS
The diwalknode() function will fail if:
EINVAL Invalid argument.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Committed
MT-Level Safe
SEE ALSO
diinit(3DEVINFO), libdevinfo(3LIB), attributes(5)
Writing Device Drivers
SunOS 5.11 Last change: 16 Jan 2009 2
|