1di_walk_link(3DEVINFO)Device Information Library Functionsdi_walk_link(3DEVINFO)
2
3
4

NAME

6       di_walk_link - traverse libdevinfo links
7

SYNOPSIS

9       cc [ flag... ] file... -ldevinfo [ library... ]
10       #include <libdevinfo.h>
11
12       int di_walk_link(di_node_t root, uint_t flag, uint_t endpoint, void *arg,
13            int (*link_callback)(di_link_t link, void *arg));
14
15

PARAMETERS

17       root             The handle to the root node of the subtree to visit.
18
19
20       flag             Specify 0. Reserved for future use.
21
22
23       endpoint         Specify  if  the  current node being visited should be
24                        the target or source of an link, either DI_LINK_TGT or
25                        DI_LINK_SRC
26
27
28       arg              A pointer to caller-specific data.
29
30
31       link_callback    The caller-supplied callback function.
32
33

DESCRIPTION

35       The  di_walk_link()  function visits all nodes in the subtree rooted at
36       root.  For each node found,  the  caller-supplied  function  link_call‐
37       back()  is  invoked  for each link associated with that node where that
38       node is the specified endpoint  of  the  link.   The  return  value  of
39       link_callback()  specifies subsequent walking behavior. See RETURN VAL‐
40       UES.
41

RETURN VALUES

43       Upon successful completion, di_walk_link() returns 0.  Otherwise, -1 is
44       returned and errno is set to indicate the error.
45
46
47       The  callback  function, link_callback(), can return one of the follow‐
48       ing:
49
50       DI_WALK_CONTINUE     Continue walking.
51
52
53       DI_WALK_TERMINATE    Terminate the walk immediately.
54
55

ERRORS

57       The di_walk_link() function will fail if:
58
59       EINVAL    An argument is invalid.
60
61

ATTRIBUTES

63       See attributes(5) for descriptions of the following attributes:
64
65
66
67
68       ┌─────────────────────────────┬─────────────────────────────┐
69       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
70       ├─────────────────────────────┼─────────────────────────────┤
71       │Interface Stability          │Evolving                     │
72       ├─────────────────────────────┼─────────────────────────────┤
73       │MT-Level                     │Safe                         │
74       └─────────────────────────────┴─────────────────────────────┘
75

SEE ALSO

77       di_init(3DEVINFO), libdevinfo(3LIB), attributes(5)
78
79
80
81SunOS 5.11                        22 Mar 2004           di_walk_link(3DEVINFO)
Impressum