| Current File : //usr/share/man/man3devinfo/di_link_next_by_node.3devinfo |
'\" te
.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
.TH di_link_next_by_node 3DEVINFO "12 Jul 2004" "SunOS 5.11" "Device Information Library Functions"
.SH NAME
di_link_next_by_node, di_link_next_by_lnode \- libdevinfo link traversal functions
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-ldevinfo\fR [ \fIlibrary\fR\&.\|.\|. ]
#include <libdevinfo.h>
\fBdi_link_t\fR \fBdi_link_next_by_node\fR(\fBdi_lnode_t\fR \fInode\fR, \fBdi_link_t\fR \fIlink\fR,
\fBuint_t\fR \fIendpoint\fR);
.fi
.LP
.nf
\fBdi_link_t\fR \fBdi_link_next_by_lnode\fR(\fBdi_node_t\fR \fIlnode\fR, \fBdi_link_t\fR \fIlink\fR,
\fBuint_t\fR \fIendpoint\fR);
.fi
.SH PARAMETERS
.sp
.ne 2
.mk
.na
\fB\fIlink\fR\fR
.ad
.RS 12n
.rt
The handle to the current the link or \fBDI_LINK_NIL\fR.
.RE
.sp
.ne 2
.mk
.na
\fB\fIendpoint\fR\fR
.ad
.RS 12n
.rt
Specify which endpoint of the link the node or lnode should correspond to, either \fBDI_LINK_TGT\fR or \fBDI_LINK_SRC\fR.
.RE
.sp
.ne 2
.mk
.na
\fB\fInode\fR\fR
.ad
.RS 12n
.rt
The device node with which the link is associated.
.RE
.sp
.ne 2
.mk
.na
\fB\fIlnode\fR\fR
.ad
.RS 12n
.rt
The lnode with which the link is associated.
.RE
.SH DESCRIPTION
.sp
.LP
The \fBdi_link_next_by_node()\fR function returns a handle to the next link that has the same endpoint node as \fIlink\fR. If \fIlink\fR is \fBDI_LINK_NIL\fR, a handle is returned to the first link whose endpoint specified by \fIendpoint\fR matches the node specified by \fInode\fR.
.sp
.LP
The \fBdi_link_next_by_lnode()\fR function returns a handle to the next link that has the same endpoint lnode as \fIlink\fR. If \fIlink\fR is \fBDI_LINK_NIL\fR, a handle is returned to the first link whose endpoint specified by \fIendpoint\fR matches the lnode specified by \fIlnode\fR.
.SH RETURN VALUES
.sp
.LP
Upon successful completion, a handle to the next link is returned. Otherwise, \fBDI_LINK_NIL\fR is returned and \fBerrno\fR is set to indicate the error.
.SH ERRORS
.sp
.LP
The \fBdi_link_next_by_node()\fR and \fBdi_link_next_by_lnode()\fR functions will fail if:
.sp
.ne 2
.mk
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 10n
.rt
An argument is invalid.
.RE
.sp
.ne 2
.mk
.na
\fB\fBENXIO\fR\fR
.ad
.RS 10n
.rt
The end of the link list has been reached.
.RE
.sp
.LP
The \fBdi_link_next_by_node()\fR function will fail if:
.sp
.ne 2
.mk
.na
\fB\fBENOTSUP\fR\fR
.ad
.RS 11n
.rt
Device usage information is not available in snapshot.
.RE
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.sp
.TS
tab() box;
cw(2.75i) |cw(2.75i)
lw(2.75i) |lw(2.75i)
.
ATTRIBUTE TYPEATTRIBUTE VALUE
_
Interface StabilityCommitted
_
MT-LevelSafe
.TE
.SH SEE ALSO
.sp
.LP
\fBdi_init\fR(3DEVINFO), \fBlibdevinfo\fR(3LIB), \fBattributes\fR(5)