6198 Let's EOL cachefs
[illumos-gate.git] / usr / src / man / man3picltree / ptree_walk_tree_by_class.3picltree
blob7789c2791d3bbd35e4dadfc7226889ea93934d31
1 '\" te
2 .\" Copyright (c) 2000, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH PTREE_WALK_TREE_BY_CLASS 3PICLTREE "Aug 1, 2000"
7 .SH NAME
8 ptree_walk_tree_by_class \- walk subtree by class
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lpicltree\fR [ \fIlibrary\fR... ]
13 #include <picltree.h>
15 \fBint\fR \fBptree_walk_tree_by_class\fR(\fBpicl_nodehdl_t\fR \fIrooth\fR,
16      \fBconst char *\fR\fIclassname\fR, \fBvoid *\fR\fIc_args\fR,
17      \fBint (*\fR\fIcallback\fR)(picl_nodehdl_t \fInodeh\fR, void *\fIc_args\fR));
18 .fi
20 .SH DESCRIPTION
21 .sp
22 .LP
23 The \fBptree_walk_tree_by_class()\fR function visits all the nodes of the
24 subtree under the node specified by \fIrooth\fR. The PICL class name of the
25 visited node is compared with the class name specified by \fIclassname\fR. If
26 the class names match, the callback function specified by \fIcallback\fR is
27 called with the matching node handle and the argument provided in \fIc_args\fR.
28 If the class name specified in \fIclassname\fR is \fINULL\fR, then the callback
29 function is invoked for all the nodes.
30 .sp
31 .LP
32 The return value from the callback function is used to determine whether to
33 continue or terminate the tree walk. The callback function returns
34 \fBPICL_WALK_CONTINUE\fR or \fBPICL_WALK_TERMINATE\fR to continue or terminate
35 the tree walk.
36 .SH RETURN VALUES
37 .sp
38 .LP
39 Upon successful completion, \fB0\fR is returned. On failure, a non-negative
40 integer is returned to indicate an error.
41 .SH ERRORS
42 .sp
43 .ne 2
44 .na
45 \fB\fBPICL_NOTNODE\fR\fR
46 .ad
47 .RS 22n
48 Not a node
49 .RE
51 .sp
52 .ne 2
53 .na
54 \fB\fBPICL_INVALIDHANDLE\fR\fR
55 .ad
56 .RS 22n
57 Invalid handle specified
58 .RE
60 .sp
61 .ne 2
62 .na
63 \fB\fBPICL_STALEHANDLE\fR\fR
64 .ad
65 .RS 22n
66 Stale handle specified
67 .RE
69 .sp
70 .ne 2
71 .na
72 \fB\fBPICL_FAILURE\fR\fR
73 .ad
74 .RS 22n
75 General system failure
76 .RE
78 .SH ATTRIBUTES
79 .sp
80 .LP
81 See \fBattributes\fR(5) for descriptions of the following attributes:
82 .sp
84 .sp
85 .TS
86 box;
87 c | c
88 l | l .
89 ATTRIBUTE TYPE  ATTRIBUTE VALUE
91 Interface Stability     Evolving
93 MT-Level        MT-Safe
94 .TE
96 .SH SEE ALSO
97 .sp
98 .LP
99 \fBptree_get_propval_by_name\fR(3PICLTREE), \fBattributes\fR(5)