"Fossies" - the Fresh Open Source Software Archive

Member "bc-1.06.95/bc/const.h" (5 Sep 2006, 2730 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 "const.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 /* const.h: Constants for bc. */
   31 
   32 /* Define INT_MAX and LONG_MAX if not defined.  Assuming 32 bits... */
   33 
   34 #ifndef INT_MAX
   35 #define INT_MAX 0x7FFFFFFF
   36 #endif
   37 #ifndef LONG_MAX
   38 #define LONG_MAX 0x7FFFFFFF
   39 #endif
   40 
   41 
   42 /* Define constants in some reasonable size.  The next 4 constants are
   43    POSIX constants. */
   44 
   45 #ifdef BC_BASE_MAX
   46   /* <limits.h> on a POSIX.2 system may have defined these.  Override. */
   47 # undef BC_BASE_MAX
   48 # undef BC_SCALE_MAX
   49 # undef BC_STRING_MAX
   50 # undef BC_DIM_MAX
   51 #endif
   52 
   53 #define BC_BASE_MAX   INT_MAX
   54 #define BC_SCALE_MAX  INT_MAX
   55 #define BC_STRING_MAX INT_MAX
   56 
   57 
   58 /* Definitions for arrays. */
   59 
   60 #define BC_DIM_MAX   16777215     /* this should be NODE_SIZE^NODE_DEPTH-1 */
   61 
   62 #define   NODE_SIZE        64     /* Must be a power of 2. */
   63 #define   NODE_MASK      0x3f     /* Must be NODE_SIZE-1. */
   64 #define   NODE_SHIFT        6     /* Number of 1 bits in NODE_MASK. */
   65 #define   NODE_DEPTH        4
   66 
   67 
   68 /* Other BC limits defined but not part of POSIX. */
   69 
   70 #define BC_LABEL_GROUP 64
   71 #define BC_LABEL_LOG    6
   72 #define BC_START_SIZE  1024 /* Initial code body size. */
   73 
   74 /* Maximum number of variables, arrays and functions and the
   75    allocation increment for the dynamic arrays. */
   76 
   77 #define MAX_STORE   32767
   78 #define STORE_INCR     32
   79 
   80 /* Other interesting constants. */
   81 
   82 #define FALSE 0
   83 #define TRUE  1
   84 
   85 /* for use with lookup (). */
   86 #define SIMPLE   0
   87 #define ARRAY    1
   88 #define FUNCT    2
   89 #define FUNCTDEF 3
   90 
   91 #ifdef __STDC__
   92 #define CONST const
   93 #define VOID  void
   94 #else
   95 #define CONST
   96 #define VOID
   97 #endif