1 /* global.h: The global variables for bc. */
3 /* This file is part of GNU bc.
4 Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
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.
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.
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
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
29 *************************************************************************/
32 /* The current break level's lable. */
33 EXTERN int break_label;
35 /* The current if statement's else label or label after else. */
38 /* The current for statement label for continuing the loop. */
39 EXTERN int continue_label;
41 /* Next available label number. */
42 EXTERN int next_label;
44 /* Byte code character storage. Used in many places for generation of code. */
45 EXTERN char genstr[80];
47 /* Count of characters printed to the output in compile_only mode. */
50 /* Have we generated any code since the last initialization of the code
54 /* Is this run an interactive execution. (Is stdin a terminal?) */
55 EXTERN char interactive;
57 /* Just generate the byte code. -c flag. */
58 EXTERN int compile_only;
60 /* Load the standard math functions. -l flag. */
63 /* Give a warning on use of any non-standard feature (non-POSIX). -w flag. */
64 EXTERN int warn_not_std;
66 /* Accept POSIX bc only! -s flag. */
69 /* Don't print the banner at start up. -q flag. */
72 /* The list of file names to process. */
73 EXTERN file_node *file_names;
75 /* The name of the current file being processed. */
76 EXTERN char *file_name;
78 /* Is the current file a named file or standard input? */
79 EXTERN char is_std_in;
81 /* global variables for the bc machine. All will be dynamic in size.*/
82 /* Function storage. main is (0) and functions (1-f_count) */
84 EXTERN bc_function *functions;
85 EXTERN char **f_names;
88 /* Variable stoarge and reverse names. */
90 EXTERN bc_var **variables;
91 EXTERN char **v_names;
94 /* Array Variable storage and reverse names. */
96 EXTERN bc_var_array **arrays;
97 EXTERN char **a_names;
100 /* Execution stack. */
101 EXTERN estack_rec *ex_stack;
103 /* Function return stack. */
104 EXTERN fstack_rec *fn_stack;
106 /* Current ibase, obase, scale, and n_history (if needed). */
110 #if defined(READLINE) || defined(LIBEDIT)
111 EXTERN int n_history;
121 /* "Condition code" -- false (0) or true (1) */
124 /* Records the number of the runtime error. */
125 EXTERN char runtime_error;
127 /* Holds the current location of execution. */
128 EXTERN program_counter pc;
130 /* For POSIX bc, this is just for number output, not strings. */
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;
137 /* Input Line numbers and other error information. */
139 EXTERN int had_error;
141 /* For larger identifiers, a tree, and how many "storage" locations
142 have been allocated. */
144 EXTERN int next_array;
145 EXTERN int next_func;
148 EXTERN id_rec *name_tree;
150 /* For use with getopt. Do not declare them here.*/
153 /* Access to the yy input file. Defined in scan.c. */