llib-lpicltree revision 2
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence/*
bf33eb0b522801792a6663b0360bc94b9e9b77c2Automatic Updater * CDDL HEADER START
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington *
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * The contents of this file are subject to the terms of the
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater * Common Development and Distribution License, Version 1.0 only
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence * (the "License"). You may not use this file except in compliance
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence * with the License.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence *
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * or http://www.opensolaris.org/os/licensing.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * See the License for the specific language governing permissions
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * and limitations under the License.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews *
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * When distributing Covered Code, include this CDDL HEADER in each
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence * If applicable, add the following below this CDDL HEADER, with the
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence * fields enclosed by brackets "[]" replaced with your own identifying
0874abad14e3e9ecfc3dc1a1a2b9969f2f027724Mark Andrews * information: Portions Copyright [yyyy] [name of copyright owner]
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence *
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * CDDL HEADER END
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein */
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence/*LINTLIBRARY*/
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence/*PROTOLIB1*/
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence
febf5f8b55abb2e6e840488a29a5ef4e20654f67David Lawrence/*
febf5f8b55abb2e6e840488a29a5ef4e20654f67David Lawrence * Copyright (c) 1999-2000 by Sun Microsystems, Inc.
febf5f8b55abb2e6e840488a29a5ef4e20654f67David Lawrence * All rights reserved.
febf5f8b55abb2e6e840488a29a5ef4e20654f67David Lawrence */
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence
431fb211db3cc59cb9b115e72526b83c76a2a082Bob Halley#pragma ident "%Z%%M% %I% %E% SMI"
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence#include <synch.h>
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence#include <picl.h>
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence#include <picltree.h>
364a82f7c25b62967678027043425201a5e5171aBob Halley#include "ptree_impl.h"
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrenceint ptree_get_root(picl_nodehdl_t *nodeh);
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrenceint ptree_create_node(const char *name, const char *clname,
92ef1a9b9dbd48ecb507b42ac62c15afefdaf838David Lawrence picl_nodehdl_t *nodeh);
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrenceint ptree_destroy_node(picl_nodehdl_t nodeh);
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrenceint ptree_add_node(picl_nodehdl_t parh, picl_nodehdl_t chdh);
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrenceint ptree_delete_node(picl_nodehdl_t nodeh);
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrenceint ptree_create_prop(const ptree_propinfo_t *pi, const void *vbuf,
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence picl_prophdl_t *proph);
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrenceint ptree_destroy_prop(picl_prophdl_t proph);
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrenceint ptree_delete_prop(picl_prophdl_t proph);
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrenceint ptree_add_prop(picl_nodehdl_t nodeh, picl_prophdl_t proph);
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrenceint ptree_create_table(picl_prophdl_t *tbl_hdl);
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrenceint ptree_add_row_to_table(picl_prophdl_t tbl, int nprops,
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence const picl_prophdl_t *props);
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrenceint ptree_update_propval_by_name(picl_nodehdl_t nodeh, const char *name,
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence const void *vbuf, unsigned int sz);
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austeinint ptree_update_propval(picl_prophdl_t proph, const void *buf,
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein unsigned int sz);
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrenceint ptree_get_propval(picl_prophdl_t proph, void *buf, unsigned int sz);
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrenceint ptree_get_propval_by_name(picl_nodehdl_t nodeh, const char *name,
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence void *buf, unsigned int sz);
0e1bef59f060f6442a93cb662b0313e8908500e1Bob Halleyint ptree_get_propinfo(picl_prophdl_t proph, ptree_propinfo_t *pi);
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsint ptree_get_first_prop(picl_nodehdl_t nodeh, picl_prophdl_t *proph);
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrenceint ptree_get_next_prop(picl_prophdl_t thish, picl_prophdl_t *proph);
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrenceint ptree_get_prop_by_name(picl_nodehdl_t nodeh, const char *name,
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence picl_prophdl_t *proph);
0e1bef59f060f6442a93cb662b0313e8908500e1Bob Halleyint ptree_get_next_by_row(picl_prophdl_t proph, picl_prophdl_t *rowh);
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrenceint ptree_get_next_by_col(picl_prophdl_t proph, picl_prophdl_t *colh);
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsint ptree_get_node_by_path(const char *prl, picl_nodehdl_t *nodeh);
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsint picld_plugin_register(picld_plugin_reg_t *infop);
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsint ptree_init_propinfo(ptree_propinfo_t *infop, int version, int ptype,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews int pmode, size_t psize, char *pname,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews int (*readfn)(ptree_rarg_t *, void *),
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews int (*writefn)(ptree_warg_t *, const void *));
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsint ptree_create_and_add_prop(picl_nodehdl_t nodeh,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ptree_propinfo_t *infop, void *vbuf,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews picl_prophdl_t *proph);
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsint ptree_create_and_add_node(picl_nodehdl_t rooth, const char *name,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews const char *classname, picl_nodehdl_t *nodeh);
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsint ptree_walk_tree_by_class(picl_nodehdl_t rooth, const char *classname,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews void *c_args, int (*callback_fn)(picl_nodehdl_t hdl, void *args));
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
0874abad14e3e9ecfc3dc1a1a2b9969f2f027724Mark Andrewsint ptree_find_node(picl_nodehdl_t rooth, char *pname,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews picl_prop_type_t ptype, void *pval, size_t valsize,
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence picl_nodehdl_t *retnodeh);
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrenceint ptree_post_event(const char *ename, const void *earg,
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence size_t size, void (*completion_handler)(char *ename,
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence void *earg, size_t size));
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrenceint ptree_register_handler(const char *ename,
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence void (*evt_handler)(const char *ename, const void *earg,
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence size_t size, void *cookie), void *cookie);
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrencevoid ptree_unregister_handler(const char *ename,
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence void (*evt_handler)(const char *ename, const void *earg,
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence size_t size, void *cookie), void *cookie);
49e558760e9c21a6b7c726ccf999a2711fd8eef9David Lawrence