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 /* 23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 * 26 * ptree.h -- public definitions for tree print module 27 * 28 * these routines are used to print the "struct node" data 29 * structures from tree.h. they call out() to do the printing. 30 */ 31 32 #ifndef _ESC_COMMON_PTREE_H 33 #define _ESC_COMMON_PTREE_H 34 35 #pragma ident "%Z%%M% %I% %E% SMI" 36 37 #ifdef __cplusplus 38 extern "C" { 39 #endif 40 41 #include <tree.h> 42 43 /* 44 * Use a pointer to one of these structs as the "arg" argument when 45 * lut_walk()-ing with ptree_plut() as the callback. "plut" is a 46 * property lut, where the lhs is expected to be a const char * and 47 * the rhs is a struct node. 48 * 49 * flags is passed to out() 50 * first = 1 indicates the first in a list, first != 1 implies a later 51 * element and thus ptree_plut() adds a preceding comma 52 * 53 */ 54 struct plut_wlk_data { 55 int flags; 56 int first; 57 }; 58 59 void ptree(int flags, struct node *np, int no_iterators, int fileline); 60 void ptree_name(int flags, struct node *np); 61 void ptree_name_iter(int flags, struct node *np); 62 void ptree_all(int flags, const char *pat); 63 void ptree_fault(int flags, const char *pat); 64 void ptree_upset(int flags, const char *pat); 65 void ptree_defect(int flags, const char *pat); 66 void ptree_error(int flags, const char *pat); 67 void ptree_ereport(int flags, const char *pat); 68 void ptree_serd(int flags, const char *pat); 69 void ptree_stat(int flags, const char *pat); 70 void ptree_config(int flags, const char *pat); 71 void ptree_prop(int flags, const char *pat); 72 void ptree_mask(int flags, const char *pat); 73 void ptree_timeval(int flags, unsigned long long *ullp); 74 void ptree_plut(void *name, void *val, void *arg); 75 const char *ptree_nodetype2str(enum nodetype t); 76 const char *ptree_nametype2str(enum nametype t); 77 78 #ifdef __cplusplus 79 } 80 #endif 81 82 #endif /* _ESC_COMMON_PTREE_H */ 83