[BACK]Return to limits.h CVS log [TXT][DIR] Up to [local] / sys / sys

Annotation of sys/sys/limits.h, Revision 1.1

1.1     ! nbrk        1: /* $OpenBSD: limits.h,v 1.7 2007/05/07 15:29:44 millert Exp $ */
        !             2: /*
        !             3:  * Copyright (c) 2002 Marc Espie.
        !             4:  *
        !             5:  * Redistribution and use in source and binary forms, with or without
        !             6:  * modification, are permitted provided that the following conditions
        !             7:  * are met:
        !             8:  * 1. Redistributions of source code must retain the above copyright
        !             9:  *    notice, this list of conditions and the following disclaimer.
        !            10:  * 2. Redistributions in binary form must reproduce the above copyright
        !            11:  *    notice, this list of conditions and the following disclaimer in the
        !            12:  *    documentation and/or other materials provided with the distribution.
        !            13:  *
        !            14:  * THIS SOFTWARE IS PROVIDED BY THE OPENBSD PROJECT AND CONTRIBUTORS
        !            15:  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
        !            16:  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
        !            17:  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OPENBSD
        !            18:  * PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
        !            19:  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
        !            20:  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
        !            21:  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
        !            22:  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
        !            23:  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        !            24:  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        !            25:  */
        !            26: #ifndef _SYS_LIMITS_H_
        !            27: #define _SYS_LIMITS_H_
        !            28:
        !            29: #include <sys/cdefs.h>
        !            30:
        !            31: /* Common definitions for limits.h. */
        !            32:
        !            33: /*
        !            34:  * <machine/internal_types.h> is meant to describe a specific architecture,
        !            35:  * but to be a safe include, that doesn't ever define anything that is
        !            36:  * user-visible (only typedefs and #define names that stays in the __xxx
        !            37:  * namespace).
        !            38:  *
        !            39:  *   __machine_has_unsigned_chars      (default is signed chars)
        !            40:  *   __FLT_xxx/__DBL_xxx               non standard values for floating
        !            41:  *                                     points limits.
        !            42:  */
        !            43: #include <machine/internal_types.h>
        !            44:
        !            45: /* Legacy */
        !            46: #include <machine/limits.h>
        !            47:
        !            48: #define        CHAR_BIT        8               /* number of bits in a char */
        !            49:
        !            50: #define        SCHAR_MAX       0x7f            /* max value for a signed char */
        !            51: #define SCHAR_MIN      (-0x7f-1)       /* min value for a signed char */
        !            52:
        !            53: #define        UCHAR_MAX       0xff            /* max value for an unsigned char */
        !            54: #ifdef __machine_has_unsigned_chars
        !            55: # define CHAR_MIN      0               /* min value for a char */
        !            56: # define CHAR_MAX      0xff            /* max value for a char */
        !            57: #else
        !            58: # define CHAR_MAX      0x7f
        !            59: # define CHAR_MIN      (-0x7f-1)
        !            60: #endif
        !            61:
        !            62: #define        USHRT_MAX       0xffff          /* max value for an unsigned short */
        !            63: #define        SHRT_MAX        0x7fff          /* max value for a short */
        !            64: #define SHRT_MIN        (-0x7fff-1)     /* min value for a short */
        !            65:
        !            66: #define        UINT_MAX        0xffffffffU     /* max value for an unsigned int */
        !            67: #define        INT_MAX         0x7fffffff      /* max value for an int */
        !            68: #define        INT_MIN         (-0x7fffffff-1) /* min value for an int */
        !            69:
        !            70: #ifdef __LP64__
        !            71: # define ULONG_MAX     0xffffffffffffffffUL
        !            72:                                        /* max value for unsigned long */
        !            73: # define LONG_MAX      0x7fffffffffffffffL
        !            74:                                        /* max value for a signed long */
        !            75: # define LONG_MIN      (-0x7fffffffffffffffL-1)
        !            76:                                        /* min value for a signed long */
        !            77: #else
        !            78: # define ULONG_MAX     0xffffffffUL    /* max value for an unsigned long */
        !            79: # define LONG_MAX      0x7fffffffL     /* max value for a long */
        !            80: # define LONG_MIN      (-0x7fffffffL-1)/* min value for a long */
        !            81: #endif
        !            82:
        !            83: #if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999
        !            84: # define ULLONG_MAX    0xffffffffffffffffULL
        !            85:                                        /* max value for unsigned long long */
        !            86: # define LLONG_MAX     0x7fffffffffffffffLL
        !            87:                                        /* max value for a signed long long */
        !            88: # define LLONG_MIN     (-0x7fffffffffffffffLL-1)
        !            89:                                        /* min value for a signed long long */
        !            90: #endif
        !            91:
        !            92: #if __BSD_VISIBLE
        !            93: # define UID_MAX       UINT_MAX        /* max value for a uid_t */
        !            94: # define GID_MAX       UINT_MAX        /* max value for a gid_t */
        !            95: #endif
        !            96:
        !            97:
        !            98: #if __XPG_VISIBLE
        !            99: # ifdef __LP64__
        !           100: #  define LONG_BIT     64
        !           101: # else
        !           102: #  define LONG_BIT     32
        !           103: # endif
        !           104: # define WORD_BIT      32
        !           105:
        !           106: /* float.h defines these as well */
        !           107: # if !defined(DBL_DIG)
        !           108: #  if defined(__DBL_DIG)
        !           109: #   define DBL_DIG     __DBL_DIG
        !           110: #   define DBL_MAX     __DBL_MAX
        !           111: #   define DBL_MIN     __DBL_MIN
        !           112:
        !           113: #   define FLT_DIG     __FLT_DIG
        !           114: #   define FLT_MAX     __FLT_MAX
        !           115: #   define FLT_MIN     __FLT_MIN
        !           116: #  else
        !           117: #   define DBL_DIG     15
        !           118: #   define DBL_MAX     1.7976931348623157E+308
        !           119: #   define DBL_MIN     2.2250738585072014E-308
        !           120:
        !           121: #   define FLT_DIG     6
        !           122: #   define FLT_MAX     3.40282347E+38F
        !           123: #   define FLT_MIN     1.17549435E-38F
        !           124: #  endif
        !           125: # endif
        !           126: #endif
        !           127:
        !           128: #endif

CVSweb