Merge commit 'dc97a43d4a70c8773a619f11b95b07a787f6f5b7' into merges
[unleashed.git] / share / man / man3picltree / ptree_get_node_by_path.3picltree
blobfecacb579c08bed19e486b63251121d3109e2736
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_GET_NODE_BY_PATH 3PICLTREE "April 9, 2016"
7 .SH NAME
8 ptree_get_node_by_path \- get handle of node specified by PICL tree path
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_get_node_by_path\fR(\fBconst char *\fR\fIptreepath\fR,
16      \fBpicl_nodehdl_t *\fR\fInodeh\fR);
17 .fi
19 .SH DESCRIPTION
20 .LP
21 The \fBptree_get_node_by_path()\fR function copies the handle of the node in
22 the PICL tree specified by the path given in \fIptreepath\fR into the location
23 \fInodeh\fR.
24 .sp
25 .LP
26 The syntax of a PICL tree path is:
27 .sp
28 .in +2
29 .nf
30 [\fIdef_propname\fR:]/[\fIdef_propval\fR[\fImatch_cond\fR] \&.\|.\|. ]
31 .fi
32 .in -2
34 .sp
35 .LP
36 where \fIdef_propname\fR prefix is a shorthand notation to specify the name of
37 the property whose value is specified in \fIdef_propval\fR, and the
38 \fImatch_cond\fR expression specifies the matching criteria for that node in
39 the form of one or more pairs of property names and values such as
40 .sp
41 .in +2
42 .nf
43 [@\fIaddress\fR][?\fIprop_name\fR[=\fIprop_val\fR] \&.\|.\|. ]
44 .fi
45 .in -2
47 .sp
48 .LP
49 where '@' is a shorthand notation to refer to the device address, which is
50 followed by the device address value address. The address value is matched with
51 the value of the property "bus-addr" if it exists. If no "bus-addr" property
52 exists, then it is matched with the value of the property "UnitAddress". Use
53 the '?' notation to limit explicitly the comparison to "bus-addr" or
54 "UnitAddress" property.  The expression following '?' specifies matching
55 property name and value pairs, where \fIprop_name\fR gives the property name
56 and \fIprop_val\fR gives the property value for non \fBPICL_PTYPE_VOID
57 \fRproperties. The values for properties of type \fBPICL_PTYPE_TABLE\fR,
58 \fBPICL_PTYPE_BYTEARRAY\fR, and \fBPICL_PTYPE_REFERENCE\fR cannot be specified
59 in the \fImatch_cond\fR expression.
60 .sp
61 .LP
62 A "_class" property value of "picl" may be used to match nodes of all PICL
63 classes.
64 .sp
65 .LP
66 All valid paths must start at the root node denoted by '/'.
67 .sp
68 .LP
69 If no prefix is specified for the path, then the prefix defaults to the "name"
70 property.
71 .SH RETURN VALUES
72 .LP
73 Upon successful completion, \fB0\fR is returned. On failure, a non-negative
74 integer is returned to indicate an error.
75 .sp
76 .LP
77 \fBPICL_NOTNODE\fR is returned if there is no node corresponding to the
78 specified path.
79 .SH ERRORS
80 .ne 2
81 .na
82 \fB\fBPICL_INVALIDARG\fR\fR
83 .ad
84 .RS 19n
85 Invalid argument
86 .RE
88 .sp
89 .ne 2
90 .na
91 \fB\fBPICL_NOTNODE\fR\fR
92 .ad
93 .RS 19n
94 Not a node
95 .RE
97 .sp
98 .ne 2
99 .na
100 \fB\fBPICL_FAILURE\fR\fR
102 .RS 19n
103 General system failure
106 .SH ATTRIBUTES
108 See \fBattributes\fR(5) for descriptions of the following attributes:
113 box;
114 c | c
115 l | l .
116 ATTRIBUTE TYPE  ATTRIBUTE VALUE
118 Interface Stability     Evolving
120 MT-Level        MT-Safe
123 .SH SEE ALSO
125 \fBptree_get_propval_by_name\fR(3PICLTREE), \fBattributes\fR(5)