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

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