traverse.h revision 178528
150477Speter/*
222379Spst * CDDL HEADER START
322401Sphk *
422379Spst * The contents of this file are subject to the terms of the
522379Spst * Common Development and Distribution License, Version 1.0 only
622379Spst * (the "License").  You may not use this file except in compliance
788857Sache * with the License.
888857Sache *
979467Smarkm * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1079467Smarkm * or http://www.opensolaris.org/os/licensing.
11201386Sed * See the License for the specific language governing permissions
12201386Sed * and limitations under the License.
1322379Spst *
1422379Spst * When distributing Covered Code, include this CDDL HEADER in each
1522379Spst * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1660566Sobrien * If applicable, add the following below this CDDL HEADER, with the
1760566Sobrien * fields enclosed by brackets "[]" replaced with your own identifying
18270120Sache * information: Portions Copyright [yyyy] [name of copyright owner]
1960566Sobrien *
20270120Sache * CDDL HEADER END
2160566Sobrien */
2222379Spst/*
2322379Spst * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
2422379Spst * Use is subject to license terms.
25 */
26
27#ifndef _TRAVERSE_H
28#define	_TRAVERSE_H
29
30#pragma ident	"%Z%%M%	%I%	%E% SMI"
31
32/*
33 * Routines used to traverse tdesc trees, invoking user-supplied callbacks
34 * as the tree is traversed.
35 */
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41#include "ctftools.h"
42
43typedef int (*tdtrav_cb_f)(tdesc_t *, tdesc_t **, void *);
44
45typedef struct tdtrav_data {
46	int vgen;
47
48	tdtrav_cb_f *firstops;
49	tdtrav_cb_f *preops;
50	tdtrav_cb_f *postops;
51
52	void *private;
53} tdtrav_data_t;
54
55void tdtrav_init(tdtrav_data_t *, int *, tdtrav_cb_f *, tdtrav_cb_f *,
56    tdtrav_cb_f *, void *);
57int tdtraverse(tdesc_t *, tdesc_t **, tdtrav_data_t *);
58
59int iitraverse(iidesc_t *, int *, tdtrav_cb_f *, tdtrav_cb_f *, tdtrav_cb_f *,
60    void *);
61int iitraverse_hash(hash_t *, int *, tdtrav_cb_f *, tdtrav_cb_f *,
62    tdtrav_cb_f *, void *);
63int iitraverse_td(iidesc_t *ii, tdtrav_data_t *);
64
65int tdtrav_assert(tdesc_t *, tdesc_t **, void *);
66
67#ifdef __cplusplus
68}
69#endif
70
71#endif /* _TRAVERSE_H */
72