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