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
43 #pragma ident "%Z%%M% %I% %E% SMI"
48 * This software is copyright(C) 1982 by Pavel Curtis
50 * Permission is granted to reproduce and distribute
51 * this file by any means so long as no fee is charged
52 * above a nominal handling fee and so long as this
53 * notice is always included in the copies.
55 * Other rights are reserved except as explicitly granted
56 * by written permission of the author.
58 * Computer Science Dept.
65 * Pavel.Cornell@Udel-Relay(ARPAnet)
66 * decvax!cornell!pavel (UUCPnet)
71 * compiler.h - Global variables and structures for the terminfo
74 * $Header: RCS/compiler.v Revision 2.1 82/10/25 14:46:04 pavel Exp$
76 * $Log: RCS/compiler.v $
77 * Revision 2.1 82/10/25 14:46:04 pavel
78 * Added Copyright Notice
80 * Revision 2.0 82/10/24 15:17:20 pavel
81 * Beta-one Test Release
83 * Revision 1.3 82/08/23 22:30:09 pavel
84 * The REAL Alpha-one Release Version
86 * Revision 1.2 82/08/19 19:10:10 pavel
87 * Alpha Test Release One
89 * Revision 1.1 82/08/12 18:38:11 pavel
95 #include <signal.h> /* use this file to determine if this is SVR4.0 system */
107 #ifndef EXTERN /* for machines w/o multiple externs */
108 #define EXTERN extern
111 #define SINGLE /* only one terminal (actually none) */
113 extern char *destination
; /* destination directory for object files */
115 EXTERN
long start_time
; /* time at start of compilation */
117 EXTERN
int curr_line
; /* current line # in input */
118 EXTERN
long curr_file_pos
; /* file offset of current line */
120 EXTERN
int debug_level
; /* level of debugging output */
122 #define DEBUG(level, fmt, a1) \
123 if (debug_level >= level)\
124 fprintf(stderr, fmt, a1);
127 * These are the types of tokens returned by the scanner.
128 * The first three are also used in the hash table of capability
129 * names. The scanner returns one of these values after loading
130 * the specifics into the global structure curr_token.
134 #define BOOLEAN 0 /* Boolean capability */
135 #define NUMBER 1 /* Numeric capability */
136 #define STRING 2 /* String-valued capability */
137 #define CANCEL 3 /* Capability to be cancelled in following tc's */
138 #define NAMES 4 /* The names for a terminal type */
140 #define MAXBOOLS 64 /* Maximum # of boolean caps we can handle */
141 #define MAXNUMS 64 /* Maximum # of numeric caps we can handle */
142 #define MAXSTRINGS 512 /* Maximum # of string caps we can handle */
145 * The global structure in which the specific parts of a
146 * scanned token are returned.
152 char *tk_name
; /* name of capability */
153 int tk_valnumber
; /* value of capability (if a number) */
154 char *tk_valstring
; /* value of capability (if a string) */
157 EXTERN
struct token curr_token
;
160 * The file comp_captab.c contains an array of these structures,
161 * one per possible capability. These are then made into a hash
162 * table array of the same structures for use by the parser.
166 struct name_table_entry
168 struct name_table_entry
*nte_link
;
169 char *nte_name
; /* name to hash on */
170 int nte_type
; /* BOOLEAN, NUMBER or STRING */
171 short nte_index
; /* index of associated variable in its array */
174 extern struct name_table_entry cap_table
[];
175 extern struct name_table_entry
*cap_hash_table
[];
177 extern int Captabsize
;
178 extern int Hashtabsize
;
179 extern int BoolCount
;
183 #define NOTFOUND ((struct name_table_entry *)0)
189 struct name_table_entry
*find_entry(); /* look up entry in hash table */
194 #ifdef SIGSTOP /* SVR4.0 and beyond */
195 #define SRCDIR "/usr/share/lib/terminfo"
197 #define SRCDIR "/usr/lib/terminfo"
204 #endif /* _COMPILER_H */