8354 sync regcomp(3C) with upstream (fix make catalog)
[unleashed/tickless.git] / usr / src / man / man3picl / picl_walk_tree_by_class.3picl
blob745fcbe55dfb15e91a22e83ea1379b2f53882685
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 PICL_WALK_TREE_BY_CLASS 3PICL "Aug 1, 2000"
7 .SH NAME
8 picl_walk_tree_by_class \- walk subtree by class
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lpicl\fR [ \fIlibrary\fR... ]
13 #include <picl.h>
15 \fBint\fR \fBpicl_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, \fBvoid *\fR\fIc_args\fR));
18 .fi
20 .SH DESCRIPTION
21 .sp
22 .LP
23 The \fBpicl_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, then the callback function specified by \fIcallback\fR
27 is called with the matching node handle and the argument provided in
28 \fIc_args\fR. If the class name specified in \fIclassname\fR is \fINULL\fR,
29 then the callback 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 .sp
42 .LP
43 \fBPICL_STALEHANDLE\fR is returned if the handle is no longer valid. This
44 occurs if the PICL tree was refreshed or reinitialized.
45 .sp
46 .LP
47 \fBPICL_INVALIDHANDLE\fR is returned if the specified handle never existed.
48 This error may be returned for a previously valid handle if the daemon was
49 brought down and restarted. When this occurs a client must revalidate any saved
50 handles.
51 .SH ERRORS
52 .sp
53 .ne 2
54 .na
55 \fB\fBPICL_NOTINITIALIZED\fR\fR
56 .ad
57 .RS 23n
58 Session not initialized
59 .RE
61 .sp
62 .ne 2
63 .na
64 \fB\fBPICL_NORESPONSE\fR\fR
65 .ad
66 .RS 23n
67 Daemon not responding
68 .RE
70 .sp
71 .ne 2
72 .na
73 \fB\fBPICL_NOTNODE\fR\fR
74 .ad
75 .RS 23n
76 Not a node
77 .RE
79 .sp
80 .ne 2
81 .na
82 \fB\fBPICL_INVALIDHANDLE\fR\fR
83 .ad
84 .RS 23n
85 Invalid handle specified
86 .RE
88 .sp
89 .ne 2
90 .na
91 \fB\fBPICL_STALEHANDLE\fR\fR
92 .ad
93 .RS 23n
94 Stale handle specified
95 .RE
97 .sp
98 .ne 2
99 .na
100 \fB\fBPICL_FAILURE\fR\fR
102 .RS 23n
103 General system failure
106 .SH ATTRIBUTES
109 See \fBattributes\fR(5)  for descriptions of the following attributes:
114 box;
115 c | c
116 l | l .
117 ATTRIBUTE TYPE  ATTRIBUTE VALUE
119 MT-Level        MT-Safe
122 .SH SEE ALSO
125 \fBpicl_get_propval_by_name\fR(3PICL), \fBattributes\fR(5)