2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License, Version 1.0 only
2N/A * (the "License"). You may not use this file except in compliance
2N/A * with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A
2N/A#ifndef _DT_XLATOR_H
2N/A#define _DT_XLATOR_H
2N/A
2N/A#pragma ident "%Z%%M% %I% %E% SMI"
2N/A
2N/A#include <libctf.h>
2N/A#include <dtrace.h>
2N/A#include <dt_ident.h>
2N/A#include <dt_list.h>
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/Astruct dt_node;
2N/A
2N/Atypedef struct dt_xlator {
2N/A dt_list_t dx_list; /* list forward/back pointers */
2N/A dt_idhash_t *dx_locals; /* hash of local scope identifiers */
2N/A dt_ident_t *dx_ident; /* identifier ref for input param */
2N/A dt_ident_t dx_souid; /* fake identifier for sou output */
2N/A dt_ident_t dx_ptrid; /* fake identifier for ptr output */
2N/A ctf_file_t *dx_src_ctfp; /* CTF container for input type */
2N/A ctf_id_t dx_src_type; /* CTF reference for input type */
2N/A ctf_id_t dx_src_base; /* CTF reference for input base */
2N/A ctf_file_t *dx_dst_ctfp; /* CTF container for output type */
2N/A ctf_id_t dx_dst_type; /* CTF reference for output type */
2N/A ctf_id_t dx_dst_base; /* CTF reference for output base */
2N/A struct dt_node *dx_members; /* list of member translations */
2N/A uint_t dx_nmembers; /* length of dx_members list */
2N/A dtrace_difo_t **dx_membdif; /* DIF for member expressions */
2N/A struct dt_node *dx_nodes; /* list of parse tree nodes */
2N/A dtrace_hdl_t *dx_hdl; /* back pointer to containing handle */
2N/A ulong_t dx_gen; /* generation number that created me */
2N/A id_t dx_id; /* global translator id */
2N/A int dx_arg; /* dynamic argument index */
2N/A} dt_xlator_t;
2N/A
2N/Aextern dt_xlator_t *dt_xlator_create(dtrace_hdl_t *,
2N/A const dtrace_typeinfo_t *, const dtrace_typeinfo_t *,
2N/A const char *, struct dt_node *, struct dt_node *);
2N/A
2N/Aextern void dt_xlator_destroy(dtrace_hdl_t *, dt_xlator_t *);
2N/A
2N/A#define DT_XLATE_FUZZY 0x0 /* lookup any matching translator */
2N/A#define DT_XLATE_EXACT 0x1 /* lookup only exact type matches */
2N/A#define DT_XLATE_EXTERN 0x2 /* extern translator if none exists */
2N/A
2N/Aextern dt_xlator_t *dt_xlator_lookup(dtrace_hdl_t *,
2N/A struct dt_node *, struct dt_node *, int);
2N/A
2N/Aextern dt_xlator_t *dt_xlator_lookup_id(dtrace_hdl_t *, id_t);
2N/Aextern dt_ident_t *dt_xlator_ident(dt_xlator_t *, ctf_file_t *, ctf_id_t);
2N/Aextern struct dt_node *dt_xlator_member(dt_xlator_t *, const char *);
2N/Aextern int dt_xlator_dynamic(const dt_xlator_t *);
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _DT_XLATOR_H */