libdap  Updated for version 3.17.0
dods-limits.h
00001 
00002 // -*- mode: c++; c-basic-offset:4 -*-
00003 
00004 // This file is part of libdap, A C++ implementation of the OPeNDAP Data
00005 // Access Protocol.
00006 
00007 // Copyright (c) 2002,2003 OPeNDAP, Inc.
00008 // Author: James Gallagher <jgallagher@opendap.org>
00009 //
00010 // This library is free software; you can redistribute it and/or
00011 // modify it under the terms of the GNU Lesser General Public
00012 // License as published by the Free Software Foundation; either
00013 // version 2.1 of the License, or (at your option) any later version.
00014 //
00015 // This library is distributed in the hope that it will be useful,
00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00023 //
00024 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
00025 
00026 // (c) COPYRIGHT URI/MIT 1996,1998,1999
00027 // Please read the full copyright statement in the file COPYRIGHT_URI.
00028 //
00029 // Authors:
00030 //      jhrg,jimg       James Gallagher <jgallagher@gso.uri.edu>
00031 
00032 // Limits for DAP2. Use these *instead* of <limits.h> since DAP2 needs to see
00033 // the same values on all machines.
00034 
00035 #ifndef _dods_limits_h
00036 #define _dods_limits_h
00037 
00038 #if 0
00039 // The old values. I switched to hex notation when 64-bit ints were added
00040 // to DAP4.
00041 #define DODS_CHAR_BIT 8
00042 #define DODS_SCHAR_MIN -128
00043 #define DODS_SCHAR_MAX 127
00044 #define DODS_UCHAR_MAX 255U
00045 #define DODS_UCHAR_MIN 0
00046 
00047 #define DODS_SHRT_MIN -32768
00048 #define DODS_SHRT_MAX 32767
00049 #define DODS_USHRT_MAX 65535U
00050 
00051 #define DODS_INT_MIN -2147483648
00052 // was (-2147483647 - 1)
00053 #define DODS_INT_MAX 2147483647
00054 #define DODS_UINT_MAX 4294967295U
00055 
00056 #define DODS_LONG_MIN -2147483648
00057 // was (-2147483647 - 1)
00058 #define DODS_LONG_MAX 2147483647
00059 #define DODS_ULONG_MAX 4294967295UL
00060 #endif
00061 
00062 #define DODS_CHAR_BIT 8
00063 #define DODS_SCHAR_MIN (-0x7f-1)
00064 #define DODS_SCHAR_MAX 0x7f
00065 #define DODS_UCHAR_MAX 0xffU
00066 #define DODS_UCHAR_MIN 0
00067 
00068 #define DODS_SHRT_MIN (-0x7fff-1)
00069 #define DODS_SHRT_MAX 0x7fff
00070 #define DODS_USHRT_MAX 0xffffU
00071 
00072 #define DODS_INT_MIN (-0x7fffffff-1)
00073 #define DODS_INT_MAX 0x7fffffff
00074 #define DODS_UINT_MAX 0xffffffffUL
00075 
00076 #define DODS_LONG_MIN DODS_INT_MIN
00077 #define DODS_LONG_MAX DODS_INT_MAX
00078 #define DODS_ULONG_MAX DODS_UINT_MAX
00079 
00080 #define DODS_LLONG_MIN (-0x7fffffffffffffffLL-1)
00081 #define DODS_LLONG_MAX 0x7fffffffffffffffLL
00082 #define DODS_ULLONG_MAX 0xffffffffffffffffULL
00083 
00084 #define DODS_MAX_ARRAY_INDEX 0x1fffffffffffffffULL
00085 
00086 #define DODS_DBL_DIG 15 /* digits of precision of a "double" */
00087 #define DODS_DBL_MAX 1.7976931348623157E+308 /* max decimal value of a */
00088 /* "double" */
00089 #define DODS_DBL_MIN 2.2250738585072014E-308 /* min decimal value of a */
00090 /* "double" */
00091 #define DODS_FLT_DIG 6  /* digits of precision of a "float" */
00092 #define DODS_FLT_MAX 3.402823466E+38F  /* max decimal value of a "float" */
00093 #define DODS_FLT_MIN 1.175494351E-38F  /* min decimal value of a "float" */
00094 
00095 /* This constant should not be used. */
00096 #define DODS_MB_LEN_MAX 4
00097 
00098 #endif // _dods_limits_h