Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
3.5 KiB

  1. /***
  2. *limits.h - implementation dependent values
  3. *
  4. * Copyright (c) 1985-1994, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Contains defines for a number of implementation dependent values
  8. * which are commonly used in C programs.
  9. * [ANSI]
  10. *
  11. ****/
  12. #ifndef _INC_LIMITS
  13. #define _INC_LIMITS
  14. #define CHAR_BIT 8 /* number of bits in a char */
  15. #define SCHAR_MIN (-128) /* minimum signed char value */
  16. #define SCHAR_MAX 127 /* maximum signed char value */
  17. #define UCHAR_MAX 0xff /* maximum unsigned char value */
  18. #ifndef _CHAR_UNSIGNED
  19. #define CHAR_MIN SCHAR_MIN /* mimimum char value */
  20. #define CHAR_MAX SCHAR_MAX /* maximum char value */
  21. #else
  22. #define CHAR_MIN 0
  23. #define CHAR_MAX UCHAR_MAX
  24. #endif /* _CHAR_UNSIGNED */
  25. #define MB_LEN_MAX 2 /* max. # bytes in multibyte char */
  26. #define SHRT_MIN (-32768) /* minimum (signed) short value */
  27. #define SHRT_MAX 32767 /* maximum (signed) short value */
  28. #define USHRT_MAX 0xffff /* maximum unsigned short value */
  29. #define INT_MIN (-2147483647 - 1) /* minimum (signed) int value */
  30. #define INT_MAX 2147483647 /* maximum (signed) int value */
  31. #define UINT_MAX 0xffffffff /* maximum unsigned int value */
  32. #define LONG_MIN (-2147483647L - 1) /* minimum (signed) long value */
  33. #define LONG_MAX 2147483647L /* maximum (signed) long value */
  34. #define ULONG_MAX 0xffffffffUL /* maximum unsigned long value */
  35. #if _INTEGRAL_MAX_BITS >= 8
  36. #define _I8_MIN (-127i8 - 1) /* minimum signed 8 bit value */
  37. #define _I8_MAX 127i8 /* maximum signed 8 bit value */
  38. #define _UI8_MAX 0xffui8 /* maximum unsigned 8 bit value */
  39. #endif
  40. #if _INTEGRAL_MAX_BITS >= 16
  41. #define _I16_MIN (-32767i16 - 1) /* minimum signed 16 bit value */
  42. #define _I16_MAX 32767i16 /* maximum signed 16 bit value */
  43. #define _UI16_MAX 0xffffui16 /* maximum unsigned 16 bit value */
  44. #endif
  45. #if _INTEGRAL_MAX_BITS >= 32
  46. #define _I32_MIN (-2147483647i32 - 1) /* minimum signed 32 bit value */
  47. #define _I32_MAX 2147483647i32 /* maximum signed 32 bit value */
  48. #define _UI32_MAX 0xffffffffui32 /* maximum unsigned 32 bit value */
  49. #endif
  50. #if _INTEGRAL_MAX_BITS >= 64
  51. /* minimum signed 64 bit value */
  52. #define _I64_MIN (-9223372036854775807i64 - 1)
  53. /* maximum signed 64 bit value */
  54. #define _I64_MAX 9223372036854775807i64
  55. /* maximum unsigned 64 bit value */
  56. #define _UI64_MAX 0xffffffffffffffffui64
  57. #endif
  58. #if _INTEGRAL_MAX_BITS >= 128
  59. /* minimum signed 128 bit value */
  60. #define _I128_MIN (-170141183460469231731687303715884105727i128 - 1)
  61. /* maximum signed 128 bit value */
  62. #define _I128_MAX 170141183460469231731687303715884105727i128
  63. /* maximum unsigned 128 bit value */
  64. #define _UI128_MAX 0xffffffffffffffffffffffffffffffffui128
  65. #endif
  66. #ifdef _POSIX_
  67. #define _POSIX_ARG_MAX 4096
  68. #define _POSIX_CHILD_MAX 6
  69. #define _POSIX_LINK_MAX 8
  70. #define _POSIX_MAX_CANON 255
  71. #define _POSIX_MAX_INPUT 255
  72. #define _POSIX_NAME_MAX 14
  73. #define _POSIX_NGROUPS_MAX 0
  74. #define _POSIX_OPEN_MAX 16
  75. #define _POSIX_PATH_MAX 255
  76. #define _POSIX_PIPE_BUF 512
  77. #define _POSIX_SSIZE_MAX 32767
  78. #define _POSIX_STREAM_MAX 8
  79. #define _POSIX_TZNAME_MAX 3
  80. #define ARG_MAX 14500 /* 16k heap, minus overhead */
  81. #define MAX_CANON _POSIX_MAX_CANON
  82. #define MAX_INPUT _POSIX_MAX_INPUT
  83. #define NAME_MAX 255
  84. #define NGROUPS_MAX 16
  85. #define OPEN_MAX 32
  86. #define PATH_MAX 512
  87. #define PIPE_BUF _POSIX_PIPE_BUF
  88. #define SSIZE_MAX _POSIX_SSIZE_MAX
  89. #define STREAM_MAX 20
  90. #define TZNAME_MAX 10
  91. #endif /* POSIX */
  92. #endif /* _INC_LIMITS */