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
38extern "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 */
54struct plut_wlk_data {
55	int flags;
56	int first;
57};
58
59void ptree(int flags, struct node *np, int no_iterators, int fileline);
60void ptree_name(int flags, struct node *np);
61void ptree_name_iter(int flags, struct node *np);
62void ptree_all(int flags, const char *pat);
63void ptree_fault(int flags, const char *pat);
64void ptree_upset(int flags, const char *pat);
65void ptree_defect(int flags, const char *pat);
66void ptree_error(int flags, const char *pat);
67void ptree_ereport(int flags, const char *pat);
68void ptree_serd(int flags, const char *pat);
69void ptree_stat(int flags, const char *pat);
70void ptree_config(int flags, const char *pat);
71void ptree_prop(int flags, const char *pat);
72void ptree_mask(int flags, const char *pat);
73void ptree_timeval(int flags, unsigned long long *ullp);
74void ptree_plut(void *name, void *val, void *arg);
75const char *ptree_nodetype2str(enum nodetype t);
76const char *ptree_nametype2str(enum nametype t);
77
78#ifdef	__cplusplus
79}
80#endif
81
82#endif	/* _ESC_COMMON_PTREE_H */
83