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
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.
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]
23 * Copyright 1997 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1988 AT&T */
28 /* All Rights Reserved */
31 * University Copyright- Copyright (c) 1982, 1986, 1988
32 * The Regents of the University of California
35 * University Acknowledgment- Portions of this document are derived from
36 * software developed by the University of California, Berkeley, and its
46 * This software is copyright(C) 1982 by Pavel Curtis
48 * Permission is granted to reproduce and distribute
49 * this file by any means so long as no fee is charged
50 * above a nominal handling fee and so long as this
51 * notice is always included in the copies.
53 * Other rights are reserved except as explicitly granted
54 * by written permission of the author.
56 * Computer Science Dept.
63 * Pavel.Cornell@Udel-Relay(ARPAnet)
64 * decvax!cornell!pavel (UUCPnet)
69 * compiler.h - Global variables and structures for the terminfo
72 * $Header: RCS/compiler.v Revision 2.1 82/10/25 14:46:04 pavel Exp$
74 * $Log: RCS/compiler.v $
75 * Revision 2.1 82/10/25 14:46:04 pavel
76 * Added Copyright Notice
78 * Revision 2.0 82/10/24 15:17:20 pavel
79 * Beta-one Test Release
81 * Revision 1.3 82/08/23 22:30:09 pavel
82 * The REAL Alpha-one Release Version
84 * Revision 1.2 82/08/19 19:10:10 pavel
85 * Alpha Test Release One
87 * Revision 1.1 82/08/12 18:38:11 pavel
93 #include <signal.h> /* use this file to determine if this is SVR4.0 system */
105 #ifndef EXTERN /* for machines w/o multiple externs */
106 #define EXTERN extern
109 #define SINGLE /* only one terminal (actually none) */
111 extern char *destination
; /* destination directory for object files */
113 EXTERN
long start_time
; /* time at start of compilation */
115 EXTERN
int curr_line
; /* current line # in input */
116 EXTERN
long curr_file_pos
; /* file offset of current line */
118 EXTERN
int debug_level
; /* level of debugging output */
120 #define DEBUG(level, fmt, a1) \
121 if (debug_level >= level)\
122 fprintf(stderr, fmt, a1);
125 * These are the types of tokens returned by the scanner.
126 * The first three are also used in the hash table of capability
127 * names. The scanner returns one of these values after loading
128 * the specifics into the global structure curr_token.
132 #define BOOLEAN 0 /* Boolean capability */
133 #define NUMBER 1 /* Numeric capability */
134 #define STRING 2 /* String-valued capability */
135 #define CANCEL 3 /* Capability to be cancelled in following tc's */
136 #define NAMES 4 /* The names for a terminal type */
137 #define UNDEF 5 /* Invalid token type */
139 #define MAXBOOLS 64 /* Maximum # of boolean caps we can handle */
140 #define MAXNUMS 64 /* Maximum # of numeric caps we can handle */
141 #define MAXSTRINGS 512 /* Maximum # of string caps we can handle */
144 * The global structure in which the specific parts of a
145 * scanned token are returned.
151 char *tk_name
; /* name of capability */
152 int tk_valnumber
; /* value of capability (if a number) */
153 char *tk_valstring
; /* value of capability (if a string) */
156 EXTERN
struct token curr_token
;
159 * The file comp_captab.c contains an array of these structures,
160 * one per possible capability. These are then made into a hash
161 * table array of the same structures for use by the parser.
165 struct name_table_entry
167 struct name_table_entry
*nte_link
;
168 char *nte_name
; /* name to hash on */
169 int nte_type
; /* BOOLEAN, NUMBER or STRING */
170 short nte_index
; /* index of associated variable in its array */
173 extern struct name_table_entry cap_table
[];
174 extern struct name_table_entry
*cap_hash_table
[];
176 extern int Captabsize
;
177 extern int Hashtabsize
;
178 extern int BoolCount
;
182 #define NOTFOUND ((struct name_table_entry *)0)
188 struct name_table_entry
*find_entry(); /* look up entry in hash table */
193 #ifdef SIGSTOP /* SVR4.0 and beyond */
194 #define SRCDIR "/usr/share/lib/terminfo"
196 #define SRCDIR "/usr/lib/terminfo"
203 #endif /* _COMPILER_H */