2 .\" Copyright (c) 2004, 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 LIBPICLTREE 3PICLTREE "Mar 1, 2004"
8 libpicltree \- PTree and Plug-in Registration interface library
12 \fBcc\fR [\fIflag \&.\|.\|.\fR] \fIfile \fR\&.\|.\|. \fB-lpicltree\fR [\fIlibrary \&.\|.\|.\fR]
19 The PTree interface is the set of functions and data structures to access and
20 manipulate the PICL tree. The daemon and the plug-in modules use the PTree
24 The Plug-in Registration interface is used by the plug-in modules to register
25 themselves with the daemon.
28 The plug-in modules create the nodes and properties of the tree. At the time of
29 creating a property, the plug-ins specify the property information in the
30 \fBptree_propinfo_t\fR structure defined as:
35 int version; /* version */
36 picl_propinfo_t piclinfo; /* info to clients */
37 int (*read)(ptree_rarg_t *arg, void *buf);
38 /* read access function for */
40 int (*write)(ptree_warg_t *arg, const void *buf);
41 /* write access function for */
49 See \fBlibpicl\fR(3PICL) for more information on PICL tree nodes and
53 The maximum size of a property value cannot exceed \fBPICL_PROPSIZE_MAX\fR. It
54 is currently set to 512KB.
55 .SS "Volatile Properties"
58 In addition to \fBPICL_READ\fR and \fBPICL_WRITE\fR property access modes, the
59 plug-in modules specify whether a property is volatile or not by setting the
60 bit \fBPICL_VOLATILE\fR.
64 #define PICL_VOLATILE 0x4
70 For a volatile property, the plug-in module provides the access functions to
71 read and/or write the property in the \fBptree_propinfo_t\fR argument passed
72 when creating the property.
75 The daemon invokes the access functions of volatile properties when clients
76 access their values. Two arguments are passed to the read access functions. The
77 first argument is a pointer to \fBptree_rarg_t\fR, which contains the handle of
78 the node, the handle of the accessed property and the credentials of the
79 caller. The second argument is a pointer to the buffer where the value is to
94 The prototype of the read access function for volatile property is:
98 int read(ptree_rarg_t *rarg, void *buf);
104 The read function returns \fBPICL_SUCCESS\fR to indicate successful completion.
107 Similarly, when a write access is performed on a volatile property, the daemon
108 invokes the write access function provided by the plug-in for that property and
109 passes it two arguments. The first argument is a pointer to \fBptree_warg_t\fR,
110 which contains the handle to the node, the handle of the accessed property and
111 the credentials of the caller. The second argument is a pointer to the buffer
112 containing the value to be written.
117 picl_nodehdl_t nodeh;
118 picl_prophdl_t proph;
126 The prototype of the write access function for volatile property is:
130 int write(ptree_warg_t *warg, const void *buf);
136 The write function returns \fBPICL_SUCCESS\fR to indicate successful
140 For all volatile properties, the 'size' of the property must be specified to be
141 the maximum possible size of the value. The maximum size of the value cannot
142 exceed \fBPICL_PROPSIZE_MAX\fR. This allows a client to allocate a sufficiently
143 large buffer before retrieving a volatile property's value
144 .SS "Plug-in Modules"
147 Plug-in modules are shared objects that are located in well-known directories
148 for the daemon to locate and load them. Plug-in module's are located in the one
149 of the following plug-in directories depending on the plaform-specific nature
150 of the data they collect and publish.
154 /usr/platform/picl/plugins/`uname -i`/
155 /usr/platform/picl/plugins/`uname -m`/
156 /usr/lib/picl/plugins/
162 A plug-in module may specify its dependency on another plug-in module using the
163 \fB-l\fR linker option. The plug-ins are loaded by the PICL daemon using
164 \fBdlopen\fR(3C) according to the specified dependencies. Each plug-in module
165 must define a \fB\&.init\fR section, which is executed when the plug-in module
166 is loaded, to register themselves with the daemon. See
167 \fBpicld_plugin_register\fR(3PICLTREE) for more information on plug-in
171 The plug-in modules may use the \fBpicld_log\fR(3PICLTREE) function to log
172 their messages to the system log file.
176 See \fBattributes\fR(5) for descriptions of the following attributes:
184 ATTRIBUTE TYPE ATTRIBUTE VALUE
192 \fBlibpicl\fR(3PICL), \fBlibpicltree\fR(3LIB), \fBpicld_log\fR(3PICLTREE),
193 \fBpicld_plugin_register\fR(3PICLTREE), \fBattributes\fR(5)