modernc.org/xau@v1.0.16/internal/autest/main_linux_arm.go (about)

     1  // Code generated by 'ccgo -export-fields F -lmodernc.org/xau/lib -o internal/autest/main_linux_arm.go -trace-translation-units /tmp/go-generate-225967613/cdb.json Autest', 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/xau/lib"
    14  )
    15  
    16  var _ = math.Pi
    17  var _ reflect.Kind
    18  var _ atomic.Value
    19  var _ unsafe.Pointer
    20  var _ *libc.TLS
    21  var _ types.Size_t
    22  
    23  func main() { libc.Start(main1) }
    24  
    25  //  In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
    26  //     are already defined.
    27  //  BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
    28  //  NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.
    29  
    30  // A null pointer constant.
    31  
    32  // XPG requires a few symbols from <sys/wait.h> being defined.
    33  // Definitions of flag bits for `waitpid' et al.
    34  //    Copyright (C) 1992-2018 Free Software Foundation, Inc.
    35  //    This file is part of the GNU C Library.
    36  //
    37  //    The GNU C Library is free software; you can redistribute it and/or
    38  //    modify it under the terms of the GNU Lesser General Public
    39  //    License as published by the Free Software Foundation; either
    40  //    version 2.1 of the License, or (at your option) any later version.
    41  //
    42  //    The GNU C Library is distributed in the hope that it will be useful,
    43  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
    44  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    45  //    Lesser General Public License for more details.
    46  //
    47  //    You should have received a copy of the GNU Lesser General Public
    48  //    License along with the GNU C Library; if not, see
    49  //    <http://www.gnu.org/licenses/>.
    50  
    51  // Bits in the third argument to `waitpid'.
    52  
    53  // Bits in the fourth argument to `waitid'.
    54  
    55  // The following values are used by the `waitid' function.
    56  
    57  // The Linux kernel defines these bare, rather than an enum,
    58  //    which causes a conflict if the include order is reversed.
    59  
    60  const ( /* waitflags.h:52:1: */
    61  	P_ALL  = 0 // Wait for any child.
    62  	P_PID  = 1 // Wait for specified process.
    63  	P_PGID = 2
    64  )
    65  
    66  type ptrdiff_t = int32 /* <builtin>:3:26 */
    67  
    68  type size_t = uint32 /* <builtin>:9:23 */
    69  
    70  type wchar_t = uint32 /* <builtin>:15:24 */
    71  
    72  //
    73  //
    74  // Copyright 1988, 1998  The Open Group
    75  //
    76  // Permission to use, copy, modify, distribute, and sell this software and its
    77  // documentation for any purpose is hereby granted without fee, provided that
    78  // the above copyright notice appear in all copies and that both that
    79  // copyright notice and this permission notice appear in supporting
    80  // documentation.
    81  //
    82  // The above copyright notice and this permission notice shall be included in
    83  // all copies or substantial portions of the Software.
    84  //
    85  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    86  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    87  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
    88  // OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
    89  // AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    90  // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    91  //
    92  // Except as contained in this notice, the name of The Open Group shall not be
    93  // used in advertising or otherwise to promote the sale, use or other dealings
    94  // in this Software without prior written authorization from The Open Group.
    95  //
    96  
    97  // config.h.  Generated from config.h.in by configure.
    98  // config.h.in.  Generated from configure.ac by autoheader.
    99  
   100  // Define to 1 if you have the <dlfcn.h> header file.
   101  
   102  // Define to 1 if you have the <inttypes.h> header file.
   103  
   104  // Define to 1 if you have the <memory.h> header file.
   105  
   106  // Define to 1 if you have the `pathconf' function.
   107  
   108  // Define to 1 if you have the <stdint.h> header file.
   109  
   110  // Define to 1 if you have the <stdlib.h> header file.
   111  
   112  // Define to 1 if you have the <strings.h> header file.
   113  
   114  // Define to 1 if you have the <string.h> header file.
   115  
   116  // Define to 1 if you have the <sys/stat.h> header file.
   117  
   118  // Define to 1 if you have the <sys/types.h> header file.
   119  
   120  // Define to 1 if you have the <unistd.h> header file.
   121  
   122  // Define to the sub-directory where libtool stores uninstalled libraries.
   123  
   124  // Name of package
   125  
   126  // Define to the address where bug reports for this package should be sent.
   127  
   128  // Define to the full name of this package.
   129  
   130  // Define to the full name and version of this package.
   131  
   132  // Define to the one symbol short name of this package.
   133  
   134  // Define to the home page for this package.
   135  
   136  // Define to the version of this package.
   137  
   138  // Major version of this package
   139  
   140  // Minor version of this package
   141  
   142  // Patch version of this package
   143  
   144  // Define to 1 if you have the ANSI C header files.
   145  
   146  // Enable extensions on AIX 3, Interix.
   147  // Enable GNU extensions on systems that have them.
   148  // Enable threading extensions on Solaris.
   149  // Enable extensions on HP NonStop.
   150  // Enable general extensions on Solaris.
   151  
   152  // Version number of package
   153  
   154  // Whether libXau is compiled with thread support
   155  // #undef XTHREADS
   156  
   157  // Whether libXau needs to use MT safe API's
   158  // #undef XUSE_MTSAFE_API
   159  
   160  // Define to 1 if on MINIX.
   161  // #undef _MINIX
   162  
   163  // Define to 2 if the system does not provide POSIX.1 features except with
   164  //    this defined.
   165  // #undef _POSIX_1_SOURCE
   166  
   167  // Define to 1 if you need to in order for `stat' and other things to work.
   168  // #undef _POSIX_SOURCE
   169  //
   170  //
   171  // Copyright 1988, 1998  The Open Group
   172  //
   173  // Permission to use, copy, modify, distribute, and sell this software and its
   174  // documentation for any purpose is hereby granted without fee, provided that
   175  // the above copyright notice appear in all copies and that both that
   176  // copyright notice and this permission notice appear in supporting
   177  // documentation.
   178  //
   179  // The above copyright notice and this permission notice shall be included in
   180  // all copies or substantial portions of the Software.
   181  //
   182  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   183  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   184  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
   185  // OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
   186  // AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
   187  // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   188  //
   189  // Except as contained in this notice, the name of The Open Group shall not be
   190  // used in advertising or otherwise to promote the sale, use or other dealings
   191  // in this Software without prior written authorization from The Open Group.
   192  //
   193  
   194  // struct xauth is full of implicit padding to properly align the pointers
   195  //    after the length fields.   We can't clean that up without breaking ABI,
   196  //    so tell clang not to bother complaining about it.
   197  
   198  type xauth = struct {
   199  	Ffamily         uint16
   200  	Faddress_length uint16
   201  	Faddress        uintptr
   202  	Fnumber_length  uint16
   203  	F__ccgo_pad1    [2]byte
   204  	Fnumber         uintptr
   205  	Fname_length    uint16
   206  	F__ccgo_pad2    [2]byte
   207  	Fname           uintptr
   208  	Fdata_length    uint16
   209  	F__ccgo_pad3    [2]byte
   210  	Fdata           uintptr
   211  } /* Xauth.h:38:9 */
   212  
   213  //
   214  //
   215  // Copyright 1988, 1998  The Open Group
   216  //
   217  // Permission to use, copy, modify, distribute, and sell this software and its
   218  // documentation for any purpose is hereby granted without fee, provided that
   219  // the above copyright notice appear in all copies and that both that
   220  // copyright notice and this permission notice appear in supporting
   221  // documentation.
   222  //
   223  // The above copyright notice and this permission notice shall be included in
   224  // all copies or substantial portions of the Software.
   225  //
   226  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   227  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   228  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
   229  // OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
   230  // AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
   231  // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   232  //
   233  // Except as contained in this notice, the name of The Open Group shall not be
   234  // used in advertising or otherwise to promote the sale, use or other dealings
   235  // in this Software without prior written authorization from The Open Group.
   236  //
   237  
   238  // config.h.  Generated from config.h.in by configure.
   239  // config.h.in.  Generated from configure.ac by autoheader.
   240  
   241  // Define to 1 if you have the <dlfcn.h> header file.
   242  
   243  // Define to 1 if you have the <inttypes.h> header file.
   244  
   245  // Define to 1 if you have the <memory.h> header file.
   246  
   247  // Define to 1 if you have the `pathconf' function.
   248  
   249  // Define to 1 if you have the <stdint.h> header file.
   250  
   251  // Define to 1 if you have the <stdlib.h> header file.
   252  
   253  // Define to 1 if you have the <strings.h> header file.
   254  
   255  // Define to 1 if you have the <string.h> header file.
   256  
   257  // Define to 1 if you have the <sys/stat.h> header file.
   258  
   259  // Define to 1 if you have the <sys/types.h> header file.
   260  
   261  // Define to 1 if you have the <unistd.h> header file.
   262  
   263  // Define to the sub-directory where libtool stores uninstalled libraries.
   264  
   265  // Name of package
   266  
   267  // Define to the address where bug reports for this package should be sent.
   268  
   269  // Define to the full name of this package.
   270  
   271  // Define to the full name and version of this package.
   272  
   273  // Define to the one symbol short name of this package.
   274  
   275  // Define to the home page for this package.
   276  
   277  // Define to the version of this package.
   278  
   279  // Major version of this package
   280  
   281  // Minor version of this package
   282  
   283  // Patch version of this package
   284  
   285  // Define to 1 if you have the ANSI C header files.
   286  
   287  // Enable extensions on AIX 3, Interix.
   288  // Enable GNU extensions on systems that have them.
   289  // Enable threading extensions on Solaris.
   290  // Enable extensions on HP NonStop.
   291  // Enable general extensions on Solaris.
   292  
   293  // Version number of package
   294  
   295  // Whether libXau is compiled with thread support
   296  // #undef XTHREADS
   297  
   298  // Whether libXau needs to use MT safe API's
   299  // #undef XUSE_MTSAFE_API
   300  
   301  // Define to 1 if on MINIX.
   302  // #undef _MINIX
   303  
   304  // Define to 2 if the system does not provide POSIX.1 features except with
   305  //    this defined.
   306  // #undef _POSIX_1_SOURCE
   307  
   308  // Define to 1 if you need to in order for `stat' and other things to work.
   309  // #undef _POSIX_SOURCE
   310  //
   311  //
   312  // Copyright 1988, 1998  The Open Group
   313  //
   314  // Permission to use, copy, modify, distribute, and sell this software and its
   315  // documentation for any purpose is hereby granted without fee, provided that
   316  // the above copyright notice appear in all copies and that both that
   317  // copyright notice and this permission notice appear in supporting
   318  // documentation.
   319  //
   320  // The above copyright notice and this permission notice shall be included in
   321  // all copies or substantial portions of the Software.
   322  //
   323  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   324  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   325  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
   326  // OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
   327  // AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
   328  // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   329  //
   330  // Except as contained in this notice, the name of The Open Group shall not be
   331  // used in advertising or otherwise to promote the sale, use or other dealings
   332  // in this Software without prior written authorization from The Open Group.
   333  //
   334  
   335  // struct xauth is full of implicit padding to properly align the pointers
   336  //    after the length fields.   We can't clean that up without breaking ABI,
   337  //    so tell clang not to bother complaining about it.
   338  
   339  type Xauth = xauth /* Xauth.h:48:3 */
   340  
   341  // POSIX.1-2008 extended locale interface (see locale.h).
   342  // Definition of locale_t.
   343  //    Copyright (C) 2017-2018 Free Software Foundation, Inc.
   344  //    This file is part of the GNU C Library.
   345  //
   346  //    The GNU C Library is free software; you can redistribute it and/or
   347  //    modify it under the terms of the GNU Lesser General Public
   348  //    License as published by the Free Software Foundation; either
   349  //    version 2.1 of the License, or (at your option) any later version.
   350  //
   351  //    The GNU C Library is distributed in the hope that it will be useful,
   352  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   353  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   354  //    Lesser General Public License for more details.
   355  //
   356  //    You should have received a copy of the GNU Lesser General Public
   357  //    License along with the GNU C Library; if not, see
   358  //    <http://www.gnu.org/licenses/>.
   359  
   360  // Definition of struct __locale_struct and __locale_t.
   361  //    Copyright (C) 1997-2018 Free Software Foundation, Inc.
   362  //    This file is part of the GNU C Library.
   363  //    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
   364  //
   365  //    The GNU C Library is free software; you can redistribute it and/or
   366  //    modify it under the terms of the GNU Lesser General Public
   367  //    License as published by the Free Software Foundation; either
   368  //    version 2.1 of the License, or (at your option) any later version.
   369  //
   370  //    The GNU C Library is distributed in the hope that it will be useful,
   371  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   372  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   373  //    Lesser General Public License for more details.
   374  //
   375  //    You should have received a copy of the GNU Lesser General Public
   376  //    License along with the GNU C Library; if not, see
   377  //    <http://www.gnu.org/licenses/>.
   378  
   379  // POSIX.1-2008: the locale_t type, representing a locale context
   380  //    (implementation-namespace version).  This type should be treated
   381  //    as opaque by applications; some details are exposed for the sake of
   382  //    efficiency in e.g. ctype functions.
   383  
   384  type __locale_struct = struct {
   385  	F__locales       [13]uintptr
   386  	F__ctype_b       uintptr
   387  	F__ctype_tolower uintptr
   388  	F__ctype_toupper uintptr
   389  	F__names         [13]uintptr
   390  } /* __locale_t.h:28:1 */
   391  
   392  type locale_t = uintptr /* locale_t.h:24:20 */
   393  
   394  // The tag name of this struct is _G_fpos_t to preserve historic
   395  //    C++ mangled names for functions taking fpos_t arguments.
   396  //    That name should not be used in new code.
   397  type _G_fpos_t = struct {
   398  	F__pos   int32
   399  	F__state struct {
   400  		F__count int32
   401  		F__value struct{ F__wch uint32 }
   402  	}
   403  } /* __fpos_t.h:10:9 */
   404  
   405  // bits/types.h -- definitions of __*_t types underlying *_t types.
   406  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
   407  //    This file is part of the GNU C Library.
   408  //
   409  //    The GNU C Library is free software; you can redistribute it and/or
   410  //    modify it under the terms of the GNU Lesser General Public
   411  //    License as published by the Free Software Foundation; either
   412  //    version 2.1 of the License, or (at your option) any later version.
   413  //
   414  //    The GNU C Library is distributed in the hope that it will be useful,
   415  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   416  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   417  //    Lesser General Public License for more details.
   418  //
   419  //    You should have received a copy of the GNU Lesser General Public
   420  //    License along with the GNU C Library; if not, see
   421  //    <http://www.gnu.org/licenses/>.
   422  
   423  // Never include this file directly; use <sys/types.h> instead.
   424  
   425  // The tag name of this struct is _G_fpos64_t to preserve historic
   426  //    C++ mangled names for functions taking fpos_t and/or fpos64_t
   427  //    arguments.  That name should not be used in new code.
   428  type _G_fpos64_t = struct {
   429  	F__pos   int64
   430  	F__state struct {
   431  		F__count int32
   432  		F__value struct{ F__wch uint32 }
   433  	}
   434  } /* __fpos64_t.h:10:9 */
   435  
   436  type _IO_FILE = struct {
   437  	F_flags          int32
   438  	F_IO_read_ptr    uintptr
   439  	F_IO_read_end    uintptr
   440  	F_IO_read_base   uintptr
   441  	F_IO_write_base  uintptr
   442  	F_IO_write_ptr   uintptr
   443  	F_IO_write_end   uintptr
   444  	F_IO_buf_base    uintptr
   445  	F_IO_buf_end     uintptr
   446  	F_IO_save_base   uintptr
   447  	F_IO_backup_base uintptr
   448  	F_IO_save_end    uintptr
   449  	F_markers        uintptr
   450  	F_chain          uintptr
   451  	F_fileno         int32
   452  	F_flags2         int32
   453  	F_old_offset     int32
   454  	F_cur_column     uint16
   455  	F_vtable_offset  int8
   456  	F_shortbuf       [1]uint8
   457  	F_lock           uintptr
   458  	F__ccgo_pad1     [4]byte
   459  	F_offset         int64
   460  	F_codecvt        uintptr
   461  	F_wide_data      uintptr
   462  	F_freeres_list   uintptr
   463  	F_freeres_buf    uintptr
   464  	F__pad5          size_t
   465  	F_mode           int32
   466  	F_unused2        [40]uint8
   467  } /* __FILE.h:4:1 */
   468  
   469  // The opaque type of streams.  This is the definition used elsewhere.
   470  type FILE = _IO_FILE /* FILE.h:7:25 */
   471  
   472  // The structure with the cookie function pointers.
   473  //    The tag name of this struct is _IO_cookie_io_functions_t to
   474  //    preserve historic C++ mangled names for functions taking
   475  //    cookie_io_functions_t arguments.  That name should not be used in
   476  //    new code.
   477  type _IO_cookie_io_functions_t = struct {
   478  	Fread  uintptr
   479  	Fwrite uintptr
   480  	Fseek  uintptr
   481  	Fclose uintptr
   482  } /* cookie_io_functions_t.h:55:9 */
   483  
   484  // The structure with the cookie function pointers.
   485  //    The tag name of this struct is _IO_cookie_io_functions_t to
   486  //    preserve historic C++ mangled names for functions taking
   487  //    cookie_io_functions_t arguments.  That name should not be used in
   488  //    new code.
   489  type cookie_io_functions_t = _IO_cookie_io_functions_t /* cookie_io_functions_t.h:61:3 */
   490  
   491  type va_list = uintptr /* stdio.h:52:24 */
   492  
   493  type off_t = int64   /* stdio.h:65:19 */
   494  type off64_t = int64 /* stdio.h:70:19 */
   495  
   496  type ssize_t = int32 /* stdio.h:77:19 */
   497  
   498  // The type of the second argument to `fgetpos' and `fsetpos'.
   499  type fpos_t = _G_fpos64_t   /* stdio.h:86:20 */
   500  type fpos64_t = _G_fpos64_t /* stdio.h:89:20 */
   501  
   502  //  In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
   503  //     are already defined.
   504  //  BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
   505  //  NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.
   506  
   507  // A null pointer constant.
   508  
   509  // XPG requires a few symbols from <sys/wait.h> being defined.
   510  // Definitions of flag bits for `waitpid' et al.
   511  //    Copyright (C) 1992-2018 Free Software Foundation, Inc.
   512  //    This file is part of the GNU C Library.
   513  //
   514  //    The GNU C Library is free software; you can redistribute it and/or
   515  //    modify it under the terms of the GNU Lesser General Public
   516  //    License as published by the Free Software Foundation; either
   517  //    version 2.1 of the License, or (at your option) any later version.
   518  //
   519  //    The GNU C Library is distributed in the hope that it will be useful,
   520  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   521  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   522  //    Lesser General Public License for more details.
   523  //
   524  //    You should have received a copy of the GNU Lesser General Public
   525  //    License along with the GNU C Library; if not, see
   526  //    <http://www.gnu.org/licenses/>.
   527  
   528  // Bits in the third argument to `waitpid'.
   529  
   530  // Bits in the fourth argument to `waitid'.
   531  
   532  // The following values are used by the `waitid' function.
   533  
   534  // The Linux kernel defines these bare, rather than an enum,
   535  //    which causes a conflict if the include order is reversed.
   536  
   537  type idtype_t = uint32 /* waitflags.h:57:3 */
   538  // Definitions of status bits for `wait' et al.
   539  //    Copyright (C) 1992-2018 Free Software Foundation, Inc.
   540  //    This file is part of the GNU C Library.
   541  //
   542  //    The GNU C Library is free software; you can redistribute it and/or
   543  //    modify it under the terms of the GNU Lesser General Public
   544  //    License as published by the Free Software Foundation; either
   545  //    version 2.1 of the License, or (at your option) any later version.
   546  //
   547  //    The GNU C Library is distributed in the hope that it will be useful,
   548  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   549  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   550  //    Lesser General Public License for more details.
   551  //
   552  //    You should have received a copy of the GNU Lesser General Public
   553  //    License along with the GNU C Library; if not, see
   554  //    <http://www.gnu.org/licenses/>.
   555  
   556  // Everything extant so far uses these same bits.
   557  
   558  // If WIFEXITED(STATUS), the low-order 8 bits of the status.
   559  
   560  // If WIFSIGNALED(STATUS), the terminating signal.
   561  
   562  // If WIFSTOPPED(STATUS), the signal that stopped the child.
   563  
   564  // Nonzero if STATUS indicates normal termination.
   565  
   566  // Nonzero if STATUS indicates termination by a signal.
   567  
   568  // Nonzero if STATUS indicates the child is stopped.
   569  
   570  // Nonzero if STATUS indicates the child continued after a stop.  We only
   571  //    define this if <bits/waitflags.h> provides the WCONTINUED flag bit.
   572  
   573  // Nonzero if STATUS indicates the child dumped core.
   574  
   575  // Macros for constructing status values.
   576  
   577  // Define the macros <sys/wait.h> also would define this way.
   578  
   579  // _FloatN API tests for enablement.
   580  // Macros to control TS 18661-3 glibc features.
   581  //    Copyright (C) 2017-2018 Free Software Foundation, Inc.
   582  //    This file is part of the GNU C Library.
   583  //
   584  //    The GNU C Library is free software; you can redistribute it and/or
   585  //    modify it under the terms of the GNU Lesser General Public
   586  //    License as published by the Free Software Foundation; either
   587  //    version 2.1 of the License, or (at your option) any later version.
   588  //
   589  //    The GNU C Library is distributed in the hope that it will be useful,
   590  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   591  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   592  //    Lesser General Public License for more details.
   593  //
   594  //    You should have received a copy of the GNU Lesser General Public
   595  //    License along with the GNU C Library; if not, see
   596  //    <http://www.gnu.org/licenses/>.
   597  
   598  // Defined to 1 if the current compiler invocation provides a
   599  //    floating-point type with the IEEE 754 binary128 format, and this glibc
   600  //    includes corresponding *f128 interfaces for it.
   601  
   602  // Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct
   603  //    from the default float, double and long double types in this glibc.
   604  
   605  // Defined to 1 if the current compiler invocation provides a
   606  //    floating-point type with the right format for _Float64x, and this
   607  //    glibc includes corresponding *f64x interfaces for it.
   608  
   609  // Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format
   610  //    of long double.  Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has
   611  //    the format of _Float128, which must be different from that of long
   612  //    double.
   613  
   614  // Defined to concatenate the literal suffix to be used with _Float128
   615  //    types, if __HAVE_FLOAT128 is 1.
   616  //    E.g.: #define __f128(x) x##f128.
   617  
   618  // Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.
   619  //    E.g.: #define __CFLOAT128 _Complex _Float128.
   620  
   621  // Macros to control TS 18661-3 glibc features where the same
   622  //    definitions are appropriate for all platforms.
   623  //    Copyright (C) 2017-2018 Free Software Foundation, Inc.
   624  //    This file is part of the GNU C Library.
   625  //
   626  //    The GNU C Library is free software; you can redistribute it and/or
   627  //    modify it under the terms of the GNU Lesser General Public
   628  //    License as published by the Free Software Foundation; either
   629  //    version 2.1 of the License, or (at your option) any later version.
   630  //
   631  //    The GNU C Library is distributed in the hope that it will be useful,
   632  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   633  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   634  //    Lesser General Public License for more details.
   635  //
   636  //    You should have received a copy of the GNU Lesser General Public
   637  //    License along with the GNU C Library; if not, see
   638  //    <http://www.gnu.org/licenses/>.
   639  
   640  // Copyright (C) 1991-2018 Free Software Foundation, Inc.
   641  //    This file is part of the GNU C Library.
   642  //
   643  //    The GNU C Library is free software; you can redistribute it and/or
   644  //    modify it under the terms of the GNU Lesser General Public
   645  //    License as published by the Free Software Foundation; either
   646  //    version 2.1 of the License, or (at your option) any later version.
   647  //
   648  //    The GNU C Library is distributed in the hope that it will be useful,
   649  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   650  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   651  //    Lesser General Public License for more details.
   652  //
   653  //    You should have received a copy of the GNU Lesser General Public
   654  //    License along with the GNU C Library; if not, see
   655  //    <http://www.gnu.org/licenses/>.
   656  
   657  // Properties of long double type.
   658  //    Copyright (C) 2016-2018 Free Software Foundation, Inc.
   659  //    This file is part of the GNU C Library.
   660  //
   661  //    The GNU C Library is free software; you can redistribute it and/or
   662  //    modify it under the terms of the GNU Lesser General Public
   663  //    License  published by the Free Software Foundation; either
   664  //    version 2.1 of the License, or (at your option) any later version.
   665  //
   666  //    The GNU C Library is distributed in the hope that it will be useful,
   667  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   668  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   669  //    Lesser General Public License for more details.
   670  //
   671  //    You should have received a copy of the GNU Lesser General Public
   672  //    License along with the GNU C Library; if not, see
   673  //    <http://www.gnu.org/licenses/>.
   674  
   675  // This header is included by <sys/cdefs.h>.
   676  //
   677  //    If long double is ABI-compatible with double, it should define
   678  //    __NO_LONG_DOUBLE_MATH to 1; otherwise, it should leave
   679  //    __NO_LONG_DOUBLE_MATH undefined.
   680  //
   681  //    If this build of the GNU C Library supports both long double
   682  //    ABI-compatible with double and some other long double format not
   683  //    ABI-compatible with double, it should define
   684  //    __LONG_DOUBLE_MATH_OPTIONAL to 1; otherwise, it should leave
   685  //    __LONG_DOUBLE_MATH_OPTIONAL undefined.
   686  //
   687  //    If __NO_LONG_DOUBLE_MATH is already defined, this header must not
   688  //    define anything; this is needed to work with the definition of
   689  //    __NO_LONG_DOUBLE_MATH in nldbl-compat.h.
   690  
   691  // In the default version of this header, long double is
   692  //    ABI-compatible with double.
   693  
   694  // This header should be included at the bottom of each bits/floatn.h.
   695  //    It defines the following macros for each _FloatN and _FloatNx type,
   696  //    where the same definitions, or definitions based only on the macros
   697  //    in bits/floatn.h, are appropriate for all glibc configurations.
   698  
   699  // Defined to 1 if the current compiler invocation provides a
   700  //    floating-point type with the right format for this type, and this
   701  //    glibc includes corresponding *fN or *fNx interfaces for it.
   702  
   703  // Defined to 1 if the corresponding __HAVE_<type> macro is 1 and the
   704  //    type is the first with its format in the sequence of (the default
   705  //    choices for) float, double, long double, _Float16, _Float32,
   706  //    _Float64, _Float128, _Float32x, _Float64x, _Float128x for this
   707  //    glibc; that is, if functions present once per floating-point format
   708  //    rather than once per type are present for this type.
   709  //
   710  //    All configurations supported by glibc have _Float32 the same format
   711  //    as float, _Float64 and _Float32x the same format as double, the
   712  //    _Float64x the same format as either long double or _Float128.  No
   713  //    configurations support _Float128x or, as of GCC 7, have compiler
   714  //    support for a type meeting the requirements for _Float128x.
   715  
   716  // Defined to 1 if the corresponding _FloatN type is not binary compatible
   717  //    with the corresponding ISO C type in the current compilation unit as
   718  //    opposed to __HAVE_DISTINCT_FLOATN, which indicates the default types built
   719  //    in glibc.
   720  
   721  // Defined to 1 if any _FloatN or _FloatNx types that are not
   722  //    ABI-distinct are however distinct types at the C language level (so
   723  //    for the purposes of __builtin_types_compatible_p and _Generic).
   724  
   725  // Defined to concatenate the literal suffix to be used with _FloatN
   726  //    or _FloatNx types, if __HAVE_<type> is 1.  The corresponding
   727  //    literal suffixes exist since GCC 7, for C only.
   728  
   729  // Defined to a complex type if __HAVE_<type> is 1.
   730  
   731  // The remaining of this file provides support for older compilers.
   732  
   733  // If double, long double and _Float64 all have the same set of
   734  //    values, TS 18661-3 requires the usual arithmetic conversions on
   735  //    long double and _Float64 to produce _Float64.  For this to be the
   736  //    case when building with a compiler without a distinct _Float64
   737  //    type, _Float64 must be a typedef for long double, not for
   738  //    double.
   739  
   740  // Returned by `div'.
   741  type div_t = struct {
   742  	Fquot int32
   743  	Frem  int32
   744  } /* stdlib.h:62:5 */
   745  
   746  // Returned by `ldiv'.
   747  type ldiv_t = struct {
   748  	Fquot int32
   749  	Frem  int32
   750  } /* stdlib.h:70:5 */
   751  
   752  // Returned by `lldiv'.
   753  type lldiv_t = struct {
   754  	Fquot int64
   755  	Frem  int64
   756  } /* stdlib.h:80:5 */
   757  
   758  // Copyright (C) 1991-2018 Free Software Foundation, Inc.
   759  //    This file is part of the GNU C Library.
   760  //
   761  //    The GNU C Library is free software; you can redistribute it and/or
   762  //    modify it under the terms of the GNU Lesser General Public
   763  //    License as published by the Free Software Foundation; either
   764  //    version 2.1 of the License, or (at your option) any later version.
   765  //
   766  //    The GNU C Library is distributed in the hope that it will be useful,
   767  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   768  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   769  //    Lesser General Public License for more details.
   770  //
   771  //    You should have received a copy of the GNU Lesser General Public
   772  //    License along with the GNU C Library; if not, see
   773  //    <http://www.gnu.org/licenses/>.
   774  
   775  //	POSIX Standard: 2.6 Primitive System Data Types	<sys/types.h>
   776  
   777  // Copyright (C) 1991-2018 Free Software Foundation, Inc.
   778  //    This file is part of the GNU C Library.
   779  //
   780  //    The GNU C Library is free software; you can redistribute it and/or
   781  //    modify it under the terms of the GNU Lesser General Public
   782  //    License as published by the Free Software Foundation; either
   783  //    version 2.1 of the License, or (at your option) any later version.
   784  //
   785  //    The GNU C Library is distributed in the hope that it will be useful,
   786  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   787  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   788  //    Lesser General Public License for more details.
   789  //
   790  //    You should have received a copy of the GNU Lesser General Public
   791  //    License along with the GNU C Library; if not, see
   792  //    <http://www.gnu.org/licenses/>.
   793  
   794  // bits/types.h -- definitions of __*_t types underlying *_t types.
   795  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
   796  //    This file is part of the GNU C Library.
   797  //
   798  //    The GNU C Library is free software; you can redistribute it and/or
   799  //    modify it under the terms of the GNU Lesser General Public
   800  //    License as published by the Free Software Foundation; either
   801  //    version 2.1 of the License, or (at your option) any later version.
   802  //
   803  //    The GNU C Library is distributed in the hope that it will be useful,
   804  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   805  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   806  //    Lesser General Public License for more details.
   807  //
   808  //    You should have received a copy of the GNU Lesser General Public
   809  //    License along with the GNU C Library; if not, see
   810  //    <http://www.gnu.org/licenses/>.
   811  
   812  // Never include this file directly; use <sys/types.h> instead.
   813  
   814  type u_char = uint8                     /* types.h:33:18 */
   815  type u_short = uint16                   /* types.h:34:19 */
   816  type u_int = uint32                     /* types.h:35:17 */
   817  type u_long = uint32                    /* types.h:36:18 */
   818  type quad_t = int64                     /* types.h:37:18 */
   819  type u_quad_t = uint64                  /* types.h:38:20 */
   820  type fsid_t = struct{ F__val [2]int32 } /* types.h:39:18 */
   821  type loff_t = int64                     /* types.h:42:18 */
   822  
   823  type ino_t = uint64   /* types.h:49:19 */
   824  type ino64_t = uint64 /* types.h:54:19 */
   825  
   826  type dev_t = uint64 /* types.h:59:17 */
   827  
   828  type gid_t = uint32 /* types.h:64:17 */
   829  
   830  type mode_t = uint32 /* types.h:69:18 */
   831  
   832  type nlink_t = uint32 /* types.h:74:19 */
   833  
   834  type uid_t = uint32 /* types.h:79:17 */
   835  
   836  type pid_t = int32 /* types.h:97:17 */
   837  
   838  type id_t = uint32 /* types.h:103:16 */
   839  
   840  type daddr_t = int32   /* types.h:114:19 */
   841  type caddr_t = uintptr /* types.h:115:19 */
   842  
   843  type key_t = int32 /* types.h:121:17 */
   844  
   845  // bits/types.h -- definitions of __*_t types underlying *_t types.
   846  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
   847  //    This file is part of the GNU C Library.
   848  //
   849  //    The GNU C Library is free software; you can redistribute it and/or
   850  //    modify it under the terms of the GNU Lesser General Public
   851  //    License as published by the Free Software Foundation; either
   852  //    version 2.1 of the License, or (at your option) any later version.
   853  //
   854  //    The GNU C Library is distributed in the hope that it will be useful,
   855  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   856  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   857  //    Lesser General Public License for more details.
   858  //
   859  //    You should have received a copy of the GNU Lesser General Public
   860  //    License along with the GNU C Library; if not, see
   861  //    <http://www.gnu.org/licenses/>.
   862  
   863  // Never include this file directly; use <sys/types.h> instead.
   864  
   865  // Returned by `clock'.
   866  type clock_t = int32 /* clock_t.h:7:19 */
   867  
   868  // bits/types.h -- definitions of __*_t types underlying *_t types.
   869  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
   870  //    This file is part of the GNU C Library.
   871  //
   872  //    The GNU C Library is free software; you can redistribute it and/or
   873  //    modify it under the terms of the GNU Lesser General Public
   874  //    License as published by the Free Software Foundation; either
   875  //    version 2.1 of the License, or (at your option) any later version.
   876  //
   877  //    The GNU C Library is distributed in the hope that it will be useful,
   878  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   879  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   880  //    Lesser General Public License for more details.
   881  //
   882  //    You should have received a copy of the GNU Lesser General Public
   883  //    License along with the GNU C Library; if not, see
   884  //    <http://www.gnu.org/licenses/>.
   885  
   886  // Never include this file directly; use <sys/types.h> instead.
   887  
   888  // Clock ID used in clock and timer functions.
   889  type clockid_t = int32 /* clockid_t.h:7:21 */
   890  
   891  // bits/types.h -- definitions of __*_t types underlying *_t types.
   892  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
   893  //    This file is part of the GNU C Library.
   894  //
   895  //    The GNU C Library is free software; you can redistribute it and/or
   896  //    modify it under the terms of the GNU Lesser General Public
   897  //    License as published by the Free Software Foundation; either
   898  //    version 2.1 of the License, or (at your option) any later version.
   899  //
   900  //    The GNU C Library is distributed in the hope that it will be useful,
   901  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   902  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   903  //    Lesser General Public License for more details.
   904  //
   905  //    You should have received a copy of the GNU Lesser General Public
   906  //    License along with the GNU C Library; if not, see
   907  //    <http://www.gnu.org/licenses/>.
   908  
   909  // Never include this file directly; use <sys/types.h> instead.
   910  
   911  // Returned by `time'.
   912  type time_t = int32 /* time_t.h:7:18 */
   913  
   914  // bits/types.h -- definitions of __*_t types underlying *_t types.
   915  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
   916  //    This file is part of the GNU C Library.
   917  //
   918  //    The GNU C Library is free software; you can redistribute it and/or
   919  //    modify it under the terms of the GNU Lesser General Public
   920  //    License as published by the Free Software Foundation; either
   921  //    version 2.1 of the License, or (at your option) any later version.
   922  //
   923  //    The GNU C Library is distributed in the hope that it will be useful,
   924  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   925  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   926  //    Lesser General Public License for more details.
   927  //
   928  //    You should have received a copy of the GNU Lesser General Public
   929  //    License along with the GNU C Library; if not, see
   930  //    <http://www.gnu.org/licenses/>.
   931  
   932  // Never include this file directly; use <sys/types.h> instead.
   933  
   934  // Timer ID returned by `timer_create'.
   935  type timer_t = uintptr /* timer_t.h:7:19 */
   936  
   937  type useconds_t = uint32 /* types.h:134:22 */
   938  type suseconds_t = int32 /* types.h:138:23 */
   939  
   940  // Copyright (C) 1989-2018 Free Software Foundation, Inc.
   941  //
   942  // This file is part of GCC.
   943  //
   944  // GCC is free software; you can redistribute it and/or modify
   945  // it under the terms of the GNU General Public License as published by
   946  // the Free Software Foundation; either version 3, or (at your option)
   947  // any later version.
   948  //
   949  // GCC is distributed in the hope that it will be useful,
   950  // but WITHOUT ANY WARRANTY; without even the implied warranty of
   951  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   952  // GNU General Public License for more details.
   953  //
   954  // Under Section 7 of GPL version 3, you are granted additional
   955  // permissions described in the GCC Runtime Library Exception, version
   956  // 3.1, as published by the Free Software Foundation.
   957  //
   958  // You should have received a copy of the GNU General Public License and
   959  // a copy of the GCC Runtime Library Exception along with this program;
   960  // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
   961  // <http://www.gnu.org/licenses/>.
   962  
   963  // ISO C Standard:  7.17  Common definitions  <stddef.h>
   964  
   965  // Any one of these symbols __need_* means that GNU libc
   966  //    wants us just to define one data type.  So don't define
   967  //    the symbols that indicate this file's entire job has been done.
   968  
   969  // This avoids lossage on SunOS but only if stdtypes.h comes first.
   970  //    There's no way to win with the other order!  Sun lossage.
   971  
   972  // On 4.3bsd-net2, make sure ansi.h is included, so we have
   973  //    one less case to deal with in the following.
   974  // On FreeBSD 5, machine/ansi.h does not exist anymore...
   975  
   976  // In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
   977  //    defined if the corresponding type is *not* defined.
   978  //    FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_.
   979  //    NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_
   980  
   981  // Sequent's header files use _PTRDIFF_T_ in some conflicting way.
   982  //    Just ignore it.
   983  
   984  // On VxWorks, <type/vxTypesBase.h> may have defined macros like
   985  //    _TYPE_size_t which will typedef size_t.  fixincludes patched the
   986  //    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
   987  //    not defined, and so that defining this macro defines _GCC_SIZE_T.
   988  //    If we find that the macros are still defined at this point, we must
   989  //    invoke them so that the type is defined as expected.
   990  
   991  // In case nobody has defined these types, but we aren't running under
   992  //    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
   993  //    __WCHAR_TYPE__ have reasonable values.  This can happen if the
   994  //    parts of GCC is compiled by an older compiler, that actually
   995  //    include gstddef.h, such as collect2.
   996  
   997  // Signed type of difference of two pointers.
   998  
   999  // Define this type if we are doing the whole job,
  1000  //    or if we want this type in particular.
  1001  
  1002  // Unsigned type of `sizeof' something.
  1003  
  1004  // Define this type if we are doing the whole job,
  1005  //    or if we want this type in particular.
  1006  
  1007  // Wide character type.
  1008  //    Locale-writers should change this as necessary to
  1009  //    be big enough to hold unique values not between 0 and 127,
  1010  //    and not (wchar_t) -1, for each defined multibyte character.
  1011  
  1012  // Define this type if we are doing the whole job,
  1013  //    or if we want this type in particular.
  1014  
  1015  //  In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
  1016  //     are already defined.
  1017  //  BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
  1018  //  NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.
  1019  
  1020  // A null pointer constant.
  1021  
  1022  // Old compatibility names for C types.
  1023  type ulong = uint32  /* types.h:148:27 */
  1024  type ushort = uint16 /* types.h:149:28 */
  1025  type uint = uint32   /* types.h:150:22 */
  1026  
  1027  // These size-specific names are used by some of the inet code.
  1028  
  1029  // Define intN_t types.
  1030  //    Copyright (C) 2017-2018 Free Software Foundation, Inc.
  1031  //    This file is part of the GNU C Library.
  1032  //
  1033  //    The GNU C Library is free software; you can redistribute it and/or
  1034  //    modify it under the terms of the GNU Lesser General Public
  1035  //    License as published by the Free Software Foundation; either
  1036  //    version 2.1 of the License, or (at your option) any later version.
  1037  //
  1038  //    The GNU C Library is distributed in the hope that it will be useful,
  1039  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1040  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1041  //    Lesser General Public License for more details.
  1042  //
  1043  //    You should have received a copy of the GNU Lesser General Public
  1044  //    License along with the GNU C Library; if not, see
  1045  //    <http://www.gnu.org/licenses/>.
  1046  
  1047  // bits/types.h -- definitions of __*_t types underlying *_t types.
  1048  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
  1049  //    This file is part of the GNU C Library.
  1050  //
  1051  //    The GNU C Library is free software; you can redistribute it and/or
  1052  //    modify it under the terms of the GNU Lesser General Public
  1053  //    License as published by the Free Software Foundation; either
  1054  //    version 2.1 of the License, or (at your option) any later version.
  1055  //
  1056  //    The GNU C Library is distributed in the hope that it will be useful,
  1057  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1058  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1059  //    Lesser General Public License for more details.
  1060  //
  1061  //    You should have received a copy of the GNU Lesser General Public
  1062  //    License along with the GNU C Library; if not, see
  1063  //    <http://www.gnu.org/licenses/>.
  1064  
  1065  // Never include this file directly; use <sys/types.h> instead.
  1066  
  1067  type int8_t = int8   /* stdint-intn.h:24:18 */
  1068  type int16_t = int16 /* stdint-intn.h:25:19 */
  1069  type int32_t = int32 /* stdint-intn.h:26:19 */
  1070  type int64_t = int64 /* stdint-intn.h:27:19 */
  1071  
  1072  // For GCC 2.7 and later, we can use specific type-size attributes.
  1073  
  1074  type u_int8_t = uint32  /* types.h:177:1 */
  1075  type u_int16_t = uint32 /* types.h:178:1 */
  1076  type u_int32_t = uint32 /* types.h:179:1 */
  1077  type u_int64_t = uint32 /* types.h:180:1 */
  1078  
  1079  type register_t = int32 /* types.h:182:13 */
  1080  
  1081  // A set of signals to be blocked, unblocked, or waited for.
  1082  type sigset_t = struct{ F__val [32]uint32 } /* sigset_t.h:7:20 */
  1083  
  1084  // Get definition of timer specification structures.
  1085  
  1086  // bits/types.h -- definitions of __*_t types underlying *_t types.
  1087  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
  1088  //    This file is part of the GNU C Library.
  1089  //
  1090  //    The GNU C Library is free software; you can redistribute it and/or
  1091  //    modify it under the terms of the GNU Lesser General Public
  1092  //    License as published by the Free Software Foundation; either
  1093  //    version 2.1 of the License, or (at your option) any later version.
  1094  //
  1095  //    The GNU C Library is distributed in the hope that it will be useful,
  1096  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1097  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1098  //    Lesser General Public License for more details.
  1099  //
  1100  //    You should have received a copy of the GNU Lesser General Public
  1101  //    License along with the GNU C Library; if not, see
  1102  //    <http://www.gnu.org/licenses/>.
  1103  
  1104  // Never include this file directly; use <sys/types.h> instead.
  1105  
  1106  // A time value that is accurate to the nearest
  1107  //    microsecond but also has a range of years.
  1108  type timeval = struct {
  1109  	Ftv_sec  int32
  1110  	Ftv_usec int32
  1111  } /* struct_timeval.h:8:1 */
  1112  
  1113  // NB: Include guard matches what <linux/time.h> uses.
  1114  
  1115  // bits/types.h -- definitions of __*_t types underlying *_t types.
  1116  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
  1117  //    This file is part of the GNU C Library.
  1118  //
  1119  //    The GNU C Library is free software; you can redistribute it and/or
  1120  //    modify it under the terms of the GNU Lesser General Public
  1121  //    License as published by the Free Software Foundation; either
  1122  //    version 2.1 of the License, or (at your option) any later version.
  1123  //
  1124  //    The GNU C Library is distributed in the hope that it will be useful,
  1125  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1126  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1127  //    Lesser General Public License for more details.
  1128  //
  1129  //    You should have received a copy of the GNU Lesser General Public
  1130  //    License along with the GNU C Library; if not, see
  1131  //    <http://www.gnu.org/licenses/>.
  1132  
  1133  // Never include this file directly; use <sys/types.h> instead.
  1134  
  1135  // POSIX.1b structure for a time value.  This is like a `struct timeval' but
  1136  //    has nanoseconds instead of microseconds.
  1137  type timespec = struct {
  1138  	Ftv_sec  int32
  1139  	Ftv_nsec int32
  1140  } /* struct_timespec.h:9:1 */
  1141  
  1142  // Some versions of <linux/posix_types.h> define this macros.
  1143  // It's easier to assume 8-bit bytes than to get CHAR_BIT.
  1144  
  1145  // fd_set for select and pselect.
  1146  type fd_set = struct{ Ffds_bits [32]int32 } /* select.h:70:5 */
  1147  
  1148  // Maximum number of file descriptors in `fd_set'.
  1149  
  1150  // Sometimes the fd_set member is assumed to have this type.
  1151  type fd_mask = int32 /* select.h:77:19 */
  1152  
  1153  // Define some inlines helping to catch common problems.
  1154  
  1155  type blksize_t = int32 /* types.h:202:21 */
  1156  
  1157  // Types from the Large File Support interface.
  1158  type blkcnt_t = int64    /* types.h:222:22 */ // Type to count number of disk blocks.
  1159  type fsblkcnt_t = uint64 /* types.h:226:24 */ // Type to count file system blocks.
  1160  type fsfilcnt_t = uint64 /* types.h:230:24 */ // Type to count file system inodes.
  1161  
  1162  type blkcnt64_t = int64    /* types.h:236:22 */ // Type to count number of disk blocks.
  1163  type fsblkcnt64_t = uint64 /* types.h:237:24 */ // Type to count file system blocks.
  1164  type fsfilcnt64_t = uint64 /* types.h:238:24 */ // Type to count file system inodes.
  1165  
  1166  // Now add the thread types.
  1167  // Declaration of common pthread types for all architectures.
  1168  //    Copyright (C) 2017-2018 Free Software Foundation, Inc.
  1169  //    This file is part of the GNU C Library.
  1170  //
  1171  //    The GNU C Library is free software; you can redistribute it and/or
  1172  //    modify it under the terms of the GNU Lesser General Public
  1173  //    License as published by the Free Software Foundation; either
  1174  //    version 2.1 of the License, or (at your option) any later version.
  1175  //
  1176  //    The GNU C Library is distributed in the hope that it will be useful,
  1177  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1178  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1179  //    Lesser General Public License for more details.
  1180  //
  1181  //    You should have received a copy of the GNU Lesser General Public
  1182  //    License along with the GNU C Library; if not, see
  1183  //    <http://www.gnu.org/licenses/>.
  1184  
  1185  // For internal mutex and condition variable definitions.
  1186  // Common threading primitives definitions for both POSIX and C11.
  1187  //    Copyright (C) 2017-2018 Free Software Foundation, Inc.
  1188  //    This file is part of the GNU C Library.
  1189  //
  1190  //    The GNU C Library is free software; you can redistribute it and/or
  1191  //    modify it under the terms of the GNU Lesser General Public
  1192  //    License as published by the Free Software Foundation; either
  1193  //    version 2.1 of the License, or (at your option) any later version.
  1194  //
  1195  //    The GNU C Library is distributed in the hope that it will be useful,
  1196  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1197  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1198  //    Lesser General Public License for more details.
  1199  //
  1200  //    You should have received a copy of the GNU Lesser General Public
  1201  //    License along with the GNU C Library; if not, see
  1202  //    <http://www.gnu.org/licenses/>.
  1203  
  1204  // Arch-specific definitions.  Each architecture must define the following
  1205  //    macros to define the expected sizes of pthread data types:
  1206  //
  1207  //    __SIZEOF_PTHREAD_ATTR_T        - size of pthread_attr_t.
  1208  //    __SIZEOF_PTHREAD_MUTEX_T       - size of pthread_mutex_t.
  1209  //    __SIZEOF_PTHREAD_MUTEXATTR_T   - size of pthread_mutexattr_t.
  1210  //    __SIZEOF_PTHREAD_COND_T        - size of pthread_cond_t.
  1211  //    __SIZEOF_PTHREAD_CONDATTR_T    - size of pthread_condattr_t.
  1212  //    __SIZEOF_PTHREAD_RWLOCK_T      - size of pthread_rwlock_t.
  1213  //    __SIZEOF_PTHREAD_RWLOCKATTR_T  - size of pthread_rwlockattr_t.
  1214  //    __SIZEOF_PTHREAD_BARRIER_T     - size of pthread_barrier_t.
  1215  //    __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t.
  1216  //
  1217  //    Also, the following macros must be define for internal pthread_mutex_t
  1218  //    struct definitions (struct __pthread_mutex_s):
  1219  //
  1220  //    __PTHREAD_COMPAT_PADDING_MID   - any additional members after 'kind'
  1221  // 				    and before '__spin' (for 64 bits) or
  1222  // 				    '__nusers' (for 32 bits).
  1223  //    __PTHREAD_COMPAT_PADDING_END   - any additional members at the end of
  1224  // 				    the internal structure.
  1225  //    __PTHREAD_MUTEX_LOCK_ELISION   - 1 if the architecture supports lock
  1226  // 				    elision or 0 otherwise.
  1227  //    __PTHREAD_MUTEX_NUSERS_AFTER_KIND - control where to put __nusers.  The
  1228  // 				       preferred value for new architectures
  1229  // 				       is 0.
  1230  //    __PTHREAD_MUTEX_USE_UNION      - control whether internal __spins and
  1231  // 				    __list will be place inside a union for
  1232  // 				    linuxthreads compatibility.
  1233  // 				    The preferred value for new architectures
  1234  // 				    is 0.
  1235  //
  1236  //    For a new port the preferred values for the required defines are:
  1237  //
  1238  //    #define __PTHREAD_COMPAT_PADDING_MID
  1239  //    #define __PTHREAD_COMPAT_PADDING_END
  1240  //    #define __PTHREAD_MUTEX_LOCK_ELISION         0
  1241  //    #define __PTHREAD_MUTEX_NUSERS_AFTER_KIND    0
  1242  //    #define __PTHREAD_MUTEX_USE_UNION            0
  1243  //
  1244  //    __PTHREAD_MUTEX_LOCK_ELISION can be set to 1 if the hardware plans to
  1245  //    eventually support lock elision using transactional memory.
  1246  //
  1247  //    The additional macro defines any constraint for the lock alignment
  1248  //    inside the thread structures:
  1249  //
  1250  //    __LOCK_ALIGNMENT - for internal lock/futex usage.
  1251  //
  1252  //    Same idea but for the once locking primitive:
  1253  //
  1254  //    __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition.
  1255  //
  1256  //    And finally the internal pthread_rwlock_t (struct __pthread_rwlock_arch_t)
  1257  //    must be defined.
  1258  //
  1259  // Copyright (C) 2002-2018 Free Software Foundation, Inc.
  1260  //    This file is part of the GNU C Library.
  1261  //
  1262  //    The GNU C Library is free software; you can redistribute it and/or
  1263  //    modify it under the terms of the GNU Lesser General Public
  1264  //    License as published by the Free Software Foundation; either
  1265  //    version 2.1 of the License, or (at your option) any later version.
  1266  //
  1267  //    The GNU C Library is distributed in the hope that it will be useful,
  1268  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1269  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1270  //    Lesser General Public License for more details.
  1271  //
  1272  //    You should have received a copy of the GNU Lesser General Public
  1273  //    License along with the GNU C Library.  If not, see
  1274  //    <http://www.gnu.org/licenses/>.
  1275  
  1276  // Copyright (C) 1992-2018 Free Software Foundation, Inc.
  1277  //    This file is part of the GNU C Library.
  1278  //
  1279  //    The GNU C Library is free software; you can redistribute it and/or
  1280  //    modify it under the terms of the GNU Lesser General Public
  1281  //    License as published by the Free Software Foundation; either
  1282  //    version 2.1 of the License, or (at your option) any later version.
  1283  //
  1284  //    The GNU C Library is distributed in the hope that it will be useful,
  1285  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1286  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1287  //    Lesser General Public License for more details.
  1288  //
  1289  //    You should have received a copy of the GNU Lesser General Public
  1290  //    License along with the GNU C Library; if not, see
  1291  //    <http://www.gnu.org/licenses/>.
  1292  
  1293  // Data structure for mutex handling.
  1294  
  1295  type __pthread_rwlock_arch_t = struct {
  1296  	F__readers       uint32
  1297  	F__writers       uint32
  1298  	F__wrphase_futex uint32
  1299  	F__writers_futex uint32
  1300  	F__pad3          uint32
  1301  	F__pad4          uint32
  1302  	F__flags         uint8
  1303  	F__shared        uint8
  1304  	F__pad1          uint8
  1305  	F__pad2          uint8
  1306  	F__cur_writer    int32
  1307  } /* pthreadtypes-arch.h:43:1 */
  1308  
  1309  // Common definition of pthread_mutex_t.
  1310  
  1311  type __pthread_internal_slist = struct{ F__next uintptr } /* thread-shared-types.h:88:9 */
  1312  
  1313  // Lock elision support.
  1314  // Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER.
  1315  
  1316  type __pthread_mutex_s = struct {
  1317  	F__lock   int32
  1318  	F__count  uint32
  1319  	F__owner  int32
  1320  	F__kind   int32
  1321  	F__nusers uint32
  1322  	F__20     struct{ F__spins int32 }
  1323  } /* thread-shared-types.h:118:1 */
  1324  
  1325  // Common definition of pthread_cond_t.
  1326  
  1327  type __pthread_cond_s = struct {
  1328  	F__0            struct{ F__wseq uint64 }
  1329  	F__8            struct{ F__g1_start uint64 }
  1330  	F__g_refs       [2]uint32
  1331  	F__g_size       [2]uint32
  1332  	F__g1_orig_size uint32
  1333  	F__wrefs        uint32
  1334  	F__g_signals    [2]uint32
  1335  } /* thread-shared-types.h:171:1 */
  1336  
  1337  // Thread identifiers.  The structure of the attribute type is not
  1338  //    exposed on purpose.
  1339  type pthread_t = uint32 /* pthreadtypes.h:27:27 */
  1340  
  1341  // Data structures for mutex handling.  The structure of the attribute
  1342  //    type is not exposed on purpose.
  1343  type pthread_mutexattr_t = struct {
  1344  	F__ccgo_pad1 [0]uint32
  1345  	F__size      [4]uint8
  1346  } /* pthreadtypes.h:36:3 */
  1347  
  1348  // Data structure for condition variable handling.  The structure of
  1349  //    the attribute type is not exposed on purpose.
  1350  type pthread_condattr_t = struct {
  1351  	F__ccgo_pad1 [0]uint32
  1352  	F__size      [4]uint8
  1353  } /* pthreadtypes.h:45:3 */
  1354  
  1355  // Keys for thread-specific data
  1356  type pthread_key_t = uint32 /* pthreadtypes.h:49:22 */
  1357  
  1358  // Once-only execution
  1359  type pthread_once_t = int32 /* pthreadtypes.h:53:30 */
  1360  
  1361  type pthread_attr_t1 = struct {
  1362  	F__ccgo_pad1 [0]uint32
  1363  	F__size      [36]uint8
  1364  } /* pthreadtypes.h:56:1 */
  1365  
  1366  type pthread_attr_t = pthread_attr_t1 /* pthreadtypes.h:62:30 */
  1367  
  1368  type pthread_mutex_t = struct{ F__data __pthread_mutex_s } /* pthreadtypes.h:72:3 */
  1369  
  1370  type pthread_cond_t = struct{ F__data __pthread_cond_s } /* pthreadtypes.h:80:3 */
  1371  
  1372  // Data structure for reader-writer lock variable handling.  The
  1373  //    structure of the attribute type is deliberately not exposed.
  1374  type pthread_rwlock_t = struct{ F__data __pthread_rwlock_arch_t } /* pthreadtypes.h:91:3 */
  1375  
  1376  type pthread_rwlockattr_t = struct {
  1377  	F__ccgo_pad1 [0]uint32
  1378  	F__size      [8]uint8
  1379  } /* pthreadtypes.h:97:3 */
  1380  
  1381  // POSIX spinlock data type.
  1382  type pthread_spinlock_t = int32 /* pthreadtypes.h:103:22 */
  1383  
  1384  // POSIX barriers data type.  The structure of the type is
  1385  //    deliberately not exposed.
  1386  type pthread_barrier_t = struct {
  1387  	F__ccgo_pad1 [0]uint32
  1388  	F__size      [20]uint8
  1389  } /* pthreadtypes.h:112:3 */
  1390  
  1391  type pthread_barrierattr_t = struct {
  1392  	F__ccgo_pad1 [0]uint32
  1393  	F__size      [4]uint8
  1394  } /* pthreadtypes.h:118:3 */
  1395  
  1396  // Reentrant versions of the `random' family of functions.
  1397  //    These functions all use the following data structure to contain
  1398  //    state, rather than global state variables.
  1399  
  1400  type random_data = struct {
  1401  	Ffptr      uintptr
  1402  	Frptr      uintptr
  1403  	Fstate     uintptr
  1404  	Frand_type int32
  1405  	Frand_deg  int32
  1406  	Frand_sep  int32
  1407  	Fend_ptr   uintptr
  1408  } /* stdlib.h:423:1 */
  1409  
  1410  // Data structure for communication with thread safe versions.  This
  1411  //    type is to be regarded as opaque.  It's only exported because users
  1412  //    have to allocate objects of this type.
  1413  type drand48_data = struct {
  1414  	F__x     [3]uint16
  1415  	F__old_x [3]uint16
  1416  	F__c     uint16
  1417  	F__init  uint16
  1418  	F__a     uint64
  1419  } /* stdlib.h:490:1 */
  1420  
  1421  type comparison_fn_t = uintptr /* stdlib.h:808:23 */
  1422  
  1423  // Floating-point inline functions for stdlib.h.
  1424  //    Copyright (C) 2012-2018 Free Software Foundation, Inc.
  1425  //    This file is part of the GNU C Library.
  1426  //
  1427  //    The GNU C Library is free software; you can redistribute it and/or
  1428  //    modify it under the terms of the GNU Lesser General Public
  1429  //    License as published by the Free Software Foundation; either
  1430  //    version 2.1 of the License, or (at your option) any later version.
  1431  //
  1432  //    The GNU C Library is distributed in the hope that it will be useful,
  1433  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1434  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1435  //    Lesser General Public License for more details.
  1436  //
  1437  //    You should have received a copy of the GNU Lesser General Public
  1438  //    License along with the GNU C Library; if not, see
  1439  //    <http://www.gnu.org/licenses/>.
  1440  
  1441  // Define some macros helping to catch buffer overflows.
  1442  
  1443  func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* Autest.c:35:1: */
  1444  	bp := tls.Alloc(32)
  1445  	defer tls.Free(32)
  1446  
  1447  	// var test_data Xauth at bp, 32
  1448  
  1449  	var name uintptr = ts      /* "XAU-TEST-1" */
  1450  	var data uintptr = ts + 11 /* "Do not begin the..." */
  1451  	var file uintptr = uintptr(0)
  1452  	var state int32 = 0
  1453  	var output uintptr
  1454  
  1455  	for *(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&argv, 4))) != 0 {
  1456  		if !(libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+60) != 0) {
  1457  			file = *(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&argv, 4)))
  1458  		} else if state == 0 {
  1459  			name = *(*uintptr)(unsafe.Pointer(argv))
  1460  			state++
  1461  		} else if state == 1 {
  1462  			data = *(*uintptr)(unsafe.Pointer(argv))
  1463  			state++
  1464  		}
  1465  	}
  1466  	(*Xauth)(unsafe.Pointer(bp /* &test_data */)).Ffamily = uint16(0)
  1467  	(*Xauth)(unsafe.Pointer(bp /* &test_data */)).Faddress_length = uint16(0)
  1468  	(*Xauth)(unsafe.Pointer(bp /* &test_data */)).Faddress = ts + 66 /* "" */
  1469  	(*Xauth)(unsafe.Pointer(bp /* &test_data */)).Fnumber_length = uint16(0)
  1470  	(*Xauth)(unsafe.Pointer(bp /* &test_data */)).Fnumber = ts + 66 /* "" */
  1471  	(*Xauth)(unsafe.Pointer(bp /* &test_data */)).Fname_length = uint16(libc.Xstrlen(tls, name))
  1472  	(*Xauth)(unsafe.Pointer(bp /* &test_data */)).Fname = name
  1473  	(*Xauth)(unsafe.Pointer(bp /* &test_data */)).Fdata_length = uint16(libc.Xstrlen(tls, data))
  1474  	(*Xauth)(unsafe.Pointer(bp /* &test_data */)).Fdata = data
  1475  	if !(file != 0) {
  1476  		output = libc.Xtmpfile(tls)
  1477  	} else {
  1478  		output = libc.Xfopen(tls, file, ts+67)
  1479  	}
  1480  	if output != 0 {
  1481  		state = xau.XXauWriteAuth(tls, output, bp)
  1482  		libc.Xfclose(tls, output)
  1483  	}
  1484  	if libc.AssignInt32(&state, 1) != 0 {
  1485  		return 0
  1486  	}
  1487  	return 1
  1488  }
  1489  
  1490  var ts1 = "XAU-TEST-1\x00Do not begin the test until instructed to do so.\x00-file\x00\x00w\x00"
  1491  var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data