Device Information Library Functions diwalklink(3DEVINFO)
NAME
diwalklink - traverse libdevinfo links
SYNOPSIS
cc [ flag... ] file... -ldevinfo [ library... ]
#include
int diwalklink(dinodet root, uintt flag, uintt endpoint, void *arg,
int (*linkcallback)(dilinkt link, void *arg));
PARAMETERS
root The handle to the root node of the subtree
to visit.
flag Specify 0. Reserved for future use.
endpoint Specify if the current node being visited
should be the target or source of an link,
either DILINKTGT or DILINKSRC
arg A pointer to caller-specific data.
linkcallback The caller-supplied callback function.
DESCRIPTION
The diwalklink() function visits all nodes in the subtree
rooted at root. For each node found, the caller-supplied
function linkcallback() is invoked for each link associated
with that node where that node is the specified endpoint of
the link. The return value of linkcallback() specifies
subsequent walking behavior. See RETURN VALUES.
RETURN VALUES
Upon successful completion, diwalklink() returns 0. Oth-
erwise, -1 is returned and errno is set to indicate the
error.
The callback function, linkcallback(), can return one of
the following:
DIWALKCONTINUE Continue walking.
DIWALKTERMINATE Terminate the walk immediately.
SunOS 5.11 Last change: 22 Mar 2004 1
Device Information Library Functions diwalklink(3DEVINFO)
ERORS
The diwalklink() function will fail if:
EINVAL An argument is invalid.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Evolving
MT-Level Safe
SEE ALSO
diinit(3DEVINFO), libdevinfo(3LIB), attributes(5)
SunOS 5.11 Last change: 22 Mar 2004 2
|