modernc.org/z@v1.7.4/internal/example_linux_riscv64.go (about) 1 // Code generated by 'ccgo -lmodernc.org/z/lib -o internal/example_linux_riscv64.go -trace-translation-units /tmp/go-generate-2452420230/cdb.json example64', DO NOT EDIT. 2 3 package main 4 5 import ( 6 "math" 7 "reflect" 8 "sync/atomic" 9 "unsafe" 10 11 "modernc.org/libc" 12 "modernc.org/libc/sys/types" 13 "modernc.org/z/lib" 14 ) 15 16 var _ = math.Pi 17 var _ reflect.Kind 18 var _ atomic.Value 19 var _ unsafe.Pointer 20 var _ *libc.TLS 21 var _ types.Size_t 22 23 func main() { libc.Start(main1) } 24 25 // Get the `_PC_*' symbols for the NAME argument to `pathconf' and `fpathconf'; 26 // the `_SC_*' symbols for the NAME argument to `sysconf'; 27 // and the `_CS_*' symbols for the NAME argument to `confstr'. 28 // `sysconf', `pathconf', and `confstr' NAME values. Generic version. 29 // Copyright (C) 1993-2021 Free Software Foundation, Inc. 30 // This file is part of the GNU C Library. 31 // 32 // The GNU C Library is free software; you can redistribute it and/or 33 // modify it under the terms of the GNU Lesser General Public 34 // License as published by the Free Software Foundation; either 35 // version 2.1 of the License, or (at your option) any later version. 36 // 37 // The GNU C Library is distributed in the hope that it will be useful, 38 // but WITHOUT ANY WARRANTY; without even the implied warranty of 39 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 40 // Lesser General Public License for more details. 41 // 42 // You should have received a copy of the GNU Lesser General Public 43 // License along with the GNU C Library; if not, see 44 // <https://www.gnu.org/licenses/>. 45 46 // Values for the NAME argument to `pathconf' and `fpathconf'. 47 const ( /* confname.h:24:1: */ 48 _PC_LINK_MAX = 0 49 _PC_MAX_CANON = 1 50 _PC_MAX_INPUT = 2 51 _PC_NAME_MAX = 3 52 _PC_PATH_MAX = 4 53 _PC_PIPE_BUF = 5 54 _PC_CHOWN_RESTRICTED = 6 55 _PC_NO_TRUNC = 7 56 _PC_VDISABLE = 8 57 _PC_SYNC_IO = 9 58 _PC_ASYNC_IO = 10 59 _PC_PRIO_IO = 11 60 _PC_SOCK_MAXBUF = 12 61 _PC_FILESIZEBITS = 13 62 _PC_REC_INCR_XFER_SIZE = 14 63 _PC_REC_MAX_XFER_SIZE = 15 64 _PC_REC_MIN_XFER_SIZE = 16 65 _PC_REC_XFER_ALIGN = 17 66 _PC_ALLOC_SIZE_MIN = 18 67 _PC_SYMLINK_MAX = 19 68 _PC_2_SYMLINKS = 20 69 ) 70 71 // Values for the NAME argument to `confstr'. 72 const ( /* confname.h:539:1: */ 73 _CS_PATH = 0 // The default search path. 74 75 _CS_V6_WIDTH_RESTRICTED_ENVS = 1 76 77 _CS_GNU_LIBC_VERSION = 2 78 _CS_GNU_LIBPTHREAD_VERSION = 3 79 80 _CS_V5_WIDTH_RESTRICTED_ENVS = 4 81 82 _CS_V7_WIDTH_RESTRICTED_ENVS = 5 83 84 _CS_LFS_CFLAGS = 1000 85 _CS_LFS_LDFLAGS = 1001 86 _CS_LFS_LIBS = 1002 87 _CS_LFS_LINTFLAGS = 1003 88 _CS_LFS64_CFLAGS = 1004 89 _CS_LFS64_LDFLAGS = 1005 90 _CS_LFS64_LIBS = 1006 91 _CS_LFS64_LINTFLAGS = 1007 92 93 _CS_XBS5_ILP32_OFF32_CFLAGS = 1100 94 _CS_XBS5_ILP32_OFF32_LDFLAGS = 1101 95 _CS_XBS5_ILP32_OFF32_LIBS = 1102 96 _CS_XBS5_ILP32_OFF32_LINTFLAGS = 1103 97 _CS_XBS5_ILP32_OFFBIG_CFLAGS = 1104 98 _CS_XBS5_ILP32_OFFBIG_LDFLAGS = 1105 99 _CS_XBS5_ILP32_OFFBIG_LIBS = 1106 100 _CS_XBS5_ILP32_OFFBIG_LINTFLAGS = 1107 101 _CS_XBS5_LP64_OFF64_CFLAGS = 1108 102 _CS_XBS5_LP64_OFF64_LDFLAGS = 1109 103 _CS_XBS5_LP64_OFF64_LIBS = 1110 104 _CS_XBS5_LP64_OFF64_LINTFLAGS = 1111 105 _CS_XBS5_LPBIG_OFFBIG_CFLAGS = 1112 106 _CS_XBS5_LPBIG_OFFBIG_LDFLAGS = 1113 107 _CS_XBS5_LPBIG_OFFBIG_LIBS = 1114 108 _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS = 1115 109 110 _CS_POSIX_V6_ILP32_OFF32_CFLAGS = 1116 111 _CS_POSIX_V6_ILP32_OFF32_LDFLAGS = 1117 112 _CS_POSIX_V6_ILP32_OFF32_LIBS = 1118 113 _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS = 1119 114 _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS = 1120 115 _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS = 1121 116 _CS_POSIX_V6_ILP32_OFFBIG_LIBS = 1122 117 _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 1123 118 _CS_POSIX_V6_LP64_OFF64_CFLAGS = 1124 119 _CS_POSIX_V6_LP64_OFF64_LDFLAGS = 1125 120 _CS_POSIX_V6_LP64_OFF64_LIBS = 1126 121 _CS_POSIX_V6_LP64_OFF64_LINTFLAGS = 1127 122 _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS = 1128 123 _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS = 1129 124 _CS_POSIX_V6_LPBIG_OFFBIG_LIBS = 1130 125 _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS = 1131 126 127 _CS_POSIX_V7_ILP32_OFF32_CFLAGS = 1132 128 _CS_POSIX_V7_ILP32_OFF32_LDFLAGS = 1133 129 _CS_POSIX_V7_ILP32_OFF32_LIBS = 1134 130 _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS = 1135 131 _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS = 1136 132 _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS = 1137 133 _CS_POSIX_V7_ILP32_OFFBIG_LIBS = 1138 134 _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS = 1139 135 _CS_POSIX_V7_LP64_OFF64_CFLAGS = 1140 136 _CS_POSIX_V7_LP64_OFF64_LDFLAGS = 1141 137 _CS_POSIX_V7_LP64_OFF64_LIBS = 1142 138 _CS_POSIX_V7_LP64_OFF64_LINTFLAGS = 1143 139 _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS = 1144 140 _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS = 1145 141 _CS_POSIX_V7_LPBIG_OFFBIG_LIBS = 1146 142 _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS = 1147 143 144 _CS_V6_ENV = 1148 145 _CS_V7_ENV = 1149 146 ) 147 148 // Values for the argument to `sysconf'. 149 const ( /* confname.h:71:1: */ 150 _SC_ARG_MAX = 0 151 _SC_CHILD_MAX = 1 152 _SC_CLK_TCK = 2 153 _SC_NGROUPS_MAX = 3 154 _SC_OPEN_MAX = 4 155 _SC_STREAM_MAX = 5 156 _SC_TZNAME_MAX = 6 157 _SC_JOB_CONTROL = 7 158 _SC_SAVED_IDS = 8 159 _SC_REALTIME_SIGNALS = 9 160 _SC_PRIORITY_SCHEDULING = 10 161 _SC_TIMERS = 11 162 _SC_ASYNCHRONOUS_IO = 12 163 _SC_PRIORITIZED_IO = 13 164 _SC_SYNCHRONIZED_IO = 14 165 _SC_FSYNC = 15 166 _SC_MAPPED_FILES = 16 167 _SC_MEMLOCK = 17 168 _SC_MEMLOCK_RANGE = 18 169 _SC_MEMORY_PROTECTION = 19 170 _SC_MESSAGE_PASSING = 20 171 _SC_SEMAPHORES = 21 172 _SC_SHARED_MEMORY_OBJECTS = 22 173 _SC_AIO_LISTIO_MAX = 23 174 _SC_AIO_MAX = 24 175 _SC_AIO_PRIO_DELTA_MAX = 25 176 _SC_DELAYTIMER_MAX = 26 177 _SC_MQ_OPEN_MAX = 27 178 _SC_MQ_PRIO_MAX = 28 179 _SC_VERSION = 29 180 _SC_PAGESIZE = 30 181 _SC_RTSIG_MAX = 31 182 _SC_SEM_NSEMS_MAX = 32 183 _SC_SEM_VALUE_MAX = 33 184 _SC_SIGQUEUE_MAX = 34 185 _SC_TIMER_MAX = 35 186 187 // Values for the argument to `sysconf' 188 // corresponding to _POSIX2_* symbols. 189 _SC_BC_BASE_MAX = 36 190 _SC_BC_DIM_MAX = 37 191 _SC_BC_SCALE_MAX = 38 192 _SC_BC_STRING_MAX = 39 193 _SC_COLL_WEIGHTS_MAX = 40 194 _SC_EQUIV_CLASS_MAX = 41 195 _SC_EXPR_NEST_MAX = 42 196 _SC_LINE_MAX = 43 197 _SC_RE_DUP_MAX = 44 198 _SC_CHARCLASS_NAME_MAX = 45 199 200 _SC_2_VERSION = 46 201 _SC_2_C_BIND = 47 202 _SC_2_C_DEV = 48 203 _SC_2_FORT_DEV = 49 204 _SC_2_FORT_RUN = 50 205 _SC_2_SW_DEV = 51 206 _SC_2_LOCALEDEF = 52 207 208 _SC_PII = 53 209 _SC_PII_XTI = 54 210 _SC_PII_SOCKET = 55 211 _SC_PII_INTERNET = 56 212 _SC_PII_OSI = 57 213 _SC_POLL = 58 214 _SC_SELECT = 59 215 _SC_UIO_MAXIOV = 60 216 _SC_IOV_MAX = 60 217 _SC_PII_INTERNET_STREAM = 61 218 _SC_PII_INTERNET_DGRAM = 62 219 _SC_PII_OSI_COTS = 63 220 _SC_PII_OSI_CLTS = 64 221 _SC_PII_OSI_M = 65 222 _SC_T_IOV_MAX = 66 223 224 // Values according to POSIX 1003.1c (POSIX threads). 225 _SC_THREADS = 67 226 _SC_THREAD_SAFE_FUNCTIONS = 68 227 _SC_GETGR_R_SIZE_MAX = 69 228 _SC_GETPW_R_SIZE_MAX = 70 229 _SC_LOGIN_NAME_MAX = 71 230 _SC_TTY_NAME_MAX = 72 231 _SC_THREAD_DESTRUCTOR_ITERATIONS = 73 232 _SC_THREAD_KEYS_MAX = 74 233 _SC_THREAD_STACK_MIN = 75 234 _SC_THREAD_THREADS_MAX = 76 235 _SC_THREAD_ATTR_STACKADDR = 77 236 _SC_THREAD_ATTR_STACKSIZE = 78 237 _SC_THREAD_PRIORITY_SCHEDULING = 79 238 _SC_THREAD_PRIO_INHERIT = 80 239 _SC_THREAD_PRIO_PROTECT = 81 240 _SC_THREAD_PROCESS_SHARED = 82 241 242 _SC_NPROCESSORS_CONF = 83 243 _SC_NPROCESSORS_ONLN = 84 244 _SC_PHYS_PAGES = 85 245 _SC_AVPHYS_PAGES = 86 246 _SC_ATEXIT_MAX = 87 247 _SC_PASS_MAX = 88 248 249 _SC_XOPEN_VERSION = 89 250 _SC_XOPEN_XCU_VERSION = 90 251 _SC_XOPEN_UNIX = 91 252 _SC_XOPEN_CRYPT = 92 253 _SC_XOPEN_ENH_I18N = 93 254 _SC_XOPEN_SHM = 94 255 256 _SC_2_CHAR_TERM = 95 257 _SC_2_C_VERSION = 96 258 _SC_2_UPE = 97 259 260 _SC_XOPEN_XPG2 = 98 261 _SC_XOPEN_XPG3 = 99 262 _SC_XOPEN_XPG4 = 100 263 264 _SC_CHAR_BIT = 101 265 _SC_CHAR_MAX = 102 266 _SC_CHAR_MIN = 103 267 _SC_INT_MAX = 104 268 _SC_INT_MIN = 105 269 _SC_LONG_BIT = 106 270 _SC_WORD_BIT = 107 271 _SC_MB_LEN_MAX = 108 272 _SC_NZERO = 109 273 _SC_SSIZE_MAX = 110 274 _SC_SCHAR_MAX = 111 275 _SC_SCHAR_MIN = 112 276 _SC_SHRT_MAX = 113 277 _SC_SHRT_MIN = 114 278 _SC_UCHAR_MAX = 115 279 _SC_UINT_MAX = 116 280 _SC_ULONG_MAX = 117 281 _SC_USHRT_MAX = 118 282 283 _SC_NL_ARGMAX = 119 284 _SC_NL_LANGMAX = 120 285 _SC_NL_MSGMAX = 121 286 _SC_NL_NMAX = 122 287 _SC_NL_SETMAX = 123 288 _SC_NL_TEXTMAX = 124 289 290 _SC_XBS5_ILP32_OFF32 = 125 291 _SC_XBS5_ILP32_OFFBIG = 126 292 _SC_XBS5_LP64_OFF64 = 127 293 _SC_XBS5_LPBIG_OFFBIG = 128 294 295 _SC_XOPEN_LEGACY = 129 296 _SC_XOPEN_REALTIME = 130 297 _SC_XOPEN_REALTIME_THREADS = 131 298 299 _SC_ADVISORY_INFO = 132 300 _SC_BARRIERS = 133 301 _SC_BASE = 134 302 _SC_C_LANG_SUPPORT = 135 303 _SC_C_LANG_SUPPORT_R = 136 304 _SC_CLOCK_SELECTION = 137 305 _SC_CPUTIME = 138 306 _SC_THREAD_CPUTIME = 139 307 _SC_DEVICE_IO = 140 308 _SC_DEVICE_SPECIFIC = 141 309 _SC_DEVICE_SPECIFIC_R = 142 310 _SC_FD_MGMT = 143 311 _SC_FIFO = 144 312 _SC_PIPE = 145 313 _SC_FILE_ATTRIBUTES = 146 314 _SC_FILE_LOCKING = 147 315 _SC_FILE_SYSTEM = 148 316 _SC_MONOTONIC_CLOCK = 149 317 _SC_MULTI_PROCESS = 150 318 _SC_SINGLE_PROCESS = 151 319 _SC_NETWORKING = 152 320 _SC_READER_WRITER_LOCKS = 153 321 _SC_SPIN_LOCKS = 154 322 _SC_REGEXP = 155 323 _SC_REGEX_VERSION = 156 324 _SC_SHELL = 157 325 _SC_SIGNALS = 158 326 _SC_SPAWN = 159 327 _SC_SPORADIC_SERVER = 160 328 _SC_THREAD_SPORADIC_SERVER = 161 329 _SC_SYSTEM_DATABASE = 162 330 _SC_SYSTEM_DATABASE_R = 163 331 _SC_TIMEOUTS = 164 332 _SC_TYPED_MEMORY_OBJECTS = 165 333 _SC_USER_GROUPS = 166 334 _SC_USER_GROUPS_R = 167 335 _SC_2_PBS = 168 336 _SC_2_PBS_ACCOUNTING = 169 337 _SC_2_PBS_LOCATE = 170 338 _SC_2_PBS_MESSAGE = 171 339 _SC_2_PBS_TRACK = 172 340 _SC_SYMLOOP_MAX = 173 341 _SC_STREAMS = 174 342 _SC_2_PBS_CHECKPOINT = 175 343 344 _SC_V6_ILP32_OFF32 = 176 345 _SC_V6_ILP32_OFFBIG = 177 346 _SC_V6_LP64_OFF64 = 178 347 _SC_V6_LPBIG_OFFBIG = 179 348 349 _SC_HOST_NAME_MAX = 180 350 _SC_TRACE = 181 351 _SC_TRACE_EVENT_FILTER = 182 352 _SC_TRACE_INHERIT = 183 353 _SC_TRACE_LOG = 184 354 355 _SC_LEVEL1_ICACHE_SIZE = 185 356 _SC_LEVEL1_ICACHE_ASSOC = 186 357 _SC_LEVEL1_ICACHE_LINESIZE = 187 358 _SC_LEVEL1_DCACHE_SIZE = 188 359 _SC_LEVEL1_DCACHE_ASSOC = 189 360 _SC_LEVEL1_DCACHE_LINESIZE = 190 361 _SC_LEVEL2_CACHE_SIZE = 191 362 _SC_LEVEL2_CACHE_ASSOC = 192 363 _SC_LEVEL2_CACHE_LINESIZE = 193 364 _SC_LEVEL3_CACHE_SIZE = 194 365 _SC_LEVEL3_CACHE_ASSOC = 195 366 _SC_LEVEL3_CACHE_LINESIZE = 196 367 _SC_LEVEL4_CACHE_SIZE = 197 368 _SC_LEVEL4_CACHE_ASSOC = 198 369 _SC_LEVEL4_CACHE_LINESIZE = 199 370 // Leave room here, maybe we need a few more cache levels some day. 371 372 _SC_IPV6 = 235 373 _SC_RAW_SOCKETS = 236 374 375 _SC_V7_ILP32_OFF32 = 237 376 _SC_V7_ILP32_OFFBIG = 238 377 _SC_V7_LP64_OFF64 = 239 378 _SC_V7_LPBIG_OFFBIG = 240 379 380 _SC_SS_REPL_MAX = 241 381 382 _SC_TRACE_EVENT_NAME_MAX = 242 383 _SC_TRACE_NAME_MAX = 243 384 _SC_TRACE_SYS_MAX = 244 385 _SC_TRACE_USER_EVENT_MAX = 245 386 387 _SC_XOPEN_STREAMS = 246 388 389 _SC_THREAD_ROBUST_PRIO_INHERIT = 247 390 _SC_THREAD_ROBUST_PRIO_PROTECT = 248 391 392 _SC_MINSIGSTKSZ = 249 393 394 _SC_SIGSTKSZ = 250 395 ) 396 397 type ptrdiff_t = int64 /* <builtin>:3:26 */ 398 399 type size_t = uint64 /* <builtin>:9:23 */ 400 401 type wchar_t = int32 /* <builtin>:15:24 */ 402 403 // A null pointer constant. 404 405 // Offset of member MEMBER in a struct of type TYPE. 406 407 // Type whose alignment is supported in every context and is at least 408 // as great as that of any standard type not using alignment 409 // specifiers. 410 type max_align_t = struct { 411 __max_align_ll int64 412 __max_align_ld float64 413 } /* stddef.h:426:3 */ 414 415 type z_size_t = size_t /* zconf.h:248:21 */ 416 417 // Maximum value for memLevel in deflateInit2 418 419 // Maximum value for windowBits in deflateInit2 and inflateInit2. 420 // WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files 421 // created by gzip. (Files created by minigzip can still be extracted by 422 // gzip.) 423 424 // The memory requirements for deflate are (in bytes): 425 // (1 << (windowBits+2)) + (1 << (memLevel+9)) 426 // that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) 427 // plus a few kilobytes for small objects. For example, if you want to reduce 428 // the default memory requirements from 256K to 128K, compile with 429 // make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" 430 // Of course this will generally degrade compression (there's no free lunch). 431 // 432 // The memory requirements for inflate are (in bytes) 1 << windowBits 433 // that is, 32K for windowBits=15 (default value) plus about 7 kilobytes 434 // for small objects. 435 436 // Type declarations 437 438 // The following definitions for FAR are needed only for MSDOS mixed 439 // model programming (small or medium model with some far allocations). 440 // This was tested only with MSC; for other MSDOS compilers you may have 441 // to define NO_MEMCPY in zutil.h. If you don't need the mixed model, 442 // just define FAR to be empty. 443 444 type Byte = uint8 /* zconf.h:391:24 */ // 8 bits 445 type uInt = uint32 /* zconf.h:393:24 */ // 16 bits or more 446 type uLong = uint64 /* zconf.h:394:24 */ // 32 bits or more 447 448 type Bytef = Byte /* zconf.h:400:22 */ 449 type charf = uint8 /* zconf.h:402:19 */ 450 type intf = int32 /* zconf.h:403:19 */ 451 type uIntf = uInt /* zconf.h:404:19 */ 452 type uLongf = uLong /* zconf.h:405:19 */ 453 454 type voidpc = uintptr /* zconf.h:408:23 */ 455 type voidpf = uintptr /* zconf.h:409:23 */ 456 type voidp = uintptr /* zconf.h:410:23 */ 457 458 // Copyright (C) 1992-2021 Free Software Foundation, Inc. 459 // 460 // This file is part of GCC. 461 // 462 // GCC is free software; you can redistribute it and/or modify it under 463 // the terms of the GNU General Public License as published by the Free 464 // Software Foundation; either version 3, or (at your option) any later 465 // version. 466 // 467 // GCC is distributed in the hope that it will be useful, but WITHOUT ANY 468 // WARRANTY; without even the implied warranty of MERCHANTABILITY or 469 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 470 // for more details. 471 // 472 // Under Section 7 of GPL version 3, you are granted additional 473 // permissions described in the GCC Runtime Library Exception, version 474 // 3.1, as published by the Free Software Foundation. 475 // 476 // You should have received a copy of the GNU General Public License and 477 // a copy of the GCC Runtime Library Exception along with this program; 478 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 479 // <http://www.gnu.org/licenses/>. 480 481 // This administrivia gets added to the beginning of limits.h 482 // if the system has its own version of limits.h. 483 484 // We use _GCC_LIMITS_H_ because we want this not to match 485 // any macros that the system's limits.h uses for its own purposes. 486 487 // Use "..." so that we find syslimits.h only in this same directory. 488 // syslimits.h stands for the system's own limits.h file. 489 // If we can use it ok unmodified, then we install this text. 490 // If fixincludes fixes it, then the fixed version is installed 491 // instead of this text. 492 493 // Copyright (C) 1991-2021 Free Software Foundation, Inc. 494 // This file is part of the GNU C Library. 495 // 496 // The GNU C Library is free software; you can redistribute it and/or 497 // modify it under the terms of the GNU Lesser General Public 498 // License as published by the Free Software Foundation; either 499 // version 2.1 of the License, or (at your option) any later version. 500 // 501 // The GNU C Library is distributed in the hope that it will be useful, 502 // but WITHOUT ANY WARRANTY; without even the implied warranty of 503 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 504 // Lesser General Public License for more details. 505 // 506 // You should have received a copy of the GNU Lesser General Public 507 // License along with the GNU C Library; if not, see 508 // <https://www.gnu.org/licenses/>. 509 510 // ISO C99 Standard: 7.10/5.2.4.2.1 Sizes of integer types <limits.h> 511 512 // Handle feature test macros at the start of a header. 513 // Copyright (C) 2016-2021 Free Software Foundation, Inc. 514 // This file is part of the GNU C Library. 515 // 516 // The GNU C Library is free software; you can redistribute it and/or 517 // modify it under the terms of the GNU Lesser General Public 518 // License as published by the Free Software Foundation; either 519 // version 2.1 of the License, or (at your option) any later version. 520 // 521 // The GNU C Library is distributed in the hope that it will be useful, 522 // but WITHOUT ANY WARRANTY; without even the implied warranty of 523 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 524 // Lesser General Public License for more details. 525 // 526 // You should have received a copy of the GNU Lesser General Public 527 // License along with the GNU C Library; if not, see 528 // <https://www.gnu.org/licenses/>. 529 530 // This header is internal to glibc and should not be included outside 531 // of glibc headers. Headers including it must define 532 // __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION first. This header 533 // cannot have multiple include guards because ISO C feature test 534 // macros depend on the definition of the macro when an affected 535 // header is included, not when the first system header is 536 // included. 537 538 // Copyright (C) 1991-2021 Free Software Foundation, Inc. 539 // This file is part of the GNU C Library. 540 // 541 // The GNU C Library is free software; you can redistribute it and/or 542 // modify it under the terms of the GNU Lesser General Public 543 // License as published by the Free Software Foundation; either 544 // version 2.1 of the License, or (at your option) any later version. 545 // 546 // The GNU C Library is distributed in the hope that it will be useful, 547 // but WITHOUT ANY WARRANTY; without even the implied warranty of 548 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 549 // Lesser General Public License for more details. 550 // 551 // You should have received a copy of the GNU Lesser General Public 552 // License along with the GNU C Library; if not, see 553 // <https://www.gnu.org/licenses/>. 554 555 // These are defined by the user (or the compiler) 556 // to specify the desired environment: 557 // 558 // __STRICT_ANSI__ ISO Standard C. 559 // _ISOC99_SOURCE Extensions to ISO C89 from ISO C99. 560 // _ISOC11_SOURCE Extensions to ISO C99 from ISO C11. 561 // _ISOC2X_SOURCE Extensions to ISO C99 from ISO C2X. 562 // __STDC_WANT_LIB_EXT2__ 563 // Extensions to ISO C99 from TR 27431-2:2010. 564 // __STDC_WANT_IEC_60559_BFP_EXT__ 565 // Extensions to ISO C11 from TS 18661-1:2014. 566 // __STDC_WANT_IEC_60559_FUNCS_EXT__ 567 // Extensions to ISO C11 from TS 18661-4:2015. 568 // __STDC_WANT_IEC_60559_TYPES_EXT__ 569 // Extensions to ISO C11 from TS 18661-3:2015. 570 // __STDC_WANT_IEC_60559_EXT__ 571 // ISO C2X interfaces defined only in Annex F. 572 // 573 // _POSIX_SOURCE IEEE Std 1003.1. 574 // _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2; 575 // if >=199309L, add IEEE Std 1003.1b-1993; 576 // if >=199506L, add IEEE Std 1003.1c-1995; 577 // if >=200112L, all of IEEE 1003.1-2004 578 // if >=200809L, all of IEEE 1003.1-2008 579 // _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if 580 // Single Unix conformance is wanted, to 600 for the 581 // sixth revision, to 700 for the seventh revision. 582 // _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions. 583 // _LARGEFILE_SOURCE Some more functions for correct standard I/O. 584 // _LARGEFILE64_SOURCE Additional functionality from LFS for large files. 585 // _FILE_OFFSET_BITS=N Select default filesystem interface. 586 // _ATFILE_SOURCE Additional *at interfaces. 587 // _DYNAMIC_STACK_SIZE_SOURCE Select correct (but non compile-time constant) 588 // MINSIGSTKSZ, SIGSTKSZ and PTHREAD_STACK_MIN. 589 // _GNU_SOURCE All of the above, plus GNU extensions. 590 // _DEFAULT_SOURCE The default set of features (taking precedence over 591 // __STRICT_ANSI__). 592 // 593 // _FORTIFY_SOURCE Add security hardening to many library functions. 594 // Set to 1 or 2; 2 performs stricter checks than 1. 595 // 596 // _REENTRANT, _THREAD_SAFE 597 // Obsolete; equivalent to _POSIX_C_SOURCE=199506L. 598 // 599 // The `-ansi' switch to the GNU C compiler, and standards conformance 600 // options such as `-std=c99', define __STRICT_ANSI__. If none of 601 // these are defined, or if _DEFAULT_SOURCE is defined, the default is 602 // to have _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to 603 // 200809L, as well as enabling miscellaneous functions from BSD and 604 // SVID. If more than one of these are defined, they accumulate. For 605 // example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE together 606 // give you ISO C, 1003.1, and 1003.2, but nothing else. 607 // 608 // These are defined by this file and are used by the 609 // header files to decide what to declare or define: 610 // 611 // __GLIBC_USE (F) Define things from feature set F. This is defined 612 // to 1 or 0; the subsequent macros are either defined 613 // or undefined, and those tests should be moved to 614 // __GLIBC_USE. 615 // __USE_ISOC11 Define ISO C11 things. 616 // __USE_ISOC99 Define ISO C99 things. 617 // __USE_ISOC95 Define ISO C90 AMD1 (C95) things. 618 // __USE_ISOCXX11 Define ISO C++11 things. 619 // __USE_POSIX Define IEEE Std 1003.1 things. 620 // __USE_POSIX2 Define IEEE Std 1003.2 things. 621 // __USE_POSIX199309 Define IEEE Std 1003.1, and .1b things. 622 // __USE_POSIX199506 Define IEEE Std 1003.1, .1b, .1c and .1i things. 623 // __USE_XOPEN Define XPG things. 624 // __USE_XOPEN_EXTENDED Define X/Open Unix things. 625 // __USE_UNIX98 Define Single Unix V2 things. 626 // __USE_XOPEN2K Define XPG6 things. 627 // __USE_XOPEN2KXSI Define XPG6 XSI things. 628 // __USE_XOPEN2K8 Define XPG7 things. 629 // __USE_XOPEN2K8XSI Define XPG7 XSI things. 630 // __USE_LARGEFILE Define correct standard I/O things. 631 // __USE_LARGEFILE64 Define LFS things with separate names. 632 // __USE_FILE_OFFSET64 Define 64bit interface as default. 633 // __USE_MISC Define things from 4.3BSD or System V Unix. 634 // __USE_ATFILE Define *at interfaces and AT_* constants for them. 635 // __USE_DYNAMIC_STACK_SIZE Define correct (but non compile-time constant) 636 // MINSIGSTKSZ, SIGSTKSZ and PTHREAD_STACK_MIN. 637 // __USE_GNU Define GNU extensions. 638 // __USE_FORTIFY_LEVEL Additional security measures used, according to level. 639 // 640 // The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are 641 // defined by this file unconditionally. `__GNU_LIBRARY__' is provided 642 // only for compatibility. All new code should use the other symbols 643 // to test for features. 644 // 645 // All macros listed above as possibly being defined by this file are 646 // explicitly undefined if they are not explicitly defined. 647 // Feature-test macros that are not defined by the user or compiler 648 // but are implied by the other feature-test macros defined (or by the 649 // lack of any definitions) are defined by the file. 650 // 651 // ISO C feature test macros depend on the definition of the macro 652 // when an affected header is included, not when the first system 653 // header is included, and so they are handled in 654 // <bits/libc-header-start.h>, which does not have a multiple include 655 // guard. Feature test macros that can be handled from the first 656 // system header included are handled here. 657 658 // Undefine everything, so we get a clean slate. 659 660 // Suppress kernel-name space pollution unless user expressedly asks 661 // for it. 662 663 // Convenience macro to test the version of gcc. 664 // Use like this: 665 // #if __GNUC_PREREQ (2,8) 666 // ... code requiring gcc 2.8 or later ... 667 // #endif 668 // Note: only works for GCC 2.0 and later, because __GNUC_MINOR__ was 669 // added in 2.0. 670 671 // Similarly for clang. Features added to GCC after version 4.2 may 672 // or may not also be available in clang, and clang's definitions of 673 // __GNUC(_MINOR)__ are fixed at 4 and 2 respectively. Not all such 674 // features can be queried via __has_extension/__has_feature. 675 676 // Whether to use feature set F. 677 678 // _BSD_SOURCE and _SVID_SOURCE are deprecated aliases for 679 // _DEFAULT_SOURCE. If _DEFAULT_SOURCE is present we do not 680 // issue a warning; the expectation is that the source is being 681 // transitioned to use the new macro. 682 683 // If _GNU_SOURCE was defined by the user, turn on all the other features. 684 685 // If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined, 686 // define _DEFAULT_SOURCE. 687 688 // This is to enable the ISO C2X extension. 689 690 // This is to enable the ISO C11 extension. 691 692 // This is to enable the ISO C99 extension. 693 694 // This is to enable the ISO C90 Amendment 1:1995 extension. 695 696 // If none of the ANSI/POSIX macros are defined, or if _DEFAULT_SOURCE 697 // is defined, use POSIX.1-2008 (or another version depending on 698 // _XOPEN_SOURCE). 699 700 // Some C libraries once required _REENTRANT and/or _THREAD_SAFE to be 701 // defined in all multithreaded code. GNU libc has not required this 702 // for many years. We now treat them as compatibility synonyms for 703 // _POSIX_C_SOURCE=199506L, which is the earliest level of POSIX with 704 // comprehensive support for multithreaded code. Using them never 705 // lowers the selected level of POSIX conformance, only raises it. 706 707 // Features part to handle 64-bit time_t support. 708 // Copyright (C) 2021 Free Software Foundation, Inc. 709 // This file is part of the GNU C Library. 710 // 711 // The GNU C Library is free software; you can redistribute it and/or 712 // modify it under the terms of the GNU Lesser General Public 713 // License as published by the Free Software Foundation; either 714 // version 2.1 of the License, or (at your option) any later version. 715 // 716 // The GNU C Library is distributed in the hope that it will be useful, 717 // but WITHOUT ANY WARRANTY; without even the implied warranty of 718 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 719 // Lesser General Public License for more details. 720 // 721 // You should have received a copy of the GNU Lesser General Public 722 // License along with the GNU C Library; if not, see 723 // <https://www.gnu.org/licenses/>. 724 725 // We need to know the word size in order to check the time size. 726 // Determine the wordsize from the preprocessor defines. RISC-V version. 727 // Copyright (C) 2002-2021 Free Software Foundation, Inc. 728 // This file is part of the GNU C Library. 729 // 730 // The GNU C Library is free software; you can redistribute it and/or 731 // modify it under the terms of the GNU Lesser General Public 732 // License as published by the Free Software Foundation; either 733 // version 2.1 of the License, or (at your option) any later version. 734 // 735 // The GNU C Library is distributed in the hope that it will be useful, 736 // but WITHOUT ANY WARRANTY; without even the implied warranty of 737 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 738 // Lesser General Public License for more details. 739 // 740 // You should have received a copy of the GNU Lesser General Public 741 // License along with the GNU C Library. If not, see 742 // <https://www.gnu.org/licenses/>. 743 744 // Bit size of the time_t type at glibc build time, RISC-V case. 745 // Copyright (C) 2020-2021 Free Software Foundation, Inc. 746 // This file is part of the GNU C Library. 747 // 748 // The GNU C Library is free software; you can redistribute it and/or 749 // modify it under the terms of the GNU Lesser General Public 750 // License as published by the Free Software Foundation; either 751 // version 2.1 of the License, or (at your option) any later version. 752 // 753 // The GNU C Library is distributed in the hope that it will be useful, 754 // but WITHOUT ANY WARRANTY; without even the implied warranty of 755 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 756 // Lesser General Public License for more details. 757 // 758 // You should have received a copy of the GNU Lesser General Public 759 // License along with the GNU C Library; if not, see 760 // <https://www.gnu.org/licenses/>. 761 762 // Determine the wordsize from the preprocessor defines. RISC-V version. 763 // Copyright (C) 2002-2021 Free Software Foundation, Inc. 764 // This file is part of the GNU C Library. 765 // 766 // The GNU C Library is free software; you can redistribute it and/or 767 // modify it under the terms of the GNU Lesser General Public 768 // License as published by the Free Software Foundation; either 769 // version 2.1 of the License, or (at your option) any later version. 770 // 771 // The GNU C Library is distributed in the hope that it will be useful, 772 // but WITHOUT ANY WARRANTY; without even the implied warranty of 773 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 774 // Lesser General Public License for more details. 775 // 776 // You should have received a copy of the GNU Lesser General Public 777 // License along with the GNU C Library. If not, see 778 // <https://www.gnu.org/licenses/>. 779 780 // RV32 and RV64 both use 64-bit time_t 781 782 // The function 'gets' existed in C89, but is impossible to use 783 // safely. It has been removed from ISO C11 and ISO C++14. Note: for 784 // compatibility with various implementations of <cstdio>, this test 785 // must consider only the value of __cplusplus when compiling C++. 786 787 // GNU formerly extended the scanf functions with modified format 788 // specifiers %as, %aS, and %a[...] that allocate a buffer for the 789 // input using malloc. This extension conflicts with ISO C99, which 790 // defines %a as a standalone format specifier that reads a floating- 791 // point number; moreover, POSIX.1-2008 provides the same feature 792 // using the modifier letter 'm' instead (%ms, %mS, %m[...]). 793 // 794 // We now follow C99 unless GNU extensions are active and the compiler 795 // is specifically in C89 or C++98 mode (strict or not). For 796 // instance, with GCC, -std=gnu11 will have C99-compliant scanf with 797 // or without -D_GNU_SOURCE, but -std=c89 -D_GNU_SOURCE will have the 798 // old extension. 799 800 // Get definitions of __STDC_* predefined macros, if the compiler has 801 // not preincluded this header automatically. 802 // Copyright (C) 1991-2021 Free Software Foundation, Inc. 803 // This file is part of the GNU C Library. 804 // 805 // The GNU C Library is free software; you can redistribute it and/or 806 // modify it under the terms of the GNU Lesser General Public 807 // License as published by the Free Software Foundation; either 808 // version 2.1 of the License, or (at your option) any later version. 809 // 810 // The GNU C Library is distributed in the hope that it will be useful, 811 // but WITHOUT ANY WARRANTY; without even the implied warranty of 812 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 813 // Lesser General Public License for more details. 814 // 815 // You should have received a copy of the GNU Lesser General Public 816 // License along with the GNU C Library; if not, see 817 // <https://www.gnu.org/licenses/>. 818 819 // This macro indicates that the installed library is the GNU C Library. 820 // For historic reasons the value now is 6 and this will stay from now 821 // on. The use of this variable is deprecated. Use __GLIBC__ and 822 // __GLIBC_MINOR__ now (see below) when you want to test for a specific 823 // GNU C library version and use the values in <gnu/lib-names.h> to get 824 // the sonames of the shared libraries. 825 826 // Major and minor version number of the GNU C library package. Use 827 // these macros to test for features in specific releases. 828 829 // This is here only because every header file already includes this one. 830 // Copyright (C) 1992-2021 Free Software Foundation, Inc. 831 // This file is part of the GNU C Library. 832 // 833 // The GNU C Library is free software; you can redistribute it and/or 834 // modify it under the terms of the GNU Lesser General Public 835 // License as published by the Free Software Foundation; either 836 // version 2.1 of the License, or (at your option) any later version. 837 // 838 // The GNU C Library is distributed in the hope that it will be useful, 839 // but WITHOUT ANY WARRANTY; without even the implied warranty of 840 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 841 // Lesser General Public License for more details. 842 // 843 // You should have received a copy of the GNU Lesser General Public 844 // License along with the GNU C Library; if not, see 845 // <https://www.gnu.org/licenses/>. 846 847 // We are almost always included from features.h. 848 849 // The GNU libc does not support any K&R compilers or the traditional mode 850 // of ISO C compilers anymore. Check for some of the combinations not 851 // supported anymore. 852 853 // Some user header file might have defined this before. 854 855 // Compilers that lack __has_attribute may object to 856 // #if defined __has_attribute && __has_attribute (...) 857 // even though they do not need to evaluate the right-hand side of the &&. 858 // Similarly for __has_builtin, etc. 859 860 // All functions, except those with callbacks or those that 861 // synchronize memory, are leaf functions. 862 863 // GCC can always grok prototypes. For C++ programs we add throw() 864 // to help it optimize the function calls. But this only works with 865 // gcc 2.8.x and egcs. For gcc 3.4 and up we even mark C functions 866 // as non-throwing using a function attribute since programs can use 867 // the -fexceptions options for C code as well. 868 869 // These two macros are not used in glibc anymore. They are kept here 870 // only because some other projects expect the macros to be defined. 871 872 // For these things, GCC behaves the ANSI way normally, 873 // and the non-ANSI way under -traditional. 874 875 // This is not a typedef so `const __ptr_t' does the right thing. 876 877 // C++ needs to know that types and declarations are C, not C++. 878 879 // Fortify support. 880 881 // Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. 882 883 // Support for flexible arrays. 884 // Headers that should use flexible arrays only if they're "real" 885 // (e.g. only if they won't affect sizeof()) should test 886 // #if __glibc_c99_flexarr_available. 887 888 // __asm__ ("xyz") is used throughout the headers to rename functions 889 // at the assembly language level. This is wrapped by the __REDIRECT 890 // macro, in order to support compilers that can do this some other 891 // way. When compilers don't support asm-names at all, we have to do 892 // preprocessor tricks instead (which don't have exactly the right 893 // semantics, but it's the best we can do). 894 // 895 // Example: 896 // int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); 897 898 // 899 // #elif __SOME_OTHER_COMPILER__ 900 // 901 // # define __REDIRECT(name, proto, alias) name proto; _Pragma("let " #name " = " #alias) 902 903 // GCC and clang have various useful declarations that can be made with 904 // the '__attribute__' syntax. All of the ways we use this do fine if 905 // they are omitted for compilers that don't understand it. 906 907 // At some point during the gcc 2.96 development the `malloc' attribute 908 // for functions was introduced. We don't want to use it unconditionally 909 // (although this would be possible) since it generates warnings. 910 911 // Tell the compiler which arguments to an allocation function 912 // indicate the size of the allocation. 913 914 // At some point during the gcc 2.96 development the `pure' attribute 915 // for functions was introduced. We don't want to use it unconditionally 916 // (although this would be possible) since it generates warnings. 917 918 // This declaration tells the compiler that the value is constant. 919 920 // At some point during the gcc 3.1 development the `used' attribute 921 // for functions was introduced. We don't want to use it unconditionally 922 // (although this would be possible) since it generates warnings. 923 924 // Since version 3.2, gcc allows marking deprecated functions. 925 926 // Since version 4.5, gcc also allows one to specify the message printed 927 // when a deprecated function is used. clang claims to be gcc 4.2, but 928 // may also support this feature. 929 930 // At some point during the gcc 2.8 development the `format_arg' attribute 931 // for functions was introduced. We don't want to use it unconditionally 932 // (although this would be possible) since it generates warnings. 933 // If several `format_arg' attributes are given for the same function, in 934 // gcc-3.0 and older, all but the last one are ignored. In newer gccs, 935 // all designated arguments are considered. 936 937 // At some point during the gcc 2.97 development the `strfmon' format 938 // attribute for functions was introduced. We don't want to use it 939 // unconditionally (although this would be possible) since it 940 // generates warnings. 941 942 // The nonnull function attribute marks pointer parameters that 943 // must not be NULL. 944 945 // The returns_nonnull function attribute marks the return type of the function 946 // as always being non-null. 947 948 // If fortification mode, we warn about unused results of certain 949 // function calls which can lead to problems. 950 951 // Forces a function to be always inlined. 952 // The Linux kernel defines __always_inline in stddef.h (283d7573), and 953 // it conflicts with this definition. Therefore undefine it first to 954 // allow either header to be included first. 955 956 // Associate error messages with the source location of the call site rather 957 // than with the source location inside the function. 958 959 // GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 960 // inline semantics, unless -fgnu89-inline is used. Using __GNUC_STDC_INLINE__ 961 // or __GNUC_GNU_INLINE is not a good enough check for gcc because gcc versions 962 // older than 4.3 may define these macros and still not guarantee GNU inlining 963 // semantics. 964 // 965 // clang++ identifies itself as gcc-4.2, but has support for GNU inlining 966 // semantics, that can be checked for by using the __GNUC_STDC_INLINE_ and 967 // __GNUC_GNU_INLINE__ macro definitions. 968 969 // GCC 4.3 and above allow passing all anonymous arguments of an 970 // __extern_always_inline function to some other vararg function. 971 972 // It is possible to compile containing GCC extensions even if GCC is 973 // run in pedantic mode if the uses are carefully marked using the 974 // `__extension__' keyword. But this is not generally available before 975 // version 2.8. 976 977 // __restrict is known in EGCS 1.2 and above, and in clang. 978 // It works also in C++ mode (outside of arrays), but only when spelled 979 // as '__restrict', not 'restrict'. 980 981 // ISO C99 also allows to declare arrays as non-overlapping. The syntax is 982 // array_name[restrict] 983 // GCC 3.1 and clang support this. 984 // This syntax is not usable in C++ mode. 985 986 // Describes a char array whose address can safely be passed as the first 987 // argument to strncpy and strncat, as the char array is not necessarily 988 // a NUL-terminated string. 989 990 // Undefine (also defined in libc-symbols.h). 991 // Copies attributes from the declaration or type referenced by 992 // the argument. 993 994 // The #ifndef lets Gnulib avoid including these on non-glibc 995 // platforms, where the includes typically do not exist. 996 // Determine the wordsize from the preprocessor defines. RISC-V version. 997 // Copyright (C) 2002-2021 Free Software Foundation, Inc. 998 // This file is part of the GNU C Library. 999 // 1000 // The GNU C Library is free software; you can redistribute it and/or 1001 // modify it under the terms of the GNU Lesser General Public 1002 // License as published by the Free Software Foundation; either 1003 // version 2.1 of the License, or (at your option) any later version. 1004 // 1005 // The GNU C Library is distributed in the hope that it will be useful, 1006 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1007 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1008 // Lesser General Public License for more details. 1009 // 1010 // You should have received a copy of the GNU Lesser General Public 1011 // License along with the GNU C Library. If not, see 1012 // <https://www.gnu.org/licenses/>. 1013 1014 // Properties of long double type. ldbl-128 version. 1015 // Copyright (C) 2016-2021 Free Software Foundation, Inc. 1016 // This file is part of the GNU C Library. 1017 // 1018 // The GNU C Library is free software; you can redistribute it and/or 1019 // modify it under the terms of the GNU Lesser General Public 1020 // License published by the Free Software Foundation; either 1021 // version 2.1 of the License, or (at your option) any later version. 1022 // 1023 // The GNU C Library is distributed in the hope that it will be useful, 1024 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1025 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1026 // Lesser General Public License for more details. 1027 // 1028 // You should have received a copy of the GNU Lesser General Public 1029 // License along with the GNU C Library; if not, see 1030 // <https://www.gnu.org/licenses/>. 1031 1032 // long double is distinct from double, so there is nothing to 1033 // define here. 1034 1035 // __glibc_macro_warning (MESSAGE) issues warning MESSAGE. This is 1036 // intended for use in preprocessor macros. 1037 // 1038 // Note: MESSAGE must be a _single_ string; concatenation of string 1039 // literals is not supported. 1040 1041 // Generic selection (ISO C11) is a C-only feature, available in GCC 1042 // since version 4.9. Previous versions do not provide generic 1043 // selection, even though they might set __STDC_VERSION__ to 201112L, 1044 // when in -std=c11 mode. Thus, we must check for !defined __GNUC__ 1045 // when testing __STDC_VERSION__ for generic selection support. 1046 // On the other hand, Clang also defines __GNUC__, so a clang-specific 1047 // check is required to enable the use of generic selection. 1048 1049 // Designates a 1-based positional argument ref-index of pointer type 1050 // that can be used to access size-index elements of the pointed-to 1051 // array according to access mode, or at least one element when 1052 // size-index is not provided: 1053 // access (access-mode, <ref-index> [, <size-index>]) 1054 1055 // Designates dealloc as a function to call to deallocate objects 1056 // allocated by the declared function. 1057 1058 // Specify that a function such as setjmp or vfork may return 1059 // twice. 1060 1061 // If we don't have __REDIRECT, prototypes will be missing if 1062 // __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. 1063 1064 // Decide whether we can define 'extern inline' functions in headers. 1065 1066 // This is here only because every header file already includes this one. 1067 // Get the definitions of all the appropriate `__stub_FUNCTION' symbols. 1068 // <gnu/stubs.h> contains `#define __stub_FUNCTION' when FUNCTION is a stub 1069 // that will always return failure (and set errno to ENOSYS). 1070 // This file is automatically generated. 1071 // This file selects the right generated file of `__stub_FUNCTION' macros 1072 // based on the architecture being compiled for. 1073 1074 // Determine the wordsize from the preprocessor defines. RISC-V version. 1075 // Copyright (C) 2002-2021 Free Software Foundation, Inc. 1076 // This file is part of the GNU C Library. 1077 // 1078 // The GNU C Library is free software; you can redistribute it and/or 1079 // modify it under the terms of the GNU Lesser General Public 1080 // License as published by the Free Software Foundation; either 1081 // version 2.1 of the License, or (at your option) any later version. 1082 // 1083 // The GNU C Library is distributed in the hope that it will be useful, 1084 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1085 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1086 // Lesser General Public License for more details. 1087 // 1088 // You should have received a copy of the GNU Lesser General Public 1089 // License along with the GNU C Library. If not, see 1090 // <https://www.gnu.org/licenses/>. 1091 1092 // This file is automatically generated. 1093 // It defines a symbol `__stub_FUNCTION' for each function 1094 // in the C library which is a stub, meaning it will fail 1095 // every time called, usually setting errno to ENOSYS. 1096 1097 // ISO/IEC TR 24731-2:2010 defines the __STDC_WANT_LIB_EXT2__ 1098 // macro. 1099 1100 // ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__ 1101 // macro. Most but not all symbols enabled by that macro in TS 1102 // 18661-1 are enabled unconditionally in C2X. In C2X, the symbols in 1103 // Annex F still require a new feature test macro 1104 // __STDC_WANT_IEC_60559_EXT__ instead (C2X does not define 1105 // __STDC_WANT_IEC_60559_BFP_EXT__), while a few features from TS 1106 // 18661-1 are not included in C2X (and thus should depend on 1107 // __STDC_WANT_IEC_60559_BFP_EXT__ even when C2X features are 1108 // enabled). 1109 // 1110 // __GLIBC_USE (IEC_60559_BFP_EXT) controls those features from TS 1111 // 18661-1 not included in C2X. 1112 // 1113 // __GLIBC_USE (IEC_60559_BFP_EXT_C2X) controls those features from TS 1114 // 18661-1 that are also included in C2X (with no feature test macro 1115 // required in C2X). 1116 // 1117 // __GLIBC_USE (IEC_60559_EXT) controls those features from TS 18661-1 1118 // that are included in C2X but conditional on 1119 // __STDC_WANT_IEC_60559_EXT__. (There are currently no features 1120 // conditional on __STDC_WANT_IEC_60559_EXT__ that are not in TS 1121 // 18661-1.) 1122 1123 // ISO/IEC TS 18661-4:2015 defines the 1124 // __STDC_WANT_IEC_60559_FUNCS_EXT__ macro. Other than the reduction 1125 // functions, the symbols from this TS are enabled unconditionally in 1126 // C2X. 1127 1128 // ISO/IEC TS 18661-3:2015 defines the 1129 // __STDC_WANT_IEC_60559_TYPES_EXT__ macro. 1130 1131 // Maximum length of any multibyte character in any locale. 1132 // We define this value here since the gcc header does not define 1133 // the correct value. 1134 1135 // If we are not using GNU CC we have to define all the symbols ourself. 1136 // Otherwise use gcc's definitions (see below). 1137 1138 // Get the compiler's limits.h, which defines almost all the ISO constants. 1139 // 1140 // We put this #include_next outside the double inclusion check because 1141 // it should be possible to include this file more than once and still get 1142 // the definitions from gcc's header. 1143 1144 // The <limits.h> files in some gcc versions don't define LLONG_MIN, 1145 // LLONG_MAX, and ULLONG_MAX. Instead only the values gcc defined for 1146 // ages are available. 1147 1148 // The integer width macros are not defined by GCC's <limits.h> before 1149 // GCC 7, or if _GNU_SOURCE rather than 1150 // __STDC_WANT_IEC_60559_BFP_EXT__ is used to enable this feature. 1151 1152 // The macros for _Bool are not defined by GCC's <limits.h> before GCC 1153 // 11, or if _GNU_SOURCE is defined rather than enabling C2x support 1154 // with -std. 1155 1156 // POSIX adds things to <limits.h>. 1157 // Copyright (C) 1991-2021 Free Software Foundation, Inc. 1158 // This file is part of the GNU C Library. 1159 // 1160 // The GNU C Library is free software; you can redistribute it and/or 1161 // modify it under the terms of the GNU Lesser General Public 1162 // License as published by the Free Software Foundation; either 1163 // version 2.1 of the License, or (at your option) any later version. 1164 // 1165 // The GNU C Library is distributed in the hope that it will be useful, 1166 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1167 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1168 // Lesser General Public License for more details. 1169 // 1170 // You should have received a copy of the GNU Lesser General Public 1171 // License along with the GNU C Library; if not, see 1172 // <https://www.gnu.org/licenses/>. 1173 1174 // POSIX Standard: 2.9.2 Minimum Values Added to <limits.h> 1175 // 1176 // Never include this file directly; use <limits.h> instead. 1177 1178 // Determine the wordsize from the preprocessor defines. RISC-V version. 1179 // Copyright (C) 2002-2021 Free Software Foundation, Inc. 1180 // This file is part of the GNU C Library. 1181 // 1182 // The GNU C Library is free software; you can redistribute it and/or 1183 // modify it under the terms of the GNU Lesser General Public 1184 // License as published by the Free Software Foundation; either 1185 // version 2.1 of the License, or (at your option) any later version. 1186 // 1187 // The GNU C Library is distributed in the hope that it will be useful, 1188 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1189 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1190 // Lesser General Public License for more details. 1191 // 1192 // You should have received a copy of the GNU Lesser General Public 1193 // License along with the GNU C Library. If not, see 1194 // <https://www.gnu.org/licenses/>. 1195 1196 // These are the standard-mandated minimum values. 1197 1198 // Minimum number of operations in one list I/O call. 1199 1200 // Minimal number of outstanding asynchronous I/O operations. 1201 1202 // Maximum length of arguments to `execve', including environment. 1203 1204 // Maximum simultaneous processes per real user ID. 1205 1206 // Minimal number of timer expiration overruns. 1207 1208 // Maximum length of a host name (not including the terminating null) 1209 // as returned from the GETHOSTNAME function. 1210 1211 // Maximum link count of a file. 1212 1213 // Maximum length of login name. 1214 1215 // Number of bytes in a terminal canonical input queue. 1216 1217 // Number of bytes for which space will be 1218 // available in a terminal input queue. 1219 1220 // Maximum number of message queues open for a process. 1221 1222 // Maximum number of supported message priorities. 1223 1224 // Number of bytes in a filename. 1225 1226 // Number of simultaneous supplementary group IDs per process. 1227 1228 // Number of files one process can have open at once. 1229 1230 // Number of bytes in a pathname. 1231 1232 // Number of bytes than can be written atomically to a pipe. 1233 1234 // The number of repeated occurrences of a BRE permitted by the 1235 // REGEXEC and REGCOMP functions when using the interval notation. 1236 1237 // Minimal number of realtime signals reserved for the application. 1238 1239 // Number of semaphores a process can have. 1240 1241 // Maximal value of a semaphore. 1242 1243 // Number of pending realtime signals. 1244 1245 // Largest value of a `ssize_t'. 1246 1247 // Number of streams a process can have open at once. 1248 1249 // The number of bytes in a symbolic link. 1250 1251 // The number of symbolic links that can be traversed in the 1252 // resolution of a pathname in the absence of a loop. 1253 1254 // Number of timer for a process. 1255 1256 // Maximum number of characters in a tty name. 1257 1258 // Maximum length of a timezone name (element of `tzname'). 1259 1260 // Maximum clock resolution in nanoseconds. 1261 1262 // Get the implementation-specific values for the above. 1263 // Minimum guaranteed maximum values for system limits. Linux version. 1264 // Copyright (C) 1993-2021 Free Software Foundation, Inc. 1265 // This file is part of the GNU C Library. 1266 // 1267 // The GNU C Library is free software; you can redistribute it and/or 1268 // modify it under the terms of the GNU Lesser General Public License as 1269 // published by the Free Software Foundation; either version 2.1 of the 1270 // License, or (at your option) any later version. 1271 // 1272 // The GNU C Library is distributed in the hope that it will be useful, 1273 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1274 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1275 // Lesser General Public License for more details. 1276 // 1277 // You should have received a copy of the GNU Lesser General Public 1278 // License along with the GNU C Library; see the file COPYING.LIB. If 1279 // not, see <https://www.gnu.org/licenses/>. 1280 1281 // The kernel header pollutes the namespace with the NR_OPEN symbol 1282 // and defines LINK_MAX although filesystems have different maxima. A 1283 // similar thing is true for OPEN_MAX: the limit can be changed at 1284 // runtime and therefore the macro must not be defined. Remove this 1285 // after including the header if necessary. 1286 1287 // The kernel sources contain a file with all the needed information. 1288 // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note 1289 1290 // Have to remove NR_OPEN? 1291 // Have to remove LINK_MAX? 1292 // Have to remove OPEN_MAX? 1293 // Have to remove ARG_MAX? 1294 1295 // The number of data keys per process. 1296 // This is the value this implementation supports. 1297 1298 // Controlling the iterations of destructors for thread-specific data. 1299 // Number of iterations this implementation does. 1300 1301 // The number of threads per process. 1302 // We have no predefined limit on the number of threads. 1303 1304 // Maximum amount by which a process can descrease its asynchronous I/O 1305 // priority level. 1306 1307 // Arrange for the definition of PTHREAD_STACK_MIN. 1308 // Definition of PTHREAD_STACK_MIN, possibly dynamic. 1309 // Copyright (C) 2021 Free Software Foundation, Inc. 1310 // This file is part of the GNU C Library. 1311 // 1312 // The GNU C Library is free software; you can redistribute it and/or 1313 // modify it under the terms of the GNU Lesser General Public 1314 // License as published by the Free Software Foundation; either 1315 // version 2.1 of the License, or (at your option) any later version. 1316 // 1317 // The GNU C Library is distributed in the hope that it will be useful, 1318 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1319 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1320 // Lesser General Public License for more details. 1321 // 1322 // You should have received a copy of the GNU Lesser General Public 1323 // License along with the GNU C Library; if not, see 1324 // <https://www.gnu.org/licenses/>. 1325 1326 // Definition of PTHREAD_STACK_MIN. Linux version. 1327 // Copyright (C) 2021 Free Software Foundation, Inc. 1328 // This file is part of the GNU C Library. 1329 // 1330 // The GNU C Library is free software; you can redistribute it and/or 1331 // modify it under the terms of the GNU Lesser General Public 1332 // License as published by the Free Software Foundation; either 1333 // version 2.1 of the License, or (at your option) any later version. 1334 // 1335 // The GNU C Library is distributed in the hope that it will be useful, 1336 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1337 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1338 // Lesser General Public License for more details. 1339 // 1340 // You should have received a copy of the GNU Lesser General Public 1341 // License along with the GNU C Library; if not, see 1342 // <https://www.gnu.org/licenses/>. 1343 1344 // Minimum size for a thread. We are free to choose a reasonable value. 1345 1346 // Maximum number of timer expiration overruns. 1347 1348 // Maximum tty name length. 1349 1350 // Maximum login name length. This is arbitrary. 1351 1352 // Maximum host name length. 1353 1354 // Maximum message queue priority level. 1355 1356 // Maximum value the semaphore can have. 1357 1358 // ssize_t is not formally required to be the signed type 1359 // corresponding to size_t, but it is for all configurations supported 1360 // by glibc. 1361 1362 // This value is a guaranteed minimum maximum. 1363 // The current maximum can be got from `sysconf'. 1364 1365 // Copyright (C) 1991-2021 Free Software Foundation, Inc. 1366 // This file is part of the GNU C Library. 1367 // 1368 // The GNU C Library is free software; you can redistribute it and/or 1369 // modify it under the terms of the GNU Lesser General Public 1370 // License as published by the Free Software Foundation; either 1371 // version 2.1 of the License, or (at your option) any later version. 1372 // 1373 // The GNU C Library is distributed in the hope that it will be useful, 1374 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1375 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1376 // Lesser General Public License for more details. 1377 // 1378 // You should have received a copy of the GNU Lesser General Public 1379 // License along with the GNU C Library; if not, see 1380 // <https://www.gnu.org/licenses/>. 1381 1382 // Never include this file directly; include <limits.h> instead. 1383 1384 // The maximum `ibase' and `obase' values allowed by the `bc' utility. 1385 1386 // The maximum number of elements allowed in an array by the `bc' utility. 1387 1388 // The maximum `scale' value allowed by the `bc' utility. 1389 1390 // The maximum length of a string constant accepted by the `bc' utility. 1391 1392 // The maximum number of weights that can be assigned to an entry of 1393 // the LC_COLLATE `order' keyword in the locale definition file. 1394 1395 // The maximum number of expressions that can be nested 1396 // within parentheses by the `expr' utility. 1397 1398 // The maximum length, in bytes, of an input line. 1399 1400 // The maximum number of repeated occurrences of a regular expression 1401 // permitted when using the interval notation `\{M,N\}'. 1402 1403 // The maximum number of bytes in a character class name. We have no 1404 // fixed limit, 2048 is a high number. 1405 1406 // These values are implementation-specific, 1407 // and may vary within the implementation. 1408 // Their precise values can be obtained from sysconf. 1409 1410 // This value is defined like this in regex.h. 1411 1412 // Copyright (C) 1991-2021 Free Software Foundation, Inc. 1413 // 1414 // This file is part of GCC. 1415 // 1416 // GCC is free software; you can redistribute it and/or modify it under 1417 // the terms of the GNU General Public License as published by the Free 1418 // Software Foundation; either version 3, or (at your option) any later 1419 // version. 1420 // 1421 // GCC is distributed in the hope that it will be useful, but WITHOUT ANY 1422 // WARRANTY; without even the implied warranty of MERCHANTABILITY or 1423 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1424 // for more details. 1425 // 1426 // Under Section 7 of GPL version 3, you are granted additional 1427 // permissions described in the GCC Runtime Library Exception, version 1428 // 3.1, as published by the Free Software Foundation. 1429 // 1430 // You should have received a copy of the GNU General Public License and 1431 // a copy of the GCC Runtime Library Exception along with this program; 1432 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 1433 // <http://www.gnu.org/licenses/>. 1434 1435 // Number of bits in a `char'. 1436 1437 // Maximum length of a multibyte character. 1438 1439 // Minimum and maximum values a `signed char' can hold. 1440 1441 // Maximum value an `unsigned char' can hold. (Minimum is 0). 1442 1443 // Minimum and maximum values a `char' can hold. 1444 1445 // Minimum and maximum values a `signed short int' can hold. 1446 1447 // Maximum value an `unsigned short int' can hold. (Minimum is 0). 1448 1449 // Minimum and maximum values a `signed int' can hold. 1450 1451 // Maximum value an `unsigned int' can hold. (Minimum is 0). 1452 1453 // Minimum and maximum values a `signed long int' can hold. 1454 // (Same as `int'). 1455 1456 // Maximum value an `unsigned long int' can hold. (Minimum is 0). 1457 1458 // Minimum and maximum values a `signed long long int' can hold. 1459 1460 // Maximum value an `unsigned long long int' can hold. (Minimum is 0). 1461 1462 // This administrivia gets added to the end of limits.h 1463 // if the system has its own version of limits.h. 1464 1465 type z_crc_t = uint32 /* zconf.h:429:17 */ 1466 1467 // Seconds since the Epoch, visible to user code when time_t is too 1468 // narrow only for consistency with the old way of widening too-narrow 1469 // types. User code should never use __time64_t. 1470 1471 type u_char = uint8 /* types.h:33:18 */ 1472 type u_short = uint16 /* types.h:34:19 */ 1473 type u_int = uint32 /* types.h:35:17 */ 1474 type u_long = uint64 /* types.h:36:18 */ 1475 type quad_t = int64 /* types.h:37:18 */ 1476 type u_quad_t = uint64 /* types.h:38:20 */ 1477 type fsid_t = struct{ __val [2]int32 } /* types.h:39:18 */ 1478 type loff_t = int64 /* types.h:42:18 */ 1479 1480 type ino_t = uint64 /* types.h:49:19 */ 1481 type ino64_t = uint64 /* types.h:54:19 */ 1482 1483 type dev_t = uint64 /* types.h:59:17 */ 1484 1485 type gid_t = uint32 /* types.h:64:17 */ 1486 1487 type mode_t = uint32 /* types.h:69:18 */ 1488 1489 type nlink_t = uint32 /* types.h:74:19 */ 1490 1491 type uid_t = uint32 /* types.h:79:17 */ 1492 1493 type off_t = int64 /* types.h:87:19 */ 1494 type off64_t = int64 /* types.h:92:19 */ 1495 1496 type pid_t = int32 /* types.h:97:17 */ 1497 1498 type id_t = uint32 /* types.h:103:16 */ 1499 1500 type ssize_t = int64 /* types.h:108:19 */ 1501 1502 type daddr_t = int32 /* types.h:114:19 */ 1503 type caddr_t = uintptr /* types.h:115:19 */ 1504 1505 type key_t = int32 /* types.h:121:17 */ 1506 1507 // bits/types.h -- definitions of __*_t types underlying *_t types. 1508 // Copyright (C) 2002-2021 Free Software Foundation, Inc. 1509 // This file is part of the GNU C Library. 1510 // 1511 // The GNU C Library is free software; you can redistribute it and/or 1512 // modify it under the terms of the GNU Lesser General Public 1513 // License as published by the Free Software Foundation; either 1514 // version 2.1 of the License, or (at your option) any later version. 1515 // 1516 // The GNU C Library is distributed in the hope that it will be useful, 1517 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1518 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1519 // Lesser General Public License for more details. 1520 // 1521 // You should have received a copy of the GNU Lesser General Public 1522 // License along with the GNU C Library; if not, see 1523 // <https://www.gnu.org/licenses/>. 1524 1525 // Never include this file directly; use <sys/types.h> instead. 1526 1527 // Returned by `clock'. 1528 type clock_t = int64 /* clock_t.h:7:19 */ 1529 1530 // bits/types.h -- definitions of __*_t types underlying *_t types. 1531 // Copyright (C) 2002-2021 Free Software Foundation, Inc. 1532 // This file is part of the GNU C Library. 1533 // 1534 // The GNU C Library is free software; you can redistribute it and/or 1535 // modify it under the terms of the GNU Lesser General Public 1536 // License as published by the Free Software Foundation; either 1537 // version 2.1 of the License, or (at your option) any later version. 1538 // 1539 // The GNU C Library is distributed in the hope that it will be useful, 1540 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1541 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1542 // Lesser General Public License for more details. 1543 // 1544 // You should have received a copy of the GNU Lesser General Public 1545 // License along with the GNU C Library; if not, see 1546 // <https://www.gnu.org/licenses/>. 1547 1548 // Never include this file directly; use <sys/types.h> instead. 1549 1550 // Clock ID used in clock and timer functions. 1551 type clockid_t = int32 /* clockid_t.h:7:21 */ 1552 1553 // bits/types.h -- definitions of __*_t types underlying *_t types. 1554 // Copyright (C) 2002-2021 Free Software Foundation, Inc. 1555 // This file is part of the GNU C Library. 1556 // 1557 // The GNU C Library is free software; you can redistribute it and/or 1558 // modify it under the terms of the GNU Lesser General Public 1559 // License as published by the Free Software Foundation; either 1560 // version 2.1 of the License, or (at your option) any later version. 1561 // 1562 // The GNU C Library is distributed in the hope that it will be useful, 1563 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1564 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1565 // Lesser General Public License for more details. 1566 // 1567 // You should have received a copy of the GNU Lesser General Public 1568 // License along with the GNU C Library; if not, see 1569 // <https://www.gnu.org/licenses/>. 1570 1571 // Never include this file directly; use <sys/types.h> instead. 1572 1573 // Returned by `time'. 1574 type time_t = int64 /* time_t.h:10:18 */ 1575 1576 // bits/types.h -- definitions of __*_t types underlying *_t types. 1577 // Copyright (C) 2002-2021 Free Software Foundation, Inc. 1578 // This file is part of the GNU C Library. 1579 // 1580 // The GNU C Library is free software; you can redistribute it and/or 1581 // modify it under the terms of the GNU Lesser General Public 1582 // License as published by the Free Software Foundation; either 1583 // version 2.1 of the License, or (at your option) any later version. 1584 // 1585 // The GNU C Library is distributed in the hope that it will be useful, 1586 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1587 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1588 // Lesser General Public License for more details. 1589 // 1590 // You should have received a copy of the GNU Lesser General Public 1591 // License along with the GNU C Library; if not, see 1592 // <https://www.gnu.org/licenses/>. 1593 1594 // Never include this file directly; use <sys/types.h> instead. 1595 1596 // Timer ID returned by `timer_create'. 1597 type timer_t = uintptr /* timer_t.h:7:19 */ 1598 1599 // Copyright (C) 1989-2021 Free Software Foundation, Inc. 1600 // 1601 // This file is part of GCC. 1602 // 1603 // GCC is free software; you can redistribute it and/or modify 1604 // it under the terms of the GNU General Public License as published by 1605 // the Free Software Foundation; either version 3, or (at your option) 1606 // any later version. 1607 // 1608 // GCC is distributed in the hope that it will be useful, 1609 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1610 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1611 // GNU General Public License for more details. 1612 // 1613 // Under Section 7 of GPL version 3, you are granted additional 1614 // permissions described in the GCC Runtime Library Exception, version 1615 // 3.1, as published by the Free Software Foundation. 1616 // 1617 // You should have received a copy of the GNU General Public License and 1618 // a copy of the GCC Runtime Library Exception along with this program; 1619 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 1620 // <http://www.gnu.org/licenses/>. 1621 1622 // ISO C Standard: 7.17 Common definitions <stddef.h> 1623 1624 // Any one of these symbols __need_* means that GNU libc 1625 // wants us just to define one data type. So don't define 1626 // the symbols that indicate this file's entire job has been done. 1627 1628 // This avoids lossage on SunOS but only if stdtypes.h comes first. 1629 // There's no way to win with the other order! Sun lossage. 1630 1631 // Sequent's header files use _PTRDIFF_T_ in some conflicting way. 1632 // Just ignore it. 1633 1634 // On VxWorks, <type/vxTypesBase.h> may have defined macros like 1635 // _TYPE_size_t which will typedef size_t. fixincludes patched the 1636 // vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is 1637 // not defined, and so that defining this macro defines _GCC_SIZE_T. 1638 // If we find that the macros are still defined at this point, we must 1639 // invoke them so that the type is defined as expected. 1640 1641 // In case nobody has defined these types, but we aren't running under 1642 // GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and 1643 // __WCHAR_TYPE__ have reasonable values. This can happen if the 1644 // parts of GCC is compiled by an older compiler, that actually 1645 // include gstddef.h, such as collect2. 1646 1647 // Signed type of difference of two pointers. 1648 1649 // Define this type if we are doing the whole job, 1650 // or if we want this type in particular. 1651 1652 // If this symbol has done its job, get rid of it. 1653 1654 // Unsigned type of `sizeof' something. 1655 1656 // Define this type if we are doing the whole job, 1657 // or if we want this type in particular. 1658 1659 // Wide character type. 1660 // Locale-writers should change this as necessary to 1661 // be big enough to hold unique values not between 0 and 127, 1662 // and not (wchar_t) -1, for each defined multibyte character. 1663 1664 // Define this type if we are doing the whole job, 1665 // or if we want this type in particular. 1666 1667 // A null pointer constant. 1668 1669 // Offset of member MEMBER in a struct of type TYPE. 1670 1671 // Old compatibility names for C types. 1672 type ulong = uint64 /* types.h:148:27 */ 1673 type ushort = uint16 /* types.h:149:28 */ 1674 type uint = uint32 /* types.h:150:22 */ 1675 1676 // These size-specific names are used by some of the inet code. 1677 1678 // Define intN_t types. 1679 // Copyright (C) 2017-2021 Free Software Foundation, Inc. 1680 // This file is part of the GNU C Library. 1681 // 1682 // The GNU C Library is free software; you can redistribute it and/or 1683 // modify it under the terms of the GNU Lesser General Public 1684 // License as published by the Free Software Foundation; either 1685 // version 2.1 of the License, or (at your option) any later version. 1686 // 1687 // The GNU C Library is distributed in the hope that it will be useful, 1688 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1689 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1690 // Lesser General Public License for more details. 1691 // 1692 // You should have received a copy of the GNU Lesser General Public 1693 // License along with the GNU C Library; if not, see 1694 // <https://www.gnu.org/licenses/>. 1695 1696 // bits/types.h -- definitions of __*_t types underlying *_t types. 1697 // Copyright (C) 2002-2021 Free Software Foundation, Inc. 1698 // This file is part of the GNU C Library. 1699 // 1700 // The GNU C Library is free software; you can redistribute it and/or 1701 // modify it under the terms of the GNU Lesser General Public 1702 // License as published by the Free Software Foundation; either 1703 // version 2.1 of the License, or (at your option) any later version. 1704 // 1705 // The GNU C Library is distributed in the hope that it will be useful, 1706 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1707 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1708 // Lesser General Public License for more details. 1709 // 1710 // You should have received a copy of the GNU Lesser General Public 1711 // License along with the GNU C Library; if not, see 1712 // <https://www.gnu.org/licenses/>. 1713 1714 // Never include this file directly; use <sys/types.h> instead. 1715 1716 type int8_t = int8 /* stdint-intn.h:24:18 */ 1717 type int16_t = int16 /* stdint-intn.h:25:19 */ 1718 type int32_t = int32 /* stdint-intn.h:26:19 */ 1719 type int64_t = int64 /* stdint-intn.h:27:19 */ 1720 1721 // These were defined by ISO C without the first `_'. 1722 type u_int8_t = uint8 /* types.h:158:19 */ 1723 type u_int16_t = uint16 /* types.h:159:20 */ 1724 type u_int32_t = uint32 /* types.h:160:20 */ 1725 type u_int64_t = uint64 /* types.h:161:20 */ 1726 1727 type register_t = int32 /* types.h:164:13 */ 1728 1729 // A set of signals to be blocked, unblocked, or waited for. 1730 type sigset_t = struct{ __val [16]uint64 } /* sigset_t.h:7:20 */ 1731 1732 // Get definition of timer specification structures. 1733 1734 // bits/types.h -- definitions of __*_t types underlying *_t types. 1735 // Copyright (C) 2002-2021 Free Software Foundation, Inc. 1736 // This file is part of the GNU C Library. 1737 // 1738 // The GNU C Library is free software; you can redistribute it and/or 1739 // modify it under the terms of the GNU Lesser General Public 1740 // License as published by the Free Software Foundation; either 1741 // version 2.1 of the License, or (at your option) any later version. 1742 // 1743 // The GNU C Library is distributed in the hope that it will be useful, 1744 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1745 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1746 // Lesser General Public License for more details. 1747 // 1748 // You should have received a copy of the GNU Lesser General Public 1749 // License along with the GNU C Library; if not, see 1750 // <https://www.gnu.org/licenses/>. 1751 1752 // Never include this file directly; use <sys/types.h> instead. 1753 1754 // A time value that is accurate to the nearest 1755 // microsecond but also has a range of years. 1756 type timeval = struct { 1757 tv_sec int64 1758 tv_usec int64 1759 } /* struct_timeval.h:8:1 */ 1760 1761 // NB: Include guard matches what <linux/time.h> uses. 1762 1763 // bits/types.h -- definitions of __*_t types underlying *_t types. 1764 // Copyright (C) 2002-2021 Free Software Foundation, Inc. 1765 // This file is part of the GNU C Library. 1766 // 1767 // The GNU C Library is free software; you can redistribute it and/or 1768 // modify it under the terms of the GNU Lesser General Public 1769 // License as published by the Free Software Foundation; either 1770 // version 2.1 of the License, or (at your option) any later version. 1771 // 1772 // The GNU C Library is distributed in the hope that it will be useful, 1773 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1774 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1775 // Lesser General Public License for more details. 1776 // 1777 // You should have received a copy of the GNU Lesser General Public 1778 // License along with the GNU C Library; if not, see 1779 // <https://www.gnu.org/licenses/>. 1780 1781 // Never include this file directly; use <sys/types.h> instead. 1782 1783 // Endian macros for string.h functions 1784 // Copyright (C) 1992-2021 Free Software Foundation, Inc. 1785 // This file is part of the GNU C Library. 1786 // 1787 // The GNU C Library is free software; you can redistribute it and/or 1788 // modify it under the terms of the GNU Lesser General Public 1789 // License as published by the Free Software Foundation; either 1790 // version 2.1 of the License, or (at your option) any later version. 1791 // 1792 // The GNU C Library is distributed in the hope that it will be useful, 1793 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1794 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1795 // Lesser General Public License for more details. 1796 // 1797 // You should have received a copy of the GNU Lesser General Public 1798 // License along with the GNU C Library; if not, see 1799 // <http://www.gnu.org/licenses/>. 1800 1801 // POSIX.1b structure for a time value. This is like a `struct timeval' but 1802 // has nanoseconds instead of microseconds. 1803 type timespec = struct { 1804 tv_sec int64 1805 tv_nsec int64 1806 } /* struct_timespec.h:11:1 */ 1807 1808 type suseconds_t = int64 /* select.h:43:23 */ 1809 1810 // Some versions of <linux/posix_types.h> define this macros. 1811 // It's easier to assume 8-bit bytes than to get CHAR_BIT. 1812 1813 // fd_set for select and pselect. 1814 type fd_set = struct{ __fds_bits [16]int64 } /* select.h:70:5 */ 1815 1816 // Maximum number of file descriptors in `fd_set'. 1817 1818 // Sometimes the fd_set member is assumed to have this type. 1819 type fd_mask = int64 /* select.h:77:19 */ 1820 1821 // Define some inlines helping to catch common problems. 1822 1823 type blksize_t = int32 /* types.h:185:21 */ 1824 1825 // Types from the Large File Support interface. 1826 type blkcnt_t = int64 /* types.h:205:22 */ // Type to count number of disk blocks. 1827 type fsblkcnt_t = uint64 /* types.h:209:24 */ // Type to count file system blocks. 1828 type fsfilcnt_t = uint64 /* types.h:213:24 */ // Type to count file system inodes. 1829 1830 type blkcnt64_t = int64 /* types.h:219:22 */ // Type to count number of disk blocks. 1831 type fsblkcnt64_t = uint64 /* types.h:220:24 */ // Type to count file system blocks. 1832 type fsfilcnt64_t = uint64 /* types.h:221:24 */ // Type to count file system inodes. 1833 1834 // Now add the thread types. 1835 // Declaration of common pthread types for all architectures. 1836 // Copyright (C) 2017-2021 Free Software Foundation, Inc. 1837 // This file is part of the GNU C Library. 1838 // 1839 // The GNU C Library is free software; you can redistribute it and/or 1840 // modify it under the terms of the GNU Lesser General Public 1841 // License as published by the Free Software Foundation; either 1842 // version 2.1 of the License, or (at your option) any later version. 1843 // 1844 // The GNU C Library is distributed in the hope that it will be useful, 1845 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1846 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1847 // Lesser General Public License for more details. 1848 // 1849 // You should have received a copy of the GNU Lesser General Public 1850 // License along with the GNU C Library; if not, see 1851 // <https://www.gnu.org/licenses/>. 1852 1853 // For internal mutex and condition variable definitions. 1854 // Common threading primitives definitions for both POSIX and C11. 1855 // Copyright (C) 2017-2021 Free Software Foundation, Inc. 1856 // This file is part of the GNU C Library. 1857 // 1858 // The GNU C Library is free software; you can redistribute it and/or 1859 // modify it under the terms of the GNU Lesser General Public 1860 // License as published by the Free Software Foundation; either 1861 // version 2.1 of the License, or (at your option) any later version. 1862 // 1863 // The GNU C Library is distributed in the hope that it will be useful, 1864 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1865 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1866 // Lesser General Public License for more details. 1867 // 1868 // You should have received a copy of the GNU Lesser General Public 1869 // License along with the GNU C Library; if not, see 1870 // <https://www.gnu.org/licenses/>. 1871 1872 // Arch-specific definitions. Each architecture must define the following 1873 // macros to define the expected sizes of pthread data types: 1874 // 1875 // __SIZEOF_PTHREAD_ATTR_T - size of pthread_attr_t. 1876 // __SIZEOF_PTHREAD_MUTEX_T - size of pthread_mutex_t. 1877 // __SIZEOF_PTHREAD_MUTEXATTR_T - size of pthread_mutexattr_t. 1878 // __SIZEOF_PTHREAD_COND_T - size of pthread_cond_t. 1879 // __SIZEOF_PTHREAD_CONDATTR_T - size of pthread_condattr_t. 1880 // __SIZEOF_PTHREAD_RWLOCK_T - size of pthread_rwlock_t. 1881 // __SIZEOF_PTHREAD_RWLOCKATTR_T - size of pthread_rwlockattr_t. 1882 // __SIZEOF_PTHREAD_BARRIER_T - size of pthread_barrier_t. 1883 // __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t. 1884 // 1885 // The additional macro defines any constraint for the lock alignment 1886 // inside the thread structures: 1887 // 1888 // __LOCK_ALIGNMENT - for internal lock/futex usage. 1889 // 1890 // Same idea but for the once locking primitive: 1891 // 1892 // __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition. 1893 1894 // Machine-specific pthread type layouts. RISC-V version. 1895 // Copyright (C) 2011-2021 Free Software Foundation, Inc. 1896 // This file is part of the GNU C Library. 1897 // 1898 // The GNU C Library is free software; you can redistribute it and/or 1899 // modify it under the terms of the GNU Lesser General Public 1900 // License as published by the Free Software Foundation; either 1901 // version 2.1 of the License, or (at your option) any later version. 1902 // 1903 // The GNU C Library is distributed in the hope that it will be useful, 1904 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1905 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1906 // Lesser General Public License for more details. 1907 // 1908 // You should have received a copy of the GNU Lesser General Public 1909 // License along with the GNU C Library. If not, see 1910 // <https://www.gnu.org/licenses/>. 1911 1912 // Endian macros for string.h functions 1913 // Copyright (C) 1992-2021 Free Software Foundation, Inc. 1914 // This file is part of the GNU C Library. 1915 // 1916 // The GNU C Library is free software; you can redistribute it and/or 1917 // modify it under the terms of the GNU Lesser General Public 1918 // License as published by the Free Software Foundation; either 1919 // version 2.1 of the License, or (at your option) any later version. 1920 // 1921 // The GNU C Library is distributed in the hope that it will be useful, 1922 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1923 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1924 // Lesser General Public License for more details. 1925 // 1926 // You should have received a copy of the GNU Lesser General Public 1927 // License along with the GNU C Library; if not, see 1928 // <http://www.gnu.org/licenses/>. 1929 1930 // Common definition of pthread_mutex_t. 1931 1932 type __pthread_internal_list = struct { 1933 __prev uintptr 1934 __next uintptr 1935 } /* thread-shared-types.h:49:9 */ 1936 1937 type __pthread_internal_slist = struct{ __next uintptr } /* thread-shared-types.h:55:9 */ 1938 1939 // Arch-specific mutex definitions. A generic implementation is provided 1940 // by sysdeps/nptl/bits/struct_mutex.h. If required, an architecture 1941 // can override it by defining: 1942 // 1943 // 1. struct __pthread_mutex_s (used on both pthread_mutex_t and mtx_t 1944 // definition). It should contains at least the internal members 1945 // defined in the generic version. 1946 // 1947 // 2. __LOCK_ALIGNMENT for any extra attribute for internal lock used with 1948 // atomic operations. 1949 // 1950 // 3. The macro __PTHREAD_MUTEX_INITIALIZER used for static initialization. 1951 // It should initialize the mutex internal flag. 1952 1953 // Default mutex implementation struct definitions. 1954 // Copyright (C) 2019-2021 Free Software Foundation, Inc. 1955 // This file is part of the GNU C Library. 1956 // 1957 // The GNU C Library is free software; you can redistribute it and/or 1958 // modify it under the terms of the GNU Lesser General Public 1959 // License as published by the Free Software Foundation; either 1960 // version 2.1 of the License, or (at your option) any later version. 1961 // 1962 // The GNU C Library is distributed in the hope that it will be useful, 1963 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1964 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1965 // Lesser General Public License for more details. 1966 // 1967 // You should have received a copy of the GNU Lesser General Public 1968 // License along with the GNU C Library; if not, see 1969 // <http://www.gnu.org/licenses/>. 1970 1971 // Generic struct for both POSIX and C11 mutexes. New ports are expected 1972 // to use the default layout, however architecture can redefine it to 1973 // add arch-specific extension (such as lock-elision). The struct have 1974 // a size of 32 bytes on LP32 and 40 bytes on LP64 architectures. 1975 1976 type __pthread_mutex_s = struct { 1977 __lock int32 1978 __count uint32 1979 __owner int32 1980 __nusers uint32 1981 __kind int32 1982 __spins int32 1983 __list struct { 1984 __prev uintptr 1985 __next uintptr 1986 } 1987 } /* struct_mutex.h:27:1 */ 1988 1989 // Arch-sepecific read-write lock definitions. A generic implementation is 1990 // provided by struct_rwlock.h. If required, an architecture can override it 1991 // by defining: 1992 // 1993 // 1. struct __pthread_rwlock_arch_t (used on pthread_rwlock_t definition). 1994 // It should contain at least the internal members defined in the 1995 // generic version. 1996 // 1997 // 2. The macro __PTHREAD_RWLOCK_INITIALIZER used for static initialization. 1998 // It should initialize the rwlock internal type. 1999 2000 // RISC-V internal rwlock struct definitions. 2001 // Copyright (C) 2019-2021 Free Software Foundation, Inc. 2002 // 2003 // This file is part of the GNU C Library. 2004 // 2005 // The GNU C Library is free software; you can redistribute it and/or 2006 // modify it under the terms of the GNU Lesser General Public 2007 // License as published by the Free Software Foundation; either 2008 // version 2.1 of the License, or (at your option) any later version. 2009 // 2010 // The GNU C Library is distributed in the hope that it will be useful, 2011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 2012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2013 // Lesser General Public License for more details. 2014 // 2015 // You should have received a copy of the GNU Lesser General Public 2016 // License along with the GNU C Library; if not, see 2017 // <https://www.gnu.org/licenses/>. 2018 2019 // There is a lot of padding in this structure. While it's not strictly 2020 // necessary on RISC-V, we're going to leave it in to be on the safe side in 2021 // case it's needed in the future. Most other architectures have the padding, 2022 // so this gives us the same extensibility as everyone else has. 2023 type __pthread_rwlock_arch_t = struct { 2024 __readers uint32 2025 __writers uint32 2026 __wrphase_futex uint32 2027 __writers_futex uint32 2028 __pad3 uint32 2029 __pad4 uint32 2030 __cur_writer int32 2031 __shared int32 2032 __pad1 uint64 2033 __pad2 uint64 2034 __flags uint32 2035 _ [4]byte 2036 } /* struct_rwlock.h:27:1 */ 2037 2038 // Common definition of pthread_cond_t. 2039 2040 type __pthread_cond_s = struct { 2041 __0 struct{ __wseq uint64 } 2042 __8 struct{ __g1_start uint64 } 2043 __g_refs [2]uint32 2044 __g_size [2]uint32 2045 __g1_orig_size uint32 2046 __wrefs uint32 2047 __g_signals [2]uint32 2048 } /* thread-shared-types.h:92:1 */ 2049 2050 // Thread identifiers. The structure of the attribute type is not 2051 // exposed on purpose. 2052 type pthread_t = uint64 /* pthreadtypes.h:27:27 */ 2053 2054 // Data structures for mutex handling. The structure of the attribute 2055 // type is not exposed on purpose. 2056 type pthread_mutexattr_t = struct { 2057 _ [0]uint32 2058 __size [4]uint8 2059 } /* pthreadtypes.h:36:3 */ 2060 2061 // Data structure for condition variable handling. The structure of 2062 // the attribute type is not exposed on purpose. 2063 type pthread_condattr_t = struct { 2064 _ [0]uint32 2065 __size [4]uint8 2066 } /* pthreadtypes.h:45:3 */ 2067 2068 // Keys for thread-specific data 2069 type pthread_key_t = uint32 /* pthreadtypes.h:49:22 */ 2070 2071 // Once-only execution 2072 type pthread_once_t = int32 /* pthreadtypes.h:53:30 */ 2073 2074 type pthread_attr_t1 = struct { 2075 _ [0]uint64 2076 __size [56]uint8 2077 } /* pthreadtypes.h:56:1 */ 2078 2079 type pthread_attr_t = pthread_attr_t1 /* pthreadtypes.h:62:30 */ 2080 2081 type pthread_mutex_t = struct{ __data __pthread_mutex_s } /* pthreadtypes.h:72:3 */ 2082 2083 type pthread_cond_t = struct{ __data __pthread_cond_s } /* pthreadtypes.h:80:3 */ 2084 2085 // Data structure for reader-writer lock variable handling. The 2086 // structure of the attribute type is deliberately not exposed. 2087 type pthread_rwlock_t = struct{ __data __pthread_rwlock_arch_t } /* pthreadtypes.h:91:3 */ 2088 2089 type pthread_rwlockattr_t = struct { 2090 _ [0]uint64 2091 __size [8]uint8 2092 } /* pthreadtypes.h:97:3 */ 2093 2094 // POSIX spinlock data type. 2095 type pthread_spinlock_t = int32 /* pthreadtypes.h:103:22 */ 2096 2097 // POSIX barriers data type. The structure of the type is 2098 // deliberately not exposed. 2099 type pthread_barrier_t = struct { 2100 _ [0]uint64 2101 __size [32]uint8 2102 } /* pthreadtypes.h:112:3 */ 2103 2104 type pthread_barrierattr_t = struct { 2105 _ [0]uint32 2106 __size [4]uint8 2107 } /* pthreadtypes.h:118:3 */ 2108 2109 // Define the standard macros for the user, 2110 // if this invocation was from the user program. 2111 2112 // Define va_list, if desired, from __gnuc_va_list. 2113 // We deliberately do not define va_list when called from 2114 // stdio.h, because ANSI C says that stdio.h is not supposed to define 2115 // va_list. stdio.h needs to have access to that data type, 2116 // but must not use that name. It should use the name __gnuc_va_list, 2117 // which is safe because it is reserved for the implementation. 2118 2119 // The macro _VA_LIST_ is the same thing used by this file in Ultrix. 2120 // But on BSD NET2 we must not test or define or undef it. 2121 // (Note that the comments in NET 2's ansi.h 2122 // are incorrect for _VA_LIST_--see stdio.h!) 2123 // The macro _VA_LIST_DEFINED is used in Windows NT 3.5 2124 // The macro _VA_LIST is used in SCO Unix 3.2. 2125 // The macro _VA_LIST_T_H is used in the Bull dpx2 2126 // The macro __va_list__ is used by BeOS. 2127 type va_list = uintptr /* stdarg.h:99:24 */ 2128 2129 // a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and 2130 // "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even 2131 // though the former does not conform to the LFS document), but considering 2132 // both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as 2133 // equivalently requesting no 64-bit operations 2134 2135 // Copyright (C) 1991-2021 Free Software Foundation, Inc. 2136 // This file is part of the GNU C Library. 2137 // 2138 // The GNU C Library is free software; you can redistribute it and/or 2139 // modify it under the terms of the GNU Lesser General Public 2140 // License as published by the Free Software Foundation; either 2141 // version 2.1 of the License, or (at your option) any later version. 2142 // 2143 // The GNU C Library is distributed in the hope that it will be useful, 2144 // but WITHOUT ANY WARRANTY; without even the implied warranty of 2145 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2146 // Lesser General Public License for more details. 2147 // 2148 // You should have received a copy of the GNU Lesser General Public 2149 // License along with the GNU C Library; if not, see 2150 // <https://www.gnu.org/licenses/>. 2151 2152 // POSIX Standard: 2.10 Symbolic Constants <unistd.h> 2153 2154 // Copyright (C) 1991-2021 Free Software Foundation, Inc. 2155 // This file is part of the GNU C Library. 2156 // 2157 // The GNU C Library is free software; you can redistribute it and/or 2158 // modify it under the terms of the GNU Lesser General Public 2159 // License as published by the Free Software Foundation; either 2160 // version 2.1 of the License, or (at your option) any later version. 2161 // 2162 // The GNU C Library is distributed in the hope that it will be useful, 2163 // but WITHOUT ANY WARRANTY; without even the implied warranty of 2164 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2165 // Lesser General Public License for more details. 2166 // 2167 // You should have received a copy of the GNU Lesser General Public 2168 // License along with the GNU C Library; if not, see 2169 // <https://www.gnu.org/licenses/>. 2170 2171 // These may be used to determine what facilities are present at compile time. 2172 // Their values can be obtained at run time from `sysconf'. 2173 2174 // POSIX Standard approved as ISO/IEC 9945-1 as of September 2008. 2175 2176 // These are not #ifdef __USE_POSIX2 because they are 2177 // in the theoretically application-owned namespace. 2178 2179 // The utilities on GNU systems also correspond to this version. 2180 2181 // The utilities on GNU systems also correspond to this version. 2182 2183 // This symbol was required until the 2001 edition of POSIX. 2184 2185 // If defined, the implementation supports the 2186 // C Language Bindings Option. 2187 2188 // If defined, the implementation supports the 2189 // C Language Development Utilities Option. 2190 2191 // If defined, the implementation supports the 2192 // Software Development Utilities Option. 2193 2194 // If defined, the implementation supports the 2195 // creation of locales with the localedef utility. 2196 2197 // X/Open version number to which the library conforms. It is selectable. 2198 2199 // Commands and utilities from XPG4 are available. 2200 2201 // We are compatible with the old published standards as well. 2202 2203 // The X/Open Unix extensions are available. 2204 2205 // The enhanced internationalization capabilities according to XPG4.2 2206 // are present. 2207 2208 // The legacy interfaces are also available. 2209 2210 // Get values of POSIX options: 2211 // 2212 // If these symbols are defined, the corresponding features are 2213 // always available. If not, they may be available sometimes. 2214 // The current values can be obtained with `sysconf'. 2215 // 2216 // _POSIX_JOB_CONTROL Job control is supported. 2217 // _POSIX_SAVED_IDS Processes have a saved set-user-ID 2218 // and a saved set-group-ID. 2219 // _POSIX_REALTIME_SIGNALS Real-time, queued signals are supported. 2220 // _POSIX_PRIORITY_SCHEDULING Priority scheduling is supported. 2221 // _POSIX_TIMERS POSIX.4 clocks and timers are supported. 2222 // _POSIX_ASYNCHRONOUS_IO Asynchronous I/O is supported. 2223 // _POSIX_PRIORITIZED_IO Prioritized asynchronous I/O is supported. 2224 // _POSIX_SYNCHRONIZED_IO Synchronizing file data is supported. 2225 // _POSIX_FSYNC The fsync function is present. 2226 // _POSIX_MAPPED_FILES Mapping of files to memory is supported. 2227 // _POSIX_MEMLOCK Locking of all memory is supported. 2228 // _POSIX_MEMLOCK_RANGE Locking of ranges of memory is supported. 2229 // _POSIX_MEMORY_PROTECTION Setting of memory protections is supported. 2230 // _POSIX_MESSAGE_PASSING POSIX.4 message queues are supported. 2231 // _POSIX_SEMAPHORES POSIX.4 counting semaphores are supported. 2232 // _POSIX_SHARED_MEMORY_OBJECTS POSIX.4 shared memory objects are supported. 2233 // _POSIX_THREADS POSIX.1c pthreads are supported. 2234 // _POSIX_THREAD_ATTR_STACKADDR Thread stack address attribute option supported. 2235 // _POSIX_THREAD_ATTR_STACKSIZE Thread stack size attribute option supported. 2236 // _POSIX_THREAD_SAFE_FUNCTIONS Thread-safe functions are supported. 2237 // _POSIX_THREAD_PRIORITY_SCHEDULING 2238 // POSIX.1c thread execution scheduling supported. 2239 // _POSIX_THREAD_PRIO_INHERIT Thread priority inheritance option supported. 2240 // _POSIX_THREAD_PRIO_PROTECT Thread priority protection option supported. 2241 // _POSIX_THREAD_PROCESS_SHARED Process-shared synchronization supported. 2242 // _POSIX_PII Protocol-independent interfaces are supported. 2243 // _POSIX_PII_XTI XTI protocol-indep. interfaces are supported. 2244 // _POSIX_PII_SOCKET Socket protocol-indep. interfaces are supported. 2245 // _POSIX_PII_INTERNET Internet family of protocols supported. 2246 // _POSIX_PII_INTERNET_STREAM Connection-mode Internet protocol supported. 2247 // _POSIX_PII_INTERNET_DGRAM Connectionless Internet protocol supported. 2248 // _POSIX_PII_OSI ISO/OSI family of protocols supported. 2249 // _POSIX_PII_OSI_COTS Connection-mode ISO/OSI service supported. 2250 // _POSIX_PII_OSI_CLTS Connectionless ISO/OSI service supported. 2251 // _POSIX_POLL Implementation supports `poll' function. 2252 // _POSIX_SELECT Implementation supports `select' and `pselect'. 2253 // 2254 // _XOPEN_REALTIME X/Open realtime support is available. 2255 // _XOPEN_REALTIME_THREADS X/Open realtime thread support is available. 2256 // _XOPEN_SHM Shared memory interface according to XPG4.2. 2257 // 2258 // _XBS5_ILP32_OFF32 Implementation provides environment with 32-bit 2259 // int, long, pointer, and off_t types. 2260 // _XBS5_ILP32_OFFBIG Implementation provides environment with 32-bit 2261 // int, long, and pointer and off_t with at least 2262 // 64 bits. 2263 // _XBS5_LP64_OFF64 Implementation provides environment with 32-bit 2264 // int, and 64-bit long, pointer, and off_t types. 2265 // _XBS5_LPBIG_OFFBIG Implementation provides environment with at 2266 // least 32 bits int and long, pointer, and off_t 2267 // with at least 64 bits. 2268 // 2269 // If any of these symbols is defined as -1, the corresponding option is not 2270 // true for any file. If any is defined as other than -1, the corresponding 2271 // option is true for all files. If a symbol is not defined at all, the value 2272 // for a specific file can be obtained from `pathconf' and `fpathconf'. 2273 // 2274 // _POSIX_CHOWN_RESTRICTED Only the super user can use `chown' to change 2275 // the owner of a file. `chown' can only be used 2276 // to change the group ID of a file to a group of 2277 // which the calling process is a member. 2278 // _POSIX_NO_TRUNC Pathname components longer than 2279 // NAME_MAX generate an error. 2280 // _POSIX_VDISABLE If defined, if the value of an element of the 2281 // `c_cc' member of `struct termios' is 2282 // _POSIX_VDISABLE, no character will have the 2283 // effect associated with that element. 2284 // _POSIX_SYNC_IO Synchronous I/O may be performed. 2285 // _POSIX_ASYNC_IO Asynchronous I/O may be performed. 2286 // _POSIX_PRIO_IO Prioritized Asynchronous I/O may be performed. 2287 // 2288 // Support for the Large File Support interface is not generally available. 2289 // If it is available the following constants are defined to one. 2290 // _LFS64_LARGEFILE Low-level I/O supports large files. 2291 // _LFS64_STDIO Standard I/O supports large files. 2292 // 2293 2294 // Define POSIX options for Linux. 2295 // Copyright (C) 1996-2021 Free Software Foundation, Inc. 2296 // This file is part of the GNU C Library. 2297 // 2298 // The GNU C Library is free software; you can redistribute it and/or 2299 // modify it under the terms of the GNU Lesser General Public License as 2300 // published by the Free Software Foundation; either version 2.1 of the 2301 // License, or (at your option) any later version. 2302 // 2303 // The GNU C Library is distributed in the hope that it will be useful, 2304 // but WITHOUT ANY WARRANTY; without even the implied warranty of 2305 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2306 // Lesser General Public License for more details. 2307 // 2308 // You should have received a copy of the GNU Lesser General Public 2309 // License along with the GNU C Library; see the file COPYING.LIB. If 2310 // not, see <https://www.gnu.org/licenses/>. 2311 2312 // Job control is supported. 2313 2314 // Processes have a saved set-user-ID and a saved set-group-ID. 2315 2316 // Priority scheduling is not supported with the correct semantics, 2317 // but GNU/Linux applications expect that the corresponding interfaces 2318 // are available, even though the semantics do not meet the POSIX 2319 // requirements. See glibc bug 14829. 2320 2321 // Synchronizing file data is supported. 2322 2323 // The fsync function is present. 2324 2325 // Mapping of files to memory is supported. 2326 2327 // Locking of all memory is supported. 2328 2329 // Locking of ranges of memory is supported. 2330 2331 // Setting of memory protections is supported. 2332 2333 // Some filesystems allow all users to change file ownership. 2334 2335 // `c_cc' member of 'struct termios' structure can be disabled by 2336 // using the value _POSIX_VDISABLE. 2337 2338 // Filenames are not silently truncated. 2339 2340 // X/Open realtime support is available. 2341 2342 // X/Open thread realtime support is available. 2343 2344 // XPG4.2 shared memory is supported. 2345 2346 // Tell we have POSIX threads. 2347 2348 // We have the reentrant functions described in POSIX. 2349 2350 // We provide priority scheduling for threads. 2351 2352 // We support user-defined stack sizes. 2353 2354 // We support user-defined stacks. 2355 2356 // We support priority inheritence. 2357 2358 // We support priority protection, though only for non-robust 2359 // mutexes. 2360 2361 // We support priority inheritence for robust mutexes. 2362 2363 // We do not support priority protection for robust mutexes. 2364 2365 // We support POSIX.1b semaphores. 2366 2367 // Real-time signals are supported. 2368 2369 // We support asynchronous I/O. 2370 // Alternative name for Unix98. 2371 // Support for prioritization is also available. 2372 2373 // The LFS support in asynchronous I/O is also available. 2374 2375 // The rest of the LFS is also available. 2376 2377 // POSIX shared memory objects are implemented. 2378 2379 // CPU-time clocks support needs to be checked at runtime. 2380 2381 // Clock support in threads must be also checked at runtime. 2382 2383 // GNU libc provides regular expression handling. 2384 2385 // Reader/Writer locks are available. 2386 2387 // We have a POSIX shell. 2388 2389 // We support the Timeouts option. 2390 2391 // We support spinlocks. 2392 2393 // The `spawn' function family is supported. 2394 2395 // We have POSIX timers. 2396 2397 // The barrier functions are available. 2398 2399 // POSIX message queues are available. 2400 2401 // Thread process-shared synchronization is supported. 2402 2403 // The monotonic clock might be available. 2404 2405 // The clock selection interfaces are available. 2406 2407 // Advisory information interfaces are available. 2408 2409 // IPv6 support is available. 2410 2411 // Raw socket support is available. 2412 2413 // We have at least one terminal. 2414 2415 // Neither process nor thread sporadic server interfaces is available. 2416 2417 // trace.h is not available. 2418 2419 // Typed memory objects are not available. 2420 2421 // Get the environment definitions from Unix98. 2422 // Copyright (C) 2020-2021 Free Software Foundation, Inc. 2423 // This file is part of the GNU C Library. 2424 // 2425 // The GNU C Library is free software; you can redistribute it and/or 2426 // modify it under the terms of the GNU Lesser General Public 2427 // License as published by the Free Software Foundation; either 2428 // version 2.1 of the License, or (at your option) any later version. 2429 // 2430 // The GNU C Library is distributed in the hope that it will be useful, 2431 // but WITHOUT ANY WARRANTY; without even the implied warranty of 2432 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2433 // Lesser General Public License for more details. 2434 // 2435 // You should have received a copy of the GNU Lesser General Public 2436 // License along with the GNU C Library; if not, see 2437 // <https://www.gnu.org/licenses/>. 2438 2439 // Determine the wordsize from the preprocessor defines. RISC-V version. 2440 // Copyright (C) 2002-2021 Free Software Foundation, Inc. 2441 // This file is part of the GNU C Library. 2442 // 2443 // The GNU C Library is free software; you can redistribute it and/or 2444 // modify it under the terms of the GNU Lesser General Public 2445 // License as published by the Free Software Foundation; either 2446 // version 2.1 of the License, or (at your option) any later version. 2447 // 2448 // The GNU C Library is distributed in the hope that it will be useful, 2449 // but WITHOUT ANY WARRANTY; without even the implied warranty of 2450 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2451 // Lesser General Public License for more details. 2452 // 2453 // You should have received a copy of the GNU Lesser General Public 2454 // License along with the GNU C Library. If not, see 2455 // <https://www.gnu.org/licenses/>. 2456 2457 // This header should define the following symbols under the described 2458 // situations. A value `1' means that the model is always supported, 2459 // `-1' means it is never supported. Undefined means it cannot be 2460 // statically decided. 2461 // 2462 // _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type 2463 // _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type 2464 // 2465 // _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type 2466 // _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type 2467 // 2468 // The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG, 2469 // _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32, 2470 // _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were 2471 // used in previous versions of the Unix standard and are available 2472 // only for compatibility. 2473 2474 // We can never provide environments with 32-bit wide pointers. 2475 // We also have no use (for now) for an environment with bigger pointers 2476 // and offsets. 2477 2478 // By default we have 64-bit wide `long int', pointers and `off_t'. 2479 2480 // Standard file descriptors. 2481 2482 // All functions that are not declared anywhere else. 2483 2484 // bits/types.h -- definitions of __*_t types underlying *_t types. 2485 // Copyright (C) 2002-2021 Free Software Foundation, Inc. 2486 // This file is part of the GNU C Library. 2487 // 2488 // The GNU C Library is free software; you can redistribute it and/or 2489 // modify it under the terms of the GNU Lesser General Public 2490 // License as published by the Free Software Foundation; either 2491 // version 2.1 of the License, or (at your option) any later version. 2492 // 2493 // The GNU C Library is distributed in the hope that it will be useful, 2494 // but WITHOUT ANY WARRANTY; without even the implied warranty of 2495 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2496 // Lesser General Public License for more details. 2497 // 2498 // You should have received a copy of the GNU Lesser General Public 2499 // License along with the GNU C Library; if not, see 2500 // <https://www.gnu.org/licenses/>. 2501 2502 // Never include this file directly; use <sys/types.h> instead. 2503 2504 // Copyright (C) 1989-2021 Free Software Foundation, Inc. 2505 // 2506 // This file is part of GCC. 2507 // 2508 // GCC is free software; you can redistribute it and/or modify 2509 // it under the terms of the GNU General Public License as published by 2510 // the Free Software Foundation; either version 3, or (at your option) 2511 // any later version. 2512 // 2513 // GCC is distributed in the hope that it will be useful, 2514 // but WITHOUT ANY WARRANTY; without even the implied warranty of 2515 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2516 // GNU General Public License for more details. 2517 // 2518 // Under Section 7 of GPL version 3, you are granted additional 2519 // permissions described in the GCC Runtime Library Exception, version 2520 // 3.1, as published by the Free Software Foundation. 2521 // 2522 // You should have received a copy of the GNU General Public License and 2523 // a copy of the GCC Runtime Library Exception along with this program; 2524 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 2525 // <http://www.gnu.org/licenses/>. 2526 2527 // ISO C Standard: 7.17 Common definitions <stddef.h> 2528 2529 // Any one of these symbols __need_* means that GNU libc 2530 // wants us just to define one data type. So don't define 2531 // the symbols that indicate this file's entire job has been done. 2532 2533 // This avoids lossage on SunOS but only if stdtypes.h comes first. 2534 // There's no way to win with the other order! Sun lossage. 2535 2536 // Sequent's header files use _PTRDIFF_T_ in some conflicting way. 2537 // Just ignore it. 2538 2539 // On VxWorks, <type/vxTypesBase.h> may have defined macros like 2540 // _TYPE_size_t which will typedef size_t. fixincludes patched the 2541 // vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is 2542 // not defined, and so that defining this macro defines _GCC_SIZE_T. 2543 // If we find that the macros are still defined at this point, we must 2544 // invoke them so that the type is defined as expected. 2545 2546 // In case nobody has defined these types, but we aren't running under 2547 // GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and 2548 // __WCHAR_TYPE__ have reasonable values. This can happen if the 2549 // parts of GCC is compiled by an older compiler, that actually 2550 // include gstddef.h, such as collect2. 2551 2552 // Signed type of difference of two pointers. 2553 2554 // Define this type if we are doing the whole job, 2555 // or if we want this type in particular. 2556 2557 // If this symbol has done its job, get rid of it. 2558 2559 // Unsigned type of `sizeof' something. 2560 2561 // Define this type if we are doing the whole job, 2562 // or if we want this type in particular. 2563 2564 // Wide character type. 2565 // Locale-writers should change this as necessary to 2566 // be big enough to hold unique values not between 0 and 127, 2567 // and not (wchar_t) -1, for each defined multibyte character. 2568 2569 // Define this type if we are doing the whole job, 2570 // or if we want this type in particular. 2571 2572 // A null pointer constant. 2573 2574 // Offset of member MEMBER in a struct of type TYPE. 2575 2576 // The Single Unix specification says that some more types are 2577 // available here. 2578 2579 type useconds_t = uint32 /* unistd.h:255:22 */ 2580 2581 type intptr_t = int64 /* unistd.h:267:20 */ 2582 2583 type socklen_t = uint32 /* unistd.h:274:21 */ 2584 2585 // Define some macros helping to catch buffer overflows. 2586 2587 // System-specific extensions. 2588 // System-specific extensions of <unistd.h>, Linux version. 2589 // Copyright (C) 2019-2021 Free Software Foundation, Inc. 2590 // This file is part of the GNU C Library. 2591 // 2592 // The GNU C Library is free software; you can redistribute it and/or 2593 // modify it under the terms of the GNU Lesser General Public 2594 // License as published by the Free Software Foundation; either 2595 // version 2.1 of the License, or (at your option) any later version. 2596 // 2597 // The GNU C Library is distributed in the hope that it will be useful, 2598 // but WITHOUT ANY WARRANTY; without even the implied warranty of 2599 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2600 // Lesser General Public License for more details. 2601 // 2602 // You should have received a copy of the GNU Lesser General Public 2603 // License along with the GNU C Library; if not, see 2604 // <https://www.gnu.org/licenses/>. 2605 2606 // MVS linker does not support external names larger than 8 bytes 2607 2608 // 2609 // The 'zlib' compression library provides in-memory compression and 2610 // decompression functions, including integrity checks of the uncompressed data. 2611 // This version of the library supports only one compression method (deflation) 2612 // but other algorithms will be added later and will have the same stream 2613 // interface. 2614 // 2615 // Compression can be done in a single step if the buffers are large enough, 2616 // or can be done by repeated calls of the compression function. In the latter 2617 // case, the application must provide more input and/or consume the output 2618 // (providing more output space) before each call. 2619 // 2620 // The compressed data format used by default by the in-memory functions is 2621 // the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped 2622 // around a deflate stream, which is itself documented in RFC 1951. 2623 // 2624 // The library also supports reading and writing files in gzip (.gz) format 2625 // with an interface similar to that of stdio using the functions that start 2626 // with "gz". The gzip format is different from the zlib format. gzip is a 2627 // gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. 2628 // 2629 // This library can optionally read and write gzip and raw deflate streams in 2630 // memory as well. 2631 // 2632 // The zlib format was designed to be compact and fast for use in memory 2633 // and on communications channels. The gzip format was designed for single- 2634 // file compression on file systems, has a larger header than zlib to maintain 2635 // directory information, and uses a different, slower check method than zlib. 2636 // 2637 // The library does not install any signal handler. The decoder checks 2638 // the consistency of the compressed data, so the library should never crash 2639 // even in the case of corrupted input. 2640 2641 type alloc_func = uintptr /* zlib.h:81:16 */ 2642 type free_func = uintptr /* zlib.h:82:16 */ 2643 2644 type z_stream_s = struct { 2645 next_in uintptr 2646 avail_in uInt 2647 _ [4]byte 2648 total_in uLong 2649 next_out uintptr 2650 avail_out uInt 2651 _ [4]byte 2652 total_out uLong 2653 msg uintptr 2654 state uintptr 2655 zalloc alloc_func 2656 zfree free_func 2657 opaque voidpf 2658 data_type int32 2659 _ [4]byte 2660 adler uLong 2661 reserved uLong 2662 } /* zlib.h:86:9 */ 2663 2664 type z_stream = z_stream_s /* zlib.h:106:3 */ 2665 2666 type z_streamp = uintptr /* zlib.h:108:22 */ 2667 2668 // 2669 // gzip header information passed to and from zlib routines. See RFC 1952 2670 // for more details on the meanings of these fields. 2671 type gz_header_s = struct { 2672 text int32 2673 _ [4]byte 2674 time uLong 2675 xflags int32 2676 os int32 2677 extra uintptr 2678 extra_len uInt 2679 extra_max uInt 2680 name uintptr 2681 name_max uInt 2682 _ [4]byte 2683 comment uintptr 2684 comm_max uInt 2685 hcrc int32 2686 done int32 2687 _ [4]byte 2688 } /* zlib.h:114:9 */ 2689 2690 // 2691 // gzip header information passed to and from zlib routines. See RFC 1952 2692 // for more details on the meanings of these fields. 2693 type gz_header = gz_header_s /* zlib.h:129:3 */ 2694 2695 type gz_headerp = uintptr /* zlib.h:131:23 */ 2696 // 2697 // inflateGetHeader() requests that gzip header information be stored in the 2698 // provided gz_header structure. inflateGetHeader() may be called after 2699 // inflateInit2() or inflateReset(), and before the first call of inflate(). 2700 // As inflate() processes the gzip stream, head->done is zero until the header 2701 // is completed, at which time head->done is set to one. If a zlib stream is 2702 // being decoded, then head->done is set to -1 to indicate that there will be 2703 // no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be 2704 // used to force inflate() to return immediately after header processing is 2705 // complete and before any actual data is decompressed. 2706 // 2707 // The text, time, xflags, and os fields are filled in with the gzip header 2708 // contents. hcrc is set to true if there is a header CRC. (The header CRC 2709 // was valid if done is set to one.) If extra is not Z_NULL, then extra_max 2710 // contains the maximum number of bytes to write to extra. Once done is true, 2711 // extra_len contains the actual extra field length, and extra contains the 2712 // extra field, or that field truncated if extra_max is less than extra_len. 2713 // If name is not Z_NULL, then up to name_max characters are written there, 2714 // terminated with a zero unless the length is greater than name_max. If 2715 // comment is not Z_NULL, then up to comm_max characters are written there, 2716 // terminated with a zero unless the length is greater than comm_max. When any 2717 // of extra, name, or comment are not Z_NULL and the respective field is not 2718 // present in the header, then that field is set to Z_NULL to signal its 2719 // absence. This allows the use of deflateSetHeader() with the returned 2720 // structure to duplicate the header. However if those fields are set to 2721 // allocated memory, then the application will need to save those pointers 2722 // elsewhere so that they can be eventually freed. 2723 // 2724 // If inflateGetHeader is not used, then the header information is simply 2725 // discarded. The header is always checked for validity, including the header 2726 // CRC if present. inflateReset() will reset the process to discard the header 2727 // information. The application would need to call inflateGetHeader() again to 2728 // retrieve the header from the next gzip stream. 2729 // 2730 // inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source 2731 // stream state was inconsistent. 2732 2733 // 2734 // ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, 2735 // unsigned char FAR *window)); 2736 // 2737 // Initialize the internal stream state for decompression using inflateBack() 2738 // calls. The fields zalloc, zfree and opaque in strm must be initialized 2739 // before the call. If zalloc and zfree are Z_NULL, then the default library- 2740 // derived memory allocation routines are used. windowBits is the base two 2741 // logarithm of the window size, in the range 8..15. window is a caller 2742 // supplied buffer of that size. Except for special applications where it is 2743 // assured that deflate was used with small window sizes, windowBits must be 15 2744 // and a 32K byte window must be supplied to be able to decompress general 2745 // deflate streams. 2746 // 2747 // See inflateBack() for the usage of these routines. 2748 // 2749 // inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of 2750 // the parameters are invalid, Z_MEM_ERROR if the internal state could not be 2751 // allocated, or Z_VERSION_ERROR if the version of the library does not match 2752 // the version of the header file. 2753 2754 type in_func = uintptr /* zlib.h:1092:18 */ 2755 type out_func = uintptr /* zlib.h:1094:13 */ 2756 // 2757 // Same as uncompress, except that sourceLen is a pointer, where the 2758 // length of the source is *sourceLen. On return, *sourceLen is the number of 2759 // source bytes consumed. 2760 2761 // gzip file access functions 2762 2763 // 2764 // This library supports reading and writing files in gzip (.gz) format with 2765 // an interface similar to that of stdio, using the functions that start with 2766 // "gz". The gzip format is different from the zlib format. gzip is a gzip 2767 // wrapper, documented in RFC 1952, wrapped around a deflate stream. 2768 2769 type gzFile_s = struct { 2770 have uint32 2771 _ [4]byte 2772 next uintptr 2773 pos off64_t 2774 } /* zlib.h:1300:9 */ 2775 2776 // 2777 // Same as uncompress, except that sourceLen is a pointer, where the 2778 // length of the source is *sourceLen. On return, *sourceLen is the number of 2779 // source bytes consumed. 2780 2781 // gzip file access functions 2782 2783 // 2784 // This library supports reading and writing files in gzip (.gz) format with 2785 // an interface similar to that of stdio, using the functions that start with 2786 // "gz". The gzip format is different from the zlib format. gzip is a gzip 2787 // wrapper, documented in RFC 1952, wrapped around a deflate stream. 2788 2789 type gzFile = uintptr /* zlib.h:1300:25 */ 2790 2791 // The tag name of this struct is _G_fpos_t to preserve historic 2792 // C++ mangled names for functions taking fpos_t arguments. 2793 // That name should not be used in new code. 2794 type _G_fpos_t = struct { 2795 __pos int64 2796 __state struct { 2797 __count int32 2798 __value struct{ __wch uint32 } 2799 } 2800 } /* __fpos_t.h:10:9 */ 2801 2802 // bits/types.h -- definitions of __*_t types underlying *_t types. 2803 // Copyright (C) 2002-2021 Free Software Foundation, Inc. 2804 // This file is part of the GNU C Library. 2805 // 2806 // The GNU C Library is free software; you can redistribute it and/or 2807 // modify it under the terms of the GNU Lesser General Public 2808 // License as published by the Free Software Foundation; either 2809 // version 2.1 of the License, or (at your option) any later version. 2810 // 2811 // The GNU C Library is distributed in the hope that it will be useful, 2812 // but WITHOUT ANY WARRANTY; without even the implied warranty of 2813 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2814 // Lesser General Public License for more details. 2815 // 2816 // You should have received a copy of the GNU Lesser General Public 2817 // License along with the GNU C Library; if not, see 2818 // <https://www.gnu.org/licenses/>. 2819 2820 // Never include this file directly; use <sys/types.h> instead. 2821 2822 // The tag name of this struct is _G_fpos64_t to preserve historic 2823 // C++ mangled names for functions taking fpos_t and/or fpos64_t 2824 // arguments. That name should not be used in new code. 2825 type _G_fpos64_t = struct { 2826 __pos int64 2827 __state struct { 2828 __count int32 2829 __value struct{ __wch uint32 } 2830 } 2831 } /* __fpos64_t.h:10:9 */ 2832 2833 type _IO_FILE = struct { 2834 _flags int32 2835 _ [4]byte 2836 _IO_read_ptr uintptr 2837 _IO_read_end uintptr 2838 _IO_read_base uintptr 2839 _IO_write_base uintptr 2840 _IO_write_ptr uintptr 2841 _IO_write_end uintptr 2842 _IO_buf_base uintptr 2843 _IO_buf_end uintptr 2844 _IO_save_base uintptr 2845 _IO_backup_base uintptr 2846 _IO_save_end uintptr 2847 _markers uintptr 2848 _chain uintptr 2849 _fileno int32 2850 _flags2 int32 2851 _old_offset int64 2852 _cur_column uint16 2853 _vtable_offset int8 2854 _shortbuf [1]uint8 2855 _ [4]byte 2856 _lock uintptr 2857 _offset int64 2858 _codecvt uintptr 2859 _wide_data uintptr 2860 _freeres_list uintptr 2861 _freeres_buf uintptr 2862 __pad5 size_t 2863 _mode int32 2864 _unused2 [20]uint8 2865 } /* __FILE.h:4:1 */ 2866 2867 // The opaque type of streams. This is the definition used elsewhere. 2868 type FILE = _IO_FILE /* FILE.h:7:25 */ 2869 2870 // These macros are used by bits/stdio.h and internal headers. 2871 2872 // Many more flag bits are defined internally. 2873 2874 // The type of the second argument to `fgetpos' and `fsetpos'. 2875 type fpos_t = _G_fpos64_t /* stdio.h:86:20 */ 2876 type fpos64_t = _G_fpos64_t /* stdio.h:89:20 */ 2877 2878 // POSIX.1-2008 extended locale interface (see locale.h). 2879 // Definition of locale_t. 2880 // Copyright (C) 2017-2021 Free Software Foundation, Inc. 2881 // This file is part of the GNU C Library. 2882 // 2883 // The GNU C Library is free software; you can redistribute it and/or 2884 // modify it under the terms of the GNU Lesser General Public 2885 // License as published by the Free Software Foundation; either 2886 // version 2.1 of the License, or (at your option) any later version. 2887 // 2888 // The GNU C Library is distributed in the hope that it will be useful, 2889 // but WITHOUT ANY WARRANTY; without even the implied warranty of 2890 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2891 // Lesser General Public License for more details. 2892 // 2893 // You should have received a copy of the GNU Lesser General Public 2894 // License along with the GNU C Library; if not, see 2895 // <https://www.gnu.org/licenses/>. 2896 2897 // Definition of struct __locale_struct and __locale_t. 2898 // Copyright (C) 1997-2021 Free Software Foundation, Inc. 2899 // This file is part of the GNU C Library. 2900 // Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. 2901 // 2902 // The GNU C Library is free software; you can redistribute it and/or 2903 // modify it under the terms of the GNU Lesser General Public 2904 // License as published by the Free Software Foundation; either 2905 // version 2.1 of the License, or (at your option) any later version. 2906 // 2907 // The GNU C Library is distributed in the hope that it will be useful, 2908 // but WITHOUT ANY WARRANTY; without even the implied warranty of 2909 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2910 // Lesser General Public License for more details. 2911 // 2912 // You should have received a copy of the GNU Lesser General Public 2913 // License along with the GNU C Library; if not, see 2914 // <https://www.gnu.org/licenses/>. 2915 2916 // POSIX.1-2008: the locale_t type, representing a locale context 2917 // (implementation-namespace version). This type should be treated 2918 // as opaque by applications; some details are exposed for the sake of 2919 // efficiency in e.g. ctype functions. 2920 2921 type __locale_struct = struct { 2922 __locales [13]uintptr 2923 __ctype_b uintptr 2924 __ctype_tolower uintptr 2925 __ctype_toupper uintptr 2926 __names [13]uintptr 2927 } /* __locale_t.h:28:1 */ 2928 2929 type locale_t = uintptr /* locale_t.h:24:20 */ 2930 2931 // Copyright (C) 1991-2021 Free Software Foundation, Inc. 2932 // This file is part of the GNU C Library. 2933 // 2934 // The GNU C Library is free software; you can redistribute it and/or 2935 // modify it under the terms of the GNU Lesser General Public 2936 // License as published by the Free Software Foundation; either 2937 // version 2.1 of the License, or (at your option) any later version. 2938 // 2939 // The GNU C Library is distributed in the hope that it will be useful, 2940 // but WITHOUT ANY WARRANTY; without even the implied warranty of 2941 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2942 // Lesser General Public License for more details. 2943 // 2944 // You should have received a copy of the GNU Lesser General Public 2945 // License along with the GNU C Library; if not, see 2946 // <https://www.gnu.org/licenses/>. 2947 2948 // ISO C99 Standard: 7.20 General utilities <stdlib.h> 2949 2950 // Handle feature test macros at the start of a header. 2951 // Copyright (C) 2016-2021 Free Software Foundation, Inc. 2952 // This file is part of the GNU C Library. 2953 // 2954 // The GNU C Library is free software; you can redistribute it and/or 2955 // modify it under the terms of the GNU Lesser General Public 2956 // License as published by the Free Software Foundation; either 2957 // version 2.1 of the License, or (at your option) any later version. 2958 // 2959 // The GNU C Library is distributed in the hope that it will be useful, 2960 // but WITHOUT ANY WARRANTY; without even the implied warranty of 2961 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2962 // Lesser General Public License for more details. 2963 // 2964 // You should have received a copy of the GNU Lesser General Public 2965 // License along with the GNU C Library; if not, see 2966 // <https://www.gnu.org/licenses/>. 2967 2968 // This header is internal to glibc and should not be included outside 2969 // of glibc headers. Headers including it must define 2970 // __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION first. This header 2971 // cannot have multiple include guards because ISO C feature test 2972 // macros depend on the definition of the macro when an affected 2973 // header is included, not when the first system header is 2974 // included. 2975 2976 // Copyright (C) 1991-2021 Free Software Foundation, Inc. 2977 // This file is part of the GNU C Library. 2978 // 2979 // The GNU C Library is free software; you can redistribute it and/or 2980 // modify it under the terms of the GNU Lesser General Public 2981 // License as published by the Free Software Foundation; either 2982 // version 2.1 of the License, or (at your option) any later version. 2983 // 2984 // The GNU C Library is distributed in the hope that it will be useful, 2985 // but WITHOUT ANY WARRANTY; without even the implied warranty of 2986 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2987 // Lesser General Public License for more details. 2988 // 2989 // You should have received a copy of the GNU Lesser General Public 2990 // License along with the GNU C Library; if not, see 2991 // <https://www.gnu.org/licenses/>. 2992 2993 // ISO/IEC TR 24731-2:2010 defines the __STDC_WANT_LIB_EXT2__ 2994 // macro. 2995 2996 // ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__ 2997 // macro. Most but not all symbols enabled by that macro in TS 2998 // 18661-1 are enabled unconditionally in C2X. In C2X, the symbols in 2999 // Annex F still require a new feature test macro 3000 // __STDC_WANT_IEC_60559_EXT__ instead (C2X does not define 3001 // __STDC_WANT_IEC_60559_BFP_EXT__), while a few features from TS 3002 // 18661-1 are not included in C2X (and thus should depend on 3003 // __STDC_WANT_IEC_60559_BFP_EXT__ even when C2X features are 3004 // enabled). 3005 // 3006 // __GLIBC_USE (IEC_60559_BFP_EXT) controls those features from TS 3007 // 18661-1 not included in C2X. 3008 // 3009 // __GLIBC_USE (IEC_60559_BFP_EXT_C2X) controls those features from TS 3010 // 18661-1 that are also included in C2X (with no feature test macro 3011 // required in C2X). 3012 // 3013 // __GLIBC_USE (IEC_60559_EXT) controls those features from TS 18661-1 3014 // that are included in C2X but conditional on 3015 // __STDC_WANT_IEC_60559_EXT__. (There are currently no features 3016 // conditional on __STDC_WANT_IEC_60559_EXT__ that are not in TS 3017 // 18661-1.) 3018 3019 // ISO/IEC TS 18661-4:2015 defines the 3020 // __STDC_WANT_IEC_60559_FUNCS_EXT__ macro. Other than the reduction 3021 // functions, the symbols from this TS are enabled unconditionally in 3022 // C2X. 3023 3024 // ISO/IEC TS 18661-3:2015 defines the 3025 // __STDC_WANT_IEC_60559_TYPES_EXT__ macro. 3026 3027 // Get size_t, wchar_t and NULL from <stddef.h>. 3028 // Copyright (C) 1989-2021 Free Software Foundation, Inc. 3029 // 3030 // This file is part of GCC. 3031 // 3032 // GCC is free software; you can redistribute it and/or modify 3033 // it under the terms of the GNU General Public License as published by 3034 // the Free Software Foundation; either version 3, or (at your option) 3035 // any later version. 3036 // 3037 // GCC is distributed in the hope that it will be useful, 3038 // but WITHOUT ANY WARRANTY; without even the implied warranty of 3039 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 3040 // GNU General Public License for more details. 3041 // 3042 // Under Section 7 of GPL version 3, you are granted additional 3043 // permissions described in the GCC Runtime Library Exception, version 3044 // 3.1, as published by the Free Software Foundation. 3045 // 3046 // You should have received a copy of the GNU General Public License and 3047 // a copy of the GCC Runtime Library Exception along with this program; 3048 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 3049 // <http://www.gnu.org/licenses/>. 3050 3051 // ISO C Standard: 7.17 Common definitions <stddef.h> 3052 3053 // Any one of these symbols __need_* means that GNU libc 3054 // wants us just to define one data type. So don't define 3055 // the symbols that indicate this file's entire job has been done. 3056 3057 // This avoids lossage on SunOS but only if stdtypes.h comes first. 3058 // There's no way to win with the other order! Sun lossage. 3059 3060 // Sequent's header files use _PTRDIFF_T_ in some conflicting way. 3061 // Just ignore it. 3062 3063 // On VxWorks, <type/vxTypesBase.h> may have defined macros like 3064 // _TYPE_size_t which will typedef size_t. fixincludes patched the 3065 // vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is 3066 // not defined, and so that defining this macro defines _GCC_SIZE_T. 3067 // If we find that the macros are still defined at this point, we must 3068 // invoke them so that the type is defined as expected. 3069 3070 // In case nobody has defined these types, but we aren't running under 3071 // GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and 3072 // __WCHAR_TYPE__ have reasonable values. This can happen if the 3073 // parts of GCC is compiled by an older compiler, that actually 3074 // include gstddef.h, such as collect2. 3075 3076 // Signed type of difference of two pointers. 3077 3078 // Define this type if we are doing the whole job, 3079 // or if we want this type in particular. 3080 3081 // If this symbol has done its job, get rid of it. 3082 3083 // Unsigned type of `sizeof' something. 3084 3085 // Define this type if we are doing the whole job, 3086 // or if we want this type in particular. 3087 3088 // Wide character type. 3089 // Locale-writers should change this as necessary to 3090 // be big enough to hold unique values not between 0 and 127, 3091 // and not (wchar_t) -1, for each defined multibyte character. 3092 3093 // Define this type if we are doing the whole job, 3094 // or if we want this type in particular. 3095 3096 // A null pointer constant. 3097 3098 // Offset of member MEMBER in a struct of type TYPE. 3099 3100 // XPG requires a few symbols from <sys/wait.h> being defined. 3101 // Definitions of flag bits for `waitpid' et al. 3102 // Copyright (C) 1992-2021 Free Software Foundation, Inc. 3103 // This file is part of the GNU C Library. 3104 // 3105 // The GNU C Library is free software; you can redistribute it and/or 3106 // modify it under the terms of the GNU Lesser General Public 3107 // License as published by the Free Software Foundation; either 3108 // version 2.1 of the License, or (at your option) any later version. 3109 // 3110 // The GNU C Library is distributed in the hope that it will be useful, 3111 // but WITHOUT ANY WARRANTY; without even the implied warranty of 3112 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 3113 // Lesser General Public License for more details. 3114 // 3115 // You should have received a copy of the GNU Lesser General Public 3116 // License along with the GNU C Library; if not, see 3117 // <https://www.gnu.org/licenses/>. 3118 3119 // Bits in the third argument to `waitpid'. 3120 3121 // Bits in the fourth argument to `waitid'. 3122 3123 // Definitions of status bits for `wait' et al. 3124 // Copyright (C) 1992-2021 Free Software Foundation, Inc. 3125 // This file is part of the GNU C Library. 3126 // 3127 // The GNU C Library is free software; you can redistribute it and/or 3128 // modify it under the terms of the GNU Lesser General Public 3129 // License as published by the Free Software Foundation; either 3130 // version 2.1 of the License, or (at your option) any later version. 3131 // 3132 // The GNU C Library is distributed in the hope that it will be useful, 3133 // but WITHOUT ANY WARRANTY; without even the implied warranty of 3134 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 3135 // Lesser General Public License for more details. 3136 // 3137 // You should have received a copy of the GNU Lesser General Public 3138 // License along with the GNU C Library; if not, see 3139 // <https://www.gnu.org/licenses/>. 3140 3141 // Everything extant so far uses these same bits. 3142 3143 // If WIFEXITED(STATUS), the low-order 8 bits of the status. 3144 3145 // If WIFSIGNALED(STATUS), the terminating signal. 3146 3147 // If WIFSTOPPED(STATUS), the signal that stopped the child. 3148 3149 // Nonzero if STATUS indicates normal termination. 3150 3151 // Nonzero if STATUS indicates termination by a signal. 3152 3153 // Nonzero if STATUS indicates the child is stopped. 3154 3155 // Nonzero if STATUS indicates the child continued after a stop. We only 3156 // define this if <bits/waitflags.h> provides the WCONTINUED flag bit. 3157 3158 // Nonzero if STATUS indicates the child dumped core. 3159 3160 // Macros for constructing status values. 3161 3162 // Define the macros <sys/wait.h> also would define this way. 3163 3164 // _FloatN API tests for enablement. 3165 // Macros to control TS 18661-3 glibc features on ldbl-128 platforms. 3166 // Copyright (C) 2017-2021 Free Software Foundation, Inc. 3167 // This file is part of the GNU C Library. 3168 // 3169 // The GNU C Library is free software; you can redistribute it and/or 3170 // modify it under the terms of the GNU Lesser General Public 3171 // License as published by the Free Software Foundation; either 3172 // version 2.1 of the License, or (at your option) any later version. 3173 // 3174 // The GNU C Library is distributed in the hope that it will be useful, 3175 // but WITHOUT ANY WARRANTY; without even the implied warranty of 3176 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 3177 // Lesser General Public License for more details. 3178 // 3179 // You should have received a copy of the GNU Lesser General Public 3180 // License along with the GNU C Library; if not, see 3181 // <https://www.gnu.org/licenses/>. 3182 3183 // Returned by `div'. 3184 type div_t = struct { 3185 quot int32 3186 rem int32 3187 } /* stdlib.h:62:5 */ 3188 3189 // Returned by `ldiv'. 3190 type ldiv_t = struct { 3191 quot int64 3192 rem int64 3193 } /* stdlib.h:70:5 */ 3194 3195 // Returned by `lldiv'. 3196 type lldiv_t = struct { 3197 quot int64 3198 rem int64 3199 } /* stdlib.h:80:5 */ 3200 3201 // Reentrant versions of the `random' family of functions. 3202 // These functions all use the following data structure to contain 3203 // state, rather than global state variables. 3204 3205 type random_data = struct { 3206 fptr uintptr 3207 rptr uintptr 3208 state uintptr 3209 rand_type int32 3210 rand_deg int32 3211 rand_sep int32 3212 _ [4]byte 3213 end_ptr uintptr 3214 } /* stdlib.h:423:1 */ 3215 3216 // Data structure for communication with thread safe versions. This 3217 // type is to be regarded as opaque. It's only exported because users 3218 // have to allocate objects of this type. 3219 type drand48_data = struct { 3220 __x [3]uint16 3221 __old_x [3]uint16 3222 __c uint16 3223 __init uint16 3224 __a uint64 3225 } /* stdlib.h:490:1 */ 3226 3227 // Floating-point inline functions for stdlib.h. 3228 // Copyright (C) 2012-2021 Free Software Foundation, Inc. 3229 // This file is part of the GNU C Library. 3230 // 3231 // The GNU C Library is free software; you can redistribute it and/or 3232 // modify it under the terms of the GNU Lesser General Public 3233 // License as published by the Free Software Foundation; either 3234 // version 2.1 of the License, or (at your option) any later version. 3235 // 3236 // The GNU C Library is distributed in the hope that it will be useful, 3237 // but WITHOUT ANY WARRANTY; without even the implied warranty of 3238 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 3239 // Lesser General Public License for more details. 3240 // 3241 // You should have received a copy of the GNU Lesser General Public 3242 // License along with the GNU C Library; if not, see 3243 // <https://www.gnu.org/licenses/>. 3244 3245 // Define some macros helping to catch buffer overflows. 3246 3247 // Macros to control TS 18661-3 glibc features on ldbl-128 platforms. 3248 // Copyright (C) 2017-2021 Free Software Foundation, Inc. 3249 // This file is part of the GNU C Library. 3250 // 3251 // The GNU C Library is free software; you can redistribute it and/or 3252 // modify it under the terms of the GNU Lesser General Public 3253 // License as published by the Free Software Foundation; either 3254 // version 2.1 of the License, or (at your option) any later version. 3255 // 3256 // The GNU C Library is distributed in the hope that it will be useful, 3257 // but WITHOUT ANY WARRANTY; without even the implied warranty of 3258 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 3259 // Lesser General Public License for more details. 3260 // 3261 // You should have received a copy of the GNU Lesser General Public 3262 // License along with the GNU C Library; if not, see 3263 // <https://www.gnu.org/licenses/>. 3264 3265 var hello = *(*[14]uint8)(unsafe.Pointer(ts)) /* example.c:29:21 */ 3266 // "hello world" would be more standard, but the repeated "hello" 3267 // stresses the compression code better, sorry... 3268 3269 var dictionary = *(*[6]uint8)(unsafe.Pointer(ts + 14)) /* example.c:34:19 */ 3270 var dictId uLong /* example.c:35:14: */ 3271 3272 var zalloc alloc_func = uintptr(0) /* example.c:77:19 */ 3273 var zfree free_func = uintptr(0) /* example.c:78:18 */ 3274 3275 // =========================================================================== 3276 // Test compress() and uncompress() 3277 func test_compress(tls *libc.TLS, compr uintptr, comprLen uLong, uncompr uintptr, uncomprLen uLong) { /* example.c:88:6: */ 3278 bp := tls.Alloc(56) 3279 defer tls.Free(56) 3280 *(*uLong)(unsafe.Pointer(bp + 40)) = comprLen 3281 *(*uLong)(unsafe.Pointer(bp + 48)) = uncomprLen 3282 3283 var err int32 3284 var len uLong = libc.Xstrlen(tls, uintptr(unsafe.Pointer(&hello))) + uint64(1) 3285 3286 err = z.Xcompress(tls, compr, bp+40, uintptr(uintptr(unsafe.Pointer(&hello))), len) 3287 { 3288 if err != 0 { 3289 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp, ts+34, err)) 3290 libc.Xexit(tls, 1) 3291 } 3292 } 3293 3294 libc.Xstrcpy(tls, uncompr, ts+43) 3295 3296 err = z.Xuncompress(tls, uncompr, bp+48, compr, *(*uLong)(unsafe.Pointer(bp + 40 /* comprLen */))) 3297 { 3298 if err != 0 { 3299 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+16, ts+51, err)) 3300 libc.Xexit(tls, 1) 3301 } 3302 } 3303 3304 if libc.Xstrcmp(tls, uncompr, uintptr(unsafe.Pointer(&hello))) != 0 { 3305 libc.Xfprintf(tls, libc.Xstderr, ts+62, 0) 3306 libc.Xexit(tls, 1) 3307 } else { 3308 libc.Xprintf(tls, ts+78, libc.VaList(bp+32, uncompr)) 3309 } 3310 } 3311 3312 // =========================================================================== 3313 // Test read/write of .gz files 3314 func test_gzio(tls *libc.TLS, fname uintptr, uncompr uintptr, uncomprLen uLong) { /* example.c:114:6: */ 3315 bp := tls.Alloc(84) 3316 defer tls.Free(84) 3317 3318 // var err int32 at bp+80, 4 3319 3320 var len int32 = int32(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&hello)))) + 1 3321 var file gzFile 3322 var pos off_t 3323 3324 file = z.Xgzopen64(tls, fname, ts+96) 3325 if file == uintptr(0) { 3326 libc.Xfprintf(tls, libc.Xstderr, ts+99, 0) 3327 libc.Xexit(tls, 1) 3328 } 3329 z.Xgzputc(tls, file, 'h') 3330 if z.Xgzputs(tls, file, ts+113) != 4 { 3331 libc.Xfprintf(tls, libc.Xstderr, ts+118, libc.VaList(bp, z.Xgzerror(tls, file, bp+80))) 3332 libc.Xexit(tls, 1) 3333 } 3334 if z.Xgzprintf(tls, file, ts+134, libc.VaList(bp+8, ts+14)) != 8 { 3335 libc.Xfprintf(tls, libc.Xstderr, ts+140, libc.VaList(bp+16, z.Xgzerror(tls, file, bp+80))) 3336 libc.Xexit(tls, 1) 3337 } 3338 z.Xgzseek64(tls, file, 1, 1) // add one zero byte 3339 z.Xgzclose(tls, file) 3340 3341 file = z.Xgzopen64(tls, fname, ts+158) 3342 if file == uintptr(0) { 3343 libc.Xfprintf(tls, libc.Xstderr, ts+99, 0) 3344 libc.Xexit(tls, 1) 3345 } 3346 libc.Xstrcpy(tls, uncompr, ts+43) 3347 3348 if z.Xgzread(tls, file, uncompr, uint32(uncomprLen)) != len { 3349 libc.Xfprintf(tls, libc.Xstderr, ts+161, libc.VaList(bp+24, z.Xgzerror(tls, file, bp+80))) 3350 libc.Xexit(tls, 1) 3351 } 3352 if libc.Xstrcmp(tls, uncompr, uintptr(unsafe.Pointer(&hello))) != 0 { 3353 libc.Xfprintf(tls, libc.Xstderr, ts+177, libc.VaList(bp+32, uncompr)) 3354 libc.Xexit(tls, 1) 3355 } else { 3356 libc.Xprintf(tls, ts+193, libc.VaList(bp+40, uncompr)) 3357 } 3358 3359 pos = z.Xgzseek64(tls, file, -8, 1) 3360 if pos != int64(6) || z.Xgztell64(tls, file) != pos { 3361 libc.Xfprintf(tls, libc.Xstderr, ts+207, 3362 libc.VaList(bp+48, pos, z.Xgztell64(tls, file))) 3363 libc.Xexit(tls, 1) 3364 } 3365 3366 if func() int32 { 3367 if (*gzFile_s)(unsafe.Pointer(file)).have != 0 { 3368 return int32(func() uint8 { 3369 (*gzFile_s)(unsafe.Pointer(file)).have-- 3370 (*gzFile_s)(unsafe.Pointer(file)).pos++ 3371 return *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*gzFile_s)(unsafe.Pointer(file)).next, 1))) 3372 }()) 3373 } 3374 return z.Xgzgetc(tls, file) 3375 }() != ' ' { 3376 libc.Xfprintf(tls, libc.Xstderr, ts+242, 0) 3377 libc.Xexit(tls, 1) 3378 } 3379 3380 if z.Xgzungetc(tls, ' ', file) != ' ' { 3381 libc.Xfprintf(tls, libc.Xstderr, ts+256, 0) 3382 libc.Xexit(tls, 1) 3383 } 3384 3385 z.Xgzgets(tls, file, uncompr, int32(uncomprLen)) 3386 if libc.Xstrlen(tls, uncompr) != uint64(7) { // " hello!" 3387 libc.Xfprintf(tls, libc.Xstderr, ts+272, libc.VaList(bp+64, z.Xgzerror(tls, file, bp+80))) 3388 libc.Xexit(tls, 1) 3389 } 3390 if libc.Xstrcmp(tls, uncompr, uintptr(unsafe.Pointer(&hello))+uintptr(6)) != 0 { 3391 libc.Xfprintf(tls, libc.Xstderr, ts+301, 0) 3392 libc.Xexit(tls, 1) 3393 } else { 3394 libc.Xprintf(tls, ts+326, libc.VaList(bp+72, uncompr)) 3395 } 3396 3397 z.Xgzclose(tls, file) 3398 } 3399 3400 // =========================================================================== 3401 // Test deflate() with small buffers 3402 func test_deflate(tls *libc.TLS, compr uintptr, comprLen uLong) { /* example.c:200:6: */ 3403 bp := tls.Alloc(176) 3404 defer tls.Free(176) 3405 3406 // var c_stream z_stream at bp+64, 112 3407 // compression stream 3408 var err int32 3409 var len uLong = libc.Xstrlen(tls, uintptr(unsafe.Pointer(&hello))) + uint64(1) 3410 3411 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).zalloc = zalloc 3412 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).zfree = zfree 3413 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).opaque = uintptr(0) 3414 3415 err = z.XdeflateInit_(tls, bp+64, -1, ts+353, int32(unsafe.Sizeof(z_stream{}))) 3416 { 3417 if err != 0 { 3418 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp, ts+360, err)) 3419 libc.Xexit(tls, 1) 3420 } 3421 } 3422 3423 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).next_in = uintptr(uintptr(unsafe.Pointer(&hello))) 3424 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).next_out = compr 3425 3426 for (*z_stream)(unsafe.Pointer(bp+64)).total_in != len && (*z_stream)(unsafe.Pointer(bp+64)).total_out < comprLen { 3427 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).avail_in = libc.AssignPtrUint32(bp+64+32, uInt(1)) // force small buffers 3428 err = z.Xdeflate(tls, bp+64, 0) 3429 { 3430 if err != 0 { 3431 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+16, ts+372, err)) 3432 libc.Xexit(tls, 1) 3433 } 3434 } 3435 3436 } 3437 // Finish the stream, still forcing small buffers: 3438 for { 3439 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).avail_out = uInt(1) 3440 err = z.Xdeflate(tls, bp+64, 4) 3441 if err == 1 { 3442 break 3443 } 3444 { 3445 if err != 0 { 3446 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+32, ts+372, err)) 3447 libc.Xexit(tls, 1) 3448 } 3449 } 3450 3451 } 3452 3453 err = z.XdeflateEnd(tls, bp+64) 3454 { 3455 if err != 0 { 3456 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+48, ts+380, err)) 3457 libc.Xexit(tls, 1) 3458 } 3459 } 3460 3461 } 3462 3463 // =========================================================================== 3464 // Test inflate() with small buffers 3465 func test_inflate(tls *libc.TLS, compr uintptr, comprLen uLong, uncompr uintptr, uncomprLen uLong) { /* example.c:238:6: */ 3466 bp := tls.Alloc(168) 3467 defer tls.Free(168) 3468 3469 var err int32 3470 // var d_stream z_stream at bp+56, 112 3471 // decompression stream 3472 3473 libc.Xstrcpy(tls, uncompr, ts+43) 3474 3475 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).zalloc = zalloc 3476 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).zfree = zfree 3477 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).opaque = uintptr(0) 3478 3479 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).next_in = compr 3480 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).avail_in = uInt(0) 3481 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).next_out = uncompr 3482 3483 err = z.XinflateInit_(tls, bp+56, ts+353, int32(unsafe.Sizeof(z_stream{}))) 3484 { 3485 if err != 0 { 3486 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp, ts+391, err)) 3487 libc.Xexit(tls, 1) 3488 } 3489 } 3490 3491 for (*z_stream)(unsafe.Pointer(bp+56)).total_out < uncomprLen && (*z_stream)(unsafe.Pointer(bp+56)).total_in < comprLen { 3492 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).avail_in = libc.AssignPtrUint32(bp+56+32, uInt(1)) // force small buffers 3493 err = z.Xinflate(tls, bp+56, 0) 3494 if err == 1 { 3495 break 3496 } 3497 { 3498 if err != 0 { 3499 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+16, ts+403, err)) 3500 libc.Xexit(tls, 1) 3501 } 3502 } 3503 3504 } 3505 3506 err = z.XinflateEnd(tls, bp+56) 3507 { 3508 if err != 0 { 3509 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+32, ts+411, err)) 3510 libc.Xexit(tls, 1) 3511 } 3512 } 3513 3514 if libc.Xstrcmp(tls, uncompr, uintptr(unsafe.Pointer(&hello))) != 0 { 3515 libc.Xfprintf(tls, libc.Xstderr, ts+422, 0) 3516 libc.Xexit(tls, 1) 3517 } else { 3518 libc.Xprintf(tls, ts+435, libc.VaList(bp+48, uncompr)) 3519 } 3520 } 3521 3522 // =========================================================================== 3523 // Test deflate() with large buffers and dynamic change of compression level 3524 func test_large_deflate(tls *libc.TLS, compr uintptr, comprLen uLong, uncompr uintptr, uncomprLen uLong) { /* example.c:279:6: */ 3525 bp := tls.Alloc(192) 3526 defer tls.Free(192) 3527 3528 // var c_stream z_stream at bp+80, 112 3529 // compression stream 3530 var err int32 3531 3532 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).zalloc = zalloc 3533 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).zfree = zfree 3534 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).opaque = uintptr(0) 3535 3536 err = z.XdeflateInit_(tls, bp+80, 1, ts+353, int32(unsafe.Sizeof(z_stream{}))) 3537 { 3538 if err != 0 { 3539 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp, ts+360, err)) 3540 libc.Xexit(tls, 1) 3541 } 3542 } 3543 3544 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).next_out = compr 3545 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).avail_out = uInt(comprLen) 3546 3547 // At this point, uncompr is still mostly zeroes, so it should compress 3548 // very well: 3549 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).next_in = uncompr 3550 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).avail_in = uInt(uncomprLen) 3551 err = z.Xdeflate(tls, bp+80, 0) 3552 { 3553 if err != 0 { 3554 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+16, ts+372, err)) 3555 libc.Xexit(tls, 1) 3556 } 3557 } 3558 3559 if (*z_stream)(unsafe.Pointer(bp+80)).avail_in != uInt(0) { 3560 libc.Xfprintf(tls, libc.Xstderr, ts+450, 0) 3561 libc.Xexit(tls, 1) 3562 } 3563 3564 // Feed in already compressed data and switch to no compression: 3565 z.XdeflateParams(tls, bp+80, 0, 0) 3566 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).next_in = compr 3567 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).avail_in = uInt(comprLen) / uInt(2) 3568 err = z.Xdeflate(tls, bp+80, 0) 3569 { 3570 if err != 0 { 3571 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+32, ts+372, err)) 3572 libc.Xexit(tls, 1) 3573 } 3574 } 3575 3576 // Switch back to compressing mode: 3577 z.XdeflateParams(tls, bp+80, 9, 1) 3578 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).next_in = uncompr 3579 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).avail_in = uInt(uncomprLen) 3580 err = z.Xdeflate(tls, bp+80, 0) 3581 { 3582 if err != 0 { 3583 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+48, ts+372, err)) 3584 libc.Xexit(tls, 1) 3585 } 3586 } 3587 3588 err = z.Xdeflate(tls, bp+80, 4) 3589 if err != 1 { 3590 libc.Xfprintf(tls, libc.Xstderr, ts+470, 0) 3591 libc.Xexit(tls, 1) 3592 } 3593 err = z.XdeflateEnd(tls, bp+80) 3594 { 3595 if err != 0 { 3596 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+64, ts+380, err)) 3597 libc.Xexit(tls, 1) 3598 } 3599 } 3600 3601 } 3602 3603 // =========================================================================== 3604 // Test inflate() with large buffers 3605 func test_large_inflate(tls *libc.TLS, compr uintptr, comprLen uLong, uncompr uintptr, uncomprLen uLong) { /* example.c:334:6: */ 3606 bp := tls.Alloc(168) 3607 defer tls.Free(168) 3608 3609 var err int32 3610 // var d_stream z_stream at bp+56, 112 3611 // decompression stream 3612 3613 libc.Xstrcpy(tls, uncompr, ts+43) 3614 3615 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).zalloc = zalloc 3616 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).zfree = zfree 3617 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).opaque = uintptr(0) 3618 3619 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).next_in = compr 3620 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).avail_in = uInt(comprLen) 3621 3622 err = z.XinflateInit_(tls, bp+56, ts+353, int32(unsafe.Sizeof(z_stream{}))) 3623 { 3624 if err != 0 { 3625 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp, ts+391, err)) 3626 libc.Xexit(tls, 1) 3627 } 3628 } 3629 3630 for { 3631 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).next_out = uncompr // discard the output 3632 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).avail_out = uInt(uncomprLen) 3633 err = z.Xinflate(tls, bp+56, 0) 3634 if err == 1 { 3635 break 3636 } 3637 { 3638 if err != 0 { 3639 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+16, ts+506, err)) 3640 libc.Xexit(tls, 1) 3641 } 3642 } 3643 3644 } 3645 3646 err = z.XinflateEnd(tls, bp+56) 3647 { 3648 if err != 0 { 3649 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+32, ts+411, err)) 3650 libc.Xexit(tls, 1) 3651 } 3652 } 3653 3654 if (*z_stream)(unsafe.Pointer(bp+56)).total_out != uint64(2)*uncomprLen+comprLen/uint64(2) { 3655 libc.Xfprintf(tls, libc.Xstderr, ts+520, libc.VaList(bp+48, (*z_stream)(unsafe.Pointer(bp+56 /* &d_stream */)).total_out)) 3656 libc.Xexit(tls, 1) 3657 } else { 3658 libc.Xprintf(tls, ts+544, 0) 3659 } 3660 } 3661 3662 // =========================================================================== 3663 // Test deflate() with full flush 3664 func test_flush(tls *libc.TLS, compr uintptr, comprLen uintptr) { /* example.c:375:6: */ 3665 bp := tls.Alloc(176) 3666 defer tls.Free(176) 3667 3668 // var c_stream z_stream at bp+64, 112 3669 // compression stream 3670 var err int32 3671 var len uInt = uInt(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&hello)))) + uInt(1) 3672 3673 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).zalloc = zalloc 3674 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).zfree = zfree 3675 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).opaque = uintptr(0) 3676 3677 err = z.XdeflateInit_(tls, bp+64, -1, ts+353, int32(unsafe.Sizeof(z_stream{}))) 3678 { 3679 if err != 0 { 3680 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp, ts+360, err)) 3681 libc.Xexit(tls, 1) 3682 } 3683 } 3684 3685 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).next_in = uintptr(uintptr(unsafe.Pointer(&hello))) 3686 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).next_out = compr 3687 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).avail_in = uInt(3) 3688 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).avail_out = uInt(*(*uLong)(unsafe.Pointer(comprLen))) 3689 err = z.Xdeflate(tls, bp+64, 3) 3690 { 3691 if err != 0 { 3692 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+16, ts+372, err)) 3693 libc.Xexit(tls, 1) 3694 } 3695 } 3696 3697 *(*Byte)(unsafe.Pointer(compr + 3))++ // force an error in first compressed block 3698 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).avail_in = len - uInt(3) 3699 3700 err = z.Xdeflate(tls, bp+64, 4) 3701 if err != 1 { 3702 { 3703 if err != 0 { 3704 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+32, ts+372, err)) 3705 libc.Xexit(tls, 1) 3706 } 3707 } 3708 3709 } 3710 err = z.XdeflateEnd(tls, bp+64) 3711 { 3712 if err != 0 { 3713 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+48, ts+380, err)) 3714 libc.Xexit(tls, 1) 3715 } 3716 } 3717 3718 *(*uLong)(unsafe.Pointer(comprLen)) = (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).total_out 3719 } 3720 3721 // =========================================================================== 3722 // Test inflateSync() 3723 func test_sync(tls *libc.TLS, compr uintptr, comprLen uLong, uncompr uintptr, uncomprLen uLong) { /* example.c:413:6: */ 3724 bp := tls.Alloc(184) 3725 defer tls.Free(184) 3726 3727 var err int32 3728 // var d_stream z_stream at bp+72, 112 3729 // decompression stream 3730 3731 libc.Xstrcpy(tls, uncompr, ts+43) 3732 3733 (*z_stream)(unsafe.Pointer(bp + 72 /* &d_stream */)).zalloc = zalloc 3734 (*z_stream)(unsafe.Pointer(bp + 72 /* &d_stream */)).zfree = zfree 3735 (*z_stream)(unsafe.Pointer(bp + 72 /* &d_stream */)).opaque = uintptr(0) 3736 3737 (*z_stream)(unsafe.Pointer(bp + 72 /* &d_stream */)).next_in = compr 3738 (*z_stream)(unsafe.Pointer(bp + 72 /* &d_stream */)).avail_in = uInt(2) // just read the zlib header 3739 3740 err = z.XinflateInit_(tls, bp+72, ts+353, int32(unsafe.Sizeof(z_stream{}))) 3741 { 3742 if err != 0 { 3743 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp, ts+391, err)) 3744 libc.Xexit(tls, 1) 3745 } 3746 } 3747 3748 (*z_stream)(unsafe.Pointer(bp + 72 /* &d_stream */)).next_out = uncompr 3749 (*z_stream)(unsafe.Pointer(bp + 72 /* &d_stream */)).avail_out = uInt(uncomprLen) 3750 3751 err = z.Xinflate(tls, bp+72, 0) 3752 { 3753 if err != 0 { 3754 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+16, ts+403, err)) 3755 libc.Xexit(tls, 1) 3756 } 3757 } 3758 3759 (*z_stream)(unsafe.Pointer(bp + 72 /* &d_stream */)).avail_in = uInt(comprLen) - uInt(2) // read all compressed data 3760 err = z.XinflateSync(tls, bp+72) /* but skip the damaged part */ 3761 { 3762 if err != 0 { 3763 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+32, ts+565, err)) 3764 libc.Xexit(tls, 1) 3765 } 3766 } 3767 3768 err = z.Xinflate(tls, bp+72, 4) 3769 if err != -3 { 3770 libc.Xfprintf(tls, libc.Xstderr, ts+577, 0) 3771 // Because of incorrect adler32 3772 libc.Xexit(tls, 1) 3773 } 3774 err = z.XinflateEnd(tls, bp+72) 3775 { 3776 if err != 0 { 3777 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+48, ts+411, err)) 3778 libc.Xexit(tls, 1) 3779 } 3780 } 3781 3782 libc.Xprintf(tls, ts+611, libc.VaList(bp+64, uncompr)) 3783 } 3784 3785 // =========================================================================== 3786 // Test deflate() with preset dictionary 3787 func test_dict_deflate(tls *libc.TLS, compr uintptr, comprLen uLong) { /* example.c:457:6: */ 3788 bp := tls.Alloc(160) 3789 defer tls.Free(160) 3790 3791 // var c_stream z_stream at bp+48, 112 3792 // compression stream 3793 var err int32 3794 3795 (*z_stream)(unsafe.Pointer(bp + 48 /* &c_stream */)).zalloc = zalloc 3796 (*z_stream)(unsafe.Pointer(bp + 48 /* &c_stream */)).zfree = zfree 3797 (*z_stream)(unsafe.Pointer(bp + 48 /* &c_stream */)).opaque = uintptr(0) 3798 3799 err = z.XdeflateInit_(tls, bp+48, 9, ts+353, int32(unsafe.Sizeof(z_stream{}))) 3800 { 3801 if err != 0 { 3802 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp, ts+360, err)) 3803 libc.Xexit(tls, 1) 3804 } 3805 } 3806 3807 err = z.XdeflateSetDictionary(tls, bp+48, 3808 uintptr(uintptr(unsafe.Pointer(&dictionary))), uint32(int32(unsafe.Sizeof(dictionary)))) 3809 { 3810 if err != 0 { 3811 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+16, ts+639, err)) 3812 libc.Xexit(tls, 1) 3813 } 3814 } 3815 3816 dictId = (*z_stream)(unsafe.Pointer(bp + 48 /* &c_stream */)).adler 3817 (*z_stream)(unsafe.Pointer(bp + 48 /* &c_stream */)).next_out = compr 3818 (*z_stream)(unsafe.Pointer(bp + 48 /* &c_stream */)).avail_out = uInt(comprLen) 3819 3820 (*z_stream)(unsafe.Pointer(bp + 48 /* &c_stream */)).next_in = uintptr(uintptr(unsafe.Pointer(&hello))) 3821 (*z_stream)(unsafe.Pointer(bp + 48 /* &c_stream */)).avail_in = uInt(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&hello)))) + uInt(1) 3822 3823 err = z.Xdeflate(tls, bp+48, 4) 3824 if err != 1 { 3825 libc.Xfprintf(tls, libc.Xstderr, ts+470, 0) 3826 libc.Xexit(tls, 1) 3827 } 3828 err = z.XdeflateEnd(tls, bp+48) 3829 { 3830 if err != 0 { 3831 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+32, ts+380, err)) 3832 libc.Xexit(tls, 1) 3833 } 3834 } 3835 3836 } 3837 3838 // =========================================================================== 3839 // Test inflate() with a preset dictionary 3840 func test_dict_inflate(tls *libc.TLS, compr uintptr, comprLen uLong, uncompr uintptr, uncomprLen uLong) { /* example.c:494:6: */ 3841 bp := tls.Alloc(168) 3842 defer tls.Free(168) 3843 3844 var err int32 3845 // var d_stream z_stream at bp+56, 112 3846 // decompression stream 3847 3848 libc.Xstrcpy(tls, uncompr, ts+43) 3849 3850 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).zalloc = zalloc 3851 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).zfree = zfree 3852 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).opaque = uintptr(0) 3853 3854 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).next_in = compr 3855 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).avail_in = uInt(comprLen) 3856 3857 err = z.XinflateInit_(tls, bp+56, ts+353, int32(unsafe.Sizeof(z_stream{}))) 3858 { 3859 if err != 0 { 3860 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp, ts+391, err)) 3861 libc.Xexit(tls, 1) 3862 } 3863 } 3864 3865 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).next_out = uncompr 3866 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).avail_out = uInt(uncomprLen) 3867 3868 for { 3869 err = z.Xinflate(tls, bp+56, 0) 3870 if err == 1 { 3871 break 3872 } 3873 if err == 2 { 3874 if (*z_stream)(unsafe.Pointer(bp+56)).adler != dictId { 3875 libc.Xfprintf(tls, libc.Xstderr, ts+660, 0) 3876 libc.Xexit(tls, 1) 3877 } 3878 err = z.XinflateSetDictionary(tls, bp+56, uintptr(uintptr(unsafe.Pointer(&dictionary))), 3879 uint32(int32(unsafe.Sizeof(dictionary)))) 3880 } 3881 { 3882 if err != 0 { 3883 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+16, ts+682, err)) 3884 libc.Xexit(tls, 1) 3885 } 3886 } 3887 3888 } 3889 3890 err = z.XinflateEnd(tls, bp+56) 3891 { 3892 if err != 0 { 3893 libc.Xfprintf(tls, libc.Xstderr, ts+20, libc.VaList(bp+32, ts+411, err)) 3894 libc.Xexit(tls, 1) 3895 } 3896 } 3897 3898 if libc.Xstrcmp(tls, uncompr, uintptr(unsafe.Pointer(&hello))) != 0 { 3899 libc.Xfprintf(tls, libc.Xstderr, ts+700, 0) 3900 libc.Xexit(tls, 1) 3901 } else { 3902 libc.Xprintf(tls, ts+723, libc.VaList(bp+48, uncompr)) 3903 } 3904 } 3905 3906 // =========================================================================== 3907 // Usage: example [output.gz [input.gz]] 3908 3909 func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* example.c:545:5: */ 3910 bp := tls.Alloc(32) 3911 defer tls.Free(32) 3912 3913 var compr uintptr 3914 var uncompr uintptr 3915 *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)) = uint64(10000) * uint64(unsafe.Sizeof(int32(0))) // don't overflow on MSDOS 3916 var uncomprLen uLong = *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)) 3917 3918 if int32(*(*uint8)(unsafe.Pointer(z.XzlibVersion(tls)))) != int32(*(*uint8)(unsafe.Pointer(myVersion))) { 3919 libc.Xfprintf(tls, libc.Xstderr, ts+752, 0) 3920 libc.Xexit(tls, 1) 3921 3922 } else if libc.Xstrcmp(tls, z.XzlibVersion(tls), ts+353) != 0 { 3923 libc.Xfprintf(tls, libc.Xstderr, ts+779, 0) 3924 } 3925 3926 libc.Xprintf(tls, ts+812, 3927 libc.VaList(bp, ts+353, 0x12b0, z.XzlibCompileFlags(tls))) 3928 3929 compr = libc.Xcalloc(tls, uint64(uInt(*(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)))), uint64(1)) 3930 uncompr = libc.Xcalloc(tls, uint64(uInt(uncomprLen)), uint64(1)) 3931 // compr and uncompr are cleared to avoid reading uninitialized 3932 // data and to ensure that uncompr compresses well. 3933 if compr == uintptr(0) || uncompr == uintptr(0) { 3934 libc.Xprintf(tls, ts+861, 0) 3935 libc.Xexit(tls, 1) 3936 } 3937 3938 test_compress(tls, compr, *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)), uncompr, uncomprLen) 3939 3940 test_gzio(tls, func() uintptr { 3941 if argc > 1 { 3942 return *(*uintptr)(unsafe.Pointer(argv + 1*8)) 3943 } 3944 return ts + 876 3945 }(), 3946 uncompr, uncomprLen) 3947 3948 test_deflate(tls, compr, *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */))) 3949 test_inflate(tls, compr, *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)), uncompr, uncomprLen) 3950 3951 test_large_deflate(tls, compr, *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)), uncompr, uncomprLen) 3952 test_large_inflate(tls, compr, *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)), uncompr, uncomprLen) 3953 3954 test_flush(tls, compr, bp+24) 3955 test_sync(tls, compr, *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)), uncompr, uncomprLen) 3956 *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)) = uncomprLen 3957 3958 test_dict_deflate(tls, compr, *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */))) 3959 test_dict_inflate(tls, compr, *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)), uncompr, uncomprLen) 3960 3961 libc.Xfree(tls, compr) 3962 libc.Xfree(tls, uncompr) 3963 3964 return 0 3965 } 3966 3967 var myVersion uintptr = ts + 353 /* "1.2.11" */ /* example.c:552:22 */ 3968 3969 var ts1 = "hello, hello!\x00hello\x00%s error: %d\n\x00compress\x00garbage\x00uncompress\x00bad uncompress\n\x00uncompress(): %s\n\x00wb\x00gzopen error\n\x00ello\x00gzputs err: %s\n\x00, %s!\x00gzprintf err: %s\n\x00rb\x00gzread err: %s\n\x00bad gzread: %s\n\x00gzread(): %s\n\x00gzseek error, pos=%ld, gztell=%ld\n\x00gzgetc error\n\x00gzungetc error\n\x00gzgets err after gzseek: %s\n\x00bad gzgets after gzseek\n\x00gzgets() after gzseek: %s\n\x001.2.11\x00deflateInit\x00deflate\x00deflateEnd\x00inflateInit\x00inflate\x00inflateEnd\x00bad inflate\n\x00inflate(): %s\n\x00deflate not greedy\n\x00deflate should report Z_STREAM_END\n\x00large inflate\x00bad large inflate: %ld\n\x00large_inflate(): OK\n\x00inflateSync\x00inflate should report DATA_ERROR\n\x00after inflateSync(): hel%s\n\x00deflateSetDictionary\x00unexpected dictionary\x00inflate with dict\x00bad inflate with dict\n\x00inflate with dictionary: %s\n\x00incompatible zlib version\n\x00warning: different zlib version\n\x00zlib version %s = 0x%04x, compile flags = 0x%lx\n\x00out of memory\n\x00foo.gz\x00" 3970 var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data