home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue6 / SDL.ZIP / !gcc / include / unixlib / h / limits < prev    next >
Encoding:
Text File  |  2006-09-17  |  5.7 KB  |  189 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /usr/local/cvsroot/gccsdk/unixlib/source/clib/limits.h,v $
  4.  * $Date: 2004/08/16 21:01:26 $
  5.  * $Revision: 1.4 $
  6.  * $State: Exp $
  7.  * $Author: joty $
  8.  *
  9.  ***************************************************************************/
  10.  
  11. /* ANSI Standard 4.14/2.2.4.2: Limits of integral types <limits.h>.  */
  12.  
  13. #ifndef __LIMITS_H
  14. #define __LIMITS_H
  15.  
  16. #ifndef __UNIXLIB_FEATURES_H
  17. #include <features.h>
  18. #endif
  19.  
  20. /* Number of bits in a 'char'.  */
  21. #define CHAR_BIT    8
  22. /* Minimum value that can be represented by a 'signed char'.  */
  23. #define SCHAR_MIN    (-0x80)
  24. /* Maximum values that can be represented by a 'signed char'
  25.    and 'unsigned char', respectively.  */
  26. #define SCHAR_MAX    0x7f
  27. #define UCHAR_MAX    0xff
  28. /* Minimum and maximum values that can be represented by a 'char'.  */
  29. #define CHAR_MIN    0x00
  30. #define CHAR_MAX    0xff
  31.  
  32. /* Maximum length of a multibyte character.  */
  33. #define MB_LEN_MAX    1
  34.  
  35. /* Minimum value that can be represented by a 'signed short int'.  */
  36. #define SHRT_MIN    (short)(0x8000U)
  37. /* Maximum values that can be represented by a 'signed short int'
  38.    and 'unsigned short int', respectively.  */
  39. #define SHRT_MAX    0x7fff
  40. #define USHRT_MAX    0xffffU
  41.  
  42. /* Minimum value that can be represented by a 'signed int'.  */
  43. #define INT_MIN     (int)(0x80000000U)
  44. /* Maximum values that can be represented by a 'signed int'
  45.    and 'unsigned int'.  */
  46. #define INT_MAX     0x7fffffff
  47. #define UINT_MAX    0xffffffffU
  48.  
  49. /* The number of bits in a 'long int'.  */
  50. #define LONGBITS 32
  51. /* Minimum value that can be represented by a 'signed long int'.  */
  52. #define LONG_MIN    (long)(0x80000000UL)
  53. /* Maximum values that can be represented by a 'signed long int'
  54.    and 'unsigned long int'.  */
  55. #define LONG_MAX    0x7fffffffL
  56. #define ULONG_MAX    0xffffffffUL
  57.  
  58. /* The minimum value that can be represented by a
  59.    'signed long long int'.  */
  60. #define LONG_LONG_MIN 0x8000000000000000LL
  61.  
  62. /* The maximum values that can be represented by a
  63.    'signed long long int' and 'unsigned long long int'.  */
  64. #define LONG_LONG_MAX 0x7fffffffffffffffLL
  65. #define ULONG_LONG_MAX 0xffffffffffffffffULL
  66.  
  67. #ifdef __USE_ISOC99
  68. /* Minimum and maximum that a signed long long int can hold.  */
  69. #define LLONG_MIN 0x8000000000000000LL
  70. #define LLONG_MAX 0x7fffffffffffffffLL
  71.  
  72. /* Maximum value that an unsigned long long int can hold.  */
  73. #define ULLONG_MAX 0xffffffffffffffffULL
  74. #endif
  75.  
  76. #define QUAD_MAX LONG_LONG_MAX
  77.  
  78. #ifdef __USE_XOPEN
  79. /* Number of bits in a word of type 'int'.  */
  80. #define WORD_BIT 32
  81.  
  82. /* Number of bits in a word of type 'long'.  */
  83. #define LONG_BIT 32
  84. #endif
  85.  
  86. /* POSIX Standard 2.9.2: Minimum Values <limits.h>.  */
  87.  
  88. #ifdef __USE_POSIX
  89. /* These are the standard-mandated minimum values.  */
  90.  
  91. /* Maximum length of arguments to `execve', including environment.  */
  92. #define    _POSIX_ARG_MAX        1024
  93. #define ARG_MAX _POSIX_ARG_MAX
  94.  
  95. /* Maximum simultaneous processes per real user ID.  */
  96. #define    _POSIX_CHILD_MAX    1
  97. #define CHILD_MAX _POSIX_CHILD_MAX
  98.  
  99. /* Maximum link count of a file.  */
  100. #define    _POSIX_LINK_MAX        1
  101. #define LINK_MAX _POSIX_LINK_MAX
  102.  
  103. /* Number of bytes in a terminal canonical input queue.  */
  104. #define    _POSIX_MAX_CANON    256
  105. #define MAX_CANON _POSIX_MAX_CANON
  106.  
  107. /* Number of bytes for which space will be
  108.    available in a terminal input queue.  */
  109. #define    _POSIX_MAX_INPUT    256
  110. #define MAX_INPUT _POSIX_MAX_INPUT
  111.  
  112. /* Number of simultaneous supplementary group IDs per process.  */
  113. #define    _POSIX_NGROUPS_MAX    0
  114. #define NGROUPS_MAX _POSIX_NGROUPS_MAX
  115.  
  116. /* Number of files one process can have open at once.
  117.    Keep in sync with <stdio.h>, FOPEN_MAX.  */
  118. #define    _POSIX_OPEN_MAX        64
  119. #define OPEN_MAX _POSIX_OPEN_MAX
  120.  
  121. /* Number of bytes in a filename.
  122.    Keep in sync with <stdio.h>, FILENAME_MAX.  */
  123. #define    _POSIX_NAME_MAX        252
  124. #define NAME_MAX _POSIX_NAME_MAX
  125.  
  126. /* Number of bytes in a pathname.  */
  127. #define    _POSIX_PATH_MAX        256
  128. #define PATH_MAX _POSIX_PATH_MAX
  129.  
  130. /* Number of bytes than can be written atomically to a pipe.  */
  131. #define    _POSIX_PIPE_BUF        512
  132. #define PIPE_BUF _POSIX_PIPE_BUF
  133.  
  134. /* Largest value of a `ssize_t'.  */
  135. #define    _POSIX_SSIZE_MAX    INT_MAX
  136. #define SSIZE_MAX _POSIX_SSIZE_MAX
  137.  
  138. /* Number of streams a process can have open at once.  */
  139. #define    _POSIX_STREAM_MAX    8
  140. #define STREAM_MAX _POSIX_STREAM_MAX
  141.  
  142. /* Maximum length of a timezone name (element of `tzname').  */
  143. #define    _POSIX_TZNAME_MAX    3
  144. #define TZNAME_MAX _POSIX_TZNAME_MAX
  145. #endif
  146.  
  147. /* POSIX2 limits.  */
  148.  
  149. #ifdef __USE_POSIX2
  150. /* The maximum `ibase' and `obase' values allowed by the `bc' utility.  */
  151. #define    _POSIX2_BC_BASE_MAX    99
  152. #define    BC_BASE_MAX    _POSIX2_BC_BASE_MAX
  153.  
  154. /* The maximum number of elements allowed in an array by the `bc' utility.  */
  155. #define    _POSIX2_BC_DIM_MAX    2048
  156. #define    BC_DIM_MAX    _POSIX2_BC_DIM_MAX
  157.  
  158. /* The maximum `scale' value allowed by the `bc' utility.  */
  159. #define    _POSIX2_BC_SCALE_MAX    99
  160. #define    BC_SCALE_MAX    _POSIX2_BC_SCALE_MAX
  161.  
  162. /* The maximum length of a string constant accepted by the `bc' utility.  */
  163. #define    _POSIX2_BC_STRING_MAX    1000
  164. #define    BC_STRING_MAX    _POSIX2_BC_STRING_MAX
  165.  
  166. /* The maximum number of weights that can be assigned to an entry of
  167.    the LC_COLLATE category `order' keyword in a locale definition.  */
  168. #define    _POSIX2_EQUIV_CLASS_MAX    2
  169. #define    EQUIV_CLASS_MAX    _POSIX2_EQUIV_CLASS_MAX
  170.  
  171. /* The maximum number of expressions that can be nested
  172.    within parentheses by the `expr' utility.  */
  173. #define    _POSIX2_EXPR_NEST_MAX    32
  174. #define    EXPR_NEST_MAX    _POSIX2_EXPR_NEST_MAX
  175.  
  176. /* The maximum length, in bytes, of an input line.  */
  177. #define    _POSIX2_LINE_MAX    2048
  178. #define    LINE_MAX    _POSIX2_LINE_MAX
  179.  
  180. /* The maximum number of repeated occurrences of a regular expression
  181.    permitted when using the interval notation `\{M,N\}'.  */
  182. #define    _POSIX2_RE_DUP_MAX    255
  183.  
  184. /* This value is defined like this in regex.h.  */
  185. #define    RE_DUP_MAX    (0x7fff)
  186. #endif
  187.  
  188. #endif
  189.