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