const.h

Go to the documentation of this file.
00001 /* const.h: Constants for bc. */
00002 
00003 /*  This file is part of bc written for MINIX.
00004     Copyright (C) 1991, 1992 Free Software Foundation, Inc.
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License , or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; see the file COPYING.  If not, write to
00018     the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
00019 
00020     You may contact the author by:
00021        e-mail:  phil@cs.wwu.edu
00022       us-mail:  Philip A. Nelson
00023                 Computer Science Department, 9062
00024                 Western Washington University
00025                 Bellingham, WA 98226-9062
00026        
00027 *************************************************************************/
00028 
00029 
00030 /* Define INT_MAX and LONG_MAX if not defined.  Assuming 32 bits... */
00031 
00032 #ifdef NO_LIMITS
00033 #define INT_MAX 0x7FFFFFFF
00034 #define LONG_MAX 0x7FFFFFFF
00035 #endif
00036 
00037 
00038 /* Define constants in some reasonable size.  The next 4 constants are
00039    POSIX constants. */
00040 
00041 #define BC_BASE_MAX   INT_MAX
00042 #define BC_SCALE_MAX  INT_MAX
00043 #define BC_STRING_MAX INT_MAX
00044 
00045 
00046 /* Definitions for arrays. */
00047 
00048 #define BC_DIM_MAX    65535       /* this should be NODE_SIZE^NODE_DEPTH-1 */
00049 
00050 #define   NODE_SIZE        16     /* Must be a power of 2. */
00051 #define   NODE_MASK       0xf     /* Must be NODE_SIZE-1. */
00052 #define   NODE_SHIFT        4     /* Number of 1 bits in NODE_MASK. */
00053 #define   NODE_DEPTH        4
00054 
00055 
00056 /* Other BC limits defined but not part of POSIX. */
00057 
00058 #define BC_LABEL_GROUP 64
00059 #define BC_LABEL_LOG    6
00060 #define BC_MAX_SEGS    16    /* Code segments. */
00061 #define BC_SEG_SIZE  1024
00062 #define BC_SEG_LOG     10
00063 
00064 /* Maximum number of variables, arrays and functions and the
00065    allocation increment for the dynamic arrays. */
00066 
00067 #define MAX_STORE   32767
00068 #define STORE_INCR     32
00069 
00070 /* Other interesting constants. */
00071 
00072 #define FALSE 0
00073 #define TRUE  1
00074 #define SIMPLE 0
00075 #define ARRAY  1
00076 #define FUNCT  2
00077 #define EXTERN extern
00078 #ifdef __STDC__
00079 #define CONST const
00080 #define VOID  void
00081 #else
00082 #define CONST
00083 #define VOID
00084 #endif
00085 
00086 /* Include the version definition. */
00087 #include "version.h"

Generated on Fri Apr 14 22:56:42 2006 for minix by  doxygen 1.4.6