xref: /titanic_41/usr/src/cmd/fm/eversholt/common/tree.h (revision b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
58a40a695Sgavinm  * Common Development and Distribution License (the "License").
68a40a695Sgavinm  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22602ca9eaScth  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  *
257c478bd9Sstevel@tonic-gate  * tree.h -- public definitions for tree module
267c478bd9Sstevel@tonic-gate  *
277c478bd9Sstevel@tonic-gate  * the parse tree is made up of struct node's.  the struct is
287c478bd9Sstevel@tonic-gate  * a "variant record" with a type, the filename and line number
297c478bd9Sstevel@tonic-gate  * related to the node, and then type-specific node data.
307c478bd9Sstevel@tonic-gate  */
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #ifndef	_ESC_COMMON_TREE_H
337c478bd9Sstevel@tonic-gate #define	_ESC_COMMON_TREE_H
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
387c478bd9Sstevel@tonic-gate extern "C" {
397c478bd9Sstevel@tonic-gate #endif
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate struct node {
427c478bd9Sstevel@tonic-gate 	enum nodetype {
43b5016cbbSstephh 		T_NOTHING,		/* used to keep going on error cases */
447c478bd9Sstevel@tonic-gate 		T_NAME,			/* identifiers, sometimes chained */
457c478bd9Sstevel@tonic-gate 		T_GLOBID,		/* globals (e.g. $a) */
467c478bd9Sstevel@tonic-gate 		T_EVENT,		/* class@path{expr} */
477c478bd9Sstevel@tonic-gate 		T_ENGINE,		/* upset threshold engine (e.g. SERD) */
487c478bd9Sstevel@tonic-gate 		T_ASRU,			/* ASRU declaration */
497c478bd9Sstevel@tonic-gate 		T_FRU,			/* FRU declaration */
507c478bd9Sstevel@tonic-gate 		T_TIMEVAL,		/* num w/time suffix (ns internally) */
517c478bd9Sstevel@tonic-gate 		T_NUM,			/* num (ull internally) */
527c478bd9Sstevel@tonic-gate 		T_QUOTE,		/* quoted string */
537c478bd9Sstevel@tonic-gate 		T_FUNC,			/* func(arglist) */
547c478bd9Sstevel@tonic-gate 		T_NVPAIR,		/* name=value pair in decl */
557c478bd9Sstevel@tonic-gate 		T_ASSIGN,		/* assignment statement */
567c478bd9Sstevel@tonic-gate 		T_CONDIF,		/* a and T_CONDELSE in (a ? b : c ) */
577c478bd9Sstevel@tonic-gate 		T_CONDELSE,		/* lists b and c in (a ? b : c ) */
587c478bd9Sstevel@tonic-gate 		T_NOT,			/* boolean ! operator */
597c478bd9Sstevel@tonic-gate 		T_AND,			/* boolean && operator */
607c478bd9Sstevel@tonic-gate 		T_OR,			/* boolean || operator */
617c478bd9Sstevel@tonic-gate 		T_EQ,			/* boolean == operator */
627c478bd9Sstevel@tonic-gate 		T_NE,			/* boolean != operator */
637c478bd9Sstevel@tonic-gate 		T_SUB,			/* integer - operator */
647c478bd9Sstevel@tonic-gate 		T_ADD,			/* integer + operator */
657c478bd9Sstevel@tonic-gate 		T_MUL,			/* integer * operator */
667c478bd9Sstevel@tonic-gate 		T_DIV,			/* integer / operator */
677c478bd9Sstevel@tonic-gate 		T_MOD,			/* integer % operator */
687c478bd9Sstevel@tonic-gate 		T_LT,			/* boolean < operator */
697c478bd9Sstevel@tonic-gate 		T_LE,			/* boolean <= operator */
707c478bd9Sstevel@tonic-gate 		T_GT,			/* boolean > operator */
717c478bd9Sstevel@tonic-gate 		T_GE,			/* boolean >= operator */
727c478bd9Sstevel@tonic-gate 		T_BITAND,		/* bitwise & operator */
737c478bd9Sstevel@tonic-gate 		T_BITOR,		/* bitwise | operator */
747c478bd9Sstevel@tonic-gate 		T_BITXOR,		/* bitwise ^ operator */
757c478bd9Sstevel@tonic-gate 		T_BITNOT,		/* bitwise ~ operator */
767c478bd9Sstevel@tonic-gate 		T_LSHIFT,		/* bitwise << operator */
777c478bd9Sstevel@tonic-gate 		T_RSHIFT,		/* bitwise >> operator */
787c478bd9Sstevel@tonic-gate 		T_ARROW,		/* lhs (N)->(K) rhs */
797c478bd9Sstevel@tonic-gate 		T_LIST,			/* comma-separated list */
807c478bd9Sstevel@tonic-gate 		T_FAULT,		/* fault declaration */
817c478bd9Sstevel@tonic-gate 		T_UPSET,		/* upset declaration */
827c478bd9Sstevel@tonic-gate 		T_DEFECT,		/* defect declaration */
837c478bd9Sstevel@tonic-gate 		T_ERROR,		/* error declaration */
847c478bd9Sstevel@tonic-gate 		T_EREPORT,		/* ereport declaration */
857c478bd9Sstevel@tonic-gate 		T_SERD,			/* SERD engine declaration */
867aec1d6eScindi 		T_STAT,			/* STAT engine declaration */
877c478bd9Sstevel@tonic-gate 		T_PROP,			/* prop statement */
887c478bd9Sstevel@tonic-gate 		T_MASK,			/* mask statement */
897c478bd9Sstevel@tonic-gate 		T_CONFIG		/* config statement */
90b5016cbbSstephh 	} t:8;
917c478bd9Sstevel@tonic-gate 
927c478bd9Sstevel@tonic-gate 	/*
937c478bd9Sstevel@tonic-gate 	 * regardless of the type of node, filename and line number
947c478bd9Sstevel@tonic-gate 	 * information from the original .esc file is tracked here.
957c478bd9Sstevel@tonic-gate 	 */
96b5016cbbSstephh 	int line:24;
977c478bd9Sstevel@tonic-gate 	const char *file;
987c478bd9Sstevel@tonic-gate 
997c478bd9Sstevel@tonic-gate 	/*
1007c478bd9Sstevel@tonic-gate 	 * the variant part of a struct node...
1017c478bd9Sstevel@tonic-gate 	 */
1027c478bd9Sstevel@tonic-gate 	union {
1037c478bd9Sstevel@tonic-gate 		struct {
1047c478bd9Sstevel@tonic-gate 			/*
1057c478bd9Sstevel@tonic-gate 			 * info kept for T_NAME, used in several ways:
1067c478bd9Sstevel@tonic-gate 			 *
1077c478bd9Sstevel@tonic-gate 			 *	1 for simple variable names.
1087c478bd9Sstevel@tonic-gate 			 *		example: j
1097c478bd9Sstevel@tonic-gate 			 *
1107c478bd9Sstevel@tonic-gate 			 *	2 for event class names, with component
1117c478bd9Sstevel@tonic-gate 			 *	  names chained together via the "next"
1127c478bd9Sstevel@tonic-gate 			 *	  pointers.
1137c478bd9Sstevel@tonic-gate 			 *		example: fault.fan.broken
1147c478bd9Sstevel@tonic-gate 			 *
1157c478bd9Sstevel@tonic-gate 			 *	3 for component pathnames, with component
1167c478bd9Sstevel@tonic-gate 			 *	  names chained together via the "next"
1177c478bd9Sstevel@tonic-gate 			 *	  pointers and iterators or instance numbers
1187c478bd9Sstevel@tonic-gate 			 *	  attached via the "child" pointers.
1197c478bd9Sstevel@tonic-gate 			 *		example: sysboard[0]/cpu[n]
1207c478bd9Sstevel@tonic-gate 			 *
1217c478bd9Sstevel@tonic-gate 			 * case 3 is the most interesting.
1227c478bd9Sstevel@tonic-gate 			 *	- if child is set, there's an iterator
1237c478bd9Sstevel@tonic-gate 			 *	- if child is a T_NAME, it is x[j] or x<j> and
1247c478bd9Sstevel@tonic-gate 			 *	  iterator type tells you vertical or horizontal
1257c478bd9Sstevel@tonic-gate 			 *	- if child is a T_NUM, it is x[0] or x<0> or
1267c478bd9Sstevel@tonic-gate 			 *	  x0 and iterator type tells you which one
1277c478bd9Sstevel@tonic-gate 			 *	- if cp pointer is set, then we recently
1287c478bd9Sstevel@tonic-gate 			 *	  matched it to a config cache entry and one
1297c478bd9Sstevel@tonic-gate 			 *	  can ignore child for now because it still
1307c478bd9Sstevel@tonic-gate 			 *	  represents the *pattern* you're matching.
1317c478bd9Sstevel@tonic-gate 			 *	  cp represents what you matched.  ptree()
1327c478bd9Sstevel@tonic-gate 			 *	  knows that if cp is set, to print that number
1337c478bd9Sstevel@tonic-gate 			 *	  instead of following child.
1347c478bd9Sstevel@tonic-gate 			 *
1357c478bd9Sstevel@tonic-gate 			 * when T_NAME nodes are chained:
1367c478bd9Sstevel@tonic-gate 			 * the "last" pointer takes you to the end of the
1377c478bd9Sstevel@tonic-gate 			 * chain, but only the first component's last pointer
1387c478bd9Sstevel@tonic-gate 			 * is kept up to date.  it is used to determine
1397c478bd9Sstevel@tonic-gate 			 * where to append newly-created T_NAME nodes (see
1407c478bd9Sstevel@tonic-gate 			 * tree_name_append()).
1417c478bd9Sstevel@tonic-gate 			 */
1427c478bd9Sstevel@tonic-gate 			const char *s;		/* the name itself */
1437c478bd9Sstevel@tonic-gate 
1447c478bd9Sstevel@tonic-gate 			struct node *child;
1457c478bd9Sstevel@tonic-gate 			struct node *next;
1467c478bd9Sstevel@tonic-gate 			struct node *last;
1477c478bd9Sstevel@tonic-gate 
1487c478bd9Sstevel@tonic-gate 			/* opaque pointer used during config matching */
1497c478bd9Sstevel@tonic-gate 			struct config *cp;
1507c478bd9Sstevel@tonic-gate 
151b5016cbbSstephh 			/*
152b5016cbbSstephh 			 * note nametype is also declared as a three bit enum
153b5016cbbSstephh 			 * in itree.h, so if this ever needs expanding that
154b5016cbbSstephh 			 * will need changing too.
155b5016cbbSstephh 			 */
1567c478bd9Sstevel@tonic-gate 			enum nametype {
1577c478bd9Sstevel@tonic-gate 				N_UNSPEC,
1587c478bd9Sstevel@tonic-gate 				N_FAULT,
1597c478bd9Sstevel@tonic-gate 				N_UPSET,
1607c478bd9Sstevel@tonic-gate 				N_DEFECT,
1617c478bd9Sstevel@tonic-gate 				N_ERROR,
1627c478bd9Sstevel@tonic-gate 				N_EREPORT,
1637aec1d6eScindi 				N_SERD,
1647aec1d6eScindi 				N_STAT
1657c478bd9Sstevel@tonic-gate 			} t:3;
1667c478bd9Sstevel@tonic-gate 			enum itertype {
1677c478bd9Sstevel@tonic-gate 				IT_NONE,
1687c478bd9Sstevel@tonic-gate 				IT_VERTICAL,
1697c478bd9Sstevel@tonic-gate 				IT_HORIZONTAL,
1707c478bd9Sstevel@tonic-gate 				IT_ENAME
1717c478bd9Sstevel@tonic-gate 			} it:2;
1727c478bd9Sstevel@tonic-gate 			unsigned childgen:1;	/* child was auto-generated */
1737c478bd9Sstevel@tonic-gate 		} name;
1747c478bd9Sstevel@tonic-gate 
1757c478bd9Sstevel@tonic-gate 		struct {
1767c478bd9Sstevel@tonic-gate 			/*
1777c478bd9Sstevel@tonic-gate 			 * info kept for T_GLOBID
1787c478bd9Sstevel@tonic-gate 			 */
1797c478bd9Sstevel@tonic-gate 			const char *s;		/* the name itself */
1807c478bd9Sstevel@tonic-gate 		} globid;
1817c478bd9Sstevel@tonic-gate 
1827c478bd9Sstevel@tonic-gate 		/*
1837c478bd9Sstevel@tonic-gate 		 * info kept for T_TIMEVAL and T_NUM
1847c478bd9Sstevel@tonic-gate 		 *
1857c478bd9Sstevel@tonic-gate 		 * timevals are kept in nanoseconds.
1867c478bd9Sstevel@tonic-gate 		 */
1877c478bd9Sstevel@tonic-gate 		unsigned long long ull;
1887c478bd9Sstevel@tonic-gate 
1897c478bd9Sstevel@tonic-gate 		struct {
1907c478bd9Sstevel@tonic-gate 			/*
1917c478bd9Sstevel@tonic-gate 			 * info kept for T_QUOTE
1927c478bd9Sstevel@tonic-gate 			 */
1937c478bd9Sstevel@tonic-gate 			const char *s;		/* the quoted string */
1947c478bd9Sstevel@tonic-gate 		} quote;
1957c478bd9Sstevel@tonic-gate 
1967c478bd9Sstevel@tonic-gate 		struct {
1977c478bd9Sstevel@tonic-gate 			/*
1987c478bd9Sstevel@tonic-gate 			 * info kept for T_FUNC
1997c478bd9Sstevel@tonic-gate 			 */
2007c478bd9Sstevel@tonic-gate 			const char *s;		/* name of function */
2017c478bd9Sstevel@tonic-gate 			struct node *arglist;
2027c478bd9Sstevel@tonic-gate 		} func;
2037c478bd9Sstevel@tonic-gate 
2047c478bd9Sstevel@tonic-gate 		struct {
2057c478bd9Sstevel@tonic-gate 			/*
2067c478bd9Sstevel@tonic-gate 			 * info kept for T_PROP and T_MASK statements
2077c478bd9Sstevel@tonic-gate 			 * as well as declarations for:
2087c478bd9Sstevel@tonic-gate 			 *	T_FAULT
2097c478bd9Sstevel@tonic-gate 			 *	T_UPSET
2107c478bd9Sstevel@tonic-gate 			 *	T_DEFECT
2117c478bd9Sstevel@tonic-gate 			 *	T_ERROR
2127c478bd9Sstevel@tonic-gate 			 *	T_EREPORT
2137c478bd9Sstevel@tonic-gate 			 *	T_ASRU
2147c478bd9Sstevel@tonic-gate 			 *	T_FRU
2157c478bd9Sstevel@tonic-gate 			 *	T_CONFIG
2167c478bd9Sstevel@tonic-gate 			 */
2177c478bd9Sstevel@tonic-gate 			struct node *np;
2187c478bd9Sstevel@tonic-gate 			struct node *nvpairs;	/* for declarations */
2197c478bd9Sstevel@tonic-gate 			struct lut *lutp;	/* for declarations */
2207c478bd9Sstevel@tonic-gate 			struct node *next;	/* for Props & Masks lists */
2217c478bd9Sstevel@tonic-gate 			struct node *expr;	/* for if statements */
2227c478bd9Sstevel@tonic-gate 			unsigned char flags;	/* see STMT_ flags below */
2237c478bd9Sstevel@tonic-gate 		} stmt;			/* used for stmt */
2247c478bd9Sstevel@tonic-gate 
2257c478bd9Sstevel@tonic-gate 		struct {
2267c478bd9Sstevel@tonic-gate 			/*
2277c478bd9Sstevel@tonic-gate 			 * info kept for T_EVENT
2287c478bd9Sstevel@tonic-gate 			 */
2297c478bd9Sstevel@tonic-gate 			struct node *ename;	/* event class name */
2307c478bd9Sstevel@tonic-gate 			struct node *epname;	/* component path name */
231b5016cbbSstephh 			struct node *oldepname;	/* unwildcarded path name */
232b5016cbbSstephh 			struct node *ewname;	/* wildcarded portion */
2337c478bd9Sstevel@tonic-gate 			struct node *eexprlist;	/* constraint expression */
2347c478bd9Sstevel@tonic-gate 			struct node *declp;	/* event declaration */
2357c478bd9Sstevel@tonic-gate 		} event;
2367c478bd9Sstevel@tonic-gate 
2377c478bd9Sstevel@tonic-gate 		struct {
2387c478bd9Sstevel@tonic-gate 			/*
2397c478bd9Sstevel@tonic-gate 			 * info kept for T_ARROW
2407c478bd9Sstevel@tonic-gate 			 */
2417c478bd9Sstevel@tonic-gate 			struct node *lhs;	/* left side of arrow */
2427c478bd9Sstevel@tonic-gate 			struct node *rhs;	/* right side of arrow */
2437c478bd9Sstevel@tonic-gate 			struct node *nnp;	/* N value */
2447c478bd9Sstevel@tonic-gate 			struct node *knp;	/* K value */
2457c478bd9Sstevel@tonic-gate 			struct node *prop;	/* arrow is part of this prop */
246b5016cbbSstephh 			int needed;
247*b7d3956bSstephh 			struct node *parent;
2487c478bd9Sstevel@tonic-gate 		} arrow;
2497c478bd9Sstevel@tonic-gate 
2507c478bd9Sstevel@tonic-gate 		struct {
2517c478bd9Sstevel@tonic-gate 			/*
2527c478bd9Sstevel@tonic-gate 			 * info kept for everything else (T_ADD, T_LIST, etc.)
2537c478bd9Sstevel@tonic-gate 			 */
2547c478bd9Sstevel@tonic-gate 			struct node *left;
2557c478bd9Sstevel@tonic-gate 			struct node *right;
256b5016cbbSstephh 			int temp;
2577c478bd9Sstevel@tonic-gate 		} expr;
2587c478bd9Sstevel@tonic-gate 	} u;
259b5016cbbSstephh 	/*
260b5016cbbSstephh 	 * Note to save memory the nodesize() function trims the end of this
261b5016cbbSstephh 	 * structure, so best not to add anything after this point
262b5016cbbSstephh 	 */
2637c478bd9Sstevel@tonic-gate };
2647c478bd9Sstevel@tonic-gate 
2657c478bd9Sstevel@tonic-gate /* flags we keep with stmts */
2667c478bd9Sstevel@tonic-gate #define	STMT_REF	0x01	/* declared item is referenced */
2677c478bd9Sstevel@tonic-gate #define	STMT_CYMARK	0x02	/* declared item is marked for cycle check */
2687c478bd9Sstevel@tonic-gate #define	STMT_CYCLE	0x04	/* cycle detected and already reported */
2697c478bd9Sstevel@tonic-gate 
2707c478bd9Sstevel@tonic-gate #define	TIMEVAL_EVENTUALLY (1000000000ULL*60*60*24*365*100)	/* 100 years */
2717c478bd9Sstevel@tonic-gate 
2727c478bd9Sstevel@tonic-gate void tree_init(void);
2737c478bd9Sstevel@tonic-gate void tree_fini(void);
2747c478bd9Sstevel@tonic-gate struct node *newnode(enum nodetype t, const char *file, int line);
2757c478bd9Sstevel@tonic-gate void tree_free(struct node *root);
2767c478bd9Sstevel@tonic-gate struct node *tree_root(struct node *np);
2777c478bd9Sstevel@tonic-gate struct node *tree_nothing(void);
2787c478bd9Sstevel@tonic-gate struct node *tree_expr(enum nodetype t, struct node *left, struct node *right);
2797c478bd9Sstevel@tonic-gate struct node *tree_event(struct node *ename, struct node *epname,
2807c478bd9Sstevel@tonic-gate     struct node *eexprlist);
2817c478bd9Sstevel@tonic-gate struct node *tree_if(struct node *expr, struct node *stmts,
2827c478bd9Sstevel@tonic-gate     const char *file, int line);
2837c478bd9Sstevel@tonic-gate struct node *tree_name(const char *s, enum itertype it,
2847c478bd9Sstevel@tonic-gate     const char *file, int line);
2857c478bd9Sstevel@tonic-gate struct node *tree_iname(const char *s, const char *file, int line);
2867c478bd9Sstevel@tonic-gate struct node *tree_globid(const char *s, const char *file, int line);
2877c478bd9Sstevel@tonic-gate struct node *tree_name_append(struct node *np1, struct node *np2);
2887c478bd9Sstevel@tonic-gate struct node *tree_name_repairdash(struct node *np1, const char *s);
2898a40a695Sgavinm struct node *tree_name_repairdash2(const char *s, struct node *np1);
2907c478bd9Sstevel@tonic-gate struct node *tree_name_iterator(struct node *np1, struct node *np2);
2917c478bd9Sstevel@tonic-gate struct node *tree_timeval(const char *s, const char *suffix,
2927c478bd9Sstevel@tonic-gate     const char *file, int line);
2937c478bd9Sstevel@tonic-gate struct node *tree_num(const char *s, const char *file, int line);
2947c478bd9Sstevel@tonic-gate struct node *tree_quote(const char *s, const char *file, int line);
2957c478bd9Sstevel@tonic-gate struct node *tree_func(const char *s, struct node *np,
2967c478bd9Sstevel@tonic-gate     const char *file, int line);
2977c478bd9Sstevel@tonic-gate struct node *tree_pname(struct node *np);
2987c478bd9Sstevel@tonic-gate struct node *tree_arrow(struct node *lhs, struct node *nnp, struct node *knp,
2997c478bd9Sstevel@tonic-gate     struct node *rhs);
3007c478bd9Sstevel@tonic-gate struct lut *tree_s2np_lut_add(struct lut *root, const char *s, struct node *np);
3017c478bd9Sstevel@tonic-gate struct node *tree_s2np_lut_lookup(struct lut *root, const char *s);
3027c478bd9Sstevel@tonic-gate struct lut *tree_name2np_lut_add(struct lut *root,
3037c478bd9Sstevel@tonic-gate     struct node *namep, struct node *np);
3047c478bd9Sstevel@tonic-gate struct node *tree_name2np_lut_lookup(struct lut *root, struct node *namep);
3057c478bd9Sstevel@tonic-gate struct node *tree_name2np_lut_lookup_name(struct lut *root, struct node *namep);
3067c478bd9Sstevel@tonic-gate struct lut *tree_event2np_lut_add(struct lut *root,
3077c478bd9Sstevel@tonic-gate     struct node *enp, struct node *np);
3087c478bd9Sstevel@tonic-gate struct node *tree_event2np_lut_lookup(struct lut *root, struct node *enp);
3097c478bd9Sstevel@tonic-gate struct node *tree_event2np_lut_lookup_event(struct lut *root,
3107c478bd9Sstevel@tonic-gate     struct node *enp);
3117c478bd9Sstevel@tonic-gate struct node *tree_decl(enum nodetype t, struct node *enp, struct node *nvpairs,
3127c478bd9Sstevel@tonic-gate     const char *file, int line);
3137c478bd9Sstevel@tonic-gate struct node *tree_stmt(enum nodetype t, struct node *np,
3147c478bd9Sstevel@tonic-gate     const char *file, int line);
3157c478bd9Sstevel@tonic-gate void tree_report();
3167c478bd9Sstevel@tonic-gate int tree_namecmp(struct node *np1, struct node *np2);
3177c478bd9Sstevel@tonic-gate int tree_eventcmp(struct node *np1, struct node *np2);
3187c478bd9Sstevel@tonic-gate 
3197c478bd9Sstevel@tonic-gate struct lut *Faults;
3207c478bd9Sstevel@tonic-gate struct lut *Upsets;
3217c478bd9Sstevel@tonic-gate struct lut *Defects;
3227c478bd9Sstevel@tonic-gate struct lut *Errors;
3237c478bd9Sstevel@tonic-gate struct lut *Ereports;
3247c478bd9Sstevel@tonic-gate struct lut *Ereportenames;
325602ca9eaScth struct lut *Ereportenames_discard;
3267c478bd9Sstevel@tonic-gate struct lut *SERDs;
3277aec1d6eScindi struct lut *STATs;
3287c478bd9Sstevel@tonic-gate struct lut *ASRUs;
3297c478bd9Sstevel@tonic-gate struct lut *FRUs;
3307c478bd9Sstevel@tonic-gate struct lut *Configs;
3317c478bd9Sstevel@tonic-gate struct node *Props;
3327c478bd9Sstevel@tonic-gate struct node *Lastprops;
3337c478bd9Sstevel@tonic-gate struct node *Masks;
3347c478bd9Sstevel@tonic-gate struct node *Lastmasks;
3357c478bd9Sstevel@tonic-gate struct node *Problems;
3367c478bd9Sstevel@tonic-gate struct node *Lastproblems;
3377c478bd9Sstevel@tonic-gate 
3387c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3397c478bd9Sstevel@tonic-gate }
3407c478bd9Sstevel@tonic-gate #endif
3417c478bd9Sstevel@tonic-gate 
3427c478bd9Sstevel@tonic-gate #endif	/* _ESC_COMMON_TREE_H */
343