Debian Codegraph @

share/libc/limits.h

raw
1 /**************************************************************************/
2 /* */
3 /* This file is part of Frama-C. */
4 /* */
5 /* Copyright (C) 2007-2022 */
6 /* CEA (Commissariat à l'énergie atomique et aux énergies */
7 /* alternatives) */
8 /* */
9 /* you can redistribute it and/or modify it under the terms of the GNU */
10 /* Lesser General Public License as published by the Free Software */
11 /* Foundation, version 2.1. */
12 /* */
13 /* It is distributed in the hope that it will be useful, */
14 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
15 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
16 /* GNU Lesser General Public License for more details. */
17 /* */
18 /* See the GNU Lesser General Public License version 2.1 */
19 /* for more details (enclosed in the file licenses/LGPLv2.1). */
20 /* */
21 /**************************************************************************/
22
23 /* ISO C: 7.10 and 5.2.4.2.1 */
24 #ifndef __FC_LIMITS
25 #define __FC_LIMITS
26
27 #include "__fc_machdep.h"
28
29 /* Number of bits in a `char'. */
30 #define CHAR_BIT __CHAR_BIT
31
32
33 /* Minimum and maximum values a `signed char' can hold. */
34 # define SCHAR_MIN __FC_SCHAR_MIN
35 # define SCHAR_MAX __FC_SCHAR_MAX
36
37 /* Maximum value an `unsigned char' can hold. (Minimum is 0.) */
38 # define UCHAR_MAX __FC_UCHAR_MAX
39
40 /* Minimum and maximum values a `char' can hold. */
41 # ifdef __CHAR_UNSIGNED__
42 # define CHAR_MIN 0
43 # define CHAR_MAX UCHAR_MAX
44 # else
45 # define CHAR_MIN SCHAR_MIN
46 # define CHAR_MAX SCHAR_MAX
47 # endif
48
49 #define MB_LEN_MAX 16
50
51 /* Minimum and maximum values a `signed short int' can hold. */
52 # define SHRT_MIN __FC_SHRT_MIN
53 # define SHRT_MAX __FC_SHRT_MAX
54
55 /* Maximum value an `unsigned short int' can hold. (Minimum is 0.) */
56 # define USHRT_MAX __FC_USHRT_MAX
57
58 /* Minimum and maximum values a `signed int' can hold. */
59 # define INT_MIN __FC_INT_MIN
60 # define INT_MAX __FC_INT_MAX
61
62 /* Maximum value an `unsigned int' can hold. (Minimum is 0.) */
63 # define UINT_MAX __FC_UINT_MAX
64
65 /* Minimum and maximum values a `signed long int' can hold. */
66 # define LONG_MAX __FC_LONG_MAX
67 # define LONG_MIN __FC_LONG_MIN
68
69 /* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */
70 #define ULONG_MAX __FC_ULONG_MAX
71
72 /* Minimum and maximum values a `signed long long int' can hold. */
73 # define LLONG_MAX __FC_LLONG_MAX
74 # define LLONG_MIN __FC_LLONG_MIN
75
76 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */
77 # define ULLONG_MAX __FC_ULLONG_MAX
78
79 /* Maximum number of bytes in a pathname, including the terminating
80 null character. (Minimum is 256.) */
81 #define PATH_MAX __FC_PATH_MAX
82
83 /* Maximum length of a host name (not including the terminating null)
84 as returned from the gethostname() function.
85 Note: Mac OS does not define this constant. */
86 #define HOST_NAME_MAX __FC_HOST_NAME_MAX
87
88 /* Maximum length of a terminal device name. */
89 #define TTY_NAME_MAX __FC_TTY_NAME_MAX
90
91 /* Maximum length of argument to the exec functions including environment data.
92 Minimum Acceptable Value: {_POSIX_ARG_MAX} (4096 in POSIX.1-2008)
93 "... the total space used to store the environment and the arguments to the
94 process is limited to {ARG_MAX} bytes."
95 */
96 #define ARG_MAX 4096
97
98 // POSIX; used by <sys/uio.h>.
99 // Must be >= _XOPEN_IOV_MAX, which is 16.
100 // 1024 is the value used by some Linux implementations.
101 #define IOV_MAX 1024
102
103
104 // Maximum Values
105
106 #define _POSIX_CLOCKRES_MIN 20000000
107
108 // Minimum Values
109
110 #define _POSIX_AIO_LISTIO_MAX 2
111 #define _POSIX_AIO_MAX 1
112 #define _POSIX_ARG_MAX 4096
113 #define _POSIX_CHILD_MAX 25
114 #define _POSIX_DELAYTIMER_MAX 32
115 #define _POSIX_HOST_NAME_MAX 255
116 #define _POSIX_LINK_MAX 8
117 #define _POSIX_LOGIN_NAME_MAX 9
118 #define _POSIX_MAX_CANON 255
119 #define _POSIX_MAX_INPUT 255
120 #define _POSIX_MQ_OPEN_MAX 8
121 #define _POSIX_MQ_PRIO_MAX 32
122 #define _POSIX_NAME_MAX 14
123 #define _POSIX_NGROUPS_MAX 8
124 #define _POSIX_OPEN_MAX 20
125 #define _POSIX_PATH_MAX 256
126 #define _POSIX_PIPE_BUF 512
127 #define _POSIX_RE_DUP_MAX 255
128 #define _POSIX_RTSIG_MAX 8
129 #define _POSIX_SEM_NSEMS_MAX 256
130 #define _POSIX_SEM_VALUE_MAX 32767
131 #define _POSIX_SIGQUEUE_MAX 32
132 #define _POSIX_SSIZE_MAX 32767
133 #define _POSIX_SS_REPL_MAX 4
134 #define _POSIX_STREAM_MAX 8
135 #define _POSIX_SYMLINK_MAX 255
136 #define _POSIX_SYMLOOP_MAX 8
137 #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
138 #define _POSIX_THREAD_KEYS_MAX 128
139 #define _POSIX_THREAD_THREADS_MAX 64
140 #define _POSIX_TIMER_MAX 32
141 #define _POSIX_TRACE_EVENT_NAME_MAX 30
142 #define _POSIX_TRACE_NAME_MAX 8
143 #define _POSIX_TRACE_SYS_MAX 8
144 #define _POSIX_TRACE_USER_EVENT_MAX 32
145 #define _POSIX_TTY_NAME_MAX 9
146 #define _POSIX_TZNAME_MAX 6
147 #define _POSIX2_BC_BASE_MAX 99
148 #define _POSIX2_BC_DIM_MAX 2048
149 #define _POSIX2_BC_SCALE_MAX 99
150 #define _POSIX2_BC_STRING_MAX 1000
151 #define _POSIX2_CHARCLASS_NAME_MAX 14
152 #define _POSIX2_COLL_WEIGHTS_MAX 2
153 #define _POSIX2_EXPR_NEST_MAX 32
154 #define _POSIX2_LINE_MAX 2048
155 #define _POSIX2_RE_DUP_MAX 255
156 #define _XOPEN_IOV_MAX 16
157 #define _XOPEN_NAME_MAX 255
158 #define _XOPEN_PATH_MAX 1024
159
160 // Other Invariant Values
161
162 #define NL_ARGMAX 9
163 #define NL_LANGMAX 14
164 #define NL_MSGMAX 32767
165 #define NL_SETMAX 255
166 #define NL_TEXTMAX _POSIX2_LINE_MAX
167 #define NZERO 20
168
169 #endif