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

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