_limits.h revision 1216
1100882Smike/* 2100882Smike * Copyright (c) 1988 The Regents of the University of California. 3100882Smike * All rights reserved. 4100882Smike * 5100882Smike * Redistribution and use in source and binary forms, with or without 6100882Smike * modification, are permitted provided that the following conditions 7100882Smike * are met: 8100882Smike * 1. Redistributions of source code must retain the above copyright 9100882Smike * notice, this list of conditions and the following disclaimer. 10100882Smike * 2. Redistributions in binary form must reproduce the above copyright 11100882Smike * notice, this list of conditions and the following disclaimer in the 12100882Smike * documentation and/or other materials provided with the distribution. 13100882Smike * 3. All advertising materials mentioning features or use of this software 14100882Smike * must display the following acknowledgement: 15100882Smike * This product includes software developed by the University of 16100882Smike * California, Berkeley and its contributors. 17100882Smike * 4. Neither the name of the University nor the names of its contributors 18100882Smike * may be used to endorse or promote products derived from this software 19100882Smike * without specific prior written permission. 20100882Smike * 21100882Smike * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22100882Smike * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23100882Smike * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24100882Smike * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25100882Smike * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26100882Smike * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27100882Smike * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28100882Smike * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29100882Smike * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30100882Smike * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31100882Smike * SUCH DAMAGE. 32100882Smike * 33100882Smike * from: @(#)limits.h 7.2 (Berkeley) 6/28/90 34100882Smike * $Id: limits.h,v 1.4 1993/12/19 05:14:46 alm Exp $ 35100882Smike */ 36100882Smike 37100882Smike#ifndef _MACHINE_LIMITS_H_ 38100882Smike#define _MACHINE_LIMITS_H_ 1 39100882Smike 40100882Smike#define CHAR_BIT 8 /* number of bits in a char */ 41100882Smike#define CLK_TCK 128 /* ticks per second */ 42100882Smike#define MB_LEN_MAX 1 /* no multibyte characters */ 43100882Smike 44100882Smike#define SCHAR_MIN (-0x7f-1) /* max value for a signed char */ 45100882Smike#define SCHAR_MAX 0x7f /* min value for a signed char */ 46100882Smike 47100882Smike#define UCHAR_MAX 0xff /* max value for an unsigned char */ 48100882Smike#define CHAR_MAX 0x7f /* max value for a char */ 49100882Smike#define CHAR_MIN (-0x7f-1) /* min value for a char */ 50100882Smike 51100882Smike#define USHRT_MAX 0xffff /* max value for an unsigned short */ 52100882Smike#define SHRT_MAX 0x7fff /* max value for a short */ 53100882Smike#define SHRT_MIN (-0x7fff-1) /* min value for a short */ 54100882Smike 55100882Smike#define UINT_MAX 0xffffffff /* max value for an unsigned int */ 56100882Smike#define INT_MAX 0x7fffffff /* max value for an int */ 57100882Smike#define INT_MIN (-0x7fffffff-1) /* min value for an int */ 58100882Smike 59100882Smike#define ULONG_MAX 0xffffffff /* max value for an unsigned long */ 60100882Smike#define LONG_MAX 0x7fffffff /* max value for a long */ 61100882Smike#define LONG_MIN (-0x7fffffff-1) /* min value for a long */ 62100882Smike 63100882Smike#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) 64100882Smike#define UQUAD_MAX 0xffffffffffffffffLL /* max unsigned quad */ 65100882Smike#define QUAD_MAX 0x7fffffffffffffffLL /* max signed quad */ 66100882Smike#define QUAD_MIN (-0x7fffffffffffffffLL-1) /* min signed quad */ 67100882Smike#endif 68100882Smike 69100882Smike#endif /* _MACHINE_LIMITS_H_ */ 70100882Smike