xref: /illumos-gate/usr/src/cmd/fm/eversholt/common/ptree.h (revision 0ccfe5834c3b867c1b6c273cae02ec8922bc0fd2)
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 #ifdef	__cplusplus
36 extern "C" {
37 #endif
38 
39 #include <tree.h>
40 
41 /*
42  * Use a pointer to one of these structs as the "arg" argument when
43  * lut_walk()-ing with ptree_plut() as the callback.  "plut" is a
44  * property lut, where the lhs is expected to be a const char * and
45  * the rhs is a struct node.
46  *
47  *	flags is passed to out()
48  *	first = 1 indicates the first in a list, first != 1 implies a later
49  *	element and thus ptree_plut() adds a preceding comma
50  *
51  */
52 struct plut_wlk_data {
53 	int flags;
54 	int first;
55 };
56 
57 void ptree(int flags, struct node *np, int no_iterators, int fileline);
58 void ptree_name(int flags, struct node *np);
59 void ptree_name_iter(int flags, struct node *np);
60 void ptree_all(int flags, const char *pat);
61 void ptree_fault(int flags, const char *pat);
62 void ptree_upset(int flags, const char *pat);
63 void ptree_defect(int flags, const char *pat);
64 void ptree_error(int flags, const char *pat);
65 void ptree_ereport(int flags, const char *pat);
66 void ptree_serd(int flags, const char *pat);
67 void ptree_stat(int flags, const char *pat);
68 void ptree_config(int flags, const char *pat);
69 void ptree_prop(int flags, const char *pat);
70 void ptree_mask(int flags, const char *pat);
71 void ptree_timeval(int flags, unsigned long long *ullp);
72 void ptree_plut(void *name, void *val, void *arg);
73 const char *ptree_nodetype2str(enum nodetype t);
74 const char *ptree_nametype2str(enum nametype t);
75 
76 #ifdef	__cplusplus
77 }
78 #endif
79 
80 #endif	/* _ESC_COMMON_PTREE_H */
81