home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / bc-1.03-src.tgz / tar.out / fsf / bc / const.h < prev    next >
C/C++ Source or Header  |  1996-09-28  |  3KB  |  99 lines

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