Merge from vendor branch OPENSSH:
[dragonfly.git] / contrib / bc / bc / global.h
1 /* global.h:  The global variables for bc.  */
2
3 /*  This file is part of GNU bc.
4     Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
5
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License , or
9     (at your option) any later version.
10
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with this program; see the file COPYING.  If not, write to
18       The Free Software Foundation, Inc.
19       59 Temple Place, Suite 330
20       Boston, MA 02111 USA
21
22     You may contact the author by:
23        e-mail:  philnelson@acm.org
24       us-mail:  Philip A. Nelson
25                 Computer Science Department, 9062
26                 Western Washington University
27                 Bellingham, WA 98226-9062
28        
29 *************************************************************************/
30
31
32 /* The current break level's lable. */
33 EXTERN int break_label;
34
35 /* The current if statement's else label or label after else. */
36 EXTERN int if_label;
37
38 /* The current for statement label for continuing the loop. */
39 EXTERN int continue_label;
40
41 /* Next available label number. */
42 EXTERN int next_label;
43
44 /* Byte code character storage.  Used in many places for generation of code. */
45 EXTERN char genstr[80];
46
47 /* Count of characters printed to the output in compile_only mode. */
48 EXTERN int out_count;
49
50 /* Have we generated any code since the last initialization of the code
51    generator.  */
52 EXTERN char did_gen;
53
54 /* Is this run an interactive execution.  (Is stdin a terminal?) */
55 EXTERN char interactive;
56
57 /* Just generate the byte code.  -c flag. */
58 EXTERN int compile_only;
59
60 /* Load the standard math functions.  -l flag. */
61 EXTERN int use_math;
62
63 /* Give a warning on use of any non-standard feature (non-POSIX).  -w flag. */
64 EXTERN int warn_not_std;
65
66 /* Accept POSIX bc only!  -s flag. */
67 EXTERN int std_only;
68
69 /* Don't print the banner at start up.  -q flag. */
70 EXTERN int quiet;
71
72 /* The list of file names to process. */
73 EXTERN file_node *file_names;
74
75 /* The name of the current file being processed. */
76 EXTERN char *file_name;
77
78 /* Is the current file a named file or standard input? */
79 EXTERN char   is_std_in;
80
81 /* global variables for the bc machine. All will be dynamic in size.*/
82 /* Function storage. main is (0) and functions (1-f_count) */
83
84 EXTERN bc_function *functions;
85 EXTERN char **f_names;
86 EXTERN int  f_count;
87
88 /* Variable stoarge and reverse names. */
89
90 EXTERN bc_var **variables;
91 EXTERN char **v_names;
92 EXTERN int  v_count;
93
94 /* Array Variable storage and reverse names. */
95
96 EXTERN bc_var_array **arrays;
97 EXTERN char **a_names;
98 EXTERN int  a_count;
99
100 /* Execution stack. */
101 EXTERN estack_rec *ex_stack;
102
103 /* Function return stack. */
104 EXTERN fstack_rec *fn_stack;
105
106 /* Current ibase, obase, scale, and n_history (if needed). */
107 EXTERN int i_base;
108 EXTERN int o_base;
109 EXTERN int scale;
110 #if defined(READLINE) || defined(LIBEDIT)
111 EXTERN int n_history;
112 #endif
113
114 #if defined(LIBEDIT)
115 /* LIBEDIT data */
116 EditLine *edit;
117 History  *hist;
118 HistEvent histev;
119 #endif
120
121 /* "Condition code" -- false (0) or true (1) */
122 EXTERN char c_code;
123
124 /* Records the number of the runtime error. */
125 EXTERN char runtime_error;
126
127 /* Holds the current location of execution. */
128 EXTERN program_counter pc;
129
130 /* For POSIX bc, this is just for number output, not strings. */
131 EXTERN int out_col;
132
133 /* Keeps track of the current number of characters per output line.
134    This includes the \n at the end of the line. */
135 EXTERN int line_size;
136
137 /* Input Line numbers and other error information. */
138 EXTERN int line_no;
139 EXTERN int had_error;
140
141 /* For larger identifiers, a tree, and how many "storage" locations
142    have been allocated. */
143
144 EXTERN int next_array;
145 EXTERN int next_func;
146 EXTERN int next_var;
147
148 EXTERN id_rec *name_tree;
149
150 /* For use with getopt.  Do not declare them here.*/
151 extern int optind;
152
153 /* Access to the yy input file.  Defined in scan.c. */
154 extern FILE *yyin;