modernc.org/z@v1.7.4/internal/minigzip_netbsd_amd64.go (about)

     1  // Code generated by 'ccgo -lmodernc.org/z/lib -o internal/minigzip_netbsd_amd64.go -trace-translation-units /tmp/go-generate-2662545308/cdb.json minigzip64', 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 _ types.Size_t
    21  
    22  func main() { libc.Start(main1) }
    23  
    24  type ptrdiff_t = int64 /* <builtin>:3:26 */
    25  
    26  type size_t = uint64 /* <builtin>:9:23 */
    27  
    28  type wchar_t = int32 /* <builtin>:15:24 */
    29  
    30  //	$NetBSD: null.h,v 1.9 2010/07/06 11:56:20 kleink Exp $
    31  
    32  // Written by Klaus Klein <kleink@NetBSD.org>, December 22, 1999.
    33  // Public domain.
    34  
    35  type max_align_t = struct{ _v uintptr } /* stddef.h:75:3 */
    36  
    37  type z_size_t = size_t /* zconf.h:248:21 */
    38  
    39  // Maximum value for memLevel in deflateInit2
    40  
    41  // Maximum value for windowBits in deflateInit2 and inflateInit2.
    42  // WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
    43  // created by gzip. (Files created by minigzip can still be extracted by
    44  // gzip.)
    45  
    46  // The memory requirements for deflate are (in bytes):
    47  //             (1 << (windowBits+2)) +  (1 << (memLevel+9))
    48  //  that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
    49  //  plus a few kilobytes for small objects. For example, if you want to reduce
    50  //  the default memory requirements from 256K to 128K, compile with
    51  //      make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
    52  //  Of course this will generally degrade compression (there's no free lunch).
    53  //
    54  //    The memory requirements for inflate are (in bytes) 1 << windowBits
    55  //  that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
    56  //  for small objects.
    57  
    58  // Type declarations
    59  
    60  // The following definitions for FAR are needed only for MSDOS mixed
    61  // model programming (small or medium model with some far allocations).
    62  // This was tested only with MSC; for other MSDOS compilers you may have
    63  // to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
    64  // just define FAR to be empty.
    65  
    66  type Byte = uint8   /* zconf.h:391:24 */ // 8 bits
    67  type uInt = uint32  /* zconf.h:393:24 */ // 16 bits or more
    68  type uLong = uint64 /* zconf.h:394:24 */ // 32 bits or more
    69  
    70  type Bytef = Byte   /* zconf.h:400:22 */
    71  type charf = int8   /* zconf.h:402:19 */
    72  type intf = int32   /* zconf.h:403:19 */
    73  type uIntf = uInt   /* zconf.h:404:19 */
    74  type uLongf = uLong /* zconf.h:405:19 */
    75  
    76  type voidpc = uintptr /* zconf.h:408:23 */
    77  type voidpf = uintptr /* zconf.h:409:23 */
    78  type voidp = uintptr  /* zconf.h:410:23 */
    79  
    80  //	$NetBSD: limits.h,v 1.40 2016/08/04 06:43:43 christos Exp $
    81  
    82  // Copyright (c) 1988, 1993
    83  //	The Regents of the University of California.  All rights reserved.
    84  //
    85  // Redistribution and use in source and binary forms, with or without
    86  // modification, are permitted provided that the following conditions
    87  // are met:
    88  // 1. Redistributions of source code must retain the above copyright
    89  //    notice, this list of conditions and the following disclaimer.
    90  // 2. Redistributions in binary form must reproduce the above copyright
    91  //    notice, this list of conditions and the following disclaimer in the
    92  //    documentation and/or other materials provided with the distribution.
    93  // 3. Neither the name of the University nor the names of its contributors
    94  //    may be used to endorse or promote products derived from this software
    95  //    without specific prior written permission.
    96  //
    97  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
    98  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    99  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   100  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   101  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   102  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   103  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   104  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   105  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   106  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   107  // SUCH DAMAGE.
   108  //
   109  //	@(#)limits.h	8.2 (Berkeley) 1/4/94
   110  
   111  //	$NetBSD: featuretest.h,v 1.10 2013/04/26 18:29:06 christos Exp $
   112  
   113  // Written by Klaus Klein <kleink@NetBSD.org>, February 2, 1998.
   114  // Public domain.
   115  //
   116  // NOTE: Do not protect this header against multiple inclusion.  Doing
   117  // so can have subtle side-effects due to header file inclusion order
   118  // and testing of e.g. _POSIX_SOURCE vs. _POSIX_C_SOURCE.  Instead,
   119  // protect each CPP macro that we want to supply.
   120  
   121  // Feature-test macros are defined by several standards, and allow an
   122  // application to specify what symbols they want the system headers to
   123  // expose, and hence what standard they want them to conform to.
   124  // There are two classes of feature-test macros.  The first class
   125  // specify complete standards, and if one of these is defined, header
   126  // files will try to conform to the relevant standard.  They are:
   127  //
   128  // ANSI macros:
   129  // _ANSI_SOURCE			ANSI C89
   130  //
   131  // POSIX macros:
   132  // _POSIX_SOURCE == 1		IEEE Std 1003.1 (version?)
   133  // _POSIX_C_SOURCE == 1		IEEE Std 1003.1-1990
   134  // _POSIX_C_SOURCE == 2		IEEE Std 1003.2-1992
   135  // _POSIX_C_SOURCE == 199309L	IEEE Std 1003.1b-1993
   136  // _POSIX_C_SOURCE == 199506L	ISO/IEC 9945-1:1996
   137  // _POSIX_C_SOURCE == 200112L	IEEE Std 1003.1-2001
   138  // _POSIX_C_SOURCE == 200809L   IEEE Std 1003.1-2008
   139  //
   140  // X/Open macros:
   141  // _XOPEN_SOURCE		System Interfaces and Headers, Issue 4, Ver 2
   142  // _XOPEN_SOURCE_EXTENDED == 1	XSH4.2 UNIX extensions
   143  // _XOPEN_SOURCE == 500		System Interfaces and Headers, Issue 5
   144  // _XOPEN_SOURCE == 520		Networking Services (XNS), Issue 5.2
   145  // _XOPEN_SOURCE == 600		IEEE Std 1003.1-2001, XSI option
   146  // _XOPEN_SOURCE == 700		IEEE Std 1003.1-2008, XSI option
   147  //
   148  // NetBSD macros:
   149  // _NETBSD_SOURCE == 1		Make all NetBSD features available.
   150  //
   151  // If more than one of these "major" feature-test macros is defined,
   152  // then the set of facilities provided (and namespace used) is the
   153  // union of that specified by the relevant standards, and in case of
   154  // conflict, the earlier standard in the above list has precedence (so
   155  // if both _POSIX_C_SOURCE and _NETBSD_SOURCE are defined, the version
   156  // of rename() that's used is the POSIX one).  If none of the "major"
   157  // feature-test macros is defined, _NETBSD_SOURCE is assumed.
   158  //
   159  // There are also "minor" feature-test macros, which enable extra
   160  // functionality in addition to some base standard.  They should be
   161  // defined along with one of the "major" macros.  The "minor" macros
   162  // are:
   163  //
   164  // _REENTRANT
   165  // _ISOC99_SOURCE
   166  // _ISOC11_SOURCE
   167  // _LARGEFILE_SOURCE		Large File Support
   168  //		<http://ftp.sas.com/standards/large.file/x_open.20Mar96.html>
   169  
   170  // We have not implemented these yet
   171  //
   172  // _POSIX_THREAD_ATTR_STACKADDR
   173  // _POSIX_THREAD_ATTR_STACKSIZE
   174  // _POSIX_THREAD_CPUTIME
   175  // _POSIX_THREAD_PRIORITY_SCHEDULING
   176  // _POSIX_THREAD_PRIO_INHERIT
   177  // _POSIX_THREAD_PRIO_PROTECT
   178  // _POSIX_THREAD_PROCESS_SHARED
   179  // _POSIX_THREAD_SAFE_FUNCTIONS
   180  // _POSIX_THREAD_SPORADIC_SERVER
   181  
   182  // The following 3 are defined in
   183  // Open Group Base Specifications Issue 7
   184  
   185  // These are the correct names, defined in terms of the above
   186  // except for PTHREAD_KEYS_MAX which is bigger than standard
   187  // mandated minimum value _POSIX_THREAD_KEYS_MAX.
   188  // Not yet: PTHREAD_STACK_MIN
   189  
   190  // X/Open CAE Specifications,
   191  // adopted in IEEE Std 1003.1-2001 XSI.
   192  
   193  // IEEE Std 1003.1-2001 TSF
   194  
   195  // Always ensure that this is consistent with <stdio.h>
   196  
   197  // X/Open Extended API set 2 (a.k.a. C063)
   198  // This hides unimplemented functions from GNU configure until
   199  // we are done implementing them.
   200  
   201  //	$NetBSD: limits.h,v 1.15 2019/01/21 20:22:48 dholland Exp $
   202  
   203  // Copyright (c) 1988 The Regents of the University of California.
   204  // All rights reserved.
   205  //
   206  // Redistribution and use in source and binary forms, with or without
   207  // modification, are permitted provided that the following conditions
   208  // are met:
   209  // 1. Redistributions of source code must retain the above copyright
   210  //    notice, this list of conditions and the following disclaimer.
   211  // 2. Redistributions in binary form must reproduce the above copyright
   212  //    notice, this list of conditions and the following disclaimer in the
   213  //    documentation and/or other materials provided with the distribution.
   214  // 3. Neither the name of the University nor the names of its contributors
   215  //    may be used to endorse or promote products derived from this software
   216  //    without specific prior written permission.
   217  //
   218  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   219  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   220  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   221  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   222  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   223  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   224  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   225  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   226  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   227  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   228  // SUCH DAMAGE.
   229  //
   230  //	@(#)limits.h	7.2 (Berkeley) 6/28/90
   231  
   232  //	$NetBSD: featuretest.h,v 1.10 2013/04/26 18:29:06 christos Exp $
   233  
   234  // Written by Klaus Klein <kleink@NetBSD.org>, February 2, 1998.
   235  // Public domain.
   236  //
   237  // NOTE: Do not protect this header against multiple inclusion.  Doing
   238  // so can have subtle side-effects due to header file inclusion order
   239  // and testing of e.g. _POSIX_SOURCE vs. _POSIX_C_SOURCE.  Instead,
   240  // protect each CPP macro that we want to supply.
   241  
   242  // Feature-test macros are defined by several standards, and allow an
   243  // application to specify what symbols they want the system headers to
   244  // expose, and hence what standard they want them to conform to.
   245  // There are two classes of feature-test macros.  The first class
   246  // specify complete standards, and if one of these is defined, header
   247  // files will try to conform to the relevant standard.  They are:
   248  //
   249  // ANSI macros:
   250  // _ANSI_SOURCE			ANSI C89
   251  //
   252  // POSIX macros:
   253  // _POSIX_SOURCE == 1		IEEE Std 1003.1 (version?)
   254  // _POSIX_C_SOURCE == 1		IEEE Std 1003.1-1990
   255  // _POSIX_C_SOURCE == 2		IEEE Std 1003.2-1992
   256  // _POSIX_C_SOURCE == 199309L	IEEE Std 1003.1b-1993
   257  // _POSIX_C_SOURCE == 199506L	ISO/IEC 9945-1:1996
   258  // _POSIX_C_SOURCE == 200112L	IEEE Std 1003.1-2001
   259  // _POSIX_C_SOURCE == 200809L   IEEE Std 1003.1-2008
   260  //
   261  // X/Open macros:
   262  // _XOPEN_SOURCE		System Interfaces and Headers, Issue 4, Ver 2
   263  // _XOPEN_SOURCE_EXTENDED == 1	XSH4.2 UNIX extensions
   264  // _XOPEN_SOURCE == 500		System Interfaces and Headers, Issue 5
   265  // _XOPEN_SOURCE == 520		Networking Services (XNS), Issue 5.2
   266  // _XOPEN_SOURCE == 600		IEEE Std 1003.1-2001, XSI option
   267  // _XOPEN_SOURCE == 700		IEEE Std 1003.1-2008, XSI option
   268  //
   269  // NetBSD macros:
   270  // _NETBSD_SOURCE == 1		Make all NetBSD features available.
   271  //
   272  // If more than one of these "major" feature-test macros is defined,
   273  // then the set of facilities provided (and namespace used) is the
   274  // union of that specified by the relevant standards, and in case of
   275  // conflict, the earlier standard in the above list has precedence (so
   276  // if both _POSIX_C_SOURCE and _NETBSD_SOURCE are defined, the version
   277  // of rename() that's used is the POSIX one).  If none of the "major"
   278  // feature-test macros is defined, _NETBSD_SOURCE is assumed.
   279  //
   280  // There are also "minor" feature-test macros, which enable extra
   281  // functionality in addition to some base standard.  They should be
   282  // defined along with one of the "major" macros.  The "minor" macros
   283  // are:
   284  //
   285  // _REENTRANT
   286  // _ISOC99_SOURCE
   287  // _ISOC11_SOURCE
   288  // _LARGEFILE_SOURCE		Large File Support
   289  //		<http://ftp.sas.com/standards/large.file/x_open.20Mar96.html>
   290  
   291  //	$NetBSD: syslimits.h,v 1.28 2015/08/21 07:19:39 uebayasi 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  //	$NetBSD: featuretest.h,v 1.10 2013/04/26 18:29:06 christos Exp $
   323  
   324  // Written by Klaus Klein <kleink@NetBSD.org>, February 2, 1998.
   325  // Public domain.
   326  //
   327  // NOTE: Do not protect this header against multiple inclusion.  Doing
   328  // so can have subtle side-effects due to header file inclusion order
   329  // and testing of e.g. _POSIX_SOURCE vs. _POSIX_C_SOURCE.  Instead,
   330  // protect each CPP macro that we want to supply.
   331  
   332  // Feature-test macros are defined by several standards, and allow an
   333  // application to specify what symbols they want the system headers to
   334  // expose, and hence what standard they want them to conform to.
   335  // There are two classes of feature-test macros.  The first class
   336  // specify complete standards, and if one of these is defined, header
   337  // files will try to conform to the relevant standard.  They are:
   338  //
   339  // ANSI macros:
   340  // _ANSI_SOURCE			ANSI C89
   341  //
   342  // POSIX macros:
   343  // _POSIX_SOURCE == 1		IEEE Std 1003.1 (version?)
   344  // _POSIX_C_SOURCE == 1		IEEE Std 1003.1-1990
   345  // _POSIX_C_SOURCE == 2		IEEE Std 1003.2-1992
   346  // _POSIX_C_SOURCE == 199309L	IEEE Std 1003.1b-1993
   347  // _POSIX_C_SOURCE == 199506L	ISO/IEC 9945-1:1996
   348  // _POSIX_C_SOURCE == 200112L	IEEE Std 1003.1-2001
   349  // _POSIX_C_SOURCE == 200809L   IEEE Std 1003.1-2008
   350  //
   351  // X/Open macros:
   352  // _XOPEN_SOURCE		System Interfaces and Headers, Issue 4, Ver 2
   353  // _XOPEN_SOURCE_EXTENDED == 1	XSH4.2 UNIX extensions
   354  // _XOPEN_SOURCE == 500		System Interfaces and Headers, Issue 5
   355  // _XOPEN_SOURCE == 520		Networking Services (XNS), Issue 5.2
   356  // _XOPEN_SOURCE == 600		IEEE Std 1003.1-2001, XSI option
   357  // _XOPEN_SOURCE == 700		IEEE Std 1003.1-2008, XSI option
   358  //
   359  // NetBSD macros:
   360  // _NETBSD_SOURCE == 1		Make all NetBSD features available.
   361  //
   362  // If more than one of these "major" feature-test macros is defined,
   363  // then the set of facilities provided (and namespace used) is the
   364  // union of that specified by the relevant standards, and in case of
   365  // conflict, the earlier standard in the above list has precedence (so
   366  // if both _POSIX_C_SOURCE and _NETBSD_SOURCE are defined, the version
   367  // of rename() that's used is the POSIX one).  If none of the "major"
   368  // feature-test macros is defined, _NETBSD_SOURCE is assumed.
   369  //
   370  // There are also "minor" feature-test macros, which enable extra
   371  // functionality in addition to some base standard.  They should be
   372  // defined along with one of the "major" macros.  The "minor" macros
   373  // are:
   374  //
   375  // _REENTRANT
   376  // _ISOC99_SOURCE
   377  // _ISOC11_SOURCE
   378  // _LARGEFILE_SOURCE		Large File Support
   379  //		<http://ftp.sas.com/standards/large.file/x_open.20Mar96.html>
   380  
   381  // kept in sync with MAXNAMLEN
   382  
   383  // IEEE Std 1003.1c-95, adopted in X/Open CAE Specification Issue 5 Version 2
   384  
   385  // X/Open CAE Specification Issue 5 Version 2
   386  
   387  type z_crc_t = uint32 /* zconf.h:429:17 */
   388  
   389  type int8_t = int8 /* types.h:54:18 */
   390  
   391  type uint8_t = uint8 /* types.h:59:19 */
   392  
   393  type int16_t = int16 /* types.h:64:19 */
   394  
   395  type uint16_t = uint16 /* types.h:69:20 */
   396  
   397  type int32_t = int32 /* types.h:74:19 */
   398  
   399  type uint32_t = uint32 /* types.h:79:20 */
   400  
   401  type int64_t = int64 /* types.h:84:19 */
   402  
   403  type uint64_t = uint64 /* types.h:89:20 */
   404  
   405  type u_int8_t = uint8_t   /* types.h:93:18 */
   406  type u_int16_t = uint16_t /* types.h:94:18 */
   407  type u_int32_t = uint32_t /* types.h:95:18 */
   408  type u_int64_t = uint64_t /* types.h:96:18 */
   409  
   410  //	$NetBSD: endian.h,v 1.1 2003/04/26 18:39:40 fvdl Exp $
   411  
   412  //	$NetBSD: endian.h,v 1.30 2016/02/27 21:37:35 christos Exp $
   413  
   414  // Copyright (c) 1987, 1991, 1993
   415  //	The Regents of the University of California.  All rights reserved.
   416  //
   417  // Redistribution and use in source and binary forms, with or without
   418  // modification, are permitted provided that the following conditions
   419  // are met:
   420  // 1. Redistributions of source code must retain the above copyright
   421  //    notice, this list of conditions and the following disclaimer.
   422  // 2. Redistributions in binary form must reproduce the above copyright
   423  //    notice, this list of conditions and the following disclaimer in the
   424  //    documentation and/or other materials provided with the distribution.
   425  // 3. Neither the name of the University nor the names of its contributors
   426  //    may be used to endorse or promote products derived from this software
   427  //    without specific prior written permission.
   428  //
   429  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   430  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   431  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   432  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   433  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   434  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   435  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   436  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   437  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   438  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   439  // SUCH DAMAGE.
   440  //
   441  //	@(#)endian.h	8.1 (Berkeley) 6/11/93
   442  
   443  //	$NetBSD: featuretest.h,v 1.10 2013/04/26 18:29:06 christos Exp $
   444  
   445  // Written by Klaus Klein <kleink@NetBSD.org>, February 2, 1998.
   446  // Public domain.
   447  //
   448  // NOTE: Do not protect this header against multiple inclusion.  Doing
   449  // so can have subtle side-effects due to header file inclusion order
   450  // and testing of e.g. _POSIX_SOURCE vs. _POSIX_C_SOURCE.  Instead,
   451  // protect each CPP macro that we want to supply.
   452  
   453  // Feature-test macros are defined by several standards, and allow an
   454  // application to specify what symbols they want the system headers to
   455  // expose, and hence what standard they want them to conform to.
   456  // There are two classes of feature-test macros.  The first class
   457  // specify complete standards, and if one of these is defined, header
   458  // files will try to conform to the relevant standard.  They are:
   459  //
   460  // ANSI macros:
   461  // _ANSI_SOURCE			ANSI C89
   462  //
   463  // POSIX macros:
   464  // _POSIX_SOURCE == 1		IEEE Std 1003.1 (version?)
   465  // _POSIX_C_SOURCE == 1		IEEE Std 1003.1-1990
   466  // _POSIX_C_SOURCE == 2		IEEE Std 1003.2-1992
   467  // _POSIX_C_SOURCE == 199309L	IEEE Std 1003.1b-1993
   468  // _POSIX_C_SOURCE == 199506L	ISO/IEC 9945-1:1996
   469  // _POSIX_C_SOURCE == 200112L	IEEE Std 1003.1-2001
   470  // _POSIX_C_SOURCE == 200809L   IEEE Std 1003.1-2008
   471  //
   472  // X/Open macros:
   473  // _XOPEN_SOURCE		System Interfaces and Headers, Issue 4, Ver 2
   474  // _XOPEN_SOURCE_EXTENDED == 1	XSH4.2 UNIX extensions
   475  // _XOPEN_SOURCE == 500		System Interfaces and Headers, Issue 5
   476  // _XOPEN_SOURCE == 520		Networking Services (XNS), Issue 5.2
   477  // _XOPEN_SOURCE == 600		IEEE Std 1003.1-2001, XSI option
   478  // _XOPEN_SOURCE == 700		IEEE Std 1003.1-2008, XSI option
   479  //
   480  // NetBSD macros:
   481  // _NETBSD_SOURCE == 1		Make all NetBSD features available.
   482  //
   483  // If more than one of these "major" feature-test macros is defined,
   484  // then the set of facilities provided (and namespace used) is the
   485  // union of that specified by the relevant standards, and in case of
   486  // conflict, the earlier standard in the above list has precedence (so
   487  // if both _POSIX_C_SOURCE and _NETBSD_SOURCE are defined, the version
   488  // of rename() that's used is the POSIX one).  If none of the "major"
   489  // feature-test macros is defined, _NETBSD_SOURCE is assumed.
   490  //
   491  // There are also "minor" feature-test macros, which enable extra
   492  // functionality in addition to some base standard.  They should be
   493  // defined along with one of the "major" macros.  The "minor" macros
   494  // are:
   495  //
   496  // _REENTRANT
   497  // _ISOC99_SOURCE
   498  // _ISOC11_SOURCE
   499  // _LARGEFILE_SOURCE		Large File Support
   500  //		<http://ftp.sas.com/standards/large.file/x_open.20Mar96.html>
   501  
   502  // Definitions for byte order, according to byte significance from low
   503  // address to high.
   504  
   505  // C-family endian-ness definitions
   506  
   507  //	$NetBSD: ansi.h,v 1.14 2011/07/17 20:54:54 joerg Exp $
   508  
   509  // -
   510  // Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
   511  // All rights reserved.
   512  //
   513  // This code is derived from software contributed to The NetBSD Foundation
   514  // by Jun-ichiro itojun Hagino and by Klaus Klein.
   515  //
   516  // Redistribution and use in source and binary forms, with or without
   517  // modification, are permitted provided that the following conditions
   518  // are met:
   519  // 1. Redistributions of source code must retain the above copyright
   520  //    notice, this list of conditions and the following disclaimer.
   521  // 2. Redistributions in binary form must reproduce the above copyright
   522  //    notice, this list of conditions and the following disclaimer in the
   523  //    documentation and/or other materials provided with the distribution.
   524  //
   525  // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
   526  // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   527  // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   528  // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
   529  // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   530  // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   531  // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   532  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   533  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   534  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   535  // POSSIBILITY OF SUCH DAMAGE.
   536  
   537  //	$NetBSD: cdefs.h,v 1.141 2019/02/21 21:34:05 christos Exp $
   538  
   539  // * Copyright (c) 1991, 1993
   540  //	The Regents of the University of California.  All rights reserved.
   541  //
   542  // This code is derived from software contributed to Berkeley by
   543  // Berkeley Software Design, Inc.
   544  //
   545  // Redistribution and use in source and binary forms, with or without
   546  // modification, are permitted provided that the following conditions
   547  // are met:
   548  // 1. Redistributions of source code must retain the above copyright
   549  //    notice, this list of conditions and the following disclaimer.
   550  // 2. Redistributions in binary form must reproduce the above copyright
   551  //    notice, this list of conditions and the following disclaimer in the
   552  //    documentation and/or other materials provided with the distribution.
   553  // 3. Neither the name of the University nor the names of its contributors
   554  //    may be used to endorse or promote products derived from this software
   555  //    without specific prior written permission.
   556  //
   557  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   558  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   559  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   560  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   561  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   562  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   563  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   564  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   565  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   566  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   567  // SUCH DAMAGE.
   568  //
   569  //	@(#)cdefs.h	8.8 (Berkeley) 1/9/95
   570  
   571  //	$NetBSD: types.h,v 1.102 2018/11/06 16:26:44 maya Exp $
   572  
   573  // -
   574  // Copyright (c) 1982, 1986, 1991, 1993, 1994
   575  //	The Regents of the University of California.  All rights reserved.
   576  // (c) UNIX System Laboratories, Inc.
   577  // All or some portions of this file are derived from material licensed
   578  // to the University of California by American Telephone and Telegraph
   579  // Co. or Unix System Laboratories, Inc. and are reproduced herein with
   580  // the permission of UNIX System Laboratories, Inc.
   581  //
   582  // Redistribution and use in source and binary forms, with or without
   583  // modification, are permitted provided that the following conditions
   584  // are met:
   585  // 1. Redistributions of source code must retain the above copyright
   586  //    notice, this list of conditions and the following disclaimer.
   587  // 2. Redistributions in binary form must reproduce the above copyright
   588  //    notice, this list of conditions and the following disclaimer in the
   589  //    documentation and/or other materials provided with the distribution.
   590  // 3. Neither the name of the University nor the names of its contributors
   591  //    may be used to endorse or promote products derived from this software
   592  //    without specific prior written permission.
   593  //
   594  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   595  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   596  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   597  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   598  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   599  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   600  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   601  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   602  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   603  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   604  // SUCH DAMAGE.
   605  //
   606  //	@(#)types.h	8.4 (Berkeley) 1/21/94
   607  
   608  type in_addr_t = uint32 /* endian.h:58:21 */
   609  
   610  type in_port_t = uint16 /* endian.h:63:21 */
   611  
   612  func __byte_swap_u64_variable(tls *libc.TLS, x uint64_t) uint64_t { /* byte_swap.h:48:1: */
   613  	panic(`/usr/include/machine/byte_swap.h:50:2: assembler statements not supported`)
   614  	return x
   615  }
   616  
   617  func __byte_swap_u32_variable(tls *libc.TLS, x uint32_t) uint32_t { /* byte_swap.h:57:1: */
   618  	panic(`/usr/include/machine/byte_swap.h:59:2: assembler statements not supported`)
   619  	return x
   620  }
   621  
   622  func __byte_swap_u16_variable(tls *libc.TLS, x uint16_t) uint16_t { /* byte_swap.h:66:1: */
   623  	panic(`/usr/include/machine/byte_swap.h:68:2: assembler statements not supported`)
   624  	return x
   625  }
   626  
   627  //      $NetBSD: bswap.h,v 1.19 2015/03/12 15:28:16 christos Exp $
   628  
   629  // Written by Manuel Bouyer. Public domain
   630  
   631  //	$NetBSD: stdint.h,v 1.8 2018/11/06 16:26:44 maya Exp $
   632  
   633  // -
   634  // Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
   635  // All rights reserved.
   636  //
   637  // This code is derived from software contributed to The NetBSD Foundation
   638  // by Klaus Klein.
   639  //
   640  // Redistribution and use in source and binary forms, with or without
   641  // modification, are permitted provided that the following conditions
   642  // are met:
   643  // 1. Redistributions of source code must retain the above copyright
   644  //    notice, this list of conditions and the following disclaimer.
   645  // 2. Redistributions in binary form must reproduce the above copyright
   646  //    notice, this list of conditions and the following disclaimer in the
   647  //    documentation and/or other materials provided with the distribution.
   648  //
   649  // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
   650  // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   651  // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   652  // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
   653  // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   654  // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   655  // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   656  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   657  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   658  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   659  // POSSIBILITY OF SUCH DAMAGE.
   660  
   661  //	$NetBSD: cdefs.h,v 1.141 2019/02/21 21:34:05 christos Exp $
   662  
   663  // * Copyright (c) 1991, 1993
   664  //	The Regents of the University of California.  All rights reserved.
   665  //
   666  // This code is derived from software contributed to Berkeley by
   667  // Berkeley Software Design, Inc.
   668  //
   669  // Redistribution and use in source and binary forms, with or without
   670  // modification, are permitted provided that the following conditions
   671  // are met:
   672  // 1. Redistributions of source code must retain the above copyright
   673  //    notice, this list of conditions and the following disclaimer.
   674  // 2. Redistributions in binary form must reproduce the above copyright
   675  //    notice, this list of conditions and the following disclaimer in the
   676  //    documentation and/or other materials provided with the distribution.
   677  // 3. Neither the name of the University nor the names of its contributors
   678  //    may be used to endorse or promote products derived from this software
   679  //    without specific prior written permission.
   680  //
   681  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   682  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   683  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   684  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   685  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   686  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   687  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   688  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   689  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   690  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   691  // SUCH DAMAGE.
   692  //
   693  //	@(#)cdefs.h	8.8 (Berkeley) 1/9/95
   694  
   695  //	$NetBSD: int_types.h,v 1.7 2014/07/25 21:43:13 joerg Exp $
   696  
   697  // -
   698  // Copyright (c) 1990 The Regents of the University of California.
   699  // All rights reserved.
   700  //
   701  // Redistribution and use in source and binary forms, with or without
   702  // modification, are permitted provided that the following conditions
   703  // are met:
   704  // 1. Redistributions of source code must retain the above copyright
   705  //    notice, this list of conditions and the following disclaimer.
   706  // 2. Redistributions in binary form must reproduce the above copyright
   707  //    notice, this list of conditions and the following disclaimer in the
   708  //    documentation and/or other materials provided with the distribution.
   709  // 3. Neither the name of the University nor the names of its contributors
   710  //    may be used to endorse or promote products derived from this software
   711  //    without specific prior written permission.
   712  //
   713  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   714  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   715  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   716  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   717  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   718  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   719  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   720  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   721  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   722  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   723  // SUCH DAMAGE.
   724  //
   725  //	from: @(#)types.h	7.5 (Berkeley) 3/9/91
   726  
   727  type intptr_t = int64 /* stdint.h:79:20 */
   728  
   729  type uintptr_t = uint64 /* stdint.h:84:21 */
   730  
   731  //	$NetBSD: int_mwgwtypes.h,v 1.8 2014/07/25 21:43:13 joerg Exp $
   732  
   733  // -
   734  // Copyright (c) 2001 The NetBSD Foundation, Inc.
   735  // All rights reserved.
   736  //
   737  // This code is derived from software contributed to The NetBSD Foundation
   738  // by Klaus Klein.
   739  //
   740  // Redistribution and use in source and binary forms, with or without
   741  // modification, are permitted provided that the following conditions
   742  // are met:
   743  // 1. Redistributions of source code must retain the above copyright
   744  //    notice, this list of conditions and the following disclaimer.
   745  // 2. Redistributions in binary form must reproduce the above copyright
   746  //    notice, this list of conditions and the following disclaimer in the
   747  //    documentation and/or other materials provided with the distribution.
   748  //
   749  // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
   750  // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   751  // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   752  // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
   753  // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   754  // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   755  // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   756  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   757  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   758  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   759  // POSSIBILITY OF SUCH DAMAGE.
   760  
   761  //	$NetBSD: common_int_mwgwtypes.h,v 1.1 2014/07/25 21:43:13 joerg Exp $
   762  
   763  // -
   764  // Copyright (c) 2014 The NetBSD Foundation, Inc.
   765  // All rights reserved.
   766  //
   767  // This code is derived from software contributed to The NetBSD Foundation
   768  // by Joerg Sonnenberger.
   769  //
   770  // Redistribution and use in source and binary forms, with or without
   771  // modification, are permitted provided that the following conditions
   772  // are met:
   773  // 1. Redistributions of source code must retain the above copyright
   774  //    notice, this list of conditions and the following disclaimer.
   775  // 2. Redistributions in binary form must reproduce the above copyright
   776  //    notice, this list of conditions and the following disclaimer in the
   777  //    documentation and/or other materials provided with the distribution.
   778  //
   779  // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
   780  // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   781  // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   782  // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
   783  // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   784  // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   785  // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   786  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   787  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   788  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   789  // POSSIBILITY OF SUCH DAMAGE.
   790  
   791  // 7.18.1 Integer types
   792  
   793  // 7.18.1.2 Minimum-width integer types
   794  
   795  type int_least8_t = int8     /* common_int_mwgwtypes.h:45:32 */
   796  type uint_least8_t = uint8   /* common_int_mwgwtypes.h:46:32 */
   797  type int_least16_t = int16   /* common_int_mwgwtypes.h:47:32 */
   798  type uint_least16_t = uint16 /* common_int_mwgwtypes.h:48:32 */
   799  type int_least32_t = int32   /* common_int_mwgwtypes.h:49:32 */
   800  type uint_least32_t = uint32 /* common_int_mwgwtypes.h:50:32 */
   801  type int_least64_t = int64   /* common_int_mwgwtypes.h:51:32 */
   802  type uint_least64_t = uint64 /* common_int_mwgwtypes.h:52:32 */
   803  
   804  // 7.18.1.3 Fastest minimum-width integer types
   805  type int_fast8_t = int32    /* common_int_mwgwtypes.h:55:32 */
   806  type uint_fast8_t = uint32  /* common_int_mwgwtypes.h:56:32 */
   807  type int_fast16_t = int32   /* common_int_mwgwtypes.h:57:32 */
   808  type uint_fast16_t = uint32 /* common_int_mwgwtypes.h:58:32 */
   809  type int_fast32_t = int32   /* common_int_mwgwtypes.h:59:32 */
   810  type uint_fast32_t = uint32 /* common_int_mwgwtypes.h:60:32 */
   811  type int_fast64_t = int64   /* common_int_mwgwtypes.h:61:32 */
   812  type uint_fast64_t = uint64 /* common_int_mwgwtypes.h:62:32 */
   813  
   814  // 7.18.1.5 Greatest-width integer types
   815  
   816  type intmax_t = int64   /* common_int_mwgwtypes.h:66:33 */
   817  type uintmax_t = uint64 /* common_int_mwgwtypes.h:67:32 */
   818  
   819  type u_char = uint8   /* types.h:101:23 */
   820  type u_short = uint16 /* types.h:102:24 */
   821  type u_int = uint32   /* types.h:103:22 */
   822  type u_long = uint64  /* types.h:104:23 */
   823  
   824  type unchar = uint8  /* types.h:106:23 */ // Sys V compatibility
   825  type ushort = uint16 /* types.h:107:24 */ // Sys V compatibility
   826  type uint = uint32   /* types.h:108:22 */ // Sys V compatibility
   827  type ulong = uint64  /* types.h:109:23 */ // Sys V compatibility
   828  
   829  type u_quad_t = uint64_t /* types.h:112:18 */ // quads
   830  type quad_t = int64_t    /* types.h:113:18 */
   831  type qaddr_t = uintptr   /* types.h:114:16 */
   832  
   833  // The types longlong_t and u_longlong_t exist for use with the
   834  // Sun-derived XDR routines involving these types, and their usage
   835  // in other contexts is discouraged.  Further note that these types
   836  // may not be equivalent to "long long" and "unsigned long long",
   837  // they are only guaranteed to be signed and unsigned 64-bit types
   838  // respectively.  Portable programs that need 64-bit types should use
   839  // the C99 types int64_t and uint64_t instead.
   840  
   841  type longlong_t = int64_t    /* types.h:126:18 */ // for XDR
   842  type u_longlong_t = uint64_t /* types.h:127:18 */ // for XDR
   843  
   844  type blkcnt_t = int64_t  /* types.h:129:18 */ // fs block count
   845  type blksize_t = int32_t /* types.h:130:18 */ // fs optimal block size
   846  
   847  type fsblkcnt_t = uint64 /* types.h:133:22 */ // fs block count (statvfs)
   848  
   849  type fsfilcnt_t = uint64 /* types.h:138:22 */ // fs file count
   850  
   851  // We don't and shouldn't use caddr_t in the kernel anymore
   852  type caddr_t = uintptr /* types.h:145:19 */ // core address
   853  
   854  type daddr_t = int64_t /* types.h:154:18 */ // disk address
   855  
   856  type dev_t = uint64_t   /* types.h:157:18 */ // device number
   857  type fixpt_t = uint32_t /* types.h:158:18 */ // fixed point number
   858  
   859  type gid_t = uint32 /* types.h:161:18 */ // group id
   860  
   861  type id_t = uint32_t  /* types.h:165:18 */ // group id, process id or user id
   862  type ino_t = uint64_t /* types.h:166:18 */ // inode number
   863  type key_t = int64    /* types.h:167:15 */ // IPC key (for Sys V IPC)
   864  
   865  type mode_t = uint32 /* types.h:170:18 */ // permissions
   866  
   867  type nlink_t = uint32_t /* types.h:174:18 */ // link count
   868  
   869  type off_t = int64 /* types.h:177:18 */ // file offset
   870  
   871  type pid_t = int32     /* types.h:182:18 */ // process id
   872  type lwpid_t = int32_t /* types.h:185:18 */ // LWP id
   873  type rlim_t = uint64_t /* types.h:186:18 */ // resource limit
   874  type segsz_t = int32_t /* types.h:187:18 */ // segment size
   875  type swblk_t = int32_t /* types.h:188:18 */ // swap offset
   876  
   877  type uid_t = uint32 /* types.h:191:18 */ // user id
   878  
   879  type mqd_t = int32 /* types.h:195:14 */
   880  
   881  type cpuid_t = uint64 /* types.h:197:23 */
   882  
   883  type psetid_t = int32 /* types.h:199:14 */
   884  
   885  type clock_t = uint32 /* types.h:268:24 */
   886  
   887  type ssize_t = int64 /* types.h:284:24 */
   888  
   889  type time_t = int64 /* types.h:289:23 */
   890  
   891  type clockid_t = int32 /* types.h:294:26 */
   892  
   893  type timer_t = int32 /* types.h:299:24 */
   894  
   895  type suseconds_t = int32 /* types.h:304:27 */
   896  
   897  type useconds_t = uint32 /* types.h:309:26 */
   898  
   899  // 32 = 2 ^ 5
   900  
   901  // Select uses bit fields of file descriptors.  These macros manipulate
   902  // such bit fields.  Note: FD_SETSIZE may be defined by the user.
   903  
   904  type fd_set1 = struct{ fds_bits [8]uint32 } /* fd_set.h:66:9 */
   905  
   906  // 32 = 2 ^ 5
   907  
   908  // Select uses bit fields of file descriptors.  These macros manipulate
   909  // such bit fields.  Note: FD_SETSIZE may be defined by the user.
   910  
   911  type fd_set = fd_set1 /* fd_set.h:68:3 */
   912  
   913  // Expose our internals if we are not required to hide them.
   914  
   915  type kauth_cred_t = uintptr /* types.h:318:27 */
   916  
   917  type pri_t = int32 /* types.h:320:13 */
   918  
   919  //	$NetBSD: pthread_types.h,v 1.23 2017/09/09 23:21:45 kamil Exp $
   920  
   921  // -
   922  // Copyright (c) 2001, 2008 The NetBSD Foundation, Inc.
   923  // All rights reserved.
   924  //
   925  // This code is derived from software contributed to The NetBSD Foundation
   926  // by Nathan J. Williams.
   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  //
   937  // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
   938  // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   939  // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   940  // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
   941  // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   942  // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   943  // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   944  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   945  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   946  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   947  // POSSIBILITY OF SUCH DAMAGE.
   948  
   949  // We use the "pthread_spin_t" name internally; "pthread_spinlock_t" is the
   950  // POSIX spinlock object.
   951  //
   952  // C++ expects to be using PTHREAD_FOO_INITIALIZER as a member initializer.
   953  // This does not work for volatile types.  Since C++ does not touch the guts
   954  // of those types, we do not include volatile in the C++ definitions.
   955  type pthread_spin_t = uint8 /* pthread_types.h:43:29 */
   956  
   957  // Copied from PTQ_HEAD in pthread_queue.h
   958  
   959  type pthread_queue_struct_t = struct {
   960  	ptqh_first uintptr
   961  	ptqh_last  uintptr
   962  } /* pthread_types.h:61:1 */
   963  
   964  type pthread_queue_t = pthread_queue_struct_t /* pthread_types.h:62:39 */
   965  type __pthread_attr_st = struct {
   966  	pta_magic   uint32
   967  	pta_flags   int32
   968  	pta_private uintptr
   969  } /* pthread_types.h:65:1 */
   970  
   971  type __pthread_mutex_st = struct {
   972  	ptm_magic      uint32
   973  	ptm_errorcheck uint8
   974  	ptm_pad1       [3]uint8_t
   975  	__8            struct{ ptm_ceiling uint8 }
   976  	ptm_pad2       [3]uint8_t
   977  	_              [4]byte
   978  	ptm_owner      pthread_t
   979  	ptm_waiters    uintptr
   980  	ptm_recursed   uint32
   981  	_              [4]byte
   982  	ptm_spare2     uintptr
   983  } /* pthread_types.h:66:1 */
   984  
   985  type __pthread_mutexattr_st = struct {
   986  	ptma_magic   uint32
   987  	_            [4]byte
   988  	ptma_private uintptr
   989  } /* pthread_types.h:67:1 */
   990  
   991  type __pthread_cond_st = struct {
   992  	ptc_magic   uint32
   993  	ptc_lock    uint8
   994  	_           [3]byte
   995  	ptc_waiters pthread_queue_t
   996  	ptc_mutex   uintptr
   997  	ptc_private uintptr
   998  } /* pthread_types.h:68:1 */
   999  
  1000  type __pthread_condattr_st = struct {
  1001  	ptca_magic   uint32
  1002  	_            [4]byte
  1003  	ptca_private uintptr
  1004  } /* pthread_types.h:69:1 */
  1005  
  1006  type __pthread_rwlock_st = struct {
  1007  	ptr_magic     uint32
  1008  	ptr_interlock uint8
  1009  	_             [3]byte
  1010  	ptr_rblocked  pthread_queue_t
  1011  	ptr_wblocked  pthread_queue_t
  1012  	ptr_nreaders  uint32
  1013  	_             [4]byte
  1014  	ptr_owner     pthread_t
  1015  	ptr_private   uintptr
  1016  } /* pthread_types.h:71:1 */
  1017  
  1018  type __pthread_rwlockattr_st = struct {
  1019  	ptra_magic   uint32
  1020  	_            [4]byte
  1021  	ptra_private uintptr
  1022  } /* pthread_types.h:72:1 */
  1023  
  1024  type __pthread_barrier_st = struct {
  1025  	ptb_magic      uint32
  1026  	ptb_lock       pthread_spin_t
  1027  	_              [3]byte
  1028  	ptb_waiters    pthread_queue_t
  1029  	ptb_initcount  uint32
  1030  	ptb_curcount   uint32
  1031  	ptb_generation uint32
  1032  	_              [4]byte
  1033  	ptb_private    uintptr
  1034  } /* pthread_types.h:73:1 */
  1035  
  1036  type __pthread_barrierattr_st = struct {
  1037  	ptba_magic   uint32
  1038  	_            [4]byte
  1039  	ptba_private uintptr
  1040  } /* pthread_types.h:74:1 */
  1041  
  1042  type pthread_t = uintptr                          /* pthread_types.h:76:29 */
  1043  type pthread_attr_t = __pthread_attr_st           /* pthread_types.h:77:34 */
  1044  type pthread_mutex_t = __pthread_mutex_st         /* pthread_types.h:78:35 */
  1045  type pthread_mutexattr_t = __pthread_mutexattr_st /* pthread_types.h:79:39 */
  1046  type pthread_cond_t = __pthread_cond_st           /* pthread_types.h:80:34 */
  1047  type pthread_condattr_t = __pthread_condattr_st   /* pthread_types.h:81:38 */
  1048  type __pthread_once_st = struct {
  1049  	pto_mutex pthread_mutex_t
  1050  	pto_done  int32
  1051  	_         [4]byte
  1052  } /* pthread_types.h:82:9 */
  1053  
  1054  type pthread_once_t = __pthread_once_st /* pthread_types.h:82:34 */
  1055  type __pthread_spinlock_st = struct {
  1056  	pts_magic uint32
  1057  	pts_spin  uint8
  1058  	_         [3]byte
  1059  	pts_flags int32
  1060  } /* pthread_types.h:83:9 */
  1061  
  1062  type pthread_spinlock_t = __pthread_spinlock_st       /* pthread_types.h:83:38 */
  1063  type pthread_rwlock_t = __pthread_rwlock_st           /* pthread_types.h:84:36 */
  1064  type pthread_rwlockattr_t = __pthread_rwlockattr_st   /* pthread_types.h:85:40 */
  1065  type pthread_barrier_t = __pthread_barrier_st         /* pthread_types.h:86:37 */
  1066  type pthread_barrierattr_t = __pthread_barrierattr_st /* pthread_types.h:87:41 */
  1067  type pthread_key_t = int32                            /* pthread_types.h:88:13 */
  1068  
  1069  //	$NetBSD: stdarg.h,v 1.4.24.1 2020/04/02 19:17:04 martin Exp $
  1070  
  1071  // -
  1072  // Copyright (c) 1991, 1993
  1073  //	The Regents of the University of California.  All rights reserved.
  1074  //
  1075  // Redistribution and use in source and binary forms, with or without
  1076  // modification, are permitted provided that the following conditions
  1077  // are met:
  1078  // 1. Redistributions of source code must retain the above copyright
  1079  //    notice, this list of conditions and the following disclaimer.
  1080  // 2. Redistributions in binary form must reproduce the above copyright
  1081  //    notice, this list of conditions and the following disclaimer in the
  1082  //    documentation and/or other materials provided with the distribution.
  1083  // 3. Neither the name of the University nor the names of its contributors
  1084  //    may be used to endorse or promote products derived from this software
  1085  //    without specific prior written permission.
  1086  //
  1087  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1088  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1089  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1090  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1091  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1092  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1093  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1094  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1095  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1096  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1097  // SUCH DAMAGE.
  1098  //
  1099  //	@(#)stdarg.h	8.1 (Berkeley) 6/10/93
  1100  
  1101  //	$NetBSD: cdefs.h,v 1.141 2019/02/21 21:34:05 christos Exp $
  1102  
  1103  // * Copyright (c) 1991, 1993
  1104  //	The Regents of the University of California.  All rights reserved.
  1105  //
  1106  // This code is derived from software contributed to Berkeley by
  1107  // Berkeley Software Design, Inc.
  1108  //
  1109  // Redistribution and use in source and binary forms, with or without
  1110  // modification, are permitted provided that the following conditions
  1111  // are met:
  1112  // 1. Redistributions of source code must retain the above copyright
  1113  //    notice, this list of conditions and the following disclaimer.
  1114  // 2. Redistributions in binary form must reproduce the above copyright
  1115  //    notice, this list of conditions and the following disclaimer in the
  1116  //    documentation and/or other materials provided with the distribution.
  1117  // 3. Neither the name of the University nor the names of its contributors
  1118  //    may be used to endorse or promote products derived from this software
  1119  //    without specific prior written permission.
  1120  //
  1121  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1122  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1123  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1124  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1125  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1126  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1127  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1128  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1129  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1130  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1131  // SUCH DAMAGE.
  1132  //
  1133  //	@(#)cdefs.h	8.8 (Berkeley) 1/9/95
  1134  
  1135  //	$NetBSD: ansi.h,v 1.14 2011/07/17 20:54:54 joerg Exp $
  1136  
  1137  // -
  1138  // Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
  1139  // All rights reserved.
  1140  //
  1141  // This code is derived from software contributed to The NetBSD Foundation
  1142  // by Jun-ichiro itojun Hagino and by Klaus Klein.
  1143  //
  1144  // Redistribution and use in source and binary forms, with or without
  1145  // modification, are permitted provided that the following conditions
  1146  // are met:
  1147  // 1. Redistributions of source code must retain the above copyright
  1148  //    notice, this list of conditions and the following disclaimer.
  1149  // 2. Redistributions in binary form must reproduce the above copyright
  1150  //    notice, this list of conditions and the following disclaimer in the
  1151  //    documentation and/or other materials provided with the distribution.
  1152  //
  1153  // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  1154  // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  1155  // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  1156  // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
  1157  // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  1158  // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  1159  // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  1160  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  1161  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  1162  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  1163  // POSSIBILITY OF SUCH DAMAGE.
  1164  
  1165  //	$NetBSD: featuretest.h,v 1.10 2013/04/26 18:29:06 christos Exp $
  1166  
  1167  // Written by Klaus Klein <kleink@NetBSD.org>, February 2, 1998.
  1168  // Public domain.
  1169  //
  1170  // NOTE: Do not protect this header against multiple inclusion.  Doing
  1171  // so can have subtle side-effects due to header file inclusion order
  1172  // and testing of e.g. _POSIX_SOURCE vs. _POSIX_C_SOURCE.  Instead,
  1173  // protect each CPP macro that we want to supply.
  1174  
  1175  // Feature-test macros are defined by several standards, and allow an
  1176  // application to specify what symbols they want the system headers to
  1177  // expose, and hence what standard they want them to conform to.
  1178  // There are two classes of feature-test macros.  The first class
  1179  // specify complete standards, and if one of these is defined, header
  1180  // files will try to conform to the relevant standard.  They are:
  1181  //
  1182  // ANSI macros:
  1183  // _ANSI_SOURCE			ANSI C89
  1184  //
  1185  // POSIX macros:
  1186  // _POSIX_SOURCE == 1		IEEE Std 1003.1 (version?)
  1187  // _POSIX_C_SOURCE == 1		IEEE Std 1003.1-1990
  1188  // _POSIX_C_SOURCE == 2		IEEE Std 1003.2-1992
  1189  // _POSIX_C_SOURCE == 199309L	IEEE Std 1003.1b-1993
  1190  // _POSIX_C_SOURCE == 199506L	ISO/IEC 9945-1:1996
  1191  // _POSIX_C_SOURCE == 200112L	IEEE Std 1003.1-2001
  1192  // _POSIX_C_SOURCE == 200809L   IEEE Std 1003.1-2008
  1193  //
  1194  // X/Open macros:
  1195  // _XOPEN_SOURCE		System Interfaces and Headers, Issue 4, Ver 2
  1196  // _XOPEN_SOURCE_EXTENDED == 1	XSH4.2 UNIX extensions
  1197  // _XOPEN_SOURCE == 500		System Interfaces and Headers, Issue 5
  1198  // _XOPEN_SOURCE == 520		Networking Services (XNS), Issue 5.2
  1199  // _XOPEN_SOURCE == 600		IEEE Std 1003.1-2001, XSI option
  1200  // _XOPEN_SOURCE == 700		IEEE Std 1003.1-2008, XSI option
  1201  //
  1202  // NetBSD macros:
  1203  // _NETBSD_SOURCE == 1		Make all NetBSD features available.
  1204  //
  1205  // If more than one of these "major" feature-test macros is defined,
  1206  // then the set of facilities provided (and namespace used) is the
  1207  // union of that specified by the relevant standards, and in case of
  1208  // conflict, the earlier standard in the above list has precedence (so
  1209  // if both _POSIX_C_SOURCE and _NETBSD_SOURCE are defined, the version
  1210  // of rename() that's used is the POSIX one).  If none of the "major"
  1211  // feature-test macros is defined, _NETBSD_SOURCE is assumed.
  1212  //
  1213  // There are also "minor" feature-test macros, which enable extra
  1214  // functionality in addition to some base standard.  They should be
  1215  // defined along with one of the "major" macros.  The "minor" macros
  1216  // are:
  1217  //
  1218  // _REENTRANT
  1219  // _ISOC99_SOURCE
  1220  // _ISOC11_SOURCE
  1221  // _LARGEFILE_SOURCE		Large File Support
  1222  //		<http://ftp.sas.com/standards/large.file/x_open.20Mar96.html>
  1223  
  1224  type va_list = uintptr /* stdarg.h:53:19 */ // getsubopt(3) external variable
  1225  
  1226  // MVS linker does not support external names larger than 8 bytes
  1227  
  1228  //
  1229  //     The 'zlib' compression library provides in-memory compression and
  1230  //   decompression functions, including integrity checks of the uncompressed data.
  1231  //   This version of the library supports only one compression method (deflation)
  1232  //   but other algorithms will be added later and will have the same stream
  1233  //   interface.
  1234  //
  1235  //     Compression can be done in a single step if the buffers are large enough,
  1236  //   or can be done by repeated calls of the compression function.  In the latter
  1237  //   case, the application must provide more input and/or consume the output
  1238  //   (providing more output space) before each call.
  1239  //
  1240  //     The compressed data format used by default by the in-memory functions is
  1241  //   the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
  1242  //   around a deflate stream, which is itself documented in RFC 1951.
  1243  //
  1244  //     The library also supports reading and writing files in gzip (.gz) format
  1245  //   with an interface similar to that of stdio using the functions that start
  1246  //   with "gz".  The gzip format is different from the zlib format.  gzip is a
  1247  //   gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
  1248  //
  1249  //     This library can optionally read and write gzip and raw deflate streams in
  1250  //   memory as well.
  1251  //
  1252  //     The zlib format was designed to be compact and fast for use in memory
  1253  //   and on communications channels.  The gzip format was designed for single-
  1254  //   file compression on file systems, has a larger header than zlib to maintain
  1255  //   directory information, and uses a different, slower check method than zlib.
  1256  //
  1257  //     The library does not install any signal handler.  The decoder checks
  1258  //   the consistency of the compressed data, so the library should never crash
  1259  //   even in the case of corrupted input.
  1260  
  1261  type alloc_func = uintptr /* zlib.h:81:16 */
  1262  type free_func = uintptr  /* zlib.h:82:16 */
  1263  
  1264  type z_stream_s = struct {
  1265  	next_in   uintptr
  1266  	avail_in  uInt
  1267  	_         [4]byte
  1268  	total_in  uLong
  1269  	next_out  uintptr
  1270  	avail_out uInt
  1271  	_         [4]byte
  1272  	total_out uLong
  1273  	msg       uintptr
  1274  	state     uintptr
  1275  	zalloc    alloc_func
  1276  	zfree     free_func
  1277  	opaque    voidpf
  1278  	data_type int32
  1279  	_         [4]byte
  1280  	adler     uLong
  1281  	reserved  uLong
  1282  } /* zlib.h:86:9 */
  1283  
  1284  type z_stream = z_stream_s /* zlib.h:106:3 */
  1285  
  1286  type z_streamp = uintptr /* zlib.h:108:22 */
  1287  
  1288  //
  1289  //      gzip header information passed to and from zlib routines.  See RFC 1952
  1290  //   for more details on the meanings of these fields.
  1291  type gz_header_s = struct {
  1292  	text      int32
  1293  	_         [4]byte
  1294  	time      uLong
  1295  	xflags    int32
  1296  	os        int32
  1297  	extra     uintptr
  1298  	extra_len uInt
  1299  	extra_max uInt
  1300  	name      uintptr
  1301  	name_max  uInt
  1302  	_         [4]byte
  1303  	comment   uintptr
  1304  	comm_max  uInt
  1305  	hcrc      int32
  1306  	done      int32
  1307  	_         [4]byte
  1308  } /* zlib.h:114:9 */
  1309  
  1310  //
  1311  //      gzip header information passed to and from zlib routines.  See RFC 1952
  1312  //   for more details on the meanings of these fields.
  1313  type gz_header = gz_header_s /* zlib.h:129:3 */
  1314  
  1315  type gz_headerp = uintptr /* zlib.h:131:23 */
  1316  //
  1317  //      inflateGetHeader() requests that gzip header information be stored in the
  1318  //    provided gz_header structure.  inflateGetHeader() may be called after
  1319  //    inflateInit2() or inflateReset(), and before the first call of inflate().
  1320  //    As inflate() processes the gzip stream, head->done is zero until the header
  1321  //    is completed, at which time head->done is set to one.  If a zlib stream is
  1322  //    being decoded, then head->done is set to -1 to indicate that there will be
  1323  //    no gzip header information forthcoming.  Note that Z_BLOCK or Z_TREES can be
  1324  //    used to force inflate() to return immediately after header processing is
  1325  //    complete and before any actual data is decompressed.
  1326  //
  1327  //      The text, time, xflags, and os fields are filled in with the gzip header
  1328  //    contents.  hcrc is set to true if there is a header CRC.  (The header CRC
  1329  //    was valid if done is set to one.) If extra is not Z_NULL, then extra_max
  1330  //    contains the maximum number of bytes to write to extra.  Once done is true,
  1331  //    extra_len contains the actual extra field length, and extra contains the
  1332  //    extra field, or that field truncated if extra_max is less than extra_len.
  1333  //    If name is not Z_NULL, then up to name_max characters are written there,
  1334  //    terminated with a zero unless the length is greater than name_max.  If
  1335  //    comment is not Z_NULL, then up to comm_max characters are written there,
  1336  //    terminated with a zero unless the length is greater than comm_max.  When any
  1337  //    of extra, name, or comment are not Z_NULL and the respective field is not
  1338  //    present in the header, then that field is set to Z_NULL to signal its
  1339  //    absence.  This allows the use of deflateSetHeader() with the returned
  1340  //    structure to duplicate the header.  However if those fields are set to
  1341  //    allocated memory, then the application will need to save those pointers
  1342  //    elsewhere so that they can be eventually freed.
  1343  //
  1344  //      If inflateGetHeader is not used, then the header information is simply
  1345  //    discarded.  The header is always checked for validity, including the header
  1346  //    CRC if present.  inflateReset() will reset the process to discard the header
  1347  //    information.  The application would need to call inflateGetHeader() again to
  1348  //    retrieve the header from the next gzip stream.
  1349  //
  1350  //      inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
  1351  //    stream state was inconsistent.
  1352  
  1353  //
  1354  // ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
  1355  //                                         unsigned char FAR *window));
  1356  //
  1357  //      Initialize the internal stream state for decompression using inflateBack()
  1358  //    calls.  The fields zalloc, zfree and opaque in strm must be initialized
  1359  //    before the call.  If zalloc and zfree are Z_NULL, then the default library-
  1360  //    derived memory allocation routines are used.  windowBits is the base two
  1361  //    logarithm of the window size, in the range 8..15.  window is a caller
  1362  //    supplied buffer of that size.  Except for special applications where it is
  1363  //    assured that deflate was used with small window sizes, windowBits must be 15
  1364  //    and a 32K byte window must be supplied to be able to decompress general
  1365  //    deflate streams.
  1366  //
  1367  //      See inflateBack() for the usage of these routines.
  1368  //
  1369  //      inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
  1370  //    the parameters are invalid, Z_MEM_ERROR if the internal state could not be
  1371  //    allocated, or Z_VERSION_ERROR if the version of the library does not match
  1372  //    the version of the header file.
  1373  
  1374  type in_func = uintptr  /* zlib.h:1092:18 */
  1375  type out_func = uintptr /* zlib.h:1094:13 */
  1376  //
  1377  //      Same as uncompress, except that sourceLen is a pointer, where the
  1378  //    length of the source is *sourceLen.  On return, *sourceLen is the number of
  1379  //    source bytes consumed.
  1380  
  1381  // gzip file access functions
  1382  
  1383  //
  1384  //      This library supports reading and writing files in gzip (.gz) format with
  1385  //    an interface similar to that of stdio, using the functions that start with
  1386  //    "gz".  The gzip format is different from the zlib format.  gzip is a gzip
  1387  //    wrapper, documented in RFC 1952, wrapped around a deflate stream.
  1388  
  1389  type gzFile_s = struct {
  1390  	have uint32
  1391  	_    [4]byte
  1392  	next uintptr
  1393  	pos  int64
  1394  } /* zlib.h:1300:9 */
  1395  
  1396  //
  1397  //      Same as uncompress, except that sourceLen is a pointer, where the
  1398  //    length of the source is *sourceLen.  On return, *sourceLen is the number of
  1399  //    source bytes consumed.
  1400  
  1401  // gzip file access functions
  1402  
  1403  //
  1404  //      This library supports reading and writing files in gzip (.gz) format with
  1405  //    an interface similar to that of stdio, using the functions that start with
  1406  //    "gz".  The gzip format is different from the zlib format.  gzip is a gzip
  1407  //    wrapper, documented in RFC 1952, wrapped around a deflate stream.
  1408  
  1409  type gzFile = uintptr /* zlib.h:1300:25 */
  1410  
  1411  //	$NetBSD: stdio.h,v 1.97.18.1 2020/03/30 18:54:56 martin Exp $
  1412  
  1413  // -
  1414  // Copyright (c) 1990, 1993
  1415  //	The Regents of the University of California.  All rights reserved.
  1416  //
  1417  // This code is derived from software contributed to Berkeley by
  1418  // Chris Torek.
  1419  //
  1420  // Redistribution and use in source and binary forms, with or without
  1421  // modification, are permitted provided that the following conditions
  1422  // are met:
  1423  // 1. Redistributions of source code must retain the above copyright
  1424  //    notice, this list of conditions and the following disclaimer.
  1425  // 2. Redistributions in binary form must reproduce the above copyright
  1426  //    notice, this list of conditions and the following disclaimer in the
  1427  //    documentation and/or other materials provided with the distribution.
  1428  // 3. Neither the name of the University nor the names of its contributors
  1429  //    may be used to endorse or promote products derived from this software
  1430  //    without specific prior written permission.
  1431  //
  1432  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1433  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1434  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1435  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1436  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1437  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1438  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1439  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1440  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1441  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1442  // SUCH DAMAGE.
  1443  //
  1444  //	@(#)stdio.h	8.5 (Berkeley) 4/29/95
  1445  
  1446  //	$NetBSD: cdefs.h,v 1.141 2019/02/21 21:34:05 christos Exp $
  1447  
  1448  // * Copyright (c) 1991, 1993
  1449  //	The Regents of the University of California.  All rights reserved.
  1450  //
  1451  // This code is derived from software contributed to Berkeley by
  1452  // Berkeley Software Design, Inc.
  1453  //
  1454  // Redistribution and use in source and binary forms, with or without
  1455  // modification, are permitted provided that the following conditions
  1456  // are met:
  1457  // 1. Redistributions of source code must retain the above copyright
  1458  //    notice, this list of conditions and the following disclaimer.
  1459  // 2. Redistributions in binary form must reproduce the above copyright
  1460  //    notice, this list of conditions and the following disclaimer in the
  1461  //    documentation and/or other materials provided with the distribution.
  1462  // 3. Neither the name of the University nor the names of its contributors
  1463  //    may be used to endorse or promote products derived from this software
  1464  //    without specific prior written permission.
  1465  //
  1466  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1467  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1468  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1469  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1470  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1471  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1472  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1473  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1474  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1475  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1476  // SUCH DAMAGE.
  1477  //
  1478  //	@(#)cdefs.h	8.8 (Berkeley) 1/9/95
  1479  
  1480  //	$NetBSD: featuretest.h,v 1.10 2013/04/26 18:29:06 christos Exp $
  1481  
  1482  // Written by Klaus Klein <kleink@NetBSD.org>, February 2, 1998.
  1483  // Public domain.
  1484  //
  1485  // NOTE: Do not protect this header against multiple inclusion.  Doing
  1486  // so can have subtle side-effects due to header file inclusion order
  1487  // and testing of e.g. _POSIX_SOURCE vs. _POSIX_C_SOURCE.  Instead,
  1488  // protect each CPP macro that we want to supply.
  1489  
  1490  // Feature-test macros are defined by several standards, and allow an
  1491  // application to specify what symbols they want the system headers to
  1492  // expose, and hence what standard they want them to conform to.
  1493  // There are two classes of feature-test macros.  The first class
  1494  // specify complete standards, and if one of these is defined, header
  1495  // files will try to conform to the relevant standard.  They are:
  1496  //
  1497  // ANSI macros:
  1498  // _ANSI_SOURCE			ANSI C89
  1499  //
  1500  // POSIX macros:
  1501  // _POSIX_SOURCE == 1		IEEE Std 1003.1 (version?)
  1502  // _POSIX_C_SOURCE == 1		IEEE Std 1003.1-1990
  1503  // _POSIX_C_SOURCE == 2		IEEE Std 1003.2-1992
  1504  // _POSIX_C_SOURCE == 199309L	IEEE Std 1003.1b-1993
  1505  // _POSIX_C_SOURCE == 199506L	ISO/IEC 9945-1:1996
  1506  // _POSIX_C_SOURCE == 200112L	IEEE Std 1003.1-2001
  1507  // _POSIX_C_SOURCE == 200809L   IEEE Std 1003.1-2008
  1508  //
  1509  // X/Open macros:
  1510  // _XOPEN_SOURCE		System Interfaces and Headers, Issue 4, Ver 2
  1511  // _XOPEN_SOURCE_EXTENDED == 1	XSH4.2 UNIX extensions
  1512  // _XOPEN_SOURCE == 500		System Interfaces and Headers, Issue 5
  1513  // _XOPEN_SOURCE == 520		Networking Services (XNS), Issue 5.2
  1514  // _XOPEN_SOURCE == 600		IEEE Std 1003.1-2001, XSI option
  1515  // _XOPEN_SOURCE == 700		IEEE Std 1003.1-2008, XSI option
  1516  //
  1517  // NetBSD macros:
  1518  // _NETBSD_SOURCE == 1		Make all NetBSD features available.
  1519  //
  1520  // If more than one of these "major" feature-test macros is defined,
  1521  // then the set of facilities provided (and namespace used) is the
  1522  // union of that specified by the relevant standards, and in case of
  1523  // conflict, the earlier standard in the above list has precedence (so
  1524  // if both _POSIX_C_SOURCE and _NETBSD_SOURCE are defined, the version
  1525  // of rename() that's used is the POSIX one).  If none of the "major"
  1526  // feature-test macros is defined, _NETBSD_SOURCE is assumed.
  1527  //
  1528  // There are also "minor" feature-test macros, which enable extra
  1529  // functionality in addition to some base standard.  They should be
  1530  // defined along with one of the "major" macros.  The "minor" macros
  1531  // are:
  1532  //
  1533  // _REENTRANT
  1534  // _ISOC99_SOURCE
  1535  // _ISOC11_SOURCE
  1536  // _LARGEFILE_SOURCE		Large File Support
  1537  //		<http://ftp.sas.com/standards/large.file/x_open.20Mar96.html>
  1538  
  1539  //	$NetBSD: ansi.h,v 1.14 2011/07/17 20:54:54 joerg Exp $
  1540  
  1541  // -
  1542  // Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
  1543  // All rights reserved.
  1544  //
  1545  // This code is derived from software contributed to The NetBSD Foundation
  1546  // by Jun-ichiro itojun Hagino and by Klaus Klein.
  1547  //
  1548  // Redistribution and use in source and binary forms, with or without
  1549  // modification, are permitted provided that the following conditions
  1550  // are met:
  1551  // 1. Redistributions of source code must retain the above copyright
  1552  //    notice, this list of conditions and the following disclaimer.
  1553  // 2. Redistributions in binary form must reproduce the above copyright
  1554  //    notice, this list of conditions and the following disclaimer in the
  1555  //    documentation and/or other materials provided with the distribution.
  1556  //
  1557  // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  1558  // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  1559  // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  1560  // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
  1561  // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  1562  // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  1563  // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  1564  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  1565  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  1566  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  1567  // POSSIBILITY OF SUCH DAMAGE.
  1568  
  1569  //	$NetBSD: null.h,v 1.9 2010/07/06 11:56:20 kleink Exp $
  1570  
  1571  // Written by Klaus Klein <kleink@NetBSD.org>, December 22, 1999.
  1572  // Public domain.
  1573  
  1574  // This is fairly grotesque, but pure ANSI code must not inspect the
  1575  // innards of an fpos_t anyway.  The library internally uses off_t,
  1576  // which we assume is exactly as big as eight chars.
  1577  type __sfpos = struct {
  1578  	_pos        int64
  1579  	_mbstate_in struct {
  1580  		__mbstateL int64
  1581  		_          [120]byte
  1582  	}
  1583  	_mbstate_out struct {
  1584  		__mbstateL int64
  1585  		_          [120]byte
  1586  	}
  1587  } /* stdio.h:67:9 */
  1588  
  1589  //	$NetBSD: stdio.h,v 1.97.18.1 2020/03/30 18:54:56 martin Exp $
  1590  
  1591  // -
  1592  // Copyright (c) 1990, 1993
  1593  //	The Regents of the University of California.  All rights reserved.
  1594  //
  1595  // This code is derived from software contributed to Berkeley by
  1596  // Chris Torek.
  1597  //
  1598  // Redistribution and use in source and binary forms, with or without
  1599  // modification, are permitted provided that the following conditions
  1600  // are met:
  1601  // 1. Redistributions of source code must retain the above copyright
  1602  //    notice, this list of conditions and the following disclaimer.
  1603  // 2. Redistributions in binary form must reproduce the above copyright
  1604  //    notice, this list of conditions and the following disclaimer in the
  1605  //    documentation and/or other materials provided with the distribution.
  1606  // 3. Neither the name of the University nor the names of its contributors
  1607  //    may be used to endorse or promote products derived from this software
  1608  //    without specific prior written permission.
  1609  //
  1610  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1611  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1612  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1613  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1614  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1615  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1616  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1617  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1618  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1619  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1620  // SUCH DAMAGE.
  1621  //
  1622  //	@(#)stdio.h	8.5 (Berkeley) 4/29/95
  1623  
  1624  //	$NetBSD: cdefs.h,v 1.141 2019/02/21 21:34:05 christos Exp $
  1625  
  1626  // * Copyright (c) 1991, 1993
  1627  //	The Regents of the University of California.  All rights reserved.
  1628  //
  1629  // This code is derived from software contributed to Berkeley by
  1630  // Berkeley Software Design, Inc.
  1631  //
  1632  // Redistribution and use in source and binary forms, with or without
  1633  // modification, are permitted provided that the following conditions
  1634  // are met:
  1635  // 1. Redistributions of source code must retain the above copyright
  1636  //    notice, this list of conditions and the following disclaimer.
  1637  // 2. Redistributions in binary form must reproduce the above copyright
  1638  //    notice, this list of conditions and the following disclaimer in the
  1639  //    documentation and/or other materials provided with the distribution.
  1640  // 3. Neither the name of the University nor the names of its contributors
  1641  //    may be used to endorse or promote products derived from this software
  1642  //    without specific prior written permission.
  1643  //
  1644  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1645  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1646  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1647  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1648  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1649  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1650  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1651  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1652  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1653  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1654  // SUCH DAMAGE.
  1655  //
  1656  //	@(#)cdefs.h	8.8 (Berkeley) 1/9/95
  1657  
  1658  //	$NetBSD: featuretest.h,v 1.10 2013/04/26 18:29:06 christos Exp $
  1659  
  1660  // Written by Klaus Klein <kleink@NetBSD.org>, February 2, 1998.
  1661  // Public domain.
  1662  //
  1663  // NOTE: Do not protect this header against multiple inclusion.  Doing
  1664  // so can have subtle side-effects due to header file inclusion order
  1665  // and testing of e.g. _POSIX_SOURCE vs. _POSIX_C_SOURCE.  Instead,
  1666  // protect each CPP macro that we want to supply.
  1667  
  1668  // Feature-test macros are defined by several standards, and allow an
  1669  // application to specify what symbols they want the system headers to
  1670  // expose, and hence what standard they want them to conform to.
  1671  // There are two classes of feature-test macros.  The first class
  1672  // specify complete standards, and if one of these is defined, header
  1673  // files will try to conform to the relevant standard.  They are:
  1674  //
  1675  // ANSI macros:
  1676  // _ANSI_SOURCE			ANSI C89
  1677  //
  1678  // POSIX macros:
  1679  // _POSIX_SOURCE == 1		IEEE Std 1003.1 (version?)
  1680  // _POSIX_C_SOURCE == 1		IEEE Std 1003.1-1990
  1681  // _POSIX_C_SOURCE == 2		IEEE Std 1003.2-1992
  1682  // _POSIX_C_SOURCE == 199309L	IEEE Std 1003.1b-1993
  1683  // _POSIX_C_SOURCE == 199506L	ISO/IEC 9945-1:1996
  1684  // _POSIX_C_SOURCE == 200112L	IEEE Std 1003.1-2001
  1685  // _POSIX_C_SOURCE == 200809L   IEEE Std 1003.1-2008
  1686  //
  1687  // X/Open macros:
  1688  // _XOPEN_SOURCE		System Interfaces and Headers, Issue 4, Ver 2
  1689  // _XOPEN_SOURCE_EXTENDED == 1	XSH4.2 UNIX extensions
  1690  // _XOPEN_SOURCE == 500		System Interfaces and Headers, Issue 5
  1691  // _XOPEN_SOURCE == 520		Networking Services (XNS), Issue 5.2
  1692  // _XOPEN_SOURCE == 600		IEEE Std 1003.1-2001, XSI option
  1693  // _XOPEN_SOURCE == 700		IEEE Std 1003.1-2008, XSI option
  1694  //
  1695  // NetBSD macros:
  1696  // _NETBSD_SOURCE == 1		Make all NetBSD features available.
  1697  //
  1698  // If more than one of these "major" feature-test macros is defined,
  1699  // then the set of facilities provided (and namespace used) is the
  1700  // union of that specified by the relevant standards, and in case of
  1701  // conflict, the earlier standard in the above list has precedence (so
  1702  // if both _POSIX_C_SOURCE and _NETBSD_SOURCE are defined, the version
  1703  // of rename() that's used is the POSIX one).  If none of the "major"
  1704  // feature-test macros is defined, _NETBSD_SOURCE is assumed.
  1705  //
  1706  // There are also "minor" feature-test macros, which enable extra
  1707  // functionality in addition to some base standard.  They should be
  1708  // defined along with one of the "major" macros.  The "minor" macros
  1709  // are:
  1710  //
  1711  // _REENTRANT
  1712  // _ISOC99_SOURCE
  1713  // _ISOC11_SOURCE
  1714  // _LARGEFILE_SOURCE		Large File Support
  1715  //		<http://ftp.sas.com/standards/large.file/x_open.20Mar96.html>
  1716  
  1717  //	$NetBSD: ansi.h,v 1.14 2011/07/17 20:54:54 joerg Exp $
  1718  
  1719  // -
  1720  // Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
  1721  // All rights reserved.
  1722  //
  1723  // This code is derived from software contributed to The NetBSD Foundation
  1724  // by Jun-ichiro itojun Hagino and by Klaus Klein.
  1725  //
  1726  // Redistribution and use in source and binary forms, with or without
  1727  // modification, are permitted provided that the following conditions
  1728  // are met:
  1729  // 1. Redistributions of source code must retain the above copyright
  1730  //    notice, this list of conditions and the following disclaimer.
  1731  // 2. Redistributions in binary form must reproduce the above copyright
  1732  //    notice, this list of conditions and the following disclaimer in the
  1733  //    documentation and/or other materials provided with the distribution.
  1734  //
  1735  // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  1736  // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  1737  // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  1738  // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
  1739  // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  1740  // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  1741  // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  1742  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  1743  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  1744  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  1745  // POSSIBILITY OF SUCH DAMAGE.
  1746  
  1747  //	$NetBSD: null.h,v 1.9 2010/07/06 11:56:20 kleink Exp $
  1748  
  1749  // Written by Klaus Klein <kleink@NetBSD.org>, December 22, 1999.
  1750  // Public domain.
  1751  
  1752  // This is fairly grotesque, but pure ANSI code must not inspect the
  1753  // innards of an fpos_t anyway.  The library internally uses off_t,
  1754  // which we assume is exactly as big as eight chars.
  1755  type fpos_t = __sfpos /* stdio.h:70:3 */
  1756  
  1757  // NB: to fit things in six character monocase externals, the stdio
  1758  // code uses the prefix `__s' for stdio objects, typically followed
  1759  // by a three-character attempt at a mnemonic.
  1760  
  1761  // stdio buffers
  1762  type __sbuf = struct {
  1763  	_base uintptr
  1764  	_size int32
  1765  	_     [4]byte
  1766  } /* stdio.h:81:1 */
  1767  
  1768  // stdio state variables.
  1769  //
  1770  // The following always hold:
  1771  //
  1772  //	if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR),
  1773  //		_lbfsize is -_bf._size, else _lbfsize is 0
  1774  //	if _flags&__SRD, _w is 0
  1775  //	if _flags&__SWR, _r is 0
  1776  //
  1777  // This ensures that the getc and putc macros (or inline functions) never
  1778  // try to write or read from a file that is in `read' or `write' mode.
  1779  // (Moreover, they can, and do, automatically switch from read mode to
  1780  // write mode, and back, on "r+" and "w+" files.)
  1781  //
  1782  // _lbfsize is used only to make the inline line-buffered output stream
  1783  // code as compact as possible.
  1784  //
  1785  // _ub, _up, and _ur are used when ungetc() pushes back more characters
  1786  // than fit in the current _bf, or when ungetc() pushes back a character
  1787  // that does not match the previous one in _bf.  When this happens,
  1788  // _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
  1789  // _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
  1790  //
  1791  // NB: see WARNING above before changing the layout of this structure!
  1792  type __sFILE = struct {
  1793  	_p     uintptr
  1794  	_r     int32
  1795  	_w     int32
  1796  	_flags uint16
  1797  	_file  int16
  1798  	_      [4]byte
  1799  	_bf    struct {
  1800  		_base uintptr
  1801  		_size int32
  1802  		_     [4]byte
  1803  	}
  1804  	_lbfsize int32
  1805  	_        [4]byte
  1806  	_cookie  uintptr
  1807  	_close   uintptr
  1808  	_read    uintptr
  1809  	_seek    uintptr
  1810  	_write   uintptr
  1811  	_ext     struct {
  1812  		_base uintptr
  1813  		_size int32
  1814  		_     [4]byte
  1815  	}
  1816  	_up        uintptr
  1817  	_ur        int32
  1818  	_ubuf      [3]uint8
  1819  	_nbuf      [1]uint8
  1820  	_flush     uintptr
  1821  	_lb_unused [8]int8
  1822  	_blksize   int32
  1823  	_          [4]byte
  1824  	_offset    int64
  1825  } /* stdio.h:112:9 */
  1826  
  1827  // stdio state variables.
  1828  //
  1829  // The following always hold:
  1830  //
  1831  //	if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR),
  1832  //		_lbfsize is -_bf._size, else _lbfsize is 0
  1833  //	if _flags&__SRD, _w is 0
  1834  //	if _flags&__SWR, _r is 0
  1835  //
  1836  // This ensures that the getc and putc macros (or inline functions) never
  1837  // try to write or read from a file that is in `read' or `write' mode.
  1838  // (Moreover, they can, and do, automatically switch from read mode to
  1839  // write mode, and back, on "r+" and "w+" files.)
  1840  //
  1841  // _lbfsize is used only to make the inline line-buffered output stream
  1842  // code as compact as possible.
  1843  //
  1844  // _ub, _up, and _ur are used when ungetc() pushes back more characters
  1845  // than fit in the current _bf, or when ungetc() pushes back a character
  1846  // that does not match the previous one in _bf.  When this happens,
  1847  // _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
  1848  // _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
  1849  //
  1850  // NB: see WARNING above before changing the layout of this structure!
  1851  type FILE = __sFILE /* stdio.h:146:3 */
  1852  
  1853  type locale_t = uintptr /* stdio.h:543:25 */
  1854  
  1855  //	$NetBSD: stdlib.h,v 1.121 2019/01/05 09:16:46 maya Exp $
  1856  
  1857  // -
  1858  // Copyright (c) 1990, 1993
  1859  //	The Regents of the University of California.  All rights reserved.
  1860  //
  1861  // Redistribution and use in source and binary forms, with or without
  1862  // modification, are permitted provided that the following conditions
  1863  // are met:
  1864  // 1. Redistributions of source code must retain the above copyright
  1865  //    notice, this list of conditions and the following disclaimer.
  1866  // 2. Redistributions in binary form must reproduce the above copyright
  1867  //    notice, this list of conditions and the following disclaimer in the
  1868  //    documentation and/or other materials provided with the distribution.
  1869  // 3. Neither the name of the University nor the names of its contributors
  1870  //    may be used to endorse or promote products derived from this software
  1871  //    without specific prior written permission.
  1872  //
  1873  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1874  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1875  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1876  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1877  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1878  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1879  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1880  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1881  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1882  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1883  // SUCH DAMAGE.
  1884  //
  1885  //	@(#)stdlib.h	8.5 (Berkeley) 5/19/95
  1886  
  1887  //	$NetBSD: cdefs.h,v 1.141 2019/02/21 21:34:05 christos Exp $
  1888  
  1889  // * Copyright (c) 1991, 1993
  1890  //	The Regents of the University of California.  All rights reserved.
  1891  //
  1892  // This code is derived from software contributed to Berkeley by
  1893  // Berkeley Software Design, Inc.
  1894  //
  1895  // Redistribution and use in source and binary forms, with or without
  1896  // modification, are permitted provided that the following conditions
  1897  // are met:
  1898  // 1. Redistributions of source code must retain the above copyright
  1899  //    notice, this list of conditions and the following disclaimer.
  1900  // 2. Redistributions in binary form must reproduce the above copyright
  1901  //    notice, this list of conditions and the following disclaimer in the
  1902  //    documentation and/or other materials provided with the distribution.
  1903  // 3. Neither the name of the University nor the names of its contributors
  1904  //    may be used to endorse or promote products derived from this software
  1905  //    without specific prior written permission.
  1906  //
  1907  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1908  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1909  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1910  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1911  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1912  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1913  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1914  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1915  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1916  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1917  // SUCH DAMAGE.
  1918  //
  1919  //	@(#)cdefs.h	8.8 (Berkeley) 1/9/95
  1920  
  1921  //	$NetBSD: featuretest.h,v 1.10 2013/04/26 18:29:06 christos Exp $
  1922  
  1923  // Written by Klaus Klein <kleink@NetBSD.org>, February 2, 1998.
  1924  // Public domain.
  1925  //
  1926  // NOTE: Do not protect this header against multiple inclusion.  Doing
  1927  // so can have subtle side-effects due to header file inclusion order
  1928  // and testing of e.g. _POSIX_SOURCE vs. _POSIX_C_SOURCE.  Instead,
  1929  // protect each CPP macro that we want to supply.
  1930  
  1931  // Feature-test macros are defined by several standards, and allow an
  1932  // application to specify what symbols they want the system headers to
  1933  // expose, and hence what standard they want them to conform to.
  1934  // There are two classes of feature-test macros.  The first class
  1935  // specify complete standards, and if one of these is defined, header
  1936  // files will try to conform to the relevant standard.  They are:
  1937  //
  1938  // ANSI macros:
  1939  // _ANSI_SOURCE			ANSI C89
  1940  //
  1941  // POSIX macros:
  1942  // _POSIX_SOURCE == 1		IEEE Std 1003.1 (version?)
  1943  // _POSIX_C_SOURCE == 1		IEEE Std 1003.1-1990
  1944  // _POSIX_C_SOURCE == 2		IEEE Std 1003.2-1992
  1945  // _POSIX_C_SOURCE == 199309L	IEEE Std 1003.1b-1993
  1946  // _POSIX_C_SOURCE == 199506L	ISO/IEC 9945-1:1996
  1947  // _POSIX_C_SOURCE == 200112L	IEEE Std 1003.1-2001
  1948  // _POSIX_C_SOURCE == 200809L   IEEE Std 1003.1-2008
  1949  //
  1950  // X/Open macros:
  1951  // _XOPEN_SOURCE		System Interfaces and Headers, Issue 4, Ver 2
  1952  // _XOPEN_SOURCE_EXTENDED == 1	XSH4.2 UNIX extensions
  1953  // _XOPEN_SOURCE == 500		System Interfaces and Headers, Issue 5
  1954  // _XOPEN_SOURCE == 520		Networking Services (XNS), Issue 5.2
  1955  // _XOPEN_SOURCE == 600		IEEE Std 1003.1-2001, XSI option
  1956  // _XOPEN_SOURCE == 700		IEEE Std 1003.1-2008, XSI option
  1957  //
  1958  // NetBSD macros:
  1959  // _NETBSD_SOURCE == 1		Make all NetBSD features available.
  1960  //
  1961  // If more than one of these "major" feature-test macros is defined,
  1962  // then the set of facilities provided (and namespace used) is the
  1963  // union of that specified by the relevant standards, and in case of
  1964  // conflict, the earlier standard in the above list has precedence (so
  1965  // if both _POSIX_C_SOURCE and _NETBSD_SOURCE are defined, the version
  1966  // of rename() that's used is the POSIX one).  If none of the "major"
  1967  // feature-test macros is defined, _NETBSD_SOURCE is assumed.
  1968  //
  1969  // There are also "minor" feature-test macros, which enable extra
  1970  // functionality in addition to some base standard.  They should be
  1971  // defined along with one of the "major" macros.  The "minor" macros
  1972  // are:
  1973  //
  1974  // _REENTRANT
  1975  // _ISOC99_SOURCE
  1976  // _ISOC11_SOURCE
  1977  // _LARGEFILE_SOURCE		Large File Support
  1978  //		<http://ftp.sas.com/standards/large.file/x_open.20Mar96.html>
  1979  
  1980  //	$NetBSD: types.h,v 1.102 2018/11/06 16:26:44 maya Exp $
  1981  
  1982  // -
  1983  // Copyright (c) 1982, 1986, 1991, 1993, 1994
  1984  //	The Regents of the University of California.  All rights reserved.
  1985  // (c) UNIX System Laboratories, Inc.
  1986  // All or some portions of this file are derived from material licensed
  1987  // to the University of California by American Telephone and Telegraph
  1988  // Co. or Unix System Laboratories, Inc. and are reproduced herein with
  1989  // the permission of UNIX System Laboratories, Inc.
  1990  //
  1991  // Redistribution and use in source and binary forms, with or without
  1992  // modification, are permitted provided that the following conditions
  1993  // are met:
  1994  // 1. Redistributions of source code must retain the above copyright
  1995  //    notice, this list of conditions and the following disclaimer.
  1996  // 2. Redistributions in binary form must reproduce the above copyright
  1997  //    notice, this list of conditions and the following disclaimer in the
  1998  //    documentation and/or other materials provided with the distribution.
  1999  // 3. Neither the name of the University nor the names of its contributors
  2000  //    may be used to endorse or promote products derived from this software
  2001  //    without specific prior written permission.
  2002  //
  2003  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  2004  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  2005  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  2006  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  2007  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  2008  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  2009  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  2010  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  2011  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  2012  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  2013  // SUCH DAMAGE.
  2014  //
  2015  //	@(#)types.h	8.4 (Berkeley) 1/21/94
  2016  
  2017  //	$NetBSD: ansi.h,v 1.11 2019/05/07 03:49:26 kamil Exp $
  2018  
  2019  //	$NetBSD: common_ansi.h,v 1.1 2014/08/19 07:27:31 matt Exp $
  2020  
  2021  // -
  2022  // Copyright (c) 2014 The NetBSD Foundation, Inc.
  2023  // All rights reserved.
  2024  //
  2025  // This code is derived from software contributed to The NetBSD Foundation
  2026  // by Matt Thomas of 3am Software Foundry.
  2027  //
  2028  // Redistribution and use in source and binary forms, with or without
  2029  // modification, are permitted provided that the following conditions
  2030  // are met:
  2031  // 1. Redistributions of source code must retain the above copyright
  2032  //    notice, this list of conditions and the following disclaimer.
  2033  // 2. Redistributions in binary form must reproduce the above copyright
  2034  //    notice, this list of conditions and the following disclaimer in the
  2035  //    documentation and/or other materials provided with the distribution.
  2036  //
  2037  // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  2038  // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  2039  // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  2040  // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
  2041  // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  2042  // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  2043  // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  2044  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  2045  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  2046  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  2047  // POSSIBILITY OF SUCH DAMAGE.
  2048  
  2049  type div_t = struct {
  2050  	quot int32
  2051  	rem  int32
  2052  } /* stdlib.h:59:3 */
  2053  
  2054  type ldiv_t = struct {
  2055  	quot int64
  2056  	rem  int64
  2057  } /* stdlib.h:64:3 */
  2058  
  2059  type lldiv_t = struct {
  2060  	quot int64
  2061  	rem  int64
  2062  } /* stdlib.h:74:3 */
  2063  
  2064  type qdiv_t = struct {
  2065  	quot quad_t
  2066  	rem  quad_t
  2067  } /* stdlib.h:81:3 */
  2068  
  2069  var prog uintptr /* minigzip.c:336:13: */
  2070  
  2071  // ===========================================================================
  2072  // Display error message and exit
  2073  func error(tls *libc.TLS, msg uintptr) { /* minigzip.c:351:6: */
  2074  	bp := tls.Alloc(16)
  2075  	defer tls.Free(16)
  2076  
  2077  	libc.Xfprintf(tls, (uintptr(unsafe.Pointer(&libc.X__sF)) + 2*152), ts /* "%s: %s\n" */, libc.VaList(bp, prog, msg))
  2078  	libc.Xexit(tls, 1)
  2079  }
  2080  
  2081  // ===========================================================================
  2082  // Compress input to output then close both files.
  2083  
  2084  func gz_compress(tls *libc.TLS, in uintptr, out gzFile) { /* minigzip.c:362:6: */
  2085  	bp := tls.Alloc(16388)
  2086  	defer tls.Free(16388)
  2087  
  2088  	// var buf [16384]int8 at bp, 16384
  2089  
  2090  	var len int32
  2091  	// var err int32 at bp+16384, 4
  2092  
  2093  	for {
  2094  		len = int32(libc.Xfread(tls, bp /* &buf[0] */, uint64(1), uint64(unsafe.Sizeof([16384]int8{})), in))
  2095  		if (int32((*FILE)(unsafe.Pointer((in)))._flags) & 0x0040) != 0 {
  2096  			libc.Xperror(tls, ts+8 /* "fread" */)
  2097  			libc.Xexit(tls, 1)
  2098  		}
  2099  		if len == 0 {
  2100  			break
  2101  		}
  2102  
  2103  		if z.Xgzwrite(tls, out, bp /* &buf[0] */, uint32(len)) != len {
  2104  			error(tls, z.Xgzerror(tls, out, bp+16384 /* &err */))
  2105  		}
  2106  	}
  2107  	libc.Xfclose(tls, in)
  2108  	if z.Xgzclose(tls, out) != 0 {
  2109  		error(tls, ts+14 /* "failed gzclose" */)
  2110  	}
  2111  }
  2112  
  2113  // ===========================================================================
  2114  // Uncompress input to output then close both files.
  2115  func gz_uncompress(tls *libc.TLS, in gzFile, out uintptr) { /* minigzip.c:430:6: */
  2116  	bp := tls.Alloc(16388)
  2117  	defer tls.Free(16388)
  2118  
  2119  	// var buf [16384]int8 at bp, 16384
  2120  
  2121  	var len int32
  2122  	// var err int32 at bp+16384, 4
  2123  
  2124  	for {
  2125  		len = z.Xgzread(tls, in, bp /* &buf[0] */, uint32(unsafe.Sizeof([16384]int8{})))
  2126  		if len < 0 {
  2127  			error(tls, z.Xgzerror(tls, in, bp+16384 /* &err */))
  2128  		}
  2129  		if len == 0 {
  2130  			break
  2131  		}
  2132  
  2133  		if int32(libc.Xfwrite(tls, bp /* &buf[0] */, uint64(1), uint64(uint32(len)), out)) != len {
  2134  			error(tls, ts+29 /* "failed fwrite" */)
  2135  		}
  2136  	}
  2137  	if libc.Xfclose(tls, out) != 0 {
  2138  		error(tls, ts+43 /* "failed fclose" */)
  2139  	}
  2140  
  2141  	if z.Xgzclose(tls, in) != 0 {
  2142  		error(tls, ts+14 /* "failed gzclose" */)
  2143  	}
  2144  }
  2145  
  2146  // ===========================================================================
  2147  // Compress the given file: create a corresponding .gz file and remove the
  2148  // original.
  2149  func file_compress(tls *libc.TLS, file uintptr, mode uintptr) { /* minigzip.c:457:6: */
  2150  	bp := tls.Alloc(1064)
  2151  	defer tls.Free(1064)
  2152  
  2153  	// var outfile [1024]int8 at bp+40, 1024
  2154  
  2155  	var in uintptr
  2156  	var out gzFile
  2157  
  2158  	if (libc.Xstrlen(tls, file) + libc.Xstrlen(tls, ts+57 /* ".gz" */)) >= size_t(unsafe.Sizeof([1024]int8{})) {
  2159  		libc.Xfprintf(tls, (uintptr(unsafe.Pointer(&libc.X__sF)) + 2*152), ts+61 /* "%s: filename too..." */, libc.VaList(bp, prog))
  2160  		libc.Xexit(tls, 1)
  2161  	}
  2162  
  2163  	libc.Xsnprintf(tls, bp+40 /* &outfile[0] */, uint64(unsafe.Sizeof([1024]int8{})), ts+84 /* "%s%s" */, libc.VaList(bp+8, file, ts+57 /* ".gz" */))
  2164  
  2165  	in = libc.Xfopen(tls, file, ts+89 /* "rb" */)
  2166  	if in == (uintptr(0)) {
  2167  		libc.Xperror(tls, file)
  2168  		libc.Xexit(tls, 1)
  2169  	}
  2170  	out = z.Xgzopen(tls, bp+40 /* &outfile[0] */, mode)
  2171  	if out == (uintptr(0)) {
  2172  		libc.Xfprintf(tls, (uintptr(unsafe.Pointer(&libc.X__sF)) + 2*152), ts+92 /* "%s: can't gzopen..." */, libc.VaList(bp+24, prog, bp+40 /* &outfile[0] */))
  2173  		libc.Xexit(tls, 1)
  2174  	}
  2175  	gz_compress(tls, in, out)
  2176  
  2177  	libc.Xunlink(tls, file)
  2178  }
  2179  
  2180  // ===========================================================================
  2181  // Uncompress the given file and remove the original.
  2182  func file_uncompress(tls *libc.TLS, file uintptr) { /* minigzip.c:496:6: */
  2183  	bp := tls.Alloc(1064)
  2184  	defer tls.Free(1064)
  2185  
  2186  	// var buf [1024]int8 at bp+40, 1024
  2187  
  2188  	var infile uintptr
  2189  	var outfile uintptr
  2190  	var out uintptr
  2191  	var in gzFile
  2192  	var len uint32 = uint32(libc.Xstrlen(tls, file))
  2193  
  2194  	if (size_t(len) + libc.Xstrlen(tls, ts+57 /* ".gz" */)) >= size_t(unsafe.Sizeof([1024]int8{})) {
  2195  		libc.Xfprintf(tls, (uintptr(unsafe.Pointer(&libc.X__sF)) + 2*152), ts+61 /* "%s: filename too..." */, libc.VaList(bp, prog))
  2196  		libc.Xexit(tls, 1)
  2197  	}
  2198  
  2199  	libc.Xsnprintf(tls, bp+40 /* &buf[0] */, uint64(unsafe.Sizeof([1024]int8{})), ts+113 /* "%s" */, libc.VaList(bp+8, file))
  2200  
  2201  	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 /* ".gz" */) == 0) {
  2202  		infile = file
  2203  		outfile = bp + 40 /* &buf[0] */
  2204  		*(*int8)(unsafe.Pointer(outfile + uintptr((len - uint32(3))))) = int8(0)
  2205  	} else {
  2206  		outfile = file
  2207  		infile = bp + 40 /* &buf[0] */
  2208  		libc.Xsnprintf(tls, (bp + 40 /* &buf[0] */ + uintptr(len)), (uint64(unsafe.Sizeof([1024]int8{})) - uint64(len)), ts+113 /* "%s" */, libc.VaList(bp+16, ts+57 /* ".gz" */))
  2209  	}
  2210  	in = z.Xgzopen(tls, infile, ts+89 /* "rb" */)
  2211  	if in == (uintptr(0)) {
  2212  		libc.Xfprintf(tls, (uintptr(unsafe.Pointer(&libc.X__sF)) + 2*152), ts+92 /* "%s: can't gzopen..." */, libc.VaList(bp+24, prog, infile))
  2213  		libc.Xexit(tls, 1)
  2214  	}
  2215  	out = libc.Xfopen(tls, outfile, ts+116 /* "wb" */)
  2216  	if out == (uintptr(0)) {
  2217  		libc.Xperror(tls, file)
  2218  		libc.Xexit(tls, 1)
  2219  	}
  2220  
  2221  	gz_uncompress(tls, in, out)
  2222  
  2223  	libc.Xunlink(tls, infile)
  2224  }
  2225  
  2226  // ===========================================================================
  2227  // Usage:  minigzip [-c] [-d] [-f] [-h] [-r] [-1 to -9] [files...]
  2228  //   -c : write to standard output
  2229  //   -d : decompress
  2230  //   -f : compress with Z_FILTERED
  2231  //   -h : compress with Z_HUFFMAN_ONLY
  2232  //   -r : compress with Z_RLE
  2233  //   -1 to -9 : compression level
  2234  
  2235  func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* minigzip.c:556:5: */
  2236  	bp := tls.Alloc(44)
  2237  	defer tls.Free(44)
  2238  
  2239  	var copyout int32 = 0
  2240  	var uncompr int32 = 0
  2241  	var file gzFile
  2242  	var bname uintptr
  2243  	// var outmode [20]int8 at bp+24, 20
  2244  
  2245  	libc.Xsnprintf(tls, bp+24 /* &outmode[0] */, uint64(unsafe.Sizeof([20]int8{})), ts+113 /* "%s" */, libc.VaList(bp, ts+119 /* "wb6 " */))
  2246  
  2247  	prog = *(*uintptr)(unsafe.Pointer(argv))
  2248  	bname = libc.Xstrrchr(tls, *(*uintptr)(unsafe.Pointer(argv)), '/')
  2249  	if bname != 0 {
  2250  		bname++
  2251  	} else {
  2252  		bname = *(*uintptr)(unsafe.Pointer(argv))
  2253  	}
  2254  	argc--
  2255  	argv += 8
  2256  
  2257  	if !(libc.Xstrcmp(tls, bname, ts+124 /* "gunzip" */) != 0) {
  2258  		uncompr = 1
  2259  	} else if !(libc.Xstrcmp(tls, bname, ts+131 /* "zcat" */) != 0) {
  2260  		copyout = libc.AssignInt32(&uncompr, 1)
  2261  	}
  2262  
  2263  	for argc > 0 {
  2264  		if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+136 /* "-c" */) == 0 {
  2265  			copyout = 1
  2266  		} else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+139 /* "-d" */) == 0 {
  2267  			uncompr = 1
  2268  		} else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+142 /* "-f" */) == 0 {
  2269  			*(*int8)(unsafe.Pointer(bp + 24 /* &outmode[0] */ + 3)) = int8('f')
  2270  		} else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+145 /* "-h" */) == 0 {
  2271  			*(*int8)(unsafe.Pointer(bp + 24 /* &outmode[0] */ + 3)) = int8('h')
  2272  		} else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+148 /* "-r" */) == 0 {
  2273  			*(*int8)(unsafe.Pointer(bp + 24 /* &outmode[0] */ + 3)) = int8('R')
  2274  		} 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) {
  2275  			*(*int8)(unsafe.Pointer(bp + 24 /* &outmode[0] */ + 2)) = *(*int8)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(argv))) + 1))
  2276  		} else {
  2277  			break
  2278  		}
  2279  		argc--
  2280  		argv += 8
  2281  	}
  2282  	if int32(*(*int8)(unsafe.Pointer(bp + 24 /* &outmode[0] */ + 3))) == ' ' {
  2283  		*(*int8)(unsafe.Pointer(bp + 24 /* &outmode[0] */ + 3)) = int8(0)
  2284  	}
  2285  	if argc == 0 {
  2286  
  2287  		if uncompr != 0 {
  2288  			file = z.Xgzdopen(tls, func() int32 {
  2289  				if int32((*FILE)(unsafe.Pointer((uintptr(unsafe.Pointer(&libc.X__sF)))))._file) == -1 {
  2290  					return -1
  2291  				}
  2292  				return int32(uint16((*FILE)(unsafe.Pointer((uintptr(unsafe.Pointer(&libc.X__sF)))))._file))
  2293  			}(), ts+89 /* "rb" */)
  2294  			if file == (uintptr(0)) {
  2295  				error(tls, ts+151 /* "can't gzdopen st..." */)
  2296  			}
  2297  			gz_uncompress(tls, file, (uintptr(unsafe.Pointer(&libc.X__sF)) + 1*152))
  2298  		} else {
  2299  			file = z.Xgzdopen(tls, func() int32 {
  2300  				if int32((*FILE)(unsafe.Pointer((uintptr(unsafe.Pointer(&libc.X__sF)) + 1*152)))._file) == -1 {
  2301  					return -1
  2302  				}
  2303  				return int32(uint16((*FILE)(unsafe.Pointer((uintptr(unsafe.Pointer(&libc.X__sF)) + 1*152)))._file))
  2304  			}(), bp+24 /* &outmode[0] */)
  2305  			if file == (uintptr(0)) {
  2306  				error(tls, ts+171 /* "can't gzdopen st..." */)
  2307  			}
  2308  			gz_compress(tls, (uintptr(unsafe.Pointer(&libc.X__sF))), file)
  2309  		}
  2310  	} else {
  2311  		if copyout != 0 {
  2312  
  2313  		}
  2314  		for ok := true; ok; ok = func() bool { argv += 8; return libc.PreDecInt32(&argc, 1) != 0 }() {
  2315  			if uncompr != 0 {
  2316  				if copyout != 0 {
  2317  					file = z.Xgzopen(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+89 /* "rb" */)
  2318  					if file == (uintptr(0)) {
  2319  						libc.Xfprintf(tls, (uintptr(unsafe.Pointer(&libc.X__sF)) + 2*152), ts+92 /* "%s: can't gzopen..." */, libc.VaList(bp+8, prog, *(*uintptr)(unsafe.Pointer(argv))))
  2320  					} else {
  2321  						gz_uncompress(tls, file, (uintptr(unsafe.Pointer(&libc.X__sF)) + 1*152))
  2322  					}
  2323  				} else {
  2324  					file_uncompress(tls, *(*uintptr)(unsafe.Pointer(argv)))
  2325  				}
  2326  			} else {
  2327  				if copyout != 0 {
  2328  					var in uintptr = libc.Xfopen(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+89 /* "rb" */)
  2329  
  2330  					if in == (uintptr(0)) {
  2331  						libc.Xperror(tls, *(*uintptr)(unsafe.Pointer(argv)))
  2332  					} else {
  2333  						file = z.Xgzdopen(tls, func() int32 {
  2334  							if int32((*FILE)(unsafe.Pointer((uintptr(unsafe.Pointer(&libc.X__sF)) + 1*152)))._file) == -1 {
  2335  								return -1
  2336  							}
  2337  							return int32(uint16((*FILE)(unsafe.Pointer((uintptr(unsafe.Pointer(&libc.X__sF)) + 1*152)))._file))
  2338  						}(), bp+24 /* &outmode[0] */)
  2339  						if file == (uintptr(0)) {
  2340  							error(tls, ts+171 /* "can't gzdopen st..." */)
  2341  						}
  2342  
  2343  						gz_compress(tls, in, file)
  2344  					}
  2345  
  2346  				} else {
  2347  					file_compress(tls, *(*uintptr)(unsafe.Pointer(argv)), bp+24 /* &outmode[0] */)
  2348  				}
  2349  			}
  2350  		}
  2351  	}
  2352  	return 0
  2353  }
  2354  
  2355  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"
  2356  var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data