xref: /titanic_51/usr/src/lib/libpicltree/llib-lpicltree (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License").  You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22/*LINTLIBRARY*/
23/*PROTOLIB1*/
24
25/*
26 * Copyright (c) 1999-2000 by Sun Microsystems, Inc.
27 * All rights reserved.
28 */
29
30#pragma ident	"%Z%%M%	%I%	%E% SMI"
31
32#include <synch.h>
33#include <picl.h>
34#include <picltree.h>
35#include "ptree_impl.h"
36
37int     ptree_get_root(picl_nodehdl_t *nodeh);
38int     ptree_create_node(const char *name, const char *clname,
39                        picl_nodehdl_t *nodeh);
40int     ptree_destroy_node(picl_nodehdl_t nodeh);
41int     ptree_add_node(picl_nodehdl_t parh, picl_nodehdl_t chdh);
42int     ptree_delete_node(picl_nodehdl_t nodeh);
43
44int     ptree_create_prop(const ptree_propinfo_t *pi, const void *vbuf,
45                        picl_prophdl_t *proph);
46int     ptree_destroy_prop(picl_prophdl_t proph);
47int     ptree_delete_prop(picl_prophdl_t proph);
48int     ptree_add_prop(picl_nodehdl_t nodeh, picl_prophdl_t proph);
49int     ptree_create_table(picl_prophdl_t *tbl_hdl);
50int     ptree_add_row_to_table(picl_prophdl_t tbl, int nprops,
51                        const picl_prophdl_t *props);
52int     ptree_update_propval_by_name(picl_nodehdl_t nodeh, const char *name,
53                        const void *vbuf, unsigned int sz);
54int     ptree_update_propval(picl_prophdl_t proph, const void *buf,
55                        unsigned int sz);
56int     ptree_get_propval(picl_prophdl_t proph, void *buf, unsigned int sz);
57int     ptree_get_propval_by_name(picl_nodehdl_t nodeh, const char *name,
58                        void *buf, unsigned int sz);
59int     ptree_get_propinfo(picl_prophdl_t proph, ptree_propinfo_t *pi);
60int     ptree_get_first_prop(picl_nodehdl_t nodeh, picl_prophdl_t *proph);
61int     ptree_get_next_prop(picl_prophdl_t thish, picl_prophdl_t *proph);
62int     ptree_get_prop_by_name(picl_nodehdl_t nodeh, const char *name,
63                        picl_prophdl_t *proph);
64int     ptree_get_next_by_row(picl_prophdl_t proph, picl_prophdl_t *rowh);
65int     ptree_get_next_by_col(picl_prophdl_t proph, picl_prophdl_t *colh);
66
67int	ptree_get_node_by_path(const char *prl, picl_nodehdl_t *nodeh);
68int	picld_plugin_register(picld_plugin_reg_t *infop);
69int	ptree_init_propinfo(ptree_propinfo_t *infop, int version, int ptype,
70			int pmode, size_t psize, char *pname,
71			int (*readfn)(ptree_rarg_t *, void *),
72			int (*writefn)(ptree_warg_t *, const void *));
73int	ptree_create_and_add_prop(picl_nodehdl_t nodeh,
74			ptree_propinfo_t *infop, void *vbuf,
75			picl_prophdl_t *proph);
76int	ptree_create_and_add_node(picl_nodehdl_t rooth, const char *name,
77			const char *classname, picl_nodehdl_t *nodeh);
78
79int	ptree_walk_tree_by_class(picl_nodehdl_t rooth, const char *classname,
80	void *c_args, int (*callback_fn)(picl_nodehdl_t hdl, void *args));
81
82int	ptree_find_node(picl_nodehdl_t rooth, char *pname,
83		picl_prop_type_t ptype, void *pval, size_t valsize,
84		picl_nodehdl_t *retnodeh);
85int	ptree_post_event(const char *ename, const void *earg,
86			size_t size, void (*completion_handler)(char *ename,
87			void *earg, size_t size));
88int	ptree_register_handler(const char *ename,
89			void (*evt_handler)(const char *ename, const void *earg,
90			size_t size, void *cookie), void *cookie);
91void	ptree_unregister_handler(const char *ename,
92			void (*evt_handler)(const char *ename, const void *earg,
93			size_t size, void *cookie), void *cookie);
94