home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
300-399
/
ff384.lzh
/
NorthC
/
NorthC1.LZH
/
include
/
limits.h
< prev
next >
Wrap
C/C++ Source or Header
|
1990-08-30
|
1KB
|
46 lines
/*
* LIMITS.H
*/
#ifndef LIMITS_H
#define LIMITS_H
#define PATHSIZE (128) /* maximum pathname length */
#define BITSPERBYTE 8
/* constants with only the high bit set */
#define HIBITS ((short) (1 << (BITSPERBYTE * sizeof(short) - 1)))
#define HIBITI ((int) (1 << (BITSPERBYTE * sizeof(int) - 1)))
#define HIBITL ((long) (1L << (BITSPERBYTE * sizeof(long) - 1)))
/* largest value for each type */
#define MAXSHORT ((short) (~HIBITS))
#define MAXINT ((int) (~HIBITI))
#define MAXLONG ((long) (~HIBITL))
/* smallest value for each type (assumes 2's complement representation) */
#define MINSHORT HIBITS
#define MININT HIBITI
#define MINLONG HIBITL
/* similar #defines for ANSI compatibility */
#define CHAR_BIT BITSPERBYTE
#define CHAR_MAX SCHAR_MAX
#define CHAR_MIN SCHAR_MIN
#define INT_MAX MAXINT
#define INT_MIN MININT
#define LONG_MAX MAXLONG
#define LONG_MIN MINLONG
#define MB_LEN_MAX (1)
#define SCHAR_MAX (127)
#define SCHAR_MIN (-128)
#define SHRT_MAX MAXSHORT
#define SHRT_MIN MINSHORT
#define UCHAR_MAX ~((unsigned char) 0)
#define UINT_MAX ~((unsigned int) 0)
#define ULONG_MAX ~((unsigned long) 0)
#define USHRT_MAX ~((unsigned short) 0)
#endif LIMITS_H