Device Information Library Functions dichildnode(3DEVINFO)
NAME
dichildnode, diparentnode, disiblingnode,
didrvfirstnode, didrvnextnode - libdevinfo node
traversal functions
SYNOPSIS
cc [ flag... ] file... -ldevinfo [ library... ]
#include
dinodet dichildnode(dinodet node);
dinodet diparentnode(dinodet node);
dinodet disiblingnode(dinodet node);
dinodet didrvfirstnode(const char *drvname, dinodet root);
dinodet didrvnextnode(dinodet node);
PARAMETERS
drvname The name of the driver of interest.
node A handle to any node in the snapshot.
root The handle of the root node for the snapshot
returned by diinit(3DEVINFO).
DESCRIPTION
The kernel device configuration data may be viewed in two
ways, either as a tree of device configuration nodes or as
a list of nodes associated with each driver. In the tree
view, each node may contain references to its parent, the
next sibling in a list of siblings, and the first child of a
list of children. In the per-driver view, each node contains
a reference to the next node associated with the same
driver. Both views are captured in the snapshot, and the
interfaces are provided for node access.
The dichildnode() function obtains a handle to the first
child of node. If no child node exists in the snapshot,
DINODENIL is returned and errno is set to ENXIO or
ENOTSUP.
SunOS 5.11 Last change: 1 Dec 1998 1
Device Information Library Functions dichildnode(3DEVINFO)
The diparentnode() function obtains a handle to the parent
node of node. If no parent node exists in the snapshot,
DINODENIL is returned and errno is set to ENXIO or
ENOTSUP.
The disiblingnode() function obtains a handle to the next
sibling node of node. If no next sibling node exists in the
snapshot, DINODENIL is returned and errno is set to ENXIO
or ENOTSUP.
The didrvfirstnode() function obtains a handle to the
first node associated with the driver specified by drvname.
If there is no such driver, DINODENIL is returned with
errno is set to EINVAL. If the driver exists but there is no
node associated with this driver, DINODENIL is returned
and errno is set to ENXIO or ENOTSUP.
The didrvnextnode() function returns a handle to the next
node bound to the same driver. If no more nodes exist,
DINODENIL is returned.
RETURN VALUES
Upon successful completion, a handle is returned. Otherwise,
DINODENIL is returned and errno is set to indicate the
error.
ERORS
These functions will fail if:
EINVAL The argument is invalid.
ENXIO The requested node does not exist.
ENOTSUP The node was not found in the snapshot, but it
may exist in the kernel. This error may occur if
the snapshot contains a partial device tree.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 1 Dec 1998 2
Device Information Library Functions dichildnode(3DEVINFO)
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Evolving
MT-Level Safe
SEE ALSO
diinit(3DEVINFO), libdevinfo(3LIB), attributes(5)
Writing Device Drivers
SunOS 5.11 Last change: 1 Dec 1998 3
|