modernc.org/z@v1.7.4/internal/example_openbsd_arm64.go (about) 1 // Code generated by 'ccgo -lmodernc.org/z/lib -o internal/example_openbsd_arm64.go -trace-translation-units /home/jnml/tmpdir/go-generate-382458099/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 type ptrdiff_t = int64 /* <builtin>:3:26 */ 26 27 type size_t = uint64 /* <builtin>:9:23 */ 28 29 type wchar_t = int32 /* <builtin>:15:24 */ 30 31 type wint_t = int32 /* stddef.h:60:18 */ 32 33 type mbstate_t = struct { 34 _ [0]uint64 35 __mbstate8 [128]int8 36 } /* stddef.h:65:21 */ 37 38 type max_align_t = struct { 39 __max_align_ll int64 40 __max_align_ld float64 41 } /* stddef.h:80:3 */ 42 43 type z_size_t = size_t /* zconf.h:248:21 */ 44 45 // Maximum value for memLevel in deflateInit2 46 47 // Maximum value for windowBits in deflateInit2 and inflateInit2. 48 // WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files 49 // created by gzip. (Files created by minigzip can still be extracted by 50 // gzip.) 51 52 // The memory requirements for deflate are (in bytes): 53 // (1 << (windowBits+2)) + (1 << (memLevel+9)) 54 // that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) 55 // plus a few kilobytes for small objects. For example, if you want to reduce 56 // the default memory requirements from 256K to 128K, compile with 57 // make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" 58 // Of course this will generally degrade compression (there's no free lunch). 59 // 60 // The memory requirements for inflate are (in bytes) 1 << windowBits 61 // that is, 32K for windowBits=15 (default value) plus about 7 kilobytes 62 // for small objects. 63 64 // Type declarations 65 66 // The following definitions for FAR are needed only for MSDOS mixed 67 // model programming (small or medium model with some far allocations). 68 // This was tested only with MSC; for other MSDOS compilers you may have 69 // to define NO_MEMCPY in zutil.h. If you don't need the mixed model, 70 // just define FAR to be empty. 71 72 type Byte = uint8 /* zconf.h:391:24 */ // 8 bits 73 type uInt = uint32 /* zconf.h:393:24 */ // 16 bits or more 74 type uLong = uint64 /* zconf.h:394:24 */ // 32 bits or more 75 76 type Bytef = Byte /* zconf.h:400:22 */ 77 type charf = int8 /* zconf.h:402:19 */ 78 type intf = int32 /* zconf.h:403:19 */ 79 type uIntf = uInt /* zconf.h:404:19 */ 80 type uLongf = uLong /* zconf.h:405:19 */ 81 82 type voidpc = uintptr /* zconf.h:408:23 */ 83 type voidpf = uintptr /* zconf.h:409:23 */ 84 type voidp = uintptr /* zconf.h:410:23 */ 85 86 // $OpenBSD: limits.h,v 1.19 2015/01/20 22:09:50 tedu Exp $ 87 // $NetBSD: limits.h,v 1.7 1994/10/26 00:56:00 cgd Exp $ 88 89 // Copyright (c) 1988 The Regents of the University of California. 90 // All rights reserved. 91 // 92 // Redistribution and use in source and binary forms, with or without 93 // modification, are permitted provided that the following conditions 94 // are met: 95 // 1. Redistributions of source code must retain the above copyright 96 // notice, this list of conditions and the following disclaimer. 97 // 2. Redistributions in binary form must reproduce the above copyright 98 // notice, this list of conditions and the following disclaimer in the 99 // documentation and/or other materials provided with the distribution. 100 // 3. Neither the name of the University nor the names of its contributors 101 // may be used to endorse or promote products derived from this software 102 // without specific prior written permission. 103 // 104 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 105 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 106 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 107 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 108 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 109 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 110 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 111 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 112 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 113 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 114 // SUCH DAMAGE. 115 // 116 // @(#)limits.h 5.9 (Berkeley) 4/3/91 117 118 // $OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $ 119 // $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $ 120 121 // Copyright (c) 1991, 1993 122 // The Regents of the University of California. All rights reserved. 123 // 124 // This code is derived from software contributed to Berkeley by 125 // Berkeley Software Design, Inc. 126 // 127 // Redistribution and use in source and binary forms, with or without 128 // modification, are permitted provided that the following conditions 129 // are met: 130 // 1. Redistributions of source code must retain the above copyright 131 // notice, this list of conditions and the following disclaimer. 132 // 2. Redistributions in binary form must reproduce the above copyright 133 // notice, this list of conditions and the following disclaimer in the 134 // documentation and/or other materials provided with the distribution. 135 // 3. Neither the name of the University nor the names of its contributors 136 // may be used to endorse or promote products derived from this software 137 // without specific prior written permission. 138 // 139 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 140 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 141 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 142 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 143 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 144 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 145 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 146 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 147 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 148 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 149 // SUCH DAMAGE. 150 // 151 // @(#)cdefs.h 8.7 (Berkeley) 1/21/94 152 153 // $OpenBSD: limits.h,v 1.10 2012/06/30 20:21:10 guenther Exp $ 154 // Copyright (c) 2002 Marc Espie. 155 // 156 // Redistribution and use in source and binary forms, with or without 157 // modification, are permitted provided that the following conditions 158 // are met: 159 // 1. Redistributions of source code must retain the above copyright 160 // notice, this list of conditions and the following disclaimer. 161 // 2. Redistributions in binary form must reproduce the above copyright 162 // notice, this list of conditions and the following disclaimer in the 163 // documentation and/or other materials provided with the distribution. 164 // 165 // THIS SOFTWARE IS PROVIDED BY THE OPENBSD PROJECT AND CONTRIBUTORS 166 // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 167 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 168 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBSD 169 // PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 170 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 171 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 172 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 173 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 174 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 175 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 176 177 // $OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $ 178 // $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $ 179 180 // Copyright (c) 1991, 1993 181 // The Regents of the University of California. All rights reserved. 182 // 183 // This code is derived from software contributed to Berkeley by 184 // Berkeley Software Design, Inc. 185 // 186 // Redistribution and use in source and binary forms, with or without 187 // modification, are permitted provided that the following conditions 188 // are met: 189 // 1. Redistributions of source code must retain the above copyright 190 // notice, this list of conditions and the following disclaimer. 191 // 2. Redistributions in binary form must reproduce the above copyright 192 // notice, this list of conditions and the following disclaimer in the 193 // documentation and/or other materials provided with the distribution. 194 // 3. Neither the name of the University nor the names of its contributors 195 // may be used to endorse or promote products derived from this software 196 // without specific prior written permission. 197 // 198 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 199 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 200 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 201 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 202 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 203 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 204 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 205 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 206 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 207 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 208 // SUCH DAMAGE. 209 // 210 // @(#)cdefs.h 8.7 (Berkeley) 1/21/94 211 212 // Common definitions for limits.h. 213 214 // Legacy 215 // $OpenBSD: limits.h,v 1.1 2016/12/17 23:38:33 patrick Exp $ 216 // $NetBSD: limits.h,v 1.4 2003/04/28 23:16:18 bjh21 Exp $ 217 218 // Copyright (c) 1988 The Regents of the University of California. 219 // All rights reserved. 220 // 221 // Redistribution and use in source and binary forms, with or without 222 // modification, are permitted provided that the following conditions 223 // are met: 224 // 1. Redistributions of source code must retain the above copyright 225 // notice, this list of conditions and the following disclaimer. 226 // 2. Redistributions in binary form must reproduce the above copyright 227 // notice, this list of conditions and the following disclaimer in the 228 // documentation and/or other materials provided with the distribution. 229 // 3. Neither the name of the University nor the names of its contributors 230 // may be used to endorse or promote products derived from this software 231 // without specific prior written permission. 232 // 233 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 234 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 235 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 236 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 237 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 238 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 239 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 240 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 241 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 242 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 243 // SUCH DAMAGE. 244 // 245 // from: @(#)limits.h 7.2 (Berkeley) 6/28/90 246 247 // $OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $ 248 // $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $ 249 250 // Copyright (c) 1991, 1993 251 // The Regents of the University of California. All rights reserved. 252 // 253 // This code is derived from software contributed to Berkeley by 254 // Berkeley Software Design, Inc. 255 // 256 // Redistribution and use in source and binary forms, with or without 257 // modification, are permitted provided that the following conditions 258 // are met: 259 // 1. Redistributions of source code must retain the above copyright 260 // notice, this list of conditions and the following disclaimer. 261 // 2. Redistributions in binary form must reproduce the above copyright 262 // notice, this list of conditions and the following disclaimer in the 263 // documentation and/or other materials provided with the distribution. 264 // 3. Neither the name of the University nor the names of its contributors 265 // may be used to endorse or promote products derived from this software 266 // without specific prior written permission. 267 // 268 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 269 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 270 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 271 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 272 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 273 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 274 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 275 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 276 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 277 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 278 // SUCH DAMAGE. 279 // 280 // @(#)cdefs.h 8.7 (Berkeley) 1/21/94 281 282 // max value for unsigned long 283 // max value for a signed long 284 // min value for a signed long 285 286 // max value for unsigned long long 287 // max value for a signed long long 288 // min value for a signed long long 289 290 // $OpenBSD: syslimits.h,v 1.15 2022/02/22 16:58:08 deraadt Exp $ 291 // $NetBSD: syslimits.h,v 1.12 1995/10/05 05:26:19 thorpej Exp $ 292 293 // Copyright (c) 1988, 1993 294 // The Regents of the University of California. All rights reserved. 295 // 296 // Redistribution and use in source and binary forms, with or without 297 // modification, are permitted provided that the following conditions 298 // are met: 299 // 1. Redistributions of source code must retain the above copyright 300 // notice, this list of conditions and the following disclaimer. 301 // 2. Redistributions in binary form must reproduce the above copyright 302 // notice, this list of conditions and the following disclaimer in the 303 // documentation and/or other materials provided with the distribution. 304 // 3. Neither the name of the University nor the names of its contributors 305 // may be used to endorse or promote products derived from this software 306 // without specific prior written permission. 307 // 308 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 309 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 310 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 311 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 312 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 313 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 314 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 315 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 316 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 317 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 318 // SUCH DAMAGE. 319 // 320 // @(#)syslimits.h 8.1 (Berkeley) 6/2/93 321 322 // $OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $ 323 // $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $ 324 325 // Copyright (c) 1991, 1993 326 // The Regents of the University of California. All rights reserved. 327 // 328 // This code is derived from software contributed to Berkeley by 329 // Berkeley Software Design, Inc. 330 // 331 // Redistribution and use in source and binary forms, with or without 332 // modification, are permitted provided that the following conditions 333 // are met: 334 // 1. Redistributions of source code must retain the above copyright 335 // notice, this list of conditions and the following disclaimer. 336 // 2. Redistributions in binary form must reproduce the above copyright 337 // notice, this list of conditions and the following disclaimer in the 338 // documentation and/or other materials provided with the distribution. 339 // 3. Neither the name of the University nor the names of its contributors 340 // may be used to endorse or promote products derived from this software 341 // without specific prior written permission. 342 // 343 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 344 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 345 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 346 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 347 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 348 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 349 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 350 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 351 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 352 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 353 // SUCH DAMAGE. 354 // 355 // @(#)cdefs.h 8.7 (Berkeley) 1/21/94 356 357 type z_crc_t = uint32 /* zconf.h:429:17 */ 358 359 // Tell sys/endian.h we have MD variants of the swap macros. 360 361 // Note that these macros evaluate their arguments several times. 362 363 // Public names 364 365 // These are specified to be function-like macros to match the spec 366 367 // POSIX names 368 369 // original BSD names 370 371 // these were exposed here before 372 373 // ancient stuff 374 375 type u_char = uint8 /* types.h:51:23 */ 376 type u_short = uint16 /* types.h:52:24 */ 377 type u_int = uint32 /* types.h:53:22 */ 378 type u_long = uint64 /* types.h:54:23 */ 379 380 type unchar = uint8 /* types.h:56:23 */ // Sys V compatibility 381 type ushort = uint16 /* types.h:57:24 */ // Sys V compatibility 382 type uint = uint32 /* types.h:58:22 */ // Sys V compatibility 383 type ulong = uint64 /* types.h:59:23 */ // Sys V compatibility 384 385 type cpuid_t = uint64 /* types.h:61:19 */ // CPU id 386 type register_t = int64 /* types.h:62:22 */ // register-sized type 387 388 // XXX The exact-width bit types should only be exposed if __BSD_VISIBLE 389 // but the rest of the includes are not ready for that yet. 390 391 type int8_t = int8 /* types.h:75:19 */ 392 393 type uint8_t = uint8 /* types.h:80:20 */ 394 395 type int16_t = int16 /* types.h:85:20 */ 396 397 type uint16_t = uint16 /* types.h:90:21 */ 398 399 type int32_t = int32 /* types.h:95:20 */ 400 401 type uint32_t = uint32 /* types.h:100:21 */ 402 403 type int64_t = int64 /* types.h:105:20 */ 404 405 type uint64_t = uint64 /* types.h:110:21 */ 406 407 // BSD-style unsigned bits types 408 type u_int8_t = uint8 /* types.h:114:19 */ 409 type u_int16_t = uint16 /* types.h:115:20 */ 410 type u_int32_t = uint32 /* types.h:116:20 */ 411 type u_int64_t = uint64 /* types.h:117:20 */ 412 413 // quads, deprecated in favor of 64 bit int types 414 type quad_t = int64 /* types.h:120:19 */ 415 type u_quad_t = uint64 /* types.h:121:20 */ 416 417 // VM system types 418 type vaddr_t = uint64 /* types.h:125:19 */ 419 type paddr_t = uint64 /* types.h:126:19 */ 420 type vsize_t = uint64 /* types.h:127:19 */ 421 type psize_t = uint64 /* types.h:128:19 */ 422 423 // Standard system types 424 type blkcnt_t = int64 /* types.h:132:20 */ // blocks allocated for file 425 type blksize_t = int32 /* types.h:133:21 */ // optimal blocksize for I/O 426 type caddr_t = uintptr /* types.h:134:14 */ // core address 427 type daddr32_t = int32 /* types.h:135:19 */ // 32-bit disk address 428 type daddr_t = int64 /* types.h:136:19 */ // 64-bit disk address 429 type dev_t = int32 /* types.h:137:18 */ // device number 430 type fixpt_t = uint32 /* types.h:138:19 */ // fixed point number 431 type gid_t = uint32 /* types.h:139:18 */ // group id 432 type id_t = uint32 /* types.h:140:17 */ // may contain pid, uid or gid 433 type ino_t = uint64 /* types.h:141:18 */ // inode number 434 type key_t = int64 /* types.h:142:18 */ // IPC key (for Sys V IPC) 435 type mode_t = uint32 /* types.h:143:18 */ // permissions 436 type nlink_t = uint32 /* types.h:144:19 */ // link count 437 type rlim_t = uint64 /* types.h:145:18 */ // resource limit 438 type segsz_t = int32 /* types.h:146:19 */ // segment size 439 type uid_t = uint32 /* types.h:147:18 */ // user id 440 type useconds_t = uint32 /* types.h:148:22 */ // microseconds 441 type suseconds_t = int64 /* types.h:149:23 */ // microseconds (signed) 442 type fsblkcnt_t = uint64 /* types.h:150:22 */ // file system block count 443 type fsfilcnt_t = uint64 /* types.h:151:22 */ // file system file count 444 445 // The following types may be defined in multiple header files. 446 type clock_t = int64 /* types.h:158:19 */ 447 448 type clockid_t = int32 /* types.h:163:21 */ 449 450 type pid_t = int32 /* types.h:168:18 */ 451 452 type ssize_t = int64 /* types.h:178:19 */ 453 454 type time_t = int64 /* types.h:183:18 */ 455 456 type timer_t = int32 /* types.h:188:19 */ 457 458 type off_t = int64 /* types.h:193:18 */ 459 460 // Note that the type used in va_arg is supposed to match the 461 // actual type **after default promotions**. 462 // Thus, va_arg (..., short) is not valid. 463 464 type va_list = uintptr /* stdarg.h:39:24 */ 465 466 // a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and 467 // "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even 468 // though the former does not conform to the LFS document), but considering 469 // both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as 470 // equivalently requesting no 64-bit operations 471 472 // $OpenBSD: unistd.h,v 1.106 2018/07/13 09:25:22 beck Exp $ 473 // $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ 474 475 // - 476 // Copyright (c) 1991 The Regents of the University of California. 477 // All rights reserved. 478 // 479 // Redistribution and use in source and binary forms, with or without 480 // modification, are permitted provided that the following conditions 481 // are met: 482 // 1. Redistributions of source code must retain the above copyright 483 // notice, this list of conditions and the following disclaimer. 484 // 2. Redistributions in binary form must reproduce the above copyright 485 // notice, this list of conditions and the following disclaimer in the 486 // documentation and/or other materials provided with the distribution. 487 // 3. Neither the name of the University nor the names of its contributors 488 // may be used to endorse or promote products derived from this software 489 // without specific prior written permission. 490 // 491 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 492 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 493 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 494 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 495 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 496 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 497 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 498 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 499 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 500 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 501 // SUCH DAMAGE. 502 // 503 // @(#)unistd.h 5.13 (Berkeley) 6/17/91 504 505 // $OpenBSD: _null.h,v 1.2 2016/09/09 22:07:58 millert Exp $ 506 507 // Written by Todd C. Miller, September 9, 2016 508 // Public domain. 509 510 // $OpenBSD: types.h,v 1.49 2022/08/06 13:31:13 semarie Exp $ 511 // $NetBSD: types.h,v 1.29 1996/11/15 22:48:25 jtc Exp $ 512 513 // - 514 // Copyright (c) 1982, 1986, 1991, 1993 515 // The Regents of the University of California. All rights reserved. 516 // (c) UNIX System Laboratories, Inc. 517 // All or some portions of this file are derived from material licensed 518 // to the University of California by American Telephone and Telegraph 519 // Co. or Unix System Laboratories, Inc. and are reproduced herein with 520 // the permission of UNIX System Laboratories, Inc. 521 // 522 // Redistribution and use in source and binary forms, with or without 523 // modification, are permitted provided that the following conditions 524 // are met: 525 // 1. Redistributions of source code must retain the above copyright 526 // notice, this list of conditions and the following disclaimer. 527 // 2. Redistributions in binary form must reproduce the above copyright 528 // notice, this list of conditions and the following disclaimer in the 529 // documentation and/or other materials provided with the distribution. 530 // 3. Neither the name of the University nor the names of its contributors 531 // may be used to endorse or promote products derived from this software 532 // without specific prior written permission. 533 // 534 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 535 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 536 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 537 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 538 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 539 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 540 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 541 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 542 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 543 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 544 // SUCH DAMAGE. 545 // 546 // @(#)types.h 8.4 (Berkeley) 1/21/94 547 548 // $OpenBSD: unistd.h,v 1.31 2015/07/20 00:56:10 guenther Exp $ 549 // $NetBSD: unistd.h,v 1.10 1994/06/29 06:46:06 cgd Exp $ 550 551 // Copyright (c) 1989, 1993 552 // The Regents of the University of California. All rights reserved. 553 // 554 // Redistribution and use in source and binary forms, with or without 555 // modification, are permitted provided that the following conditions 556 // are met: 557 // 1. Redistributions of source code must retain the above copyright 558 // notice, this list of conditions and the following disclaimer. 559 // 2. Redistributions in binary form must reproduce the above copyright 560 // notice, this list of conditions and the following disclaimer in the 561 // documentation and/or other materials provided with the distribution. 562 // 3. Neither the name of the University nor the names of its contributors 563 // may be used to endorse or promote products derived from this software 564 // without specific prior written permission. 565 // 566 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 567 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 568 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 569 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 570 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 571 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 572 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 573 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 574 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 575 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 576 // SUCH DAMAGE. 577 // 578 // @(#)unistd.h 8.2 (Berkeley) 1/7/94 579 580 // $OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $ 581 // $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $ 582 583 // Copyright (c) 1991, 1993 584 // The Regents of the University of California. All rights reserved. 585 // 586 // This code is derived from software contributed to Berkeley by 587 // Berkeley Software Design, Inc. 588 // 589 // Redistribution and use in source and binary forms, with or without 590 // modification, are permitted provided that the following conditions 591 // are met: 592 // 1. Redistributions of source code must retain the above copyright 593 // notice, this list of conditions and the following disclaimer. 594 // 2. Redistributions in binary form must reproduce the above copyright 595 // notice, this list of conditions and the following disclaimer in the 596 // documentation and/or other materials provided with the distribution. 597 // 3. Neither the name of the University nor the names of its contributors 598 // may be used to endorse or promote products derived from this software 599 // without specific prior written permission. 600 // 601 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 602 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 603 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 604 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 605 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 606 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 607 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 608 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 609 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 610 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 611 // SUCH DAMAGE. 612 // 613 // @(#)cdefs.h 8.7 (Berkeley) 1/21/94 614 615 // Define the POSIX.1 version we target for compliance. 616 617 // access function 618 619 // whence values for lseek(2) 620 621 // old BSD whence values for lseek(2); renamed by POSIX 1003.1 622 623 // the parameters argument passed to the __tfork() syscall 624 type __tfork = struct { 625 tf_tcb uintptr 626 tf_tid uintptr 627 tf_stack uintptr 628 } /* unistd.h:66:1 */ 629 630 // the parameters argument for the kbind() syscall 631 type __kbind = struct { 632 kb_addr uintptr 633 kb_size size_t 634 } /* unistd.h:73:1 */ 635 636 // the pathconf(2) variable values are part of the ABI 637 638 // configurable pathname variables 639 640 // POSIX options and option groups we unconditionally do or don't 641 // implement. Please keep this list in alphabetical order. 642 // 643 // Anything which is defined as zero below **must** have an 644 // implementation for the corresponding sysconf() which is able to 645 // determine conclusively whether or not the feature is supported. 646 // Anything which is defined as other than -1 below **must** have 647 // complete headers, types, and function declarations as specified by 648 // the POSIX standard; however, if the relevant sysconf() function 649 // returns -1, the functions may be stubbed out. 650 651 // Define the POSIX.2 version we target for compliance. 652 653 // the sysconf(3) variable values are part of the ABI 654 655 // configurable system variables 656 657 // configurable system strings 658 659 type intptr_t = int64 /* unistd.h:320:21 */ 660 661 // MVS linker does not support external names larger than 8 bytes 662 663 // 664 // The 'zlib' compression library provides in-memory compression and 665 // decompression functions, including integrity checks of the uncompressed data. 666 // This version of the library supports only one compression method (deflation) 667 // but other algorithms will be added later and will have the same stream 668 // interface. 669 // 670 // Compression can be done in a single step if the buffers are large enough, 671 // or can be done by repeated calls of the compression function. In the latter 672 // case, the application must provide more input and/or consume the output 673 // (providing more output space) before each call. 674 // 675 // The compressed data format used by default by the in-memory functions is 676 // the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped 677 // around a deflate stream, which is itself documented in RFC 1951. 678 // 679 // The library also supports reading and writing files in gzip (.gz) format 680 // with an interface similar to that of stdio using the functions that start 681 // with "gz". The gzip format is different from the zlib format. gzip is a 682 // gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. 683 // 684 // This library can optionally read and write gzip and raw deflate streams in 685 // memory as well. 686 // 687 // The zlib format was designed to be compact and fast for use in memory 688 // and on communications channels. The gzip format was designed for single- 689 // file compression on file systems, has a larger header than zlib to maintain 690 // directory information, and uses a different, slower check method than zlib. 691 // 692 // The library does not install any signal handler. The decoder checks 693 // the consistency of the compressed data, so the library should never crash 694 // even in the case of corrupted input. 695 696 type alloc_func = uintptr /* zlib.h:81:16 */ 697 type free_func = uintptr /* zlib.h:82:16 */ 698 699 type z_stream_s = struct { 700 next_in uintptr 701 avail_in uInt 702 _ [4]byte 703 total_in uLong 704 next_out uintptr 705 avail_out uInt 706 _ [4]byte 707 total_out uLong 708 msg uintptr 709 state uintptr 710 zalloc alloc_func 711 zfree free_func 712 opaque voidpf 713 data_type int32 714 _ [4]byte 715 adler uLong 716 reserved uLong 717 } /* zlib.h:86:9 */ 718 719 type z_stream = z_stream_s /* zlib.h:106:3 */ 720 721 type z_streamp = uintptr /* zlib.h:108:22 */ 722 723 // gzip header information passed to and from zlib routines. See RFC 1952 724 // 725 // for more details on the meanings of these fields. 726 type gz_header_s = struct { 727 text int32 728 _ [4]byte 729 time uLong 730 xflags int32 731 os int32 732 extra uintptr 733 extra_len uInt 734 extra_max uInt 735 name uintptr 736 name_max uInt 737 _ [4]byte 738 comment uintptr 739 comm_max uInt 740 hcrc int32 741 done int32 742 _ [4]byte 743 } /* zlib.h:114:9 */ 744 745 // gzip header information passed to and from zlib routines. See RFC 1952 746 // 747 // for more details on the meanings of these fields. 748 type gz_header = gz_header_s /* zlib.h:129:3 */ 749 750 type gz_headerp = uintptr /* zlib.h:131:23 */ 751 // 752 // inflateGetHeader() requests that gzip header information be stored in the 753 // provided gz_header structure. inflateGetHeader() may be called after 754 // inflateInit2() or inflateReset(), and before the first call of inflate(). 755 // As inflate() processes the gzip stream, head->done is zero until the header 756 // is completed, at which time head->done is set to one. If a zlib stream is 757 // being decoded, then head->done is set to -1 to indicate that there will be 758 // no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be 759 // used to force inflate() to return immediately after header processing is 760 // complete and before any actual data is decompressed. 761 // 762 // The text, time, xflags, and os fields are filled in with the gzip header 763 // contents. hcrc is set to true if there is a header CRC. (The header CRC 764 // was valid if done is set to one.) If extra is not Z_NULL, then extra_max 765 // contains the maximum number of bytes to write to extra. Once done is true, 766 // extra_len contains the actual extra field length, and extra contains the 767 // extra field, or that field truncated if extra_max is less than extra_len. 768 // If name is not Z_NULL, then up to name_max characters are written there, 769 // terminated with a zero unless the length is greater than name_max. If 770 // comment is not Z_NULL, then up to comm_max characters are written there, 771 // terminated with a zero unless the length is greater than comm_max. When any 772 // of extra, name, or comment are not Z_NULL and the respective field is not 773 // present in the header, then that field is set to Z_NULL to signal its 774 // absence. This allows the use of deflateSetHeader() with the returned 775 // structure to duplicate the header. However if those fields are set to 776 // allocated memory, then the application will need to save those pointers 777 // elsewhere so that they can be eventually freed. 778 // 779 // If inflateGetHeader is not used, then the header information is simply 780 // discarded. The header is always checked for validity, including the header 781 // CRC if present. inflateReset() will reset the process to discard the header 782 // information. The application would need to call inflateGetHeader() again to 783 // retrieve the header from the next gzip stream. 784 // 785 // inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source 786 // stream state was inconsistent. 787 788 // 789 // ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, 790 // unsigned char FAR *window)); 791 // 792 // Initialize the internal stream state for decompression using inflateBack() 793 // calls. The fields zalloc, zfree and opaque in strm must be initialized 794 // before the call. If zalloc and zfree are Z_NULL, then the default library- 795 // derived memory allocation routines are used. windowBits is the base two 796 // logarithm of the window size, in the range 8..15. window is a caller 797 // supplied buffer of that size. Except for special applications where it is 798 // assured that deflate was used with small window sizes, windowBits must be 15 799 // and a 32K byte window must be supplied to be able to decompress general 800 // deflate streams. 801 // 802 // See inflateBack() for the usage of these routines. 803 // 804 // inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of 805 // the parameters are invalid, Z_MEM_ERROR if the internal state could not be 806 // allocated, or Z_VERSION_ERROR if the version of the library does not match 807 // the version of the header file. 808 809 type in_func = uintptr /* zlib.h:1092:18 */ 810 type out_func = uintptr /* zlib.h:1094:13 */ 811 // 812 // Same as uncompress, except that sourceLen is a pointer, where the 813 // length of the source is *sourceLen. On return, *sourceLen is the number of 814 // source bytes consumed. 815 816 // gzip file access functions 817 818 // 819 // This library supports reading and writing files in gzip (.gz) format with 820 // an interface similar to that of stdio, using the functions that start with 821 // "gz". The gzip format is different from the zlib format. gzip is a gzip 822 // wrapper, documented in RFC 1952, wrapped around a deflate stream. 823 824 type gzFile_s = struct { 825 have uint32 826 _ [4]byte 827 next uintptr 828 pos off_t 829 } /* zlib.h:1300:9 */ 830 831 // 832 // Same as uncompress, except that sourceLen is a pointer, where the 833 // length of the source is *sourceLen. On return, *sourceLen is the number of 834 // source bytes consumed. 835 836 // gzip file access functions 837 838 // 839 // This library supports reading and writing files in gzip (.gz) format with 840 // an interface similar to that of stdio, using the functions that start with 841 // "gz". The gzip format is different from the zlib format. gzip is a gzip 842 // wrapper, documented in RFC 1952, wrapped around a deflate stream. 843 844 type gzFile = uintptr /* zlib.h:1300:25 */ 845 846 // $OpenBSD: stdio.h,v 1.55 2022/01/05 20:57:27 millert Exp $ 847 // $NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $ 848 849 // - 850 // Copyright (c) 1990 The Regents of the University of California. 851 // All rights reserved. 852 // 853 // This code is derived from software contributed to Berkeley by 854 // Chris Torek. 855 // 856 // Redistribution and use in source and binary forms, with or without 857 // modification, are permitted provided that the following conditions 858 // are met: 859 // 1. Redistributions of source code must retain the above copyright 860 // notice, this list of conditions and the following disclaimer. 861 // 2. Redistributions in binary form must reproduce the above copyright 862 // notice, this list of conditions and the following disclaimer in the 863 // documentation and/or other materials provided with the distribution. 864 // 3. Neither the name of the University nor the names of its contributors 865 // may be used to endorse or promote products derived from this software 866 // without specific prior written permission. 867 // 868 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 869 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 870 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 871 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 872 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 873 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 874 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 875 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 876 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 877 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 878 // SUCH DAMAGE. 879 // 880 // @(#)stdio.h 5.17 (Berkeley) 6/3/91 881 882 // $OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $ 883 // $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $ 884 885 // Copyright (c) 1991, 1993 886 // The Regents of the University of California. All rights reserved. 887 // 888 // This code is derived from software contributed to Berkeley by 889 // Berkeley Software Design, Inc. 890 // 891 // Redistribution and use in source and binary forms, with or without 892 // modification, are permitted provided that the following conditions 893 // are met: 894 // 1. Redistributions of source code must retain the above copyright 895 // notice, this list of conditions and the following disclaimer. 896 // 2. Redistributions in binary form must reproduce the above copyright 897 // notice, this list of conditions and the following disclaimer in the 898 // documentation and/or other materials provided with the distribution. 899 // 3. Neither the name of the University nor the names of its contributors 900 // may be used to endorse or promote products derived from this software 901 // without specific prior written permission. 902 // 903 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 904 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 905 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 906 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 907 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 908 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 909 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 910 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 911 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 912 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 913 // SUCH DAMAGE. 914 // 915 // @(#)cdefs.h 8.7 (Berkeley) 1/21/94 916 917 // $OpenBSD: _null.h,v 1.2 2016/09/09 22:07:58 millert Exp $ 918 919 // Written by Todd C. Miller, September 9, 2016 920 // Public domain. 921 922 // $OpenBSD: _types.h,v 1.10 2022/08/06 13:31:13 semarie Exp $ 923 924 // - 925 // Copyright (c) 1990, 1993 926 // The Regents of the University of California. All rights reserved. 927 // 928 // Redistribution and use in source and binary forms, with or without 929 // modification, are permitted provided that the following conditions 930 // are met: 931 // 1. Redistributions of source code must retain the above copyright 932 // notice, this list of conditions and the following disclaimer. 933 // 2. Redistributions in binary form must reproduce the above copyright 934 // notice, this list of conditions and the following disclaimer in the 935 // documentation and/or other materials provided with the distribution. 936 // 3. Neither the name of the University nor the names of its contributors 937 // may be used to endorse or promote products derived from this software 938 // without specific prior written permission. 939 // 940 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 941 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 942 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 943 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 944 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 945 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 946 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 947 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 948 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 949 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 950 // SUCH DAMAGE. 951 // 952 // @(#)types.h 8.3 (Berkeley) 1/5/94 953 954 // $OpenBSD: types.h,v 1.49 2022/08/06 13:31:13 semarie Exp $ 955 // $NetBSD: types.h,v 1.29 1996/11/15 22:48:25 jtc Exp $ 956 957 // - 958 // Copyright (c) 1982, 1986, 1991, 1993 959 // The Regents of the University of California. All rights reserved. 960 // (c) UNIX System Laboratories, Inc. 961 // All or some portions of this file are derived from material licensed 962 // to the University of California by American Telephone and Telegraph 963 // Co. or Unix System Laboratories, Inc. and are reproduced herein with 964 // the permission of UNIX System Laboratories, Inc. 965 // 966 // Redistribution and use in source and binary forms, with or without 967 // modification, are permitted provided that the following conditions 968 // are met: 969 // 1. Redistributions of source code must retain the above copyright 970 // notice, this list of conditions and the following disclaimer. 971 // 2. Redistributions in binary form must reproduce the above copyright 972 // notice, this list of conditions and the following disclaimer in the 973 // documentation and/or other materials provided with the distribution. 974 // 3. Neither the name of the University nor the names of its contributors 975 // may be used to endorse or promote products derived from this software 976 // without specific prior written permission. 977 // 978 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 979 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 980 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 981 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 982 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 983 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 984 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 985 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 986 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 987 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 988 // SUCH DAMAGE. 989 // 990 // @(#)types.h 8.4 (Berkeley) 1/21/94 991 992 type fpos_t = off_t /* stdio.h:61:15 */ // stdio file position type 993 994 // NB: to fit things in six character monocase externals, the stdio 995 // code uses the prefix `__s' for stdio objects, typically followed 996 // by a three-character attempt at a mnemonic. 997 998 // stdio buffers 999 type __sbuf = struct { 1000 _base uintptr 1001 _size int32 1002 _ [4]byte 1003 } /* stdio.h:70:1 */ 1004 1005 // stdio state variables. 1006 // 1007 // The following always hold: 1008 // 1009 // if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR), 1010 // _lbfsize is -_bf._size, else _lbfsize is 0 1011 // if _flags&__SRD, _w is 0 1012 // if _flags&__SWR, _r is 0 1013 // 1014 // This ensures that the getc and putc macros (or inline functions) never 1015 // try to write or read from a file that is in `read' or `write' mode. 1016 // (Moreover, they can, and do, automatically switch from read mode to 1017 // write mode, and back, on "r+" and "w+" files.) 1018 // 1019 // _lbfsize is used only to make the inline line-buffered output stream 1020 // code as compact as possible. 1021 // 1022 // _ub, _up, and _ur are used when ungetc() pushes back more characters 1023 // than fit in the current _bf, or when ungetc() pushes back a character 1024 // that does not match the previous one in _bf. When this happens, 1025 // _ub._base becomes non-nil (i.e., a stream has ungetc() data iff 1026 // _ub._base!=NULL) and _up and _ur save the current values of _p and _r. 1027 type __sFILE = struct { 1028 _p uintptr 1029 _r int32 1030 _w int32 1031 _flags int16 1032 _file int16 1033 _ [4]byte 1034 _bf struct { 1035 _base uintptr 1036 _size int32 1037 _ [4]byte 1038 } 1039 _lbfsize int32 1040 _ [4]byte 1041 _cookie uintptr 1042 _close uintptr 1043 _read uintptr 1044 _seek uintptr 1045 _write uintptr 1046 _ext struct { 1047 _base uintptr 1048 _size int32 1049 _ [4]byte 1050 } 1051 _up uintptr 1052 _ur int32 1053 _ubuf [3]uint8 1054 _nbuf [1]uint8 1055 _lb struct { 1056 _base uintptr 1057 _size int32 1058 _ [4]byte 1059 } 1060 _blksize int32 1061 _ [4]byte 1062 _offset fpos_t 1063 } /* stdio.h:99:9 */ 1064 1065 // stdio state variables. 1066 // 1067 // The following always hold: 1068 // 1069 // if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR), 1070 // _lbfsize is -_bf._size, else _lbfsize is 0 1071 // if _flags&__SRD, _w is 0 1072 // if _flags&__SWR, _r is 0 1073 // 1074 // This ensures that the getc and putc macros (or inline functions) never 1075 // try to write or read from a file that is in `read' or `write' mode. 1076 // (Moreover, they can, and do, automatically switch from read mode to 1077 // write mode, and back, on "r+" and "w+" files.) 1078 // 1079 // _lbfsize is used only to make the inline line-buffered output stream 1080 // code as compact as possible. 1081 // 1082 // _ub, _up, and _ur are used when ungetc() pushes back more characters 1083 // than fit in the current _bf, or when ungetc() pushes back a character 1084 // that does not match the previous one in _bf. When this happens, 1085 // _ub._base becomes non-nil (i.e., a stream has ungetc() data iff 1086 // _ub._base!=NULL) and _up and _ur save the current values of _p and _r. 1087 type FILE = __sFILE /* stdio.h:131:3 */ 1088 1089 // The macro implementations of putc and putc_unlocked are not 1090 // fully POSIX compliant; they do not set errno on failure 1091 1092 // The macro implementations of putc and putc_unlocked are not 1093 // fully POSIX compliant; they do not set errno on failure 1094 1095 // $OpenBSD: string.h,v 1.32 2017/09/05 03:16:13 schwarze Exp $ 1096 // $NetBSD: string.h,v 1.6 1994/10/26 00:56:30 cgd Exp $ 1097 1098 // - 1099 // Copyright (c) 1990 The Regents of the University of California. 1100 // All rights reserved. 1101 // 1102 // Redistribution and use in source and binary forms, with or without 1103 // modification, are permitted provided that the following conditions 1104 // are met: 1105 // 1. Redistributions of source code must retain the above copyright 1106 // notice, this list of conditions and the following disclaimer. 1107 // 2. Redistributions in binary form must reproduce the above copyright 1108 // notice, this list of conditions and the following disclaimer in the 1109 // documentation and/or other materials provided with the distribution. 1110 // 3. Neither the name of the University nor the names of its contributors 1111 // may be used to endorse or promote products derived from this software 1112 // without specific prior written permission. 1113 // 1114 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1115 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1116 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1117 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 1118 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1119 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1120 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 1121 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 1122 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 1123 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1124 // SUCH DAMAGE. 1125 // 1126 // @(#)string.h 5.10 (Berkeley) 3/9/91 1127 1128 // $OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $ 1129 // $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $ 1130 1131 // Copyright (c) 1991, 1993 1132 // The Regents of the University of California. All rights reserved. 1133 // 1134 // This code is derived from software contributed to Berkeley by 1135 // Berkeley Software Design, Inc. 1136 // 1137 // Redistribution and use in source and binary forms, with or without 1138 // modification, are permitted provided that the following conditions 1139 // are met: 1140 // 1. Redistributions of source code must retain the above copyright 1141 // notice, this list of conditions and the following disclaimer. 1142 // 2. Redistributions in binary form must reproduce the above copyright 1143 // notice, this list of conditions and the following disclaimer in the 1144 // documentation and/or other materials provided with the distribution. 1145 // 3. Neither the name of the University nor the names of its contributors 1146 // may be used to endorse or promote products derived from this software 1147 // without specific prior written permission. 1148 // 1149 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1150 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1151 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1152 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 1153 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1154 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1155 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 1156 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 1157 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 1158 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1159 // SUCH DAMAGE. 1160 // 1161 // @(#)cdefs.h 8.7 (Berkeley) 1/21/94 1162 1163 // $OpenBSD: _null.h,v 1.2 2016/09/09 22:07:58 millert Exp $ 1164 1165 // Written by Todd C. Miller, September 9, 2016 1166 // Public domain. 1167 1168 // $OpenBSD: _types.h,v 1.4 2018/03/05 01:15:25 deraadt Exp $ 1169 // - 1170 // Copyright (c) 1990, 1993 1171 // The Regents of the University of California. All rights reserved. 1172 // 1173 // Redistribution and use in source and binary forms, with or without 1174 // modification, are permitted provided that the following conditions 1175 // are met: 1176 // 1. Redistributions of source code must retain the above copyright 1177 // notice, this list of conditions and the following disclaimer. 1178 // 2. Redistributions in binary form must reproduce the above copyright 1179 // notice, this list of conditions and the following disclaimer in the 1180 // documentation and/or other materials provided with the distribution. 1181 // 3. Neither the name of the University nor the names of its contributors 1182 // may be used to endorse or promote products derived from this software 1183 // without specific prior written permission. 1184 // 1185 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1186 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1187 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1188 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 1189 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1190 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1191 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 1192 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 1193 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 1194 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1195 // SUCH DAMAGE. 1196 // 1197 // @(#)types.h 8.3 (Berkeley) 1/5/94 1198 // @(#)ansi.h 8.2 (Berkeley) 1/4/94 1199 1200 // POSIX mandates that certain string functions not present in ISO C 1201 // be prototyped in strings.h. Historically, we've included them here. 1202 // $OpenBSD: strings.h,v 1.6 2017/09/10 21:50:36 schwarze Exp $ 1203 1204 // - 1205 // Copyright (c) 1990 The Regents of the University of California. 1206 // All rights reserved. 1207 // 1208 // Redistribution and use in source and binary forms, with or without 1209 // modification, are permitted provided that the following conditions 1210 // are met: 1211 // 1. Redistributions of source code must retain the above copyright 1212 // notice, this list of conditions and the following disclaimer. 1213 // 2. Redistributions in binary form must reproduce the above copyright 1214 // notice, this list of conditions and the following disclaimer in the 1215 // documentation and/or other materials provided with the distribution. 1216 // 3. Neither the name of the University nor the names of its contributors 1217 // may be used to endorse or promote products derived from this software 1218 // without specific prior written permission. 1219 // 1220 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1221 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1222 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1223 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 1224 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1225 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1226 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 1227 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 1228 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 1229 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1230 // SUCH DAMAGE. 1231 // 1232 // @(#)strings.h 5.8 (Berkeley) 5/15/90 1233 1234 // $OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $ 1235 // $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $ 1236 1237 // Copyright (c) 1991, 1993 1238 // The Regents of the University of California. All rights reserved. 1239 // 1240 // This code is derived from software contributed to Berkeley by 1241 // Berkeley Software Design, Inc. 1242 // 1243 // Redistribution and use in source and binary forms, with or without 1244 // modification, are permitted provided that the following conditions 1245 // are met: 1246 // 1. Redistributions of source code must retain the above copyright 1247 // notice, this list of conditions and the following disclaimer. 1248 // 2. Redistributions in binary form must reproduce the above copyright 1249 // notice, this list of conditions and the following disclaimer in the 1250 // documentation and/or other materials provided with the distribution. 1251 // 3. Neither the name of the University nor the names of its contributors 1252 // may be used to endorse or promote products derived from this software 1253 // without specific prior written permission. 1254 // 1255 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1256 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1257 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1258 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 1259 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1260 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1261 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 1262 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 1263 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 1264 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1265 // SUCH DAMAGE. 1266 // 1267 // @(#)cdefs.h 8.7 (Berkeley) 1/21/94 1268 1269 // $OpenBSD: _types.h,v 1.4 2018/03/05 01:15:25 deraadt Exp $ 1270 // - 1271 // Copyright (c) 1990, 1993 1272 // The Regents of the University of California. All rights reserved. 1273 // 1274 // Redistribution and use in source and binary forms, with or without 1275 // modification, are permitted provided that the following conditions 1276 // are met: 1277 // 1. Redistributions of source code must retain the above copyright 1278 // notice, this list of conditions and the following disclaimer. 1279 // 2. Redistributions in binary form must reproduce the above copyright 1280 // notice, this list of conditions and the following disclaimer in the 1281 // documentation and/or other materials provided with the distribution. 1282 // 3. Neither the name of the University nor the names of its contributors 1283 // may be used to endorse or promote products derived from this software 1284 // without specific prior written permission. 1285 // 1286 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1287 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1288 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1289 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 1290 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1291 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1292 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 1293 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 1294 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 1295 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1296 // SUCH DAMAGE. 1297 // 1298 // @(#)types.h 8.3 (Berkeley) 1/5/94 1299 // @(#)ansi.h 8.2 (Berkeley) 1/4/94 1300 1301 // POSIX mandates that certain string functions not present in ISO C 1302 // be prototyped in strings.h. 1303 1304 type locale_t = uintptr /* strings.h:53:14 */ 1305 1306 // $OpenBSD: stdlib.h,v 1.76 2019/05/10 15:03:24 otto Exp $ 1307 // $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ 1308 1309 // - 1310 // Copyright (c) 1990 The Regents of the University of California. 1311 // All rights reserved. 1312 // 1313 // Redistribution and use in source and binary forms, with or without 1314 // modification, are permitted provided that the following conditions 1315 // are met: 1316 // 1. Redistributions of source code must retain the above copyright 1317 // notice, this list of conditions and the following disclaimer. 1318 // 2. Redistributions in binary form must reproduce the above copyright 1319 // notice, this list of conditions and the following disclaimer in the 1320 // documentation and/or other materials provided with the distribution. 1321 // 3. Neither the name of the University nor the names of its contributors 1322 // may be used to endorse or promote products derived from this software 1323 // without specific prior written permission. 1324 // 1325 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1326 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1327 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1328 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 1329 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1330 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1331 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 1332 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 1333 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 1334 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1335 // SUCH DAMAGE. 1336 // 1337 // @(#)stdlib.h 5.13 (Berkeley) 6/4/91 1338 1339 // $OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $ 1340 // $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $ 1341 1342 // Copyright (c) 1991, 1993 1343 // The Regents of the University of California. All rights reserved. 1344 // 1345 // This code is derived from software contributed to Berkeley by 1346 // Berkeley Software Design, Inc. 1347 // 1348 // Redistribution and use in source and binary forms, with or without 1349 // modification, are permitted provided that the following conditions 1350 // are met: 1351 // 1. Redistributions of source code must retain the above copyright 1352 // notice, this list of conditions and the following disclaimer. 1353 // 2. Redistributions in binary form must reproduce the above copyright 1354 // notice, this list of conditions and the following disclaimer in the 1355 // documentation and/or other materials provided with the distribution. 1356 // 3. Neither the name of the University nor the names of its contributors 1357 // may be used to endorse or promote products derived from this software 1358 // without specific prior written permission. 1359 // 1360 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1361 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1362 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1363 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 1364 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1365 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1366 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 1367 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 1368 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 1369 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1370 // SUCH DAMAGE. 1371 // 1372 // @(#)cdefs.h 8.7 (Berkeley) 1/21/94 1373 1374 // $OpenBSD: _null.h,v 1.2 2016/09/09 22:07:58 millert Exp $ 1375 1376 // Written by Todd C. Miller, September 9, 2016 1377 // Public domain. 1378 1379 // $OpenBSD: _types.h,v 1.4 2018/03/05 01:15:25 deraadt Exp $ 1380 // - 1381 // Copyright (c) 1990, 1993 1382 // The Regents of the University of California. All rights reserved. 1383 // 1384 // Redistribution and use in source and binary forms, with or without 1385 // modification, are permitted provided that the following conditions 1386 // are met: 1387 // 1. Redistributions of source code must retain the above copyright 1388 // notice, this list of conditions and the following disclaimer. 1389 // 2. Redistributions in binary form must reproduce the above copyright 1390 // notice, this list of conditions and the following disclaimer in the 1391 // documentation and/or other materials provided with the distribution. 1392 // 3. Neither the name of the University nor the names of its contributors 1393 // may be used to endorse or promote products derived from this software 1394 // without specific prior written permission. 1395 // 1396 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1397 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1398 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1399 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 1400 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1401 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1402 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 1403 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 1404 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 1405 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1406 // SUCH DAMAGE. 1407 // 1408 // @(#)types.h 8.3 (Berkeley) 1/5/94 1409 // @(#)ansi.h 8.2 (Berkeley) 1/4/94 1410 1411 // $OpenBSD: types.h,v 1.49 2022/08/06 13:31:13 semarie Exp $ 1412 // $NetBSD: types.h,v 1.29 1996/11/15 22:48:25 jtc Exp $ 1413 1414 // - 1415 // Copyright (c) 1982, 1986, 1991, 1993 1416 // The Regents of the University of California. All rights reserved. 1417 // (c) UNIX System Laboratories, Inc. 1418 // All or some portions of this file are derived from material licensed 1419 // to the University of California by American Telephone and Telegraph 1420 // Co. or Unix System Laboratories, Inc. and are reproduced herein with 1421 // the permission of UNIX System Laboratories, Inc. 1422 // 1423 // Redistribution and use in source and binary forms, with or without 1424 // modification, are permitted provided that the following conditions 1425 // are met: 1426 // 1. Redistributions of source code must retain the above copyright 1427 // notice, this list of conditions and the following disclaimer. 1428 // 2. Redistributions in binary form must reproduce the above copyright 1429 // notice, this list of conditions and the following disclaimer in the 1430 // documentation and/or other materials provided with the distribution. 1431 // 3. Neither the name of the University nor the names of its contributors 1432 // may be used to endorse or promote products derived from this software 1433 // without specific prior written permission. 1434 // 1435 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1436 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1437 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1438 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 1439 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1440 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1441 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 1442 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 1443 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 1444 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1445 // SUCH DAMAGE. 1446 // 1447 // @(#)types.h 8.4 (Berkeley) 1/21/94 1448 1449 // in C++, wchar_t is a built-in type 1450 1451 type div_t = struct { 1452 quot int32 1453 rem int32 1454 } /* stdlib.h:59:3 */ 1455 1456 type ldiv_t = struct { 1457 quot int64 1458 rem int64 1459 } /* stdlib.h:64:3 */ 1460 1461 type lldiv_t = struct { 1462 quot int64 1463 rem int64 1464 } /* stdlib.h:70:3 */ 1465 1466 type qdiv_t = struct { 1467 quot quad_t 1468 rem quad_t 1469 } /* stdlib.h:77:3 */ 1470 1471 var hello = *(*[14]int8)(unsafe.Pointer(ts)) /* example.c:29:21 */ 1472 // "hello world" would be more standard, but the repeated "hello" 1473 // stresses the compression code better, sorry... 1474 1475 var dictionary = *(*[6]int8)(unsafe.Pointer(ts + 14)) /* example.c:34:19 */ 1476 var dictId uLong /* example.c:35:14: */ 1477 1478 var zalloc alloc_func = uintptr(0) /* example.c:77:19 */ 1479 var zfree free_func = uintptr(0) /* example.c:78:18 */ 1480 1481 // =========================================================================== 1482 // Test compress() and uncompress() 1483 func test_compress(tls *libc.TLS, compr uintptr, comprLen uLong, uncompr uintptr, uncomprLen uLong) { /* example.c:88:6: */ 1484 bp := tls.Alloc(56) 1485 defer tls.Free(56) 1486 *(*uLong)(unsafe.Pointer(bp + 40)) = comprLen 1487 *(*uLong)(unsafe.Pointer(bp + 48)) = uncomprLen 1488 1489 var err int32 1490 var len uLong = libc.Xstrlen(tls, uintptr(unsafe.Pointer(&hello))) + uint64(1) 1491 1492 err = z.Xcompress(tls, compr, bp+40, uintptr(uintptr(unsafe.Pointer(&hello))), len) 1493 { 1494 if err != 0 { 1495 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp, ts+34, err)) 1496 libc.Xexit(tls, 1) 1497 } 1498 } 1499 1500 libc.Xstrcpy(tls, uncompr, ts+43) 1501 1502 err = z.Xuncompress(tls, uncompr, bp+48, compr, *(*uLong)(unsafe.Pointer(bp + 40 /* comprLen */))) 1503 { 1504 if err != 0 { 1505 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+16, ts+51, err)) 1506 libc.Xexit(tls, 1) 1507 } 1508 } 1509 1510 if libc.Xstrcmp(tls, uncompr, uintptr(unsafe.Pointer(&hello))) != 0 { 1511 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+62, 0) 1512 libc.Xexit(tls, 1) 1513 } else { 1514 libc.Xprintf(tls, ts+78, libc.VaList(bp+32, uncompr)) 1515 } 1516 } 1517 1518 // =========================================================================== 1519 // Test read/write of .gz files 1520 func test_gzio(tls *libc.TLS, fname uintptr, uncompr uintptr, uncomprLen uLong) { /* example.c:114:6: */ 1521 bp := tls.Alloc(84) 1522 defer tls.Free(84) 1523 1524 // var err int32 at bp+80, 4 1525 1526 var len int32 = int32(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&hello)))) + 1 1527 var file gzFile 1528 var pos off_t 1529 1530 file = z.Xgzopen(tls, fname, ts+96) 1531 if file == uintptr(0) { 1532 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+99, 0) 1533 libc.Xexit(tls, 1) 1534 } 1535 z.Xgzputc(tls, file, 'h') 1536 if z.Xgzputs(tls, file, ts+113) != 4 { 1537 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+118, libc.VaList(bp, z.Xgzerror(tls, file, bp+80))) 1538 libc.Xexit(tls, 1) 1539 } 1540 if z.Xgzprintf(tls, file, ts+134, libc.VaList(bp+8, ts+14)) != 8 { 1541 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+140, libc.VaList(bp+16, z.Xgzerror(tls, file, bp+80))) 1542 libc.Xexit(tls, 1) 1543 } 1544 z.Xgzseek(tls, file, 1, 1) // add one zero byte 1545 z.Xgzclose(tls, file) 1546 1547 file = z.Xgzopen(tls, fname, ts+158) 1548 if file == uintptr(0) { 1549 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+99, 0) 1550 libc.Xexit(tls, 1) 1551 } 1552 libc.Xstrcpy(tls, uncompr, ts+43) 1553 1554 if z.Xgzread(tls, file, uncompr, uint32(uncomprLen)) != len { 1555 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+161, libc.VaList(bp+24, z.Xgzerror(tls, file, bp+80))) 1556 libc.Xexit(tls, 1) 1557 } 1558 if libc.Xstrcmp(tls, uncompr, uintptr(unsafe.Pointer(&hello))) != 0 { 1559 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+177, libc.VaList(bp+32, uncompr)) 1560 libc.Xexit(tls, 1) 1561 } else { 1562 libc.Xprintf(tls, ts+193, libc.VaList(bp+40, uncompr)) 1563 } 1564 1565 pos = z.Xgzseek(tls, file, -8, 1) 1566 if pos != int64(6) || z.Xgztell(tls, file) != pos { 1567 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+207, 1568 libc.VaList(bp+48, int64(pos), int64(z.Xgztell(tls, file)))) 1569 libc.Xexit(tls, 1) 1570 } 1571 1572 if func() int32 { 1573 if (*gzFile_s)(unsafe.Pointer(file)).have != 0 { 1574 return int32(func() uint8 { 1575 (*gzFile_s)(unsafe.Pointer(file)).have-- 1576 (*gzFile_s)(unsafe.Pointer(file)).pos++ 1577 return *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*gzFile_s)(unsafe.Pointer(file)).next, 1))) 1578 }()) 1579 } 1580 return z.Xgzgetc(tls, file) 1581 }() != ' ' { 1582 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+242, 0) 1583 libc.Xexit(tls, 1) 1584 } 1585 1586 if z.Xgzungetc(tls, ' ', file) != ' ' { 1587 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+256, 0) 1588 libc.Xexit(tls, 1) 1589 } 1590 1591 z.Xgzgets(tls, file, uncompr, int32(uncomprLen)) 1592 if libc.Xstrlen(tls, uncompr) != uint64(7) { // " hello!" 1593 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+272, libc.VaList(bp+64, z.Xgzerror(tls, file, bp+80))) 1594 libc.Xexit(tls, 1) 1595 } 1596 if libc.Xstrcmp(tls, uncompr, uintptr(unsafe.Pointer(&hello))+uintptr(6)) != 0 { 1597 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+301, 0) 1598 libc.Xexit(tls, 1) 1599 } else { 1600 libc.Xprintf(tls, ts+326, libc.VaList(bp+72, uncompr)) 1601 } 1602 1603 z.Xgzclose(tls, file) 1604 } 1605 1606 // =========================================================================== 1607 // Test deflate() with small buffers 1608 func test_deflate(tls *libc.TLS, compr uintptr, comprLen uLong) { /* example.c:200:6: */ 1609 bp := tls.Alloc(176) 1610 defer tls.Free(176) 1611 1612 // var c_stream z_stream at bp+64, 112 1613 // compression stream 1614 var err int32 1615 var len uLong = libc.Xstrlen(tls, uintptr(unsafe.Pointer(&hello))) + uint64(1) 1616 1617 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).zalloc = zalloc 1618 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).zfree = zfree 1619 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).opaque = uintptr(0) 1620 1621 err = z.XdeflateInit_(tls, bp+64, -1, ts+353, int32(unsafe.Sizeof(z_stream{}))) 1622 { 1623 if err != 0 { 1624 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp, ts+360, err)) 1625 libc.Xexit(tls, 1) 1626 } 1627 } 1628 1629 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).next_in = uintptr(uintptr(unsafe.Pointer(&hello))) 1630 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).next_out = compr 1631 1632 for (*z_stream)(unsafe.Pointer(bp+64)).total_in != len && (*z_stream)(unsafe.Pointer(bp+64)).total_out < comprLen { 1633 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).avail_in = libc.AssignPtrUint32(bp+64+32, uInt(1)) // force small buffers 1634 err = z.Xdeflate(tls, bp+64, 0) 1635 { 1636 if err != 0 { 1637 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+16, ts+372, err)) 1638 libc.Xexit(tls, 1) 1639 } 1640 } 1641 1642 } 1643 // Finish the stream, still forcing small buffers: 1644 for { 1645 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).avail_out = uInt(1) 1646 err = z.Xdeflate(tls, bp+64, 4) 1647 if err == 1 { 1648 break 1649 } 1650 { 1651 if err != 0 { 1652 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+32, ts+372, err)) 1653 libc.Xexit(tls, 1) 1654 } 1655 } 1656 1657 } 1658 1659 err = z.XdeflateEnd(tls, bp+64) 1660 { 1661 if err != 0 { 1662 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+48, ts+380, err)) 1663 libc.Xexit(tls, 1) 1664 } 1665 } 1666 1667 } 1668 1669 // =========================================================================== 1670 // Test inflate() with small buffers 1671 func test_inflate(tls *libc.TLS, compr uintptr, comprLen uLong, uncompr uintptr, uncomprLen uLong) { /* example.c:238:6: */ 1672 bp := tls.Alloc(168) 1673 defer tls.Free(168) 1674 1675 var err int32 1676 // var d_stream z_stream at bp+56, 112 1677 // decompression stream 1678 1679 libc.Xstrcpy(tls, uncompr, ts+43) 1680 1681 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).zalloc = zalloc 1682 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).zfree = zfree 1683 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).opaque = uintptr(0) 1684 1685 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).next_in = compr 1686 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).avail_in = uInt(0) 1687 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).next_out = uncompr 1688 1689 err = z.XinflateInit_(tls, bp+56, ts+353, int32(unsafe.Sizeof(z_stream{}))) 1690 { 1691 if err != 0 { 1692 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp, ts+391, err)) 1693 libc.Xexit(tls, 1) 1694 } 1695 } 1696 1697 for (*z_stream)(unsafe.Pointer(bp+56)).total_out < uncomprLen && (*z_stream)(unsafe.Pointer(bp+56)).total_in < comprLen { 1698 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).avail_in = libc.AssignPtrUint32(bp+56+32, uInt(1)) // force small buffers 1699 err = z.Xinflate(tls, bp+56, 0) 1700 if err == 1 { 1701 break 1702 } 1703 { 1704 if err != 0 { 1705 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+16, ts+403, err)) 1706 libc.Xexit(tls, 1) 1707 } 1708 } 1709 1710 } 1711 1712 err = z.XinflateEnd(tls, bp+56) 1713 { 1714 if err != 0 { 1715 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+32, ts+411, err)) 1716 libc.Xexit(tls, 1) 1717 } 1718 } 1719 1720 if libc.Xstrcmp(tls, uncompr, uintptr(unsafe.Pointer(&hello))) != 0 { 1721 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+422, 0) 1722 libc.Xexit(tls, 1) 1723 } else { 1724 libc.Xprintf(tls, ts+435, libc.VaList(bp+48, uncompr)) 1725 } 1726 } 1727 1728 // =========================================================================== 1729 // Test deflate() with large buffers and dynamic change of compression level 1730 func test_large_deflate(tls *libc.TLS, compr uintptr, comprLen uLong, uncompr uintptr, uncomprLen uLong) { /* example.c:279:6: */ 1731 bp := tls.Alloc(192) 1732 defer tls.Free(192) 1733 1734 // var c_stream z_stream at bp+80, 112 1735 // compression stream 1736 var err int32 1737 1738 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).zalloc = zalloc 1739 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).zfree = zfree 1740 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).opaque = uintptr(0) 1741 1742 err = z.XdeflateInit_(tls, bp+80, 1, ts+353, int32(unsafe.Sizeof(z_stream{}))) 1743 { 1744 if err != 0 { 1745 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp, ts+360, err)) 1746 libc.Xexit(tls, 1) 1747 } 1748 } 1749 1750 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).next_out = compr 1751 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).avail_out = uInt(comprLen) 1752 1753 // At this point, uncompr is still mostly zeroes, so it should compress 1754 // very well: 1755 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).next_in = uncompr 1756 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).avail_in = uInt(uncomprLen) 1757 err = z.Xdeflate(tls, bp+80, 0) 1758 { 1759 if err != 0 { 1760 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+16, ts+372, err)) 1761 libc.Xexit(tls, 1) 1762 } 1763 } 1764 1765 if (*z_stream)(unsafe.Pointer(bp+80)).avail_in != uInt(0) { 1766 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+450, 0) 1767 libc.Xexit(tls, 1) 1768 } 1769 1770 // Feed in already compressed data and switch to no compression: 1771 z.XdeflateParams(tls, bp+80, 0, 0) 1772 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).next_in = compr 1773 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).avail_in = uInt(comprLen) / uInt(2) 1774 err = z.Xdeflate(tls, bp+80, 0) 1775 { 1776 if err != 0 { 1777 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+32, ts+372, err)) 1778 libc.Xexit(tls, 1) 1779 } 1780 } 1781 1782 // Switch back to compressing mode: 1783 z.XdeflateParams(tls, bp+80, 9, 1) 1784 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).next_in = uncompr 1785 (*z_stream)(unsafe.Pointer(bp + 80 /* &c_stream */)).avail_in = uInt(uncomprLen) 1786 err = z.Xdeflate(tls, bp+80, 0) 1787 { 1788 if err != 0 { 1789 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+48, ts+372, err)) 1790 libc.Xexit(tls, 1) 1791 } 1792 } 1793 1794 err = z.Xdeflate(tls, bp+80, 4) 1795 if err != 1 { 1796 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+470, 0) 1797 libc.Xexit(tls, 1) 1798 } 1799 err = z.XdeflateEnd(tls, bp+80) 1800 { 1801 if err != 0 { 1802 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+64, ts+380, err)) 1803 libc.Xexit(tls, 1) 1804 } 1805 } 1806 1807 } 1808 1809 // =========================================================================== 1810 // Test inflate() with large buffers 1811 func test_large_inflate(tls *libc.TLS, compr uintptr, comprLen uLong, uncompr uintptr, uncomprLen uLong) { /* example.c:334:6: */ 1812 bp := tls.Alloc(168) 1813 defer tls.Free(168) 1814 1815 var err int32 1816 // var d_stream z_stream at bp+56, 112 1817 // decompression stream 1818 1819 libc.Xstrcpy(tls, uncompr, ts+43) 1820 1821 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).zalloc = zalloc 1822 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).zfree = zfree 1823 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).opaque = uintptr(0) 1824 1825 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).next_in = compr 1826 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).avail_in = uInt(comprLen) 1827 1828 err = z.XinflateInit_(tls, bp+56, ts+353, int32(unsafe.Sizeof(z_stream{}))) 1829 { 1830 if err != 0 { 1831 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp, ts+391, err)) 1832 libc.Xexit(tls, 1) 1833 } 1834 } 1835 1836 for { 1837 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).next_out = uncompr // discard the output 1838 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).avail_out = uInt(uncomprLen) 1839 err = z.Xinflate(tls, bp+56, 0) 1840 if err == 1 { 1841 break 1842 } 1843 { 1844 if err != 0 { 1845 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+16, ts+506, err)) 1846 libc.Xexit(tls, 1) 1847 } 1848 } 1849 1850 } 1851 1852 err = z.XinflateEnd(tls, bp+56) 1853 { 1854 if err != 0 { 1855 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+32, ts+411, err)) 1856 libc.Xexit(tls, 1) 1857 } 1858 } 1859 1860 if (*z_stream)(unsafe.Pointer(bp+56)).total_out != uint64(2)*uncomprLen+comprLen/uint64(2) { 1861 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+520, libc.VaList(bp+48, (*z_stream)(unsafe.Pointer(bp+56 /* &d_stream */)).total_out)) 1862 libc.Xexit(tls, 1) 1863 } else { 1864 libc.Xprintf(tls, ts+544, 0) 1865 } 1866 } 1867 1868 // =========================================================================== 1869 // Test deflate() with full flush 1870 func test_flush(tls *libc.TLS, compr uintptr, comprLen uintptr) { /* example.c:375:6: */ 1871 bp := tls.Alloc(176) 1872 defer tls.Free(176) 1873 1874 // var c_stream z_stream at bp+64, 112 1875 // compression stream 1876 var err int32 1877 var len uInt = uInt(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&hello)))) + uInt(1) 1878 1879 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).zalloc = zalloc 1880 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).zfree = zfree 1881 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).opaque = uintptr(0) 1882 1883 err = z.XdeflateInit_(tls, bp+64, -1, ts+353, int32(unsafe.Sizeof(z_stream{}))) 1884 { 1885 if err != 0 { 1886 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp, ts+360, err)) 1887 libc.Xexit(tls, 1) 1888 } 1889 } 1890 1891 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).next_in = uintptr(uintptr(unsafe.Pointer(&hello))) 1892 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).next_out = compr 1893 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).avail_in = uInt(3) 1894 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).avail_out = uInt(*(*uLong)(unsafe.Pointer(comprLen))) 1895 err = z.Xdeflate(tls, bp+64, 3) 1896 { 1897 if err != 0 { 1898 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+16, ts+372, err)) 1899 libc.Xexit(tls, 1) 1900 } 1901 } 1902 1903 *(*Byte)(unsafe.Pointer(compr + 3))++ // force an error in first compressed block 1904 (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).avail_in = len - uInt(3) 1905 1906 err = z.Xdeflate(tls, bp+64, 4) 1907 if err != 1 { 1908 { 1909 if err != 0 { 1910 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+32, ts+372, err)) 1911 libc.Xexit(tls, 1) 1912 } 1913 } 1914 1915 } 1916 err = z.XdeflateEnd(tls, bp+64) 1917 { 1918 if err != 0 { 1919 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+48, ts+380, err)) 1920 libc.Xexit(tls, 1) 1921 } 1922 } 1923 1924 *(*uLong)(unsafe.Pointer(comprLen)) = (*z_stream)(unsafe.Pointer(bp + 64 /* &c_stream */)).total_out 1925 } 1926 1927 // =========================================================================== 1928 // Test inflateSync() 1929 func test_sync(tls *libc.TLS, compr uintptr, comprLen uLong, uncompr uintptr, uncomprLen uLong) { /* example.c:413:6: */ 1930 bp := tls.Alloc(184) 1931 defer tls.Free(184) 1932 1933 var err int32 1934 // var d_stream z_stream at bp+72, 112 1935 // decompression stream 1936 1937 libc.Xstrcpy(tls, uncompr, ts+43) 1938 1939 (*z_stream)(unsafe.Pointer(bp + 72 /* &d_stream */)).zalloc = zalloc 1940 (*z_stream)(unsafe.Pointer(bp + 72 /* &d_stream */)).zfree = zfree 1941 (*z_stream)(unsafe.Pointer(bp + 72 /* &d_stream */)).opaque = uintptr(0) 1942 1943 (*z_stream)(unsafe.Pointer(bp + 72 /* &d_stream */)).next_in = compr 1944 (*z_stream)(unsafe.Pointer(bp + 72 /* &d_stream */)).avail_in = uInt(2) // just read the zlib header 1945 1946 err = z.XinflateInit_(tls, bp+72, ts+353, int32(unsafe.Sizeof(z_stream{}))) 1947 { 1948 if err != 0 { 1949 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp, ts+391, err)) 1950 libc.Xexit(tls, 1) 1951 } 1952 } 1953 1954 (*z_stream)(unsafe.Pointer(bp + 72 /* &d_stream */)).next_out = uncompr 1955 (*z_stream)(unsafe.Pointer(bp + 72 /* &d_stream */)).avail_out = uInt(uncomprLen) 1956 1957 err = z.Xinflate(tls, bp+72, 0) 1958 { 1959 if err != 0 { 1960 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+16, ts+403, err)) 1961 libc.Xexit(tls, 1) 1962 } 1963 } 1964 1965 (*z_stream)(unsafe.Pointer(bp + 72 /* &d_stream */)).avail_in = uInt(comprLen) - uInt(2) // read all compressed data 1966 err = z.XinflateSync(tls, bp+72) /* but skip the damaged part */ 1967 { 1968 if err != 0 { 1969 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+32, ts+565, err)) 1970 libc.Xexit(tls, 1) 1971 } 1972 } 1973 1974 err = z.Xinflate(tls, bp+72, 4) 1975 if err != -3 { 1976 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+577, 0) 1977 // Because of incorrect adler32 1978 libc.Xexit(tls, 1) 1979 } 1980 err = z.XinflateEnd(tls, bp+72) 1981 { 1982 if err != 0 { 1983 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+48, ts+411, err)) 1984 libc.Xexit(tls, 1) 1985 } 1986 } 1987 1988 libc.Xprintf(tls, ts+611, libc.VaList(bp+64, uncompr)) 1989 } 1990 1991 // =========================================================================== 1992 // Test deflate() with preset dictionary 1993 func test_dict_deflate(tls *libc.TLS, compr uintptr, comprLen uLong) { /* example.c:457:6: */ 1994 bp := tls.Alloc(160) 1995 defer tls.Free(160) 1996 1997 // var c_stream z_stream at bp+48, 112 1998 // compression stream 1999 var err int32 2000 2001 (*z_stream)(unsafe.Pointer(bp + 48 /* &c_stream */)).zalloc = zalloc 2002 (*z_stream)(unsafe.Pointer(bp + 48 /* &c_stream */)).zfree = zfree 2003 (*z_stream)(unsafe.Pointer(bp + 48 /* &c_stream */)).opaque = uintptr(0) 2004 2005 err = z.XdeflateInit_(tls, bp+48, 9, ts+353, int32(unsafe.Sizeof(z_stream{}))) 2006 { 2007 if err != 0 { 2008 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp, ts+360, err)) 2009 libc.Xexit(tls, 1) 2010 } 2011 } 2012 2013 err = z.XdeflateSetDictionary(tls, bp+48, 2014 uintptr(uintptr(unsafe.Pointer(&dictionary))), uint32(int32(unsafe.Sizeof(dictionary)))) 2015 { 2016 if err != 0 { 2017 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+16, ts+639, err)) 2018 libc.Xexit(tls, 1) 2019 } 2020 } 2021 2022 dictId = (*z_stream)(unsafe.Pointer(bp + 48 /* &c_stream */)).adler 2023 (*z_stream)(unsafe.Pointer(bp + 48 /* &c_stream */)).next_out = compr 2024 (*z_stream)(unsafe.Pointer(bp + 48 /* &c_stream */)).avail_out = uInt(comprLen) 2025 2026 (*z_stream)(unsafe.Pointer(bp + 48 /* &c_stream */)).next_in = uintptr(uintptr(unsafe.Pointer(&hello))) 2027 (*z_stream)(unsafe.Pointer(bp + 48 /* &c_stream */)).avail_in = uInt(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&hello)))) + uInt(1) 2028 2029 err = z.Xdeflate(tls, bp+48, 4) 2030 if err != 1 { 2031 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+470, 0) 2032 libc.Xexit(tls, 1) 2033 } 2034 err = z.XdeflateEnd(tls, bp+48) 2035 { 2036 if err != 0 { 2037 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+32, ts+380, err)) 2038 libc.Xexit(tls, 1) 2039 } 2040 } 2041 2042 } 2043 2044 // =========================================================================== 2045 // Test inflate() with a preset dictionary 2046 func test_dict_inflate(tls *libc.TLS, compr uintptr, comprLen uLong, uncompr uintptr, uncomprLen uLong) { /* example.c:494:6: */ 2047 bp := tls.Alloc(168) 2048 defer tls.Free(168) 2049 2050 var err int32 2051 // var d_stream z_stream at bp+56, 112 2052 // decompression stream 2053 2054 libc.Xstrcpy(tls, uncompr, ts+43) 2055 2056 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).zalloc = zalloc 2057 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).zfree = zfree 2058 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).opaque = uintptr(0) 2059 2060 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).next_in = compr 2061 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).avail_in = uInt(comprLen) 2062 2063 err = z.XinflateInit_(tls, bp+56, ts+353, int32(unsafe.Sizeof(z_stream{}))) 2064 { 2065 if err != 0 { 2066 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp, ts+391, err)) 2067 libc.Xexit(tls, 1) 2068 } 2069 } 2070 2071 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).next_out = uncompr 2072 (*z_stream)(unsafe.Pointer(bp + 56 /* &d_stream */)).avail_out = uInt(uncomprLen) 2073 2074 for { 2075 err = z.Xinflate(tls, bp+56, 0) 2076 if err == 1 { 2077 break 2078 } 2079 if err == 2 { 2080 if (*z_stream)(unsafe.Pointer(bp+56)).adler != dictId { 2081 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+660, 0) 2082 libc.Xexit(tls, 1) 2083 } 2084 err = z.XinflateSetDictionary(tls, bp+56, uintptr(uintptr(unsafe.Pointer(&dictionary))), 2085 uint32(int32(unsafe.Sizeof(dictionary)))) 2086 } 2087 { 2088 if err != 0 { 2089 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+16, ts+682, err)) 2090 libc.Xexit(tls, 1) 2091 } 2092 } 2093 2094 } 2095 2096 err = z.XinflateEnd(tls, bp+56) 2097 { 2098 if err != 0 { 2099 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+20, libc.VaList(bp+32, ts+411, err)) 2100 libc.Xexit(tls, 1) 2101 } 2102 } 2103 2104 if libc.Xstrcmp(tls, uncompr, uintptr(unsafe.Pointer(&hello))) != 0 { 2105 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+700, 0) 2106 libc.Xexit(tls, 1) 2107 } else { 2108 libc.Xprintf(tls, ts+723, libc.VaList(bp+48, uncompr)) 2109 } 2110 } 2111 2112 // =========================================================================== 2113 // Usage: example [output.gz [input.gz]] 2114 2115 func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* example.c:545:5: */ 2116 bp := tls.Alloc(32) 2117 defer tls.Free(32) 2118 2119 var compr uintptr 2120 var uncompr uintptr 2121 *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)) = uint64(10000) * uint64(unsafe.Sizeof(int32(0))) // don't overflow on MSDOS 2122 var uncomprLen uLong = *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)) 2123 2124 if int32(*(*int8)(unsafe.Pointer(z.XzlibVersion(tls)))) != int32(*(*int8)(unsafe.Pointer(myVersion))) { 2125 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+752, 0) 2126 libc.Xexit(tls, 1) 2127 2128 } else if libc.Xstrcmp(tls, z.XzlibVersion(tls), ts+353) != 0 { 2129 libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+779, 0) 2130 } 2131 2132 libc.Xprintf(tls, ts+812, 2133 libc.VaList(bp, ts+353, 0x12b0, z.XzlibCompileFlags(tls))) 2134 2135 compr = libc.Xcalloc(tls, uint64(uInt(*(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)))), uint64(1)) 2136 uncompr = libc.Xcalloc(tls, uint64(uInt(uncomprLen)), uint64(1)) 2137 // compr and uncompr are cleared to avoid reading uninitialized 2138 // data and to ensure that uncompr compresses well. 2139 if compr == uintptr(0) || uncompr == uintptr(0) { 2140 libc.Xprintf(tls, ts+861, 0) 2141 libc.Xexit(tls, 1) 2142 } 2143 2144 test_compress(tls, compr, *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)), uncompr, uncomprLen) 2145 2146 test_gzio(tls, func() uintptr { 2147 if argc > 1 { 2148 return *(*uintptr)(unsafe.Pointer(argv + 1*8)) 2149 } 2150 return ts + 876 2151 }(), 2152 uncompr, uncomprLen) 2153 2154 test_deflate(tls, compr, *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */))) 2155 test_inflate(tls, compr, *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)), uncompr, uncomprLen) 2156 2157 test_large_deflate(tls, compr, *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)), uncompr, uncomprLen) 2158 test_large_inflate(tls, compr, *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)), uncompr, uncomprLen) 2159 2160 test_flush(tls, compr, bp+24) 2161 test_sync(tls, compr, *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)), uncompr, uncomprLen) 2162 *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)) = uncomprLen 2163 2164 test_dict_deflate(tls, compr, *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */))) 2165 test_dict_inflate(tls, compr, *(*uLong)(unsafe.Pointer(bp + 24 /* comprLen */)), uncompr, uncomprLen) 2166 2167 libc.Xfree(tls, compr) 2168 libc.Xfree(tls, uncompr) 2169 2170 return 0 2171 } 2172 2173 var myVersion uintptr = ts + 353 /* "1.2.11" */ /* example.c:552:22 */ 2174 2175 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" 2176 var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data