sys/limits.h

Go to the documentation of this file.
00001 /*-
00002  * Copyright (c) 1988, 1993
00003  *      The Regents of the University of California.  All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  * 1. Redistributions of source code must retain the above copyright
00009  *    notice, this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright
00011  *    notice, this list of conditions and the following disclaimer in the
00012  *    documentation and/or other materials provided with the distribution.
00013  * 4. Neither the name of the University nor the names of its contributors
00014  *    may be used to endorse or promote products derived from this software
00015  *    without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00027  * SUCH DAMAGE.
00028  *
00029  * $FreeBSD: src/sys/sys/limits.h,v 1.9 2005/01/07 02:29:23 imp Exp $
00030  */
00031 
00032 #ifndef _SYS_LIMITS_H_
00033 #define _SYS_LIMITS_H_
00034 
00035 #include <sys/cdefs.h>
00036 #include <machine/_limits.h>
00037 
00038 #define CHAR_BIT        __CHAR_BIT      /* number of bits in a char */
00039 
00040 #define SCHAR_MAX       __SCHAR_MAX     /* max value for a signed char */
00041 #define SCHAR_MIN       __SCHAR_MIN     /* min value for a signed char */
00042 
00043 #define UCHAR_MAX       __UCHAR_MAX     /* max value for an unsigned char */
00044 
00045 #ifdef __CHAR_UNSIGNED__
00046 #define CHAR_MAX        UCHAR_MAX       /* max value for a char */
00047 #define CHAR_MIN        0               /* min value for a char */
00048 #else
00049 #define CHAR_MAX        SCHAR_MAX
00050 #define CHAR_MIN        SCHAR_MIN
00051 #endif
00052 
00053 #define USHRT_MAX       __USHRT_MAX     /* max value for an unsigned short */
00054 #define SHRT_MAX        __SHRT_MAX      /* max value for a short */
00055 #define SHRT_MIN        __SHRT_MIN      /* min value for a short */
00056 
00057 #define UINT_MAX        __UINT_MAX      /* max value for an unsigned int */
00058 #define INT_MAX         __INT_MAX       /* max value for an int */
00059 #define INT_MIN         __INT_MIN       /* min value for an int */
00060 
00061 #define ULONG_MAX       __ULONG_MAX     /* max for an unsigned long */
00062 #define LONG_MAX        __LONG_MAX      /* max for a long */
00063 #define LONG_MIN        __LONG_MIN      /* min for a long */
00064 
00065 #ifdef __LONG_LONG_SUPPORTED
00066 #define ULLONG_MAX      __ULLONG_MAX    /* max for an unsigned long long */
00067 #define LLONG_MAX       __LLONG_MAX     /* max for a long long */
00068 #define LLONG_MIN       __LLONG_MIN     /* min for a long long */
00069 #endif
00070 
00071 #if __POSIX_VISIBLE || __XSI_VISIBLE
00072 #define SSIZE_MAX       __SSIZE_MAX     /* max value for an ssize_t */
00073 #endif
00074 
00075 #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
00076 #define SIZE_T_MAX      __SIZE_T_MAX    /* max value for a size_t */
00077 
00078 #define OFF_MAX         __OFF_MAX       /* max value for an off_t */
00079 #define OFF_MIN         __OFF_MIN       /* min value for an off_t */
00080 #endif
00081 
00082 #if __BSD_VISIBLE
00083 #define GID_MAX         UINT_MAX        /* max value for a gid_t */
00084 #define UID_MAX         UINT_MAX        /* max value for a uid_t */
00085 
00086 #define UQUAD_MAX       (__UQUAD_MAX)   /* max value for a uquad_t */
00087 #define QUAD_MAX        (__QUAD_MAX)    /* max value for a quad_t */
00088 #define QUAD_MIN        (__QUAD_MIN)    /* min value for a quad_t */
00089 #endif
00090 
00091 #if __XSI_VISIBLE
00092 #define LONG_BIT        __LONG_BIT
00093 #define WORD_BIT        __WORD_BIT
00094 #endif
00095 
00096 #endif /* !_SYS_LIMITS_H_ */

Copyright © Nokia Corporation 2001-2008
Back to top