E.2 Contents of <limits.h>

The <limits.h> header file has the following contents:

#ifndef __LIMITS_LOADED
#define __LIMITS_LOADED 1
/*
 *  <limits.h> - Sizes of integral types
 *
 *  Copyright (c) 1995 by Digital Equipment Corporation.  All rights reserved.
 *
 *  DEC C for OpenVMS VAX and OpenVMS Alpha
 *  DEC C++ for OpenVMS VAX and OpenVMS Alpha
 */

#ifdef __cplusplus
extern "C" {
#endif

/* Note:  Section 2.2.4.2 of the Rationale states "The limits for the maxima
   and minima of unsigned types are specified as unsigned constants..."
   The alert reader will notice there are no minima for the unsigned
   types, but we will follow the Rationale's advice anyway. */

/* Number of bits for the smallest object that is not a bit-field (byte): */
#define CHAR_BIT        8

/* Minimum value for an object of type "signed char": */
#define SCHAR_MIN       (-SCHAR_MAX - 1)

/* Maximum value for an object of type "signed char": */
#define SCHAR_MAX       127

/* Maximum value for an object of type "unsigned char": */
#define UCHAR_MAX       255u

#ifdef __UNSIGNED_CHAR
  /* Minimum value for an object of type "char": */
# define CHAR_MIN       0
  /* Maximum value for an object of type "char": */
# define CHAR_MAX       UCHAR_MAX
#else
  /* Minimum value for an object of type "char": */
# define CHAR_MIN       SCHAR_MIN
  /* Maximum value for an object of type "char": */
# define CHAR_MAX       SCHAR_MAX
#endif

/* Maximum number of bytes in a multibyte character, for any supported locale: */
#if __VMS_VER >= 60200000
#define MB_LEN_MAX      4
#else
#define MB_LEN_MAX      1
#endif

/* Minimum value for an object of type "short int": */
# define SHRT_MIN       (-SHRT_MAX - 1)

/* Maximum value for an object of type "short int": */
# define SHRT_MAX       32767

/* Maximum value for an object of type "unsigned short int": */
# define USHRT_MAX      65535u

/* Minimum value for an object of type "int": */
# define INT_MIN        (-INT_MAX - 1)

/* Maximum value for an object of type "int": */
# define INT_MAX        2147483647

/* Maximum value for an object of type "unsigned int": */
# define UINT_MAX       4294967295u

/* Minimum value for an object of type "long int": */
# define LONG_MIN       (-LONG_MAX - 1)

/* Maximum value for an object of type "long int": */
# define LONG_MAX       2147483647

/* Maximum value for an object of type "unsigned long int": */
# define ULONG_MAX      4294967295u

/* Value for objects of type "__int??": */
# define __INT16_MIN       (-__INT16_MAX - 1)
# define __INT16_MAX       32767
# define __UINT16_MAX      65535u
# define __INT32_MIN       (-__INT32_MAX - 1)
# define __INT32_MAX       2147483647
# define __UINT32_MAX      4294967295u

#ifdef __ALPHA
# define __INT64_MIN       (-__INT64_MAX - 1)
# define __INT64_MAX       (((__int64)0x7fffffff << 32) | 0xffffffffu)
# define __UINT64_MAX      ((unsigned __int64)0x1 << 63)
#endif

#if __VMS_VER >= 60200000
#define COLL_WEIGHTS_MAX 5

/* Messaging limits */

#define NL_TEXTMAX      8192
#define NL_SETMAX       65535
#define NL_MSGMAX       65535

#define CHARCLASS_NAME_MAX     14
#define NL_ARGMAX       9
#define NL_LANGMAX      14

/* Maximum number of bytes supported for the name of a time zone */
#define TZNAME_MAX      15

/* Maximum value of an object of type ssize_t */
#define SSIZE_MAX       INT_MAX
#endif /* OpenVMS V6.2 or later */

#ifdef __cplusplus
}
#endif

#endif /* __LIMITS_LOADED */


Previous Page | Next Page | Table of Contents | Index