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

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