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