xref: /titanic_52/usr/src/cmd/abi/spectrans/spec2map/xlator.h (revision 753d2d2e8e7fd0c9bcf736d9bf2f2faf4d6234cc)
1*753d2d2eSraf /*
2*753d2d2eSraf  * CDDL HEADER START
3*753d2d2eSraf  *
4*753d2d2eSraf  * The contents of this file are subject to the terms of the
5*753d2d2eSraf  * Common Development and Distribution License, Version 1.0 only
6*753d2d2eSraf  * (the "License").  You may not use this file except in compliance
7*753d2d2eSraf  * with the License.
8*753d2d2eSraf  *
9*753d2d2eSraf  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*753d2d2eSraf  * or http://www.opensolaris.org/os/licensing.
11*753d2d2eSraf  * See the License for the specific language governing permissions
12*753d2d2eSraf  * and limitations under the License.
13*753d2d2eSraf  *
14*753d2d2eSraf  * When distributing Covered Code, include this CDDL HEADER in each
15*753d2d2eSraf  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*753d2d2eSraf  * If applicable, add the following below this CDDL HEADER, with the
17*753d2d2eSraf  * fields enclosed by brackets "[]" replaced with your own identifying
18*753d2d2eSraf  * information: Portions Copyright [yyyy] [name of copyright owner]
19*753d2d2eSraf  *
20*753d2d2eSraf  * CDDL HEADER END
21*753d2d2eSraf  */
22*753d2d2eSraf /*
23*753d2d2eSraf  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*753d2d2eSraf  * Use is subject to license terms.
25*753d2d2eSraf  */
26*753d2d2eSraf 
27*753d2d2eSraf #ifndef	_XLATOR_H
28*753d2d2eSraf #define	_XLATOR_H
29*753d2d2eSraf 
30*753d2d2eSraf #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*753d2d2eSraf 
32*753d2d2eSraf #include <parser.h>
33*753d2d2eSraf #include <errlog.h>
34*753d2d2eSraf 
35*753d2d2eSraf #ifdef	__cplusplus
36*753d2d2eSraf extern "C" {
37*753d2d2eSraf #endif
38*753d2d2eSraf 
39*753d2d2eSraf #define	ARCHBUFLEN	80
40*753d2d2eSraf 
41*753d2d2eSraf /* Architecture Bitmap */
42*753d2d2eSraf #define	XLATOR_SPARC	0x01
43*753d2d2eSraf #define	XLATOR_SPARCV9	0x02
44*753d2d2eSraf #define	XLATOR_I386	0x04
45*753d2d2eSraf #define	XLATOR_IA64	0x08
46*753d2d2eSraf #define	XLATOR_AMD64	0x10
47*753d2d2eSraf #define	XLATOR_ALLARCH	0xFF
48*753d2d2eSraf 
49*753d2d2eSraf /* *_sanity() return codes */
50*753d2d2eSraf #define	VS_OK	0
51*753d2d2eSraf #define	VS_INVARCH	1
52*753d2d2eSraf #define	VS_INVVERS	2
53*753d2d2eSraf #define	VS_INVALID	3
54*753d2d2eSraf 
55*753d2d2eSraf typedef enum {
56*753d2d2eSraf 	NOTYPE,			/* A type has not yet been assigned */
57*753d2d2eSraf 				/* to the interface */
58*753d2d2eSraf 	FUNCTION = XLATOR_KW_FUNC,	/* Functional Interface */
59*753d2d2eSraf 	DATA = XLATOR_KW_DATA		/* Data Interface */
60*753d2d2eSraf }    Iftype;
61*753d2d2eSraf 
62*753d2d2eSraf typedef enum {
63*753d2d2eSraf 	DEFAULT,		/* No special mapfile treatment */
64*753d2d2eSraf 	DIRECT,			/* Needs "<sym> DIRECT;" in mapfile */
65*753d2d2eSraf 	NODIRECT,		/* Needs "<sym> NODIRECT;" in mapfile */
66*753d2d2eSraf 	PROTECTED		/* Needs to be in a "protected:" section */
67*753d2d2eSraf }    Ifbinding;
68*753d2d2eSraf 
69*753d2d2eSraf typedef struct Interface {
70*753d2d2eSraf 	char const *IF_name;		/* Name of interface */
71*753d2d2eSraf 	Iftype IF_type;		/* type: FUNCTION or DATA */
72*753d2d2eSraf 	char *IF_version;	/* Version information */
73*753d2d2eSraf 	char *IF_class;		/* public or private or some color */
74*753d2d2eSraf 	Ifbinding IF_binding;	/* direct or nodirect or protected */
75*753d2d2eSraf 	char *IF_filter;	/* path string for "filter" keyword */
76*753d2d2eSraf 	char *IF_auxiliary;	/* path string for "auxiliary" keyword */
77*753d2d2eSraf }    Interface;
78*753d2d2eSraf 
79*753d2d2eSraf extern char *TargetArchStr;
80*753d2d2eSraf extern int IsFilterLib;
81*753d2d2eSraf 
82*753d2d2eSraf extern int check_version(const int, const int, const char);
83*753d2d2eSraf extern int parse_setfile(const char *);
84*753d2d2eSraf extern int parse_versions(const char *);
85*753d2d2eSraf 
86*753d2d2eSraf extern int valid_version(const char *);
87*753d2d2eSraf extern int valid_arch(const char *);
88*753d2d2eSraf 
89*753d2d2eSraf #ifdef	__cplusplus
90*753d2d2eSraf }
91*753d2d2eSraf #endif
92*753d2d2eSraf 
93*753d2d2eSraf #endif	/* _XLATOR_H */
94