home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume26 / cook-1.4 / part01 / h / limits.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-03  |  982 b   |  55 lines

  1.  
  2. /*
  3.  *  ANSI C definitions
  4.  *
  5.  *  these definitions work for char:8, short:16, int:32, long:32,
  6.  *
  7.  * MANIFEST: minimal limits.h replacement
  8.  */
  9.  
  10. #ifndef _H_limits
  11. #define _H_limits
  12.  
  13. #define CHAR_BIT 8
  14. #define CHAR_MAX 127
  15. #define CHAR_MIN (-128)
  16. #define SCHAR_MAX 127
  17. #define SCHAR_MIN (-128)
  18. #define UCHAR_MAX 255
  19. #define SHRT_MIN (-32768)
  20. #define SHRT_MAX 32767
  21. #define USHRT_MAX 65535
  22. #define LONG_MAX 2147483647
  23. #define LONG_MIN (-2147483648)
  24. #define ULONG_MAX 4294967295
  25.  
  26. #define INT_MAX LONG_MAX
  27. #define INT_MIN LONG_MIN
  28. #define UINT_MAX ULONG_MAX
  29.  
  30. /*
  31.  *  POSIX definitions
  32.  */
  33.  
  34. #if defined(sun) || defined(BSD)
  35.  
  36. /*
  37.  *  these definitions work for BSD and SunOS
  38.  */
  39. #define NAME_MAX 255
  40. #define PATH_MAX 1023
  41.  
  42. #else
  43.  
  44. /*
  45.  *  These definitions work for SystemV
  46.  *      note that 5.2 and 5.3 state in the release notes that 1024 is correct,
  47.  *      even though the distributed limits.h has 256 in it.
  48.  */
  49. #define NAME_MAX 14
  50. #define PATH_MAX 1024
  51.  
  52. #endif
  53.  
  54. #endif /* _H_limits */
  55.