modernc.org/z@v1.7.4/internal/minigzip_windows_arm64.go (about) 1 // Code generated by 'ccgo -lmodernc.org/z/lib -o internal\minigzip_windows_arm64.go -trace-translation-units C:\Users\jnml\AppData\Local\Temp\go-generate-2743941486\cdb.json minigzip.exe', 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 = uint16 /* <builtin>:15:24 */ 30 31 type va_list = uintptr /* <builtin>:50:27 */ 32 33 // ===---- __stddef_max_align_t.h - Definition of max_align_t for modules ---=== 34 // 35 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 36 // See https://llvm.org/LICENSE.txt for license information. 37 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 38 // 39 //===-----------------------------------------------------------------------=== 40 41 // Define 'max_align_t' to match the GCC definition. 42 type max_align_t = struct { 43 __clang_max_align_nonce1 int64 44 __clang_max_align_nonce2 float64 45 } /* __stddef_max_align_t.h:24:3 */ 46 47 // Some C libraries expect to see a wint_t here. Others (notably MinGW) will use 48 // __WINT_TYPE__ directly; accommodate both by requiring __need_wint_t 49 50 type z_size_t = size_t /* zconf.h:248:21 */ 51 52 // Maximum value for memLevel in deflateInit2 53 54 // Maximum value for windowBits in deflateInit2 and inflateInit2. 55 // WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files 56 // created by gzip. (Files created by minigzip can still be extracted by 57 // gzip.) 58 59 // The memory requirements for deflate are (in bytes): 60 // (1 << (windowBits+2)) + (1 << (memLevel+9)) 61 // that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) 62 // plus a few kilobytes for small objects. For example, if you want to reduce 63 // the default memory requirements from 256K to 128K, compile with 64 // make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" 65 // Of course this will generally degrade compression (there's no free lunch). 66 // 67 // The memory requirements for inflate are (in bytes) 1 << windowBits 68 // that is, 32K for windowBits=15 (default value) plus about 7 kilobytes 69 // for small objects. 70 71 // Type declarations 72 73 // The following definitions for FAR are needed only for MSDOS mixed 74 // model programming (small or medium model with some far allocations). 75 // This was tested only with MSC; for other MSDOS compilers you may have 76 // to define NO_MEMCPY in zutil.h. If you don't need the mixed model, 77 // just define FAR to be empty. 78 79 // If building or using zlib as a DLL, define ZLIB_DLL. 80 // This is not mandatory, but it offers a little performance increase. 81 // If building or using zlib with the WINAPI/WINAPIV calling convention, 82 // define ZLIB_WINAPI. 83 // Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. 84 85 type Byte = uint8 /* zconf.h:391:24 */ // 8 bits 86 type uInt = uint32 /* zconf.h:393:24 */ // 16 bits or more 87 type uLong = uint32 /* zconf.h:394:24 */ // 32 bits or more 88 89 type Bytef = Byte /* zconf.h:400:22 */ 90 type charf = int8 /* zconf.h:402:19 */ 91 type intf = int32 /* zconf.h:403:19 */ 92 type uIntf = uInt /* zconf.h:404:19 */ 93 type uLongf = uLong /* zconf.h:405:19 */ 94 95 type voidpc = uintptr /* zconf.h:408:23 */ 96 type voidpf = uintptr /* zconf.h:409:23 */ 97 type voidp = uintptr /* zconf.h:410:23 */ 98 99 //===---- limits.h - Standard header for integer sizes --------------------===* * 100 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 101 // See https://llvm.org/LICENSE.txt for license information. 102 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 103 // 104 // \*===----------------------------------------------------------------------=== 105 106 // The system's limits.h may, in turn, try to #include_next GCC's limits.h. 107 // Avert this #include_next madness. 108 109 // System headers include a number of constants from POSIX in <limits.h>. 110 // Include it if we're hosted. 111 112 // Many system headers try to "help us out" by defining these. No really, we 113 // know how big each datatype is. 114 115 // C90/99 5.2.4.2.1 116 117 // C2x 5.2.4.2.1 118 // FIXME: This is using the placeholder dates Clang produces for these macros 119 // in C2x mode; switch to the correct values once they've been published. 120 121 // C99 5.2.4.2.1: Added long long. 122 // C++11 18.3.3.2: same contents as the Standard C Library header <limits.h>. 123 // 124 125 // LONG_LONG_MIN/LONG_LONG_MAX/ULONG_LONG_MAX are a GNU extension. It's too bad 126 // that we don't have something like #pragma poison that could be used to 127 // deprecate a macro - the code should just use LLONG_MAX and friends. 128 // 129 130 type z_crc_t = uint32 /* zconf.h:429:17 */ 131 132 type ssize_t = int64 /* corecrt.h:45:35 */ 133 134 type rsize_t = size_t /* corecrt.h:52:16 */ 135 136 type intptr_t = int64 /* corecrt.h:62:35 */ 137 138 type uintptr_t = uint64 /* corecrt.h:75:44 */ 139 140 type wint_t = uint16 /* corecrt.h:106:24 */ 141 type wctype_t = uint16 /* corecrt.h:107:24 */ 142 143 type errno_t = int32 /* corecrt.h:113:13 */ 144 145 type time_t = int64 /* corecrt.h:138:20 */ 146 147 type threadlocaleinfostruct = struct { 148 _locale_pctype uintptr 149 _locale_mb_cur_max int32 150 _locale_lc_codepage uint32 151 } /* corecrt.h:430:1 */ 152 153 type pthreadlocinfo = uintptr /* corecrt.h:432:39 */ 154 type pthreadmbcinfo = uintptr /* corecrt.h:433:36 */ 155 156 type localeinfo_struct = struct { 157 locinfo pthreadlocinfo 158 mbcinfo pthreadmbcinfo 159 } /* corecrt.h:436:9 */ 160 161 type _locale_tstruct = localeinfo_struct /* corecrt.h:439:3 */ 162 type _locale_t = uintptr /* corecrt.h:439:19 */ 163 164 type tagLC_ID = struct { 165 wLanguage uint16 166 wCountry uint16 167 wCodePage uint16 168 } /* corecrt.h:443:9 */ 169 170 type LC_ID = tagLC_ID /* corecrt.h:447:3 */ 171 type LPLC_ID = uintptr /* corecrt.h:447:9 */ 172 173 type threadlocinfo = threadlocaleinfostruct /* corecrt.h:482:3 */ 174 175 type _ino_t = uint16 /* types.h:43:24 */ 176 type ino_t = uint16 /* types.h:45:24 */ 177 178 type _dev_t = uint32 /* types.h:51:22 */ 179 type dev_t = uint32 /* types.h:53:22 */ 180 181 type _pid_t = int64 /* types.h:63:17 */ 182 183 type pid_t = _pid_t /* types.h:68:16 */ 184 185 type _mode_t = uint16 /* types.h:74:24 */ 186 187 type mode_t = _mode_t /* types.h:77:17 */ 188 189 type _off_t = int32 /* _mingw_off_t.h:5:16 */ 190 type off32_t = int32 /* _mingw_off_t.h:7:16 */ 191 192 type _off64_t = int64 /* _mingw_off_t.h:13:39 */ 193 type off64_t = int64 /* _mingw_off_t.h:15:39 */ 194 195 type off_t = off64_t /* _mingw_off_t.h:24:17 */ 196 197 type useconds_t = uint32 /* types.h:84:22 */ 198 199 type timespec = struct { 200 tv_sec time_t 201 tv_nsec int32 202 _ [4]byte 203 } /* types.h:89:1 */ 204 205 type itimerspec = struct { 206 it_interval struct { 207 tv_sec time_t 208 tv_nsec int32 209 _ [4]byte 210 } 211 it_value struct { 212 tv_sec time_t 213 tv_nsec int32 214 _ [4]byte 215 } 216 } /* types.h:94:1 */ 217 218 type _sigset_t = uint64 /* types.h:104:28 */ 219 220 // GCC always defines __va_copy, but does not define va_copy unless in c99 mode 221 // or -ansi is not specified, since it was not part of C90. 222 223 // ===---- stddef.h - Basic type definitions --------------------------------=== 224 // 225 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 226 // See https://llvm.org/LICENSE.txt for license information. 227 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 228 // 229 //===-----------------------------------------------------------------------=== 230 231 // a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and 232 // "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even 233 // though the former does not conform to the LFS document), but considering 234 // both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as 235 // equivalently requesting no 64-bit operations 236 237 // MVS linker does not support external names larger than 8 bytes 238 239 // 240 // The 'zlib' compression library provides in-memory compression and 241 // decompression functions, including integrity checks of the uncompressed data. 242 // This version of the library supports only one compression method (deflation) 243 // but other algorithms will be added later and will have the same stream 244 // interface. 245 // 246 // Compression can be done in a single step if the buffers are large enough, 247 // or can be done by repeated calls of the compression function. In the latter 248 // case, the application must provide more input and/or consume the output 249 // (providing more output space) before each call. 250 // 251 // The compressed data format used by default by the in-memory functions is 252 // the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped 253 // around a deflate stream, which is itself documented in RFC 1951. 254 // 255 // The library also supports reading and writing files in gzip (.gz) format 256 // with an interface similar to that of stdio using the functions that start 257 // with "gz". The gzip format is different from the zlib format. gzip is a 258 // gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. 259 // 260 // This library can optionally read and write gzip and raw deflate streams in 261 // memory as well. 262 // 263 // The zlib format was designed to be compact and fast for use in memory 264 // and on communications channels. The gzip format was designed for single- 265 // file compression on file systems, has a larger header than zlib to maintain 266 // directory information, and uses a different, slower check method than zlib. 267 // 268 // The library does not install any signal handler. The decoder checks 269 // the consistency of the compressed data, so the library should never crash 270 // even in the case of corrupted input. 271 272 type alloc_func = uintptr /* zlib.h:81:16 */ 273 type free_func = uintptr /* zlib.h:82:16 */ 274 275 type z_stream_s = struct { 276 next_in uintptr 277 avail_in uInt 278 total_in uLong 279 next_out uintptr 280 avail_out uInt 281 total_out uLong 282 msg uintptr 283 state uintptr 284 zalloc alloc_func 285 zfree free_func 286 opaque voidpf 287 data_type int32 288 adler uLong 289 reserved uLong 290 _ [4]byte 291 } /* zlib.h:86:9 */ 292 293 type z_stream = z_stream_s /* zlib.h:106:3 */ 294 295 type z_streamp = uintptr /* zlib.h:108:22 */ 296 297 // 298 // gzip header information passed to and from zlib routines. See RFC 1952 299 // for more details on the meanings of these fields. 300 type gz_header_s = struct { 301 text int32 302 time uLong 303 xflags int32 304 os int32 305 extra uintptr 306 extra_len uInt 307 extra_max uInt 308 name uintptr 309 name_max uInt 310 _ [4]byte 311 comment uintptr 312 comm_max uInt 313 hcrc int32 314 done int32 315 _ [4]byte 316 } /* zlib.h:114:9 */ 317 318 // 319 // gzip header information passed to and from zlib routines. See RFC 1952 320 // for more details on the meanings of these fields. 321 type gz_header = gz_header_s /* zlib.h:129:3 */ 322 323 type gz_headerp = uintptr /* zlib.h:131:23 */ 324 // 325 // inflateGetHeader() requests that gzip header information be stored in the 326 // provided gz_header structure. inflateGetHeader() may be called after 327 // inflateInit2() or inflateReset(), and before the first call of inflate(). 328 // As inflate() processes the gzip stream, head->done is zero until the header 329 // is completed, at which time head->done is set to one. If a zlib stream is 330 // being decoded, then head->done is set to -1 to indicate that there will be 331 // no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be 332 // used to force inflate() to return immediately after header processing is 333 // complete and before any actual data is decompressed. 334 // 335 // The text, time, xflags, and os fields are filled in with the gzip header 336 // contents. hcrc is set to true if there is a header CRC. (The header CRC 337 // was valid if done is set to one.) If extra is not Z_NULL, then extra_max 338 // contains the maximum number of bytes to write to extra. Once done is true, 339 // extra_len contains the actual extra field length, and extra contains the 340 // extra field, or that field truncated if extra_max is less than extra_len. 341 // If name is not Z_NULL, then up to name_max characters are written there, 342 // terminated with a zero unless the length is greater than name_max. If 343 // comment is not Z_NULL, then up to comm_max characters are written there, 344 // terminated with a zero unless the length is greater than comm_max. When any 345 // of extra, name, or comment are not Z_NULL and the respective field is not 346 // present in the header, then that field is set to Z_NULL to signal its 347 // absence. This allows the use of deflateSetHeader() with the returned 348 // structure to duplicate the header. However if those fields are set to 349 // allocated memory, then the application will need to save those pointers 350 // elsewhere so that they can be eventually freed. 351 // 352 // If inflateGetHeader is not used, then the header information is simply 353 // discarded. The header is always checked for validity, including the header 354 // CRC if present. inflateReset() will reset the process to discard the header 355 // information. The application would need to call inflateGetHeader() again to 356 // retrieve the header from the next gzip stream. 357 // 358 // inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source 359 // stream state was inconsistent. 360 361 // 362 // ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, 363 // unsigned char FAR *window)); 364 // 365 // Initialize the internal stream state for decompression using inflateBack() 366 // calls. The fields zalloc, zfree and opaque in strm must be initialized 367 // before the call. If zalloc and zfree are Z_NULL, then the default library- 368 // derived memory allocation routines are used. windowBits is the base two 369 // logarithm of the window size, in the range 8..15. window is a caller 370 // supplied buffer of that size. Except for special applications where it is 371 // assured that deflate was used with small window sizes, windowBits must be 15 372 // and a 32K byte window must be supplied to be able to decompress general 373 // deflate streams. 374 // 375 // See inflateBack() for the usage of these routines. 376 // 377 // inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of 378 // the parameters are invalid, Z_MEM_ERROR if the internal state could not be 379 // allocated, or Z_VERSION_ERROR if the version of the library does not match 380 // the version of the header file. 381 382 type in_func = uintptr /* zlib.h:1092:18 */ 383 type out_func = uintptr /* zlib.h:1094:13 */ 384 // 385 // Same as uncompress, except that sourceLen is a pointer, where the 386 // length of the source is *sourceLen. On return, *sourceLen is the number of 387 // source bytes consumed. 388 389 // gzip file access functions 390 391 // 392 // This library supports reading and writing files in gzip (.gz) format with 393 // an interface similar to that of stdio, using the functions that start with 394 // "gz". The gzip format is different from the zlib format. gzip is a gzip 395 // wrapper, documented in RFC 1952, wrapped around a deflate stream. 396 397 type gzFile_s = struct { 398 have uint32 399 _ [4]byte 400 next uintptr 401 pos int32 402 _ [4]byte 403 } /* zlib.h:1300:9 */ 404 405 // 406 // Same as uncompress, except that sourceLen is a pointer, where the 407 // length of the source is *sourceLen. On return, *sourceLen is the number of 408 // source bytes consumed. 409 410 // gzip file access functions 411 412 // 413 // This library supports reading and writing files in gzip (.gz) format with 414 // an interface similar to that of stdio, using the functions that start with 415 // "gz". The gzip format is different from the zlib format. gzip is a gzip 416 // wrapper, documented in RFC 1952, wrapped around a deflate stream. 417 418 type gzFile = uintptr /* zlib.h:1300:25 */ 419 420 // * 421 // This file has no copyright assigned and is placed in the Public Domain. 422 // This file is part of the mingw-w64 runtime package. 423 // No warranty is given; refer to the file DISCLAIMER.PD within this package. 424 425 // * 426 // This file has no copyright assigned and is placed in the Public Domain. 427 // This file is part of the Wine project. 428 // No warranty is given; refer to the file DISCLAIMER.PD within this package. 429 430 // * 431 // This file has no copyright assigned and is placed in the Public Domain. 432 // This file is part of the mingw-w64 runtime package. 433 // No warranty is given; refer to the file DISCLAIMER.PD within this package. 434 435 type _iobuf = struct{ _Placeholder uintptr } /* stdio.h:33:3 */ 436 437 type FILE = _iobuf /* stdio.h:47:25 */ 438 439 type fpos_t = int64 /* stdio.h:115:37 */ 440 441 func vsnwprintf(tls *libc.TLS, s uintptr, n size_t, format uintptr, arg va_list) int32 { /* stdio.h:1321:15: */ 442 var __ret int32 = libc.X__stdio_common_vswprintf(tls, 0x0004, s, n, format, uintptr(0), arg) 443 if __ret < 0 { 444 return -1 445 } 446 return __ret 447 448 } 449 450 // * 451 // This file has no copyright assigned and is placed in the Public Domain. 452 // This file is part of the mingw-w64 runtime package. 453 // No warranty is given; refer to the file DISCLAIMER.PD within this package. 454 455 // ===-------- vadefs.h ---------------------------------------------------=== 456 // 457 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 458 // See https://llvm.org/LICENSE.txt for license information. 459 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 460 // 461 //===-----------------------------------------------------------------------=== 462 463 // Only include this if we are aiming for MSVC compatibility. 464 // * 465 // This file has no copyright assigned and is placed in the Public Domain. 466 // This file is part of the mingw-w64 runtime package. 467 // No warranty is given; refer to the file DISCLAIMER.PD within this package. 468 469 func vswprintf(tls *libc.TLS, __stream uintptr, __count size_t, __format uintptr, __local_argv uintptr) int32 { /* swprintf.inl:27:5: */ 470 return vsnwprintf(tls, __stream, __count, __format, __local_argv) 471 } 472 473 func _vfscanf_s_l(tls *libc.TLS, _File uintptr, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:40:27: */ 474 return libc.X__stdio_common_vfscanf(tls, 0x0001, _File, _Format, _Locale, _ArgList) 475 476 } 477 478 func _vfscanf_l(tls *libc.TLS, _File uintptr, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:85:27: */ 479 return libc.X__stdio_common_vfscanf(tls, uint64(0), _File, _Format, _Locale, _ArgList) 480 481 } 482 483 func _vsscanf_s_l(tls *libc.TLS, _Src uintptr, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:108:27: */ 484 return libc.X__stdio_common_vsscanf(tls, 0x0001, _Src, libc.Uint64(libc.Uint64FromInt32(-1)), _Format, _Locale, _ArgList) 485 486 } 487 488 func _vsscanf_l(tls *libc.TLS, _Src uintptr, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:135:27: */ 489 return libc.X__stdio_common_vsscanf(tls, uint64(0), _Src, libc.Uint64(libc.Uint64FromInt32(-1)), _Format, _Locale, _ArgList) 490 491 } 492 493 func _vfprintf_s_l(tls *libc.TLS, _File uintptr, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:181:27: */ 494 return libc.X__stdio_common_vfprintf_s(tls, uint64(0), _File, _Format, _Locale, _ArgList) 495 496 } 497 498 func _vsnprintf_c_l(tls *libc.TLS, _DstBuf uintptr, _MaxCount size_t, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:234:27: */ 499 return libc.X__stdio_common_vsprintf(tls, uint64(0), _DstBuf, _MaxCount, _Format, _Locale, _ArgList) 500 501 } 502 503 func _vsnprintf_s_l(tls *libc.TLS, _DstBuf uintptr, _DstSize size_t, _MaxCount size_t, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:261:27: */ 504 return libc.X__stdio_common_vsnprintf_s(tls, uint64(0), _DstBuf, _DstSize, _MaxCount, _Format, _Locale, _ArgList) 505 506 } 507 508 func _vsprintf_s_l(tls *libc.TLS, _DstBuf uintptr, _DstSize size_t, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:292:27: */ 509 return libc.X__stdio_common_vsprintf_s(tls, uint64(0), _DstBuf, _DstSize, _Format, _Locale, _ArgList) 510 511 } 512 513 func _vfprintf_p_l(tls *libc.TLS, _File uintptr, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:319:27: */ 514 return libc.X__stdio_common_vfprintf_p(tls, uint64(0), _File, _Format, _Locale, _ArgList) 515 516 } 517 518 func _vsprintf_p_l(tls *libc.TLS, _DstBuf uintptr, _MaxCount size_t, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:372:27: */ 519 return libc.X__stdio_common_vsprintf_p(tls, uint64(0), _DstBuf, _MaxCount, _Format, _Locale, _ArgList) 520 521 } 522 523 func _vscprintf_p_l(tls *libc.TLS, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:399:27: */ 524 return libc.X__stdio_common_vsprintf_p(tls, 0x0002, uintptr(0), uint64(0), _Format, _Locale, _ArgList) 525 526 } 527 528 func _vfprintf_l(tls *libc.TLS, _File uintptr, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:426:27: */ 529 return libc.X__stdio_common_vfprintf(tls, uint64(0), _File, _Format, _Locale, _ArgList) 530 531 } 532 533 func _vsnprintf_l(tls *libc.TLS, _DstBuf uintptr, _MaxCount size_t, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:453:27: */ 534 return libc.X__stdio_common_vsprintf(tls, 0x0001, _DstBuf, _MaxCount, _Format, _Locale, _ArgList) 535 536 } 537 538 func _vsprintf_l(tls *libc.TLS, _DstBuf uintptr, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:466:27: */ 539 return _vsnprintf_l(tls, _DstBuf, libc.Uint64(libc.Uint64FromInt32(-1)), _Format, _Locale, _ArgList) 540 541 } 542 543 func _vscprintf_l(tls *libc.TLS, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:480:27: */ 544 return libc.X__stdio_common_vsprintf(tls, 0x0002, uintptr(0), uint64(0), _Format, _Locale, _ArgList) 545 546 } 547 548 func _vfwscanf_s_l(tls *libc.TLS, _File uintptr, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:588:27: */ 549 return libc.X__stdio_common_vfwscanf(tls, 0x0002|0x0001, _File, _Format, _Locale, _ArgList) 550 551 } 552 553 func _vswscanf_s_l(tls *libc.TLS, _Src uintptr, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:633:27: */ 554 return libc.X__stdio_common_vswscanf(tls, 0x0002|0x0001, _Src, libc.Uint64(libc.Uint64FromInt32(-1)), _Format, _Locale, _ArgList) 555 556 } 557 558 func _vsnwscanf_s_l(tls *libc.TLS, _Src uintptr, _MaxCount size_t, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:656:27: */ 559 return libc.X__stdio_common_vswscanf(tls, 0x0002|0x0001, _Src, _MaxCount, _Format, _Locale, _ArgList) 560 561 } 562 563 func _vfwprintf_s_l(tls *libc.TLS, _File uintptr, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:679:27: */ 564 return libc.X__stdio_common_vfwprintf_s(tls, 0x0004, _File, _Format, _Locale, _ArgList) 565 566 } 567 568 func _vswprintf_s_l(tls *libc.TLS, _DstBuf uintptr, _DstSize size_t, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:732:27: */ 569 return libc.X__stdio_common_vswprintf_s(tls, 0x0004, _DstBuf, _DstSize, _Format, _Locale, _ArgList) 570 571 } 572 573 func _vsnwprintf_s_l(tls *libc.TLS, _DstBuf uintptr, _DstSize size_t, _MaxCount size_t, _Format uintptr, _Locale _locale_t, _ArgList va_list) int32 { /* stdio_s.h:759:27: */ 574 return libc.X__stdio_common_vsnwprintf_s(tls, 0x0004, _DstBuf, _DstSize, _MaxCount, _Format, _Locale, _ArgList) 575 576 } 577 578 //===---- limits.h - Standard header for integer sizes --------------------===* * 579 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 580 // See https://llvm.org/LICENSE.txt for license information. 581 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 582 // 583 // \*===----------------------------------------------------------------------=== 584 585 type _onexit_t = uintptr /* stdlib.h:50:15 */ 586 587 type _div_t = struct { 588 quot int32 589 rem int32 590 } /* stdlib.h:60:11 */ 591 592 type div_t = _div_t /* stdlib.h:63:5 */ 593 594 type _ldiv_t = struct { 595 quot int32 596 rem int32 597 } /* stdlib.h:65:11 */ 598 599 type ldiv_t = _ldiv_t /* stdlib.h:68:5 */ 600 601 type _LDOUBLE = struct{ ld [10]uint8 } /* stdlib.h:77:5 */ 602 603 type _CRT_DOUBLE = struct{ x float64 } /* stdlib.h:84:5 */ 604 605 type _CRT_FLOAT = struct{ f float32 } /* stdlib.h:88:5 */ 606 607 type _LONGDOUBLE = struct{ x float64 } /* stdlib.h:95:5 */ 608 609 type _LDBL12 = struct{ ld12 [12]uint8 } /* stdlib.h:102:5 */ 610 611 type _purecall_handler = uintptr /* stdlib.h:143:16 */ 612 613 type _invalid_parameter_handler = uintptr /* stdlib.h:148:16 */ 614 615 type lldiv_t = struct { 616 quot int64 617 rem int64 618 } /* stdlib.h:724:61 */ 619 620 // * 621 // This file has no copyright assigned and is placed in the Public Domain. 622 // This file is part of the mingw-w64 runtime package. 623 // No warranty is given; refer to the file DISCLAIMER.PD within this package. 624 625 // * 626 // This file has no copyright assigned and is placed in the Public Domain. 627 // This file is part of the mingw-w64 runtime package. 628 // No warranty is given; refer to the file DISCLAIMER.PD within this package. 629 630 // Return codes for _heapwalk() 631 632 // Values for _heapinfo.useflag 633 634 // The structure used to walk through the heap with _heapwalk. 635 type _heapinfo = struct { 636 _pentry uintptr 637 _size size_t 638 _useflag int32 639 _ [4]byte 640 } /* malloc.h:46:11 */ 641 642 // * 643 // This file has no copyright assigned and is placed in the Public Domain. 644 // This file is part of the mingw-w64 runtime package. 645 // No warranty is given; refer to the file DISCLAIMER.PD within this package. 646 647 // * 648 // This file has no copyright assigned and is placed in the Public Domain. 649 // This file is part of the mingw-w64 runtime package. 650 // No warranty is given; refer to the file DISCLAIMER.PD within this package. 651 652 // Return codes for _heapwalk() 653 654 // Values for _heapinfo.useflag 655 656 // The structure used to walk through the heap with _heapwalk. 657 type _HEAPINFO = _heapinfo /* malloc.h:50:5 */ 658 type _fsize_t = uint32 /* io.h:29:25 */ 659 660 type _finddata32_t = struct { 661 attrib uint32 662 time_create int32 663 time_access int32 664 time_write int32 665 size _fsize_t 666 name [260]int8 667 } /* io.h:35:3 */ 668 669 type _finddata32i64_t = struct { 670 attrib uint32 671 time_create int32 672 time_access int32 673 time_write int32 674 size int64 675 name [260]int8 676 _ [4]byte 677 } /* io.h:44:3 */ 678 679 type _finddata64i32_t = struct { 680 attrib uint32 681 _ [4]byte 682 time_create int64 683 time_access int64 684 time_write int64 685 size _fsize_t 686 name [260]int8 687 } /* io.h:53:3 */ 688 689 type __finddata64_t = struct { 690 attrib uint32 691 _ [4]byte 692 time_create int64 693 time_access int64 694 time_write int64 695 size int64 696 name [260]int8 697 _ [4]byte 698 } /* io.h:62:3 */ 699 700 type _wfinddata32_t = struct { 701 attrib uint32 702 time_create int32 703 time_access int32 704 time_write int32 705 size _fsize_t 706 name [260]wchar_t 707 } /* io.h:94:3 */ 708 709 type _wfinddata32i64_t = struct { 710 attrib uint32 711 time_create int32 712 time_access int32 713 time_write int32 714 size int64 715 name [260]wchar_t 716 } /* io.h:103:3 */ 717 718 type _wfinddata64i32_t = struct { 719 attrib uint32 720 _ [4]byte 721 time_create int64 722 time_access int64 723 time_write int64 724 size _fsize_t 725 name [260]wchar_t 726 _ [4]byte 727 } /* io.h:112:3 */ 728 729 type _wfinddata64_t = struct { 730 attrib uint32 731 _ [4]byte 732 time_create int64 733 time_access int64 734 time_write int64 735 size int64 736 name [260]wchar_t 737 } /* io.h:121:3 */ 738 739 // * 740 // This file has no copyright assigned and is placed in the Public Domain. 741 // This file is part of the mingw-w64 runtime package. 742 // No warranty is given; refer to the file DISCLAIMER.PD within this package. 743 744 var prog uintptr /* minigzip.c:336:13: */ 745 746 // =========================================================================== 747 // Display error message and exit 748 func error(tls *libc.TLS, msg uintptr) { /* minigzip.c:351:6: */ 749 bp := tls.Alloc(16) 750 defer tls.Free(16) 751 752 libc.Xfprintf(tls, libc.X__acrt_iob_func(tls, uint32(2)), ts, libc.VaList(bp, prog, msg)) 753 libc.Xexit(tls, 1) 754 } 755 756 // =========================================================================== 757 // Compress input to output then close both files. 758 759 func gz_compress(tls *libc.TLS, in uintptr, out gzFile) { /* minigzip.c:362:6: */ 760 bp := tls.Alloc(16388) 761 defer tls.Free(16388) 762 763 // var buf [16384]int8 at bp, 16384 764 765 var len int32 766 // var err int32 at bp+16384, 4 767 768 for { 769 len = int32(libc.Xfread(tls, bp, uint64(1), uint64(unsafe.Sizeof([16384]int8{})), in)) 770 if libc.Xferror(tls, in) != 0 { 771 libc.Xperror(tls, ts+8) 772 libc.Xexit(tls, 1) 773 } 774 if len == 0 { 775 break 776 } 777 778 if z.Xgzwrite(tls, out, bp, uint32(len)) != len { 779 error(tls, z.Xgzerror(tls, out, bp+16384)) 780 } 781 } 782 libc.Xfclose(tls, in) 783 if z.Xgzclose(tls, out) != 0 { 784 error(tls, ts+14) 785 } 786 } 787 788 // =========================================================================== 789 // Uncompress input to output then close both files. 790 func gz_uncompress(tls *libc.TLS, in gzFile, out uintptr) { /* minigzip.c:430:6: */ 791 bp := tls.Alloc(16388) 792 defer tls.Free(16388) 793 794 // var buf [16384]int8 at bp, 16384 795 796 var len int32 797 // var err int32 at bp+16384, 4 798 799 for { 800 len = z.Xgzread(tls, in, bp, uint32(unsafe.Sizeof([16384]int8{}))) 801 if len < 0 { 802 error(tls, z.Xgzerror(tls, in, bp+16384)) 803 } 804 if len == 0 { 805 break 806 } 807 808 if int32(libc.Xfwrite(tls, bp, uint64(1), uint64(uint32(len)), out)) != len { 809 error(tls, ts+29) 810 } 811 } 812 if libc.Xfclose(tls, out) != 0 { 813 error(tls, ts+43) 814 } 815 816 if z.Xgzclose(tls, in) != 0 { 817 error(tls, ts+14) 818 } 819 } 820 821 // =========================================================================== 822 // Compress the given file: create a corresponding .gz file and remove the 823 // original. 824 func file_compress(tls *libc.TLS, file uintptr, mode uintptr) { /* minigzip.c:457:6: */ 825 bp := tls.Alloc(1064) 826 defer tls.Free(1064) 827 828 // var outfile [1024]int8 at bp+40, 1024 829 830 var in uintptr 831 var out gzFile 832 833 if libc.Xstrlen(tls, file)+libc.Xstrlen(tls, ts+57) >= size_t(unsafe.Sizeof([1024]int8{})) { 834 libc.Xfprintf(tls, libc.X__acrt_iob_func(tls, uint32(2)), ts+61, libc.VaList(bp, prog)) 835 libc.Xexit(tls, 1) 836 } 837 838 libc.Xsnprintf(tls, bp+40, uint64(unsafe.Sizeof([1024]int8{})), ts+84, libc.VaList(bp+8, file, ts+57)) 839 840 in = libc.Xfopen(tls, file, ts+89) 841 if in == uintptr(0) { 842 libc.Xperror(tls, file) 843 libc.Xexit(tls, 1) 844 } 845 out = z.Xgzopen(tls, bp+40, mode) 846 if out == uintptr(0) { 847 libc.Xfprintf(tls, libc.X__acrt_iob_func(tls, uint32(2)), ts+92, libc.VaList(bp+24, prog, bp+40)) 848 libc.Xexit(tls, 1) 849 } 850 gz_compress(tls, in, out) 851 852 libc.Xunlink(tls, file) 853 } 854 855 // =========================================================================== 856 // Uncompress the given file and remove the original. 857 func file_uncompress(tls *libc.TLS, file uintptr) { /* minigzip.c:496:6: */ 858 bp := tls.Alloc(1064) 859 defer tls.Free(1064) 860 861 // var buf [1024]int8 at bp+40, 1024 862 863 var infile uintptr 864 var outfile uintptr 865 var out uintptr 866 var in gzFile 867 var len uint32 = uint32(libc.Xstrlen(tls, file)) 868 869 if size_t(len)+libc.Xstrlen(tls, ts+57) >= size_t(unsafe.Sizeof([1024]int8{})) { 870 libc.Xfprintf(tls, libc.X__acrt_iob_func(tls, uint32(2)), ts+61, libc.VaList(bp, prog)) 871 libc.Xexit(tls, 1) 872 } 873 874 libc.Xsnprintf(tls, bp+40, uint64(unsafe.Sizeof([1024]int8{})), ts+113, libc.VaList(bp+8, file)) 875 876 if uint64(len) > uint64(unsafe.Sizeof([4]int8{}))-uint64(1) && libc.Xstrcmp(tls, file+uintptr(len)-uintptr(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)), ts+57) == 0 { 877 infile = file 878 outfile = bp + 40 /* &buf[0] */ 879 *(*int8)(unsafe.Pointer(outfile + uintptr(len-uint32(3)))) = int8(0) 880 } else { 881 outfile = file 882 infile = bp + 40 /* &buf[0] */ 883 libc.Xsnprintf(tls, bp+40+uintptr(len), uint64(unsafe.Sizeof([1024]int8{}))-uint64(len), ts+113, libc.VaList(bp+16, ts+57 /* ".gz" */)) 884 } 885 in = z.Xgzopen(tls, infile, ts+89) 886 if in == uintptr(0) { 887 libc.Xfprintf(tls, libc.X__acrt_iob_func(tls, uint32(2)), ts+92, libc.VaList(bp+24, prog, infile)) 888 libc.Xexit(tls, 1) 889 } 890 out = libc.Xfopen(tls, outfile, ts+116) 891 if out == uintptr(0) { 892 libc.Xperror(tls, file) 893 libc.Xexit(tls, 1) 894 } 895 896 gz_uncompress(tls, in, out) 897 898 libc.Xunlink(tls, infile) 899 } 900 901 // =========================================================================== 902 // Usage: minigzip [-c] [-d] [-f] [-h] [-r] [-1 to -9] [files...] 903 // -c : write to standard output 904 // -d : decompress 905 // -f : compress with Z_FILTERED 906 // -h : compress with Z_HUFFMAN_ONLY 907 // -r : compress with Z_RLE 908 // -1 to -9 : compression level 909 910 func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* minigzip.c:556:5: */ 911 bp := tls.Alloc(44) 912 defer tls.Free(44) 913 914 var copyout int32 = 0 915 var uncompr int32 = 0 916 var file gzFile 917 var bname uintptr 918 // var outmode [20]int8 at bp+24, 20 919 920 libc.Xsnprintf(tls, bp+24, uint64(unsafe.Sizeof([20]int8{})), ts+113, libc.VaList(bp, ts+119)) 921 922 prog = *(*uintptr)(unsafe.Pointer(argv)) 923 bname = libc.Xstrrchr(tls, *(*uintptr)(unsafe.Pointer(argv)), '/') 924 if bname != 0 { 925 bname++ 926 } else { 927 bname = *(*uintptr)(unsafe.Pointer(argv)) 928 } 929 argc-- 930 argv += 8 931 932 if !(libc.Xstrcmp(tls, bname, ts+124) != 0) { 933 uncompr = 1 934 } else if !(libc.Xstrcmp(tls, bname, ts+131) != 0) { 935 copyout = libc.AssignInt32(&uncompr, 1) 936 } 937 938 for argc > 0 { 939 if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+136) == 0 { 940 copyout = 1 941 } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+139) == 0 { 942 uncompr = 1 943 } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+142) == 0 { 944 *(*int8)(unsafe.Pointer(bp + 24 + 3)) = int8('f') 945 } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+145) == 0 { 946 *(*int8)(unsafe.Pointer(bp + 24 + 3)) = int8('h') 947 } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+148) == 0 { 948 *(*int8)(unsafe.Pointer(bp + 24 + 3)) = int8('R') 949 } else if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv))))) == '-' && int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv)) + 1))) >= '1' && int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv)) + 1))) <= '9' && int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv)) + 2))) == 0 { 950 *(*int8)(unsafe.Pointer(bp + 24 + 2)) = *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv)) + 1)) 951 } else { 952 break 953 } 954 argc-- 955 argv += 8 956 } 957 if int32(*(*int8)(unsafe.Pointer(bp + 24 + 3))) == ' ' { 958 *(*int8)(unsafe.Pointer(bp + 24 + 3)) = int8(0) 959 } 960 if argc == 0 { 961 libc.Xsetmode(tls, libc.Xfileno(tls, libc.X__acrt_iob_func(tls, uint32(0))), 0x8000) 962 libc.Xsetmode(tls, libc.Xfileno(tls, libc.X__acrt_iob_func(tls, uint32(1))), 0x8000) 963 if uncompr != 0 { 964 file = z.Xgzdopen(tls, libc.Xfileno(tls, libc.X__acrt_iob_func(tls, uint32(0))), ts+89) 965 if file == uintptr(0) { 966 error(tls, ts+151) 967 } 968 gz_uncompress(tls, file, libc.X__acrt_iob_func(tls, uint32(1))) 969 } else { 970 file = z.Xgzdopen(tls, libc.Xfileno(tls, libc.X__acrt_iob_func(tls, uint32(1))), bp+24) 971 if file == uintptr(0) { 972 error(tls, ts+171) 973 } 974 gz_compress(tls, libc.X__acrt_iob_func(tls, uint32(0)), file) 975 } 976 } else { 977 if copyout != 0 { 978 libc.Xsetmode(tls, libc.Xfileno(tls, libc.X__acrt_iob_func(tls, uint32(1))), 0x8000) 979 } 980 for __ccgo := true; __ccgo; __ccgo = func() bool { argv += 8; return libc.PreDecInt32(&argc, 1) != 0 }() { 981 if uncompr != 0 { 982 if copyout != 0 { 983 file = z.Xgzopen(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+89) 984 if file == uintptr(0) { 985 libc.Xfprintf(tls, libc.X__acrt_iob_func(tls, uint32(2)), ts+92, libc.VaList(bp+8, prog, *(*uintptr)(unsafe.Pointer(argv)))) 986 } else { 987 gz_uncompress(tls, file, libc.X__acrt_iob_func(tls, uint32(1))) 988 } 989 } else { 990 file_uncompress(tls, *(*uintptr)(unsafe.Pointer(argv))) 991 } 992 } else { 993 if copyout != 0 { 994 var in uintptr = libc.Xfopen(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+89) 995 996 if in == uintptr(0) { 997 libc.Xperror(tls, *(*uintptr)(unsafe.Pointer(argv))) 998 } else { 999 file = z.Xgzdopen(tls, libc.Xfileno(tls, libc.X__acrt_iob_func(tls, uint32(1))), bp+24) 1000 if file == uintptr(0) { 1001 error(tls, ts+171) 1002 } 1003 1004 gz_compress(tls, in, file) 1005 } 1006 1007 } else { 1008 file_compress(tls, *(*uintptr)(unsafe.Pointer(argv)), bp+24) 1009 } 1010 } 1011 } 1012 } 1013 return 0 1014 } 1015 1016 var ts1 = "%s: %s\n\x00fread\x00failed gzclose\x00failed fwrite\x00failed fclose\x00.gz\x00%s: filename too long\n\x00%s%s\x00rb\x00%s: can't gzopen %s\n\x00%s\x00wb\x00wb6 \x00gunzip\x00zcat\x00-c\x00-d\x00-f\x00-h\x00-r\x00can't gzdopen stdin\x00can't gzdopen stdout\x00" 1017 var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data