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