"Fossies" - the Fresh Open Source Software Archive

Member "bc-1.06.95/bc/global.h" (5 Sep 2006, 4448 Bytes) of package /linux/misc/old/bc-1.06.95.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "global.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 1.06.95_vs_1.07.

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