home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / bc-1.03-base.tgz / bc-1.03-base.tar / fsf / bc / global.h < prev    next >
C/C++ Source or Header  |  1994-11-02  |  4KB  |  126 lines

  1. /* global.h:  The global variables for bc.  */
  2.  
  3. /*  This file is part of bc written for MINIX.
  4.     Copyright (C) 1991, 1992, 1993, 1994 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, 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20.     You may contact the author by:
  21.        e-mail:  phil@cs.wwu.edu
  22.       us-mail:  Philip A. Nelson
  23.                 Computer Science Department, 9062
  24.                 Western Washington University
  25.                 Bellingham, WA 98226-9062
  26.        
  27. *************************************************************************/
  28.  
  29.  
  30. /* The current break level's lable. */
  31. EXTERN int break_label;
  32.  
  33. /* The current if statement's else label or label after else. */
  34. EXTERN int if_label;
  35.  
  36. /* The current for statement label for continuing the loop. */
  37. EXTERN int continue_label;
  38.  
  39. /* Next available label number. */
  40. EXTERN int next_label;
  41.  
  42. /* Byte code character storage.  Used in many places for generation of code. */
  43. EXTERN char genstr[80];
  44.  
  45. /* Count of characters printed to the output in compile_only mode. */
  46. EXTERN int out_count;
  47.  
  48. /* Have we generated any code since the last initialization of the code
  49.    generator.  */
  50. EXTERN char did_gen;
  51.  
  52. /* Is this run an interactive execution.  (Is stdin a terminal?) */
  53. EXTERN char interactive;
  54.  
  55. /* Just generate the byte code.  -c flag. */
  56. EXTERN char compile_only;
  57.  
  58. /* Load the standard math functions.  -l flag. */
  59. EXTERN char use_math;
  60.  
  61. /* Give a warning on use of any non-standard feature (non-POSIX).  -w flag. */
  62. EXTERN char warn_not_std;
  63.  
  64. /* Accept POSIX bc only!  -s flag. */
  65. EXTERN char std_only;
  66.  
  67. /* global variables for the bc machine. All will be dynamic in size.*/
  68. /* Function storage. main is (0) and functions (1-f_count) */
  69.  
  70. EXTERN bc_function *functions;
  71. EXTERN char **f_names;
  72. EXTERN int  f_count;
  73.  
  74. /* Variable stoarge and reverse names. */
  75.  
  76. EXTERN bc_var **variables;
  77. EXTERN char **v_names;
  78. EXTERN int  v_count;
  79.  
  80. /* Array Variable storage and reverse names. */
  81.  
  82. EXTERN bc_var_array **arrays;
  83. EXTERN char **a_names;
  84. EXTERN int  a_count;
  85.  
  86. /* Execution stack. */
  87. EXTERN estack_rec *ex_stack;
  88.  
  89. /* Function return stack. */
  90. EXTERN fstack_rec *fn_stack;
  91.  
  92. /* Other "storage". */
  93. EXTERN int i_base;
  94. EXTERN int o_base;
  95. EXTERN int scale;
  96. EXTERN char c_code;
  97. EXTERN int out_col;
  98. EXTERN char runtime_error;
  99. EXTERN program_counter pc;
  100.  
  101. /* Input Line numbers and other error information. */
  102. EXTERN int line_no;
  103. EXTERN int had_error;
  104.  
  105. /* For larger identifiers, a tree, and how many "storage" locations
  106.    have been allocated. */
  107.  
  108. EXTERN int next_array;
  109. EXTERN int next_func;
  110. EXTERN int next_var;
  111.  
  112. EXTERN id_rec *name_tree;
  113.  
  114. /* For error message production */
  115. EXTERN char **g_argv;
  116. EXTERN int    g_argc;
  117. EXTERN char   is_std_in;
  118.  
  119. /* defined in number.c */
  120. extern bc_num _zero_;
  121. extern bc_num _one_;
  122.  
  123. /* For use with getopt.  Do not declare them here.*/
  124. extern int optind;
  125.  
  126.