github.com/jdgcs/sqlite3@v1.12.1-0.20210908114423-bc5f96e4dd51/internal/mptest/main_linux_amd64.go (about)

     1  // Code generated by 'ccgo -export-defines "" -o internal/mptest/main_linux_amd64.go -trace-translation-units testdata/sqlite-src-3360000/mptest/mptest.c -Itestdata/sqlite-amalgamation-3360000 -l modernc.org/sqlite/lib -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_OS_UNIX=1', 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/sqlite/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  const (
    25  	BIG_ENDIAN                            = 4321
    26  	BUFSIZ                                = 8192
    27  	BYTE_ORDER                            = 1234
    28  	DEFAULT_TIMEOUT                       = 10000
    29  	E2BIG                                 = 7
    30  	EACCES                                = 13
    31  	EADDRINUSE                            = 98
    32  	EADDRNOTAVAIL                         = 99
    33  	EADV                                  = 68
    34  	EAFNOSUPPORT                          = 97
    35  	EAGAIN                                = 11
    36  	EALREADY                              = 114
    37  	EBADE                                 = 52
    38  	EBADF                                 = 9
    39  	EBADFD                                = 77
    40  	EBADMSG                               = 74
    41  	EBADR                                 = 53
    42  	EBADRQC                               = 56
    43  	EBADSLT                               = 57
    44  	EBFONT                                = 59
    45  	EBUSY                                 = 16
    46  	ECANCELED                             = 125
    47  	ECHILD                                = 10
    48  	ECHRNG                                = 44
    49  	ECOMM                                 = 70
    50  	ECONNABORTED                          = 103
    51  	ECONNREFUSED                          = 111
    52  	ECONNRESET                            = 104
    53  	EDEADLK                               = 35
    54  	EDEADLOCK                             = 35
    55  	EDESTADDRREQ                          = 89
    56  	EDOM                                  = 33
    57  	EDOTDOT                               = 73
    58  	EDQUOT                                = 122
    59  	EEXIST                                = 17
    60  	EFAULT                                = 14
    61  	EFBIG                                 = 27
    62  	EHOSTDOWN                             = 112
    63  	EHOSTUNREACH                          = 113
    64  	EHWPOISON                             = 133
    65  	EIDRM                                 = 43
    66  	EILSEQ                                = 84
    67  	EINPROGRESS                           = 115
    68  	EINTR                                 = 4
    69  	EINVAL                                = 22
    70  	EIO                                   = 5
    71  	EISCONN                               = 106
    72  	EISDIR                                = 21
    73  	EISNAM                                = 120
    74  	EKEYEXPIRED                           = 127
    75  	EKEYREJECTED                          = 129
    76  	EKEYREVOKED                           = 128
    77  	EL2HLT                                = 51
    78  	EL2NSYNC                              = 45
    79  	EL3HLT                                = 46
    80  	EL3RST                                = 47
    81  	ELIBACC                               = 79
    82  	ELIBBAD                               = 80
    83  	ELIBEXEC                              = 83
    84  	ELIBMAX                               = 82
    85  	ELIBSCN                               = 81
    86  	ELNRNG                                = 48
    87  	ELOOP                                 = 40
    88  	EMEDIUMTYPE                           = 124
    89  	EMFILE                                = 24
    90  	EMLINK                                = 31
    91  	EMSGSIZE                              = 90
    92  	EMULTIHOP                             = 72
    93  	ENAMETOOLONG                          = 36
    94  	ENAVAIL                               = 119
    95  	ENETDOWN                              = 100
    96  	ENETRESET                             = 102
    97  	ENETUNREACH                           = 101
    98  	ENFILE                                = 23
    99  	ENOANO                                = 55
   100  	ENOBUFS                               = 105
   101  	ENOCSI                                = 50
   102  	ENODATA                               = 61
   103  	ENODEV                                = 19
   104  	ENOENT                                = 2
   105  	ENOEXEC                               = 8
   106  	ENOKEY                                = 126
   107  	ENOLCK                                = 37
   108  	ENOLINK                               = 67
   109  	ENOMEDIUM                             = 123
   110  	ENOMEM                                = 12
   111  	ENOMSG                                = 42
   112  	ENONET                                = 64
   113  	ENOPKG                                = 65
   114  	ENOPROTOOPT                           = 92
   115  	ENOSPC                                = 28
   116  	ENOSR                                 = 63
   117  	ENOSTR                                = 60
   118  	ENOSYS                                = 38
   119  	ENOTBLK                               = 15
   120  	ENOTCONN                              = 107
   121  	ENOTDIR                               = 20
   122  	ENOTEMPTY                             = 39
   123  	ENOTNAM                               = 118
   124  	ENOTRECOVERABLE                       = 131
   125  	ENOTSOCK                              = 88
   126  	ENOTSUP                               = 95
   127  	ENOTTY                                = 25
   128  	ENOTUNIQ                              = 76
   129  	ENXIO                                 = 6
   130  	EOF                                   = -1
   131  	EOPNOTSUPP                            = 95
   132  	EOVERFLOW                             = 75
   133  	EOWNERDEAD                            = 130
   134  	EPERM                                 = 1
   135  	EPFNOSUPPORT                          = 96
   136  	EPIPE                                 = 32
   137  	EPROTO                                = 71
   138  	EPROTONOSUPPORT                       = 93
   139  	EPROTOTYPE                            = 91
   140  	ERANGE                                = 34
   141  	EREMCHG                               = 78
   142  	EREMOTE                               = 66
   143  	EREMOTEIO                             = 121
   144  	ERESTART                              = 85
   145  	ERFKILL                               = 132
   146  	EROFS                                 = 30
   147  	ESHUTDOWN                             = 108
   148  	ESOCKTNOSUPPORT                       = 94
   149  	ESPIPE                                = 29
   150  	ESRCH                                 = 3
   151  	ESRMNT                                = 69
   152  	ESTALE                                = 116
   153  	ESTRPIPE                              = 86
   154  	ETIME                                 = 62
   155  	ETIMEDOUT                             = 110
   156  	ETOOMANYREFS                          = 109
   157  	ETXTBSY                               = 26
   158  	EUCLEAN                               = 117
   159  	EUNATCH                               = 49
   160  	EUSERS                                = 87
   161  	EWOULDBLOCK                           = 11
   162  	EXDEV                                 = 18
   163  	EXFULL                                = 54
   164  	EXIT_FAILURE                          = 1
   165  	EXIT_SUCCESS                          = 0
   166  	FD_SETSIZE                            = 1024
   167  	FILENAME_MAX                          = 4096
   168  	FOPEN_MAX                             = 16
   169  	FTS5_TOKENIZE_AUX                     = 0x0008
   170  	FTS5_TOKENIZE_DOCUMENT                = 0x0004
   171  	FTS5_TOKENIZE_PREFIX                  = 0x0002
   172  	FTS5_TOKENIZE_QUERY                   = 0x0001
   173  	FTS5_TOKEN_COLOCATED                  = 0x0001
   174  	FULLY_WITHIN                          = 2
   175  	F_LOCK                                = 1
   176  	F_OK                                  = 0
   177  	F_TEST                                = 3
   178  	F_TLOCK                               = 2
   179  	F_ULOCK                               = 0
   180  	HAVE_USLEEP                           = 1
   181  	LITTLE_ENDIAN                         = 1234
   182  	L_INCR                                = 1
   183  	L_SET                                 = 0
   184  	L_XTND                                = 2
   185  	L_ctermid                             = 9
   186  	L_tmpnam                              = 20
   187  	MX_ARG                                = 2
   188  	NDEBUG                                = 1
   189  	NOT_WITHIN                            = 0
   190  	PARTLY_WITHIN                         = 1
   191  	PDP_ENDIAN                            = 3412
   192  	P_tmpdir                              = "/tmp"
   193  	RAND_MAX                              = 2147483647
   194  	R_OK                                  = 4
   195  	SEEK_CUR                              = 1
   196  	SEEK_END                              = 2
   197  	SEEK_SET                              = 0
   198  	SQLITE3_H                             = 0
   199  	SQLITE3_TEXT                          = 3
   200  	SQLITE_ABORT                          = 4
   201  	SQLITE_ABORT_ROLLBACK                 = 516
   202  	SQLITE_ACCESS_EXISTS                  = 0
   203  	SQLITE_ACCESS_READ                    = 2
   204  	SQLITE_ACCESS_READWRITE               = 1
   205  	SQLITE_ALTER_TABLE                    = 26
   206  	SQLITE_ANALYZE                        = 28
   207  	SQLITE_ANY                            = 5
   208  	SQLITE_API                            = 0
   209  	SQLITE_APICALL                        = 0
   210  	SQLITE_ATTACH                         = 24
   211  	SQLITE_AUTH                           = 23
   212  	SQLITE_AUTH_USER                      = 279
   213  	SQLITE_BLOB                           = 4
   214  	SQLITE_BUSY                           = 5
   215  	SQLITE_BUSY_RECOVERY                  = 261
   216  	SQLITE_BUSY_SNAPSHOT                  = 517
   217  	SQLITE_BUSY_TIMEOUT                   = 773
   218  	SQLITE_CALLBACK                       = 0
   219  	SQLITE_CANTOPEN                       = 14
   220  	SQLITE_CANTOPEN_CONVPATH              = 1038
   221  	SQLITE_CANTOPEN_DIRTYWAL              = 1294
   222  	SQLITE_CANTOPEN_FULLPATH              = 782
   223  	SQLITE_CANTOPEN_ISDIR                 = 526
   224  	SQLITE_CANTOPEN_NOTEMPDIR             = 270
   225  	SQLITE_CANTOPEN_SYMLINK               = 1550
   226  	SQLITE_CDECL                          = 0
   227  	SQLITE_CHANGESETAPPLY_INVERT          = 0x0002
   228  	SQLITE_CHANGESETAPPLY_NOSAVEPOINT     = 0x0001
   229  	SQLITE_CHANGESETSTART_INVERT          = 0x0002
   230  	SQLITE_CHANGESET_ABORT                = 2
   231  	SQLITE_CHANGESET_CONFLICT             = 3
   232  	SQLITE_CHANGESET_CONSTRAINT           = 4
   233  	SQLITE_CHANGESET_DATA                 = 1
   234  	SQLITE_CHANGESET_FOREIGN_KEY          = 5
   235  	SQLITE_CHANGESET_NOTFOUND             = 2
   236  	SQLITE_CHANGESET_OMIT                 = 0
   237  	SQLITE_CHANGESET_REPLACE              = 1
   238  	SQLITE_CHECKPOINT_FULL                = 1
   239  	SQLITE_CHECKPOINT_PASSIVE             = 0
   240  	SQLITE_CHECKPOINT_RESTART             = 2
   241  	SQLITE_CHECKPOINT_TRUNCATE            = 3
   242  	SQLITE_CONFIG_COVERING_INDEX_SCAN     = 20
   243  	SQLITE_CONFIG_GETMALLOC               = 5
   244  	SQLITE_CONFIG_GETMUTEX                = 11
   245  	SQLITE_CONFIG_GETPCACHE               = 15
   246  	SQLITE_CONFIG_GETPCACHE2              = 19
   247  	SQLITE_CONFIG_HEAP                    = 8
   248  	SQLITE_CONFIG_LOG                     = 16
   249  	SQLITE_CONFIG_LOOKASIDE               = 13
   250  	SQLITE_CONFIG_MALLOC                  = 4
   251  	SQLITE_CONFIG_MEMDB_MAXSIZE           = 29
   252  	SQLITE_CONFIG_MEMSTATUS               = 9
   253  	SQLITE_CONFIG_MMAP_SIZE               = 22
   254  	SQLITE_CONFIG_MULTITHREAD             = 2
   255  	SQLITE_CONFIG_MUTEX                   = 10
   256  	SQLITE_CONFIG_PAGECACHE               = 7
   257  	SQLITE_CONFIG_PCACHE                  = 14
   258  	SQLITE_CONFIG_PCACHE2                 = 18
   259  	SQLITE_CONFIG_PCACHE_HDRSZ            = 24
   260  	SQLITE_CONFIG_PMASZ                   = 25
   261  	SQLITE_CONFIG_SCRATCH                 = 6
   262  	SQLITE_CONFIG_SERIALIZED              = 3
   263  	SQLITE_CONFIG_SINGLETHREAD            = 1
   264  	SQLITE_CONFIG_SMALL_MALLOC            = 27
   265  	SQLITE_CONFIG_SORTERREF_SIZE          = 28
   266  	SQLITE_CONFIG_SQLLOG                  = 21
   267  	SQLITE_CONFIG_STMTJRNL_SPILL          = 26
   268  	SQLITE_CONFIG_URI                     = 17
   269  	SQLITE_CONFIG_WIN32_HEAPSIZE          = 23
   270  	SQLITE_CONSTRAINT                     = 19
   271  	SQLITE_CONSTRAINT_CHECK               = 275
   272  	SQLITE_CONSTRAINT_COMMITHOOK          = 531
   273  	SQLITE_CONSTRAINT_FOREIGNKEY          = 787
   274  	SQLITE_CONSTRAINT_FUNCTION            = 1043
   275  	SQLITE_CONSTRAINT_NOTNULL             = 1299
   276  	SQLITE_CONSTRAINT_PINNED              = 2835
   277  	SQLITE_CONSTRAINT_PRIMARYKEY          = 1555
   278  	SQLITE_CONSTRAINT_ROWID               = 2579
   279  	SQLITE_CONSTRAINT_TRIGGER             = 1811
   280  	SQLITE_CONSTRAINT_UNIQUE              = 2067
   281  	SQLITE_CONSTRAINT_VTAB                = 2323
   282  	SQLITE_COPY                           = 0
   283  	SQLITE_CORE                           = 1
   284  	SQLITE_CORRUPT                        = 11
   285  	SQLITE_CORRUPT_INDEX                  = 779
   286  	SQLITE_CORRUPT_SEQUENCE               = 523
   287  	SQLITE_CORRUPT_VTAB                   = 267
   288  	SQLITE_CREATE_INDEX                   = 1
   289  	SQLITE_CREATE_TABLE                   = 2
   290  	SQLITE_CREATE_TEMP_INDEX              = 3
   291  	SQLITE_CREATE_TEMP_TABLE              = 4
   292  	SQLITE_CREATE_TEMP_TRIGGER            = 5
   293  	SQLITE_CREATE_TEMP_VIEW               = 6
   294  	SQLITE_CREATE_TRIGGER                 = 7
   295  	SQLITE_CREATE_VIEW                    = 8
   296  	SQLITE_CREATE_VTABLE                  = 29
   297  	SQLITE_DBCONFIG_DEFENSIVE             = 1010
   298  	SQLITE_DBCONFIG_DQS_DDL               = 1014
   299  	SQLITE_DBCONFIG_DQS_DML               = 1013
   300  	SQLITE_DBCONFIG_ENABLE_FKEY           = 1002
   301  	SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER = 1004
   302  	SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION = 1005
   303  	SQLITE_DBCONFIG_ENABLE_QPSG           = 1007
   304  	SQLITE_DBCONFIG_ENABLE_TRIGGER        = 1003
   305  	SQLITE_DBCONFIG_ENABLE_VIEW           = 1015
   306  	SQLITE_DBCONFIG_LEGACY_ALTER_TABLE    = 1012
   307  	SQLITE_DBCONFIG_LEGACY_FILE_FORMAT    = 1016
   308  	SQLITE_DBCONFIG_LOOKASIDE             = 1001
   309  	SQLITE_DBCONFIG_MAINDBNAME            = 1000
   310  	SQLITE_DBCONFIG_MAX                   = 1017
   311  	SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE      = 1006
   312  	SQLITE_DBCONFIG_RESET_DATABASE        = 1009
   313  	SQLITE_DBCONFIG_TRIGGER_EQP           = 1008
   314  	SQLITE_DBCONFIG_TRUSTED_SCHEMA        = 1017
   315  	SQLITE_DBCONFIG_WRITABLE_SCHEMA       = 1011
   316  	SQLITE_DBSTATUS_CACHE_HIT             = 7
   317  	SQLITE_DBSTATUS_CACHE_MISS            = 8
   318  	SQLITE_DBSTATUS_CACHE_SPILL           = 12
   319  	SQLITE_DBSTATUS_CACHE_USED            = 1
   320  	SQLITE_DBSTATUS_CACHE_USED_SHARED     = 11
   321  	SQLITE_DBSTATUS_CACHE_WRITE           = 9
   322  	SQLITE_DBSTATUS_DEFERRED_FKS          = 10
   323  	SQLITE_DBSTATUS_LOOKASIDE_HIT         = 4
   324  	SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL   = 6
   325  	SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE   = 5
   326  	SQLITE_DBSTATUS_LOOKASIDE_USED        = 0
   327  	SQLITE_DBSTATUS_MAX                   = 12
   328  	SQLITE_DBSTATUS_SCHEMA_USED           = 2
   329  	SQLITE_DBSTATUS_STMT_USED             = 3
   330  	SQLITE_DELETE                         = 9
   331  	SQLITE_DENY                           = 1
   332  	SQLITE_DEPRECATED                     = 0
   333  	SQLITE_DESERIALIZE_FREEONCLOSE        = 1
   334  	SQLITE_DESERIALIZE_READONLY           = 4
   335  	SQLITE_DESERIALIZE_RESIZEABLE         = 2
   336  	SQLITE_DETACH                         = 25
   337  	SQLITE_DETERMINISTIC                  = 0x000000800
   338  	SQLITE_DIRECTONLY                     = 0x000080000
   339  	SQLITE_DONE                           = 101
   340  	SQLITE_DROP_INDEX                     = 10
   341  	SQLITE_DROP_TABLE                     = 11
   342  	SQLITE_DROP_TEMP_INDEX                = 12
   343  	SQLITE_DROP_TEMP_TABLE                = 13
   344  	SQLITE_DROP_TEMP_TRIGGER              = 14
   345  	SQLITE_DROP_TEMP_VIEW                 = 15
   346  	SQLITE_DROP_TRIGGER                   = 16
   347  	SQLITE_DROP_VIEW                      = 17
   348  	SQLITE_DROP_VTABLE                    = 30
   349  	SQLITE_EMPTY                          = 16
   350  	SQLITE_ENABLE_COLUMN_METADATA         = 1
   351  	SQLITE_ENABLE_FTS5                    = 1
   352  	SQLITE_ENABLE_GEOPOLY                 = 1
   353  	SQLITE_ENABLE_JSON1                   = 1
   354  	SQLITE_ENABLE_MEMORY_MANAGEMENT       = 1
   355  	SQLITE_ENABLE_OFFSET_SQL_FUNC         = 1
   356  	SQLITE_ENABLE_PREUPDATE_HOOK          = 1
   357  	SQLITE_ENABLE_RBU                     = 1
   358  	SQLITE_ENABLE_RTREE                   = 1
   359  	SQLITE_ENABLE_SESSION                 = 1
   360  	SQLITE_ENABLE_SNAPSHOT                = 1
   361  	SQLITE_ENABLE_STAT4                   = 1
   362  	SQLITE_ENABLE_UNLOCK_NOTIFY           = 1
   363  	SQLITE_ERROR                          = 1
   364  	SQLITE_ERROR_MISSING_COLLSEQ          = 257
   365  	SQLITE_ERROR_RETRY                    = 513
   366  	SQLITE_ERROR_SNAPSHOT                 = 769
   367  	SQLITE_EXPERIMENTAL                   = 0
   368  	SQLITE_FAIL                           = 3
   369  	SQLITE_FCNTL_BEGIN_ATOMIC_WRITE       = 31
   370  	SQLITE_FCNTL_BUSYHANDLER              = 15
   371  	SQLITE_FCNTL_CHUNK_SIZE               = 6
   372  	SQLITE_FCNTL_CKPT_DONE                = 37
   373  	SQLITE_FCNTL_CKPT_START               = 39
   374  	SQLITE_FCNTL_CKSM_FILE                = 41
   375  	SQLITE_FCNTL_COMMIT_ATOMIC_WRITE      = 32
   376  	SQLITE_FCNTL_COMMIT_PHASETWO          = 22
   377  	SQLITE_FCNTL_DATA_VERSION             = 35
   378  	SQLITE_FCNTL_EXTERNAL_READER          = 40
   379  	SQLITE_FCNTL_FILE_POINTER             = 7
   380  	SQLITE_FCNTL_GET_LOCKPROXYFILE        = 2
   381  	SQLITE_FCNTL_HAS_MOVED                = 20
   382  	SQLITE_FCNTL_JOURNAL_POINTER          = 28
   383  	SQLITE_FCNTL_LAST_ERRNO               = 4
   384  	SQLITE_FCNTL_LOCKSTATE                = 1
   385  	SQLITE_FCNTL_LOCK_TIMEOUT             = 34
   386  	SQLITE_FCNTL_MMAP_SIZE                = 18
   387  	SQLITE_FCNTL_OVERWRITE                = 11
   388  	SQLITE_FCNTL_PDB                      = 30
   389  	SQLITE_FCNTL_PERSIST_WAL              = 10
   390  	SQLITE_FCNTL_POWERSAFE_OVERWRITE      = 13
   391  	SQLITE_FCNTL_PRAGMA                   = 14
   392  	SQLITE_FCNTL_RBU                      = 26
   393  	SQLITE_FCNTL_RESERVE_BYTES            = 38
   394  	SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE    = 33
   395  	SQLITE_FCNTL_SET_LOCKPROXYFILE        = 3
   396  	SQLITE_FCNTL_SIZE_HINT                = 5
   397  	SQLITE_FCNTL_SIZE_LIMIT               = 36
   398  	SQLITE_FCNTL_SYNC                     = 21
   399  	SQLITE_FCNTL_SYNC_OMITTED             = 8
   400  	SQLITE_FCNTL_TEMPFILENAME             = 16
   401  	SQLITE_FCNTL_TRACE                    = 19
   402  	SQLITE_FCNTL_VFSNAME                  = 12
   403  	SQLITE_FCNTL_VFS_POINTER              = 27
   404  	SQLITE_FCNTL_WAL_BLOCK                = 24
   405  	SQLITE_FCNTL_WIN32_AV_RETRY           = 9
   406  	SQLITE_FCNTL_WIN32_GET_HANDLE         = 29
   407  	SQLITE_FCNTL_WIN32_SET_HANDLE         = 23
   408  	SQLITE_FCNTL_ZIPVFS                   = 25
   409  	SQLITE_FLOAT                          = 2
   410  	SQLITE_FORMAT                         = 24
   411  	SQLITE_FULL                           = 13
   412  	SQLITE_FUNCTION                       = 31
   413  	SQLITE_GET_LOCKPROXYFILE              = 2
   414  	SQLITE_IGNORE                         = 2
   415  	SQLITE_INDEX_CONSTRAINT_EQ            = 2
   416  	SQLITE_INDEX_CONSTRAINT_FUNCTION      = 150
   417  	SQLITE_INDEX_CONSTRAINT_GE            = 32
   418  	SQLITE_INDEX_CONSTRAINT_GLOB          = 66
   419  	SQLITE_INDEX_CONSTRAINT_GT            = 4
   420  	SQLITE_INDEX_CONSTRAINT_IS            = 72
   421  	SQLITE_INDEX_CONSTRAINT_ISNOT         = 69
   422  	SQLITE_INDEX_CONSTRAINT_ISNOTNULL     = 70
   423  	SQLITE_INDEX_CONSTRAINT_ISNULL        = 71
   424  	SQLITE_INDEX_CONSTRAINT_LE            = 8
   425  	SQLITE_INDEX_CONSTRAINT_LIKE          = 65
   426  	SQLITE_INDEX_CONSTRAINT_LT            = 16
   427  	SQLITE_INDEX_CONSTRAINT_MATCH         = 64
   428  	SQLITE_INDEX_CONSTRAINT_NE            = 68
   429  	SQLITE_INDEX_CONSTRAINT_REGEXP        = 67
   430  	SQLITE_INDEX_SCAN_UNIQUE              = 1
   431  	SQLITE_INNOCUOUS                      = 0x000200000
   432  	SQLITE_INSERT                         = 18
   433  	SQLITE_INTEGER                        = 1
   434  	SQLITE_INTERNAL                       = 2
   435  	SQLITE_INTERRUPT                      = 9
   436  	SQLITE_IOCAP_ATOMIC                   = 0x00000001
   437  	SQLITE_IOCAP_ATOMIC16K                = 0x00000040
   438  	SQLITE_IOCAP_ATOMIC1K                 = 0x00000004
   439  	SQLITE_IOCAP_ATOMIC2K                 = 0x00000008
   440  	SQLITE_IOCAP_ATOMIC32K                = 0x00000080
   441  	SQLITE_IOCAP_ATOMIC4K                 = 0x00000010
   442  	SQLITE_IOCAP_ATOMIC512                = 0x00000002
   443  	SQLITE_IOCAP_ATOMIC64K                = 0x00000100
   444  	SQLITE_IOCAP_ATOMIC8K                 = 0x00000020
   445  	SQLITE_IOCAP_BATCH_ATOMIC             = 0x00004000
   446  	SQLITE_IOCAP_IMMUTABLE                = 0x00002000
   447  	SQLITE_IOCAP_POWERSAFE_OVERWRITE      = 0x00001000
   448  	SQLITE_IOCAP_SAFE_APPEND              = 0x00000200
   449  	SQLITE_IOCAP_SEQUENTIAL               = 0x00000400
   450  	SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN    = 0x00000800
   451  	SQLITE_IOERR                          = 10
   452  	SQLITE_IOERR_ACCESS                   = 3338
   453  	SQLITE_IOERR_AUTH                     = 7178
   454  	SQLITE_IOERR_BEGIN_ATOMIC             = 7434
   455  	SQLITE_IOERR_BLOCKED                  = 2826
   456  	SQLITE_IOERR_CHECKRESERVEDLOCK        = 3594
   457  	SQLITE_IOERR_CLOSE                    = 4106
   458  	SQLITE_IOERR_COMMIT_ATOMIC            = 7690
   459  	SQLITE_IOERR_CONVPATH                 = 6666
   460  	SQLITE_IOERR_CORRUPTFS                = 8458
   461  	SQLITE_IOERR_DATA                     = 8202
   462  	SQLITE_IOERR_DELETE                   = 2570
   463  	SQLITE_IOERR_DELETE_NOENT             = 5898
   464  	SQLITE_IOERR_DIR_CLOSE                = 4362
   465  	SQLITE_IOERR_DIR_FSYNC                = 1290
   466  	SQLITE_IOERR_FSTAT                    = 1802
   467  	SQLITE_IOERR_FSYNC                    = 1034
   468  	SQLITE_IOERR_GETTEMPPATH              = 6410
   469  	SQLITE_IOERR_LOCK                     = 3850
   470  	SQLITE_IOERR_MMAP                     = 6154
   471  	SQLITE_IOERR_NOMEM                    = 3082
   472  	SQLITE_IOERR_RDLOCK                   = 2314
   473  	SQLITE_IOERR_READ                     = 266
   474  	SQLITE_IOERR_ROLLBACK_ATOMIC          = 7946
   475  	SQLITE_IOERR_SEEK                     = 5642
   476  	SQLITE_IOERR_SHMLOCK                  = 5130
   477  	SQLITE_IOERR_SHMMAP                   = 5386
   478  	SQLITE_IOERR_SHMOPEN                  = 4618
   479  	SQLITE_IOERR_SHMSIZE                  = 4874
   480  	SQLITE_IOERR_SHORT_READ               = 522
   481  	SQLITE_IOERR_TRUNCATE                 = 1546
   482  	SQLITE_IOERR_UNLOCK                   = 2058
   483  	SQLITE_IOERR_VNODE                    = 6922
   484  	SQLITE_IOERR_WRITE                    = 778
   485  	SQLITE_LAST_ERRNO                     = 4
   486  	SQLITE_LIKE_DOESNT_MATCH_BLOBS        = 1
   487  	SQLITE_LIMIT_ATTACHED                 = 7
   488  	SQLITE_LIMIT_COLUMN                   = 2
   489  	SQLITE_LIMIT_COMPOUND_SELECT          = 4
   490  	SQLITE_LIMIT_EXPR_DEPTH               = 3
   491  	SQLITE_LIMIT_FUNCTION_ARG             = 6
   492  	SQLITE_LIMIT_LENGTH                   = 0
   493  	SQLITE_LIMIT_LIKE_PATTERN_LENGTH      = 8
   494  	SQLITE_LIMIT_SQL_LENGTH               = 1
   495  	SQLITE_LIMIT_TRIGGER_DEPTH            = 10
   496  	SQLITE_LIMIT_VARIABLE_NUMBER          = 9
   497  	SQLITE_LIMIT_VDBE_OP                  = 5
   498  	SQLITE_LIMIT_WORKER_THREADS           = 11
   499  	SQLITE_LOCKED                         = 6
   500  	SQLITE_LOCKED_SHAREDCACHE             = 262
   501  	SQLITE_LOCKED_VTAB                    = 518
   502  	SQLITE_LOCK_EXCLUSIVE                 = 4
   503  	SQLITE_LOCK_NONE                      = 0
   504  	SQLITE_LOCK_PENDING                   = 3
   505  	SQLITE_LOCK_RESERVED                  = 2
   506  	SQLITE_LOCK_SHARED                    = 1
   507  	SQLITE_MISMATCH                       = 20
   508  	SQLITE_MISUSE                         = 21
   509  	SQLITE_MUTEX_APPDEF                   = 1
   510  	SQLITE_MUTEX_FAST                     = 0
   511  	SQLITE_MUTEX_RECURSIVE                = 1
   512  	SQLITE_MUTEX_STATIC_APP1              = 8
   513  	SQLITE_MUTEX_STATIC_APP2              = 9
   514  	SQLITE_MUTEX_STATIC_APP3              = 10
   515  	SQLITE_MUTEX_STATIC_LRU               = 6
   516  	SQLITE_MUTEX_STATIC_LRU2              = 7
   517  	SQLITE_MUTEX_STATIC_MAIN              = 2
   518  	SQLITE_MUTEX_STATIC_MASTER            = 2
   519  	SQLITE_MUTEX_STATIC_MEM               = 3
   520  	SQLITE_MUTEX_STATIC_MEM2              = 4
   521  	SQLITE_MUTEX_STATIC_OPEN              = 4
   522  	SQLITE_MUTEX_STATIC_PMEM              = 7
   523  	SQLITE_MUTEX_STATIC_PRNG              = 5
   524  	SQLITE_MUTEX_STATIC_VFS1              = 11
   525  	SQLITE_MUTEX_STATIC_VFS2              = 12
   526  	SQLITE_MUTEX_STATIC_VFS3              = 13
   527  	SQLITE_NOLFS                          = 22
   528  	SQLITE_NOMEM                          = 7
   529  	SQLITE_NOTADB                         = 26
   530  	SQLITE_NOTFOUND                       = 12
   531  	SQLITE_NOTICE                         = 27
   532  	SQLITE_NOTICE_RECOVER_ROLLBACK        = 539
   533  	SQLITE_NOTICE_RECOVER_WAL             = 283
   534  	SQLITE_NULL                           = 5
   535  	SQLITE_OK                             = 0
   536  	SQLITE_OK_LOAD_PERMANENTLY            = 256
   537  	SQLITE_OK_SYMLINK                     = 512
   538  	SQLITE_OPEN_AUTOPROXY                 = 0x00000020
   539  	SQLITE_OPEN_CREATE                    = 0x00000004
   540  	SQLITE_OPEN_DELETEONCLOSE             = 0x00000008
   541  	SQLITE_OPEN_EXCLUSIVE                 = 0x00000010
   542  	SQLITE_OPEN_FULLMUTEX                 = 0x00010000
   543  	SQLITE_OPEN_MAIN_DB                   = 0x00000100
   544  	SQLITE_OPEN_MAIN_JOURNAL              = 0x00000800
   545  	SQLITE_OPEN_MASTER_JOURNAL            = 0x00004000
   546  	SQLITE_OPEN_MEMORY                    = 0x00000080
   547  	SQLITE_OPEN_NOFOLLOW                  = 0x01000000
   548  	SQLITE_OPEN_NOMUTEX                   = 0x00008000
   549  	SQLITE_OPEN_PRIVATECACHE              = 0x00040000
   550  	SQLITE_OPEN_READONLY                  = 0x00000001
   551  	SQLITE_OPEN_READWRITE                 = 0x00000002
   552  	SQLITE_OPEN_SHAREDCACHE               = 0x00020000
   553  	SQLITE_OPEN_SUBJOURNAL                = 0x00002000
   554  	SQLITE_OPEN_SUPER_JOURNAL             = 0x00004000
   555  	SQLITE_OPEN_TEMP_DB                   = 0x00000200
   556  	SQLITE_OPEN_TEMP_JOURNAL              = 0x00001000
   557  	SQLITE_OPEN_TRANSIENT_DB              = 0x00000400
   558  	SQLITE_OPEN_URI                       = 0x00000040
   559  	SQLITE_OPEN_WAL                       = 0x00080000
   560  	SQLITE_OS_UNIX                        = 1
   561  	SQLITE_PERM                           = 3
   562  	SQLITE_PRAGMA                         = 19
   563  	SQLITE_PREPARE_NORMALIZE              = 0x02
   564  	SQLITE_PREPARE_NO_VTAB                = 0x04
   565  	SQLITE_PREPARE_PERSISTENT             = 0x01
   566  	SQLITE_PROTOCOL                       = 15
   567  	SQLITE_RANGE                          = 25
   568  	SQLITE_READ                           = 20
   569  	SQLITE_READONLY                       = 8
   570  	SQLITE_READONLY_CANTINIT              = 1288
   571  	SQLITE_READONLY_CANTLOCK              = 520
   572  	SQLITE_READONLY_DBMOVED               = 1032
   573  	SQLITE_READONLY_DIRECTORY             = 1544
   574  	SQLITE_READONLY_RECOVERY              = 264
   575  	SQLITE_READONLY_ROLLBACK              = 776
   576  	SQLITE_RECURSIVE                      = 33
   577  	SQLITE_REINDEX                        = 27
   578  	SQLITE_REPLACE                        = 5
   579  	SQLITE_ROLLBACK                       = 1
   580  	SQLITE_ROW                            = 100
   581  	SQLITE_SAVEPOINT                      = 32
   582  	SQLITE_SCANSTAT_EST                   = 2
   583  	SQLITE_SCANSTAT_EXPLAIN               = 4
   584  	SQLITE_SCANSTAT_NAME                  = 3
   585  	SQLITE_SCANSTAT_NLOOP                 = 0
   586  	SQLITE_SCANSTAT_NVISIT                = 1
   587  	SQLITE_SCANSTAT_SELECTID              = 5
   588  	SQLITE_SCHEMA                         = 17
   589  	SQLITE_SELECT                         = 21
   590  	SQLITE_SERIALIZE_NOCOPY               = 0x001
   591  	SQLITE_SESSION_CONFIG_STRMSIZE        = 1
   592  	SQLITE_SESSION_OBJCONFIG_SIZE         = 1
   593  	SQLITE_SET_LOCKPROXYFILE              = 3
   594  	SQLITE_SHM_EXCLUSIVE                  = 8
   595  	SQLITE_SHM_LOCK                       = 2
   596  	SQLITE_SHM_NLOCK                      = 8
   597  	SQLITE_SHM_SHARED                     = 4
   598  	SQLITE_SHM_UNLOCK                     = 1
   599  	SQLITE_SOUNDEX                        = 1
   600  	SQLITE_SOURCE_ID                      = "2021-06-18 18:36:39 5c9a6c06871cb9fe42814af9c039eb6da5427a6ec28f187af7ebfb62eafa66e5"
   601  	SQLITE_STATUS_MALLOC_COUNT            = 9
   602  	SQLITE_STATUS_MALLOC_SIZE             = 5
   603  	SQLITE_STATUS_MEMORY_USED             = 0
   604  	SQLITE_STATUS_PAGECACHE_OVERFLOW      = 2
   605  	SQLITE_STATUS_PAGECACHE_SIZE          = 7
   606  	SQLITE_STATUS_PAGECACHE_USED          = 1
   607  	SQLITE_STATUS_PARSER_STACK            = 6
   608  	SQLITE_STATUS_SCRATCH_OVERFLOW        = 4
   609  	SQLITE_STATUS_SCRATCH_SIZE            = 8
   610  	SQLITE_STATUS_SCRATCH_USED            = 3
   611  	SQLITE_STDCALL                        = 0
   612  	SQLITE_STMTSTATUS_AUTOINDEX           = 3
   613  	SQLITE_STMTSTATUS_FULLSCAN_STEP       = 1
   614  	SQLITE_STMTSTATUS_MEMUSED             = 99
   615  	SQLITE_STMTSTATUS_REPREPARE           = 5
   616  	SQLITE_STMTSTATUS_RUN                 = 6
   617  	SQLITE_STMTSTATUS_SORT                = 2
   618  	SQLITE_STMTSTATUS_VM_STEP             = 4
   619  	SQLITE_SUBTYPE                        = 0x000100000
   620  	SQLITE_SYNC_DATAONLY                  = 0x00010
   621  	SQLITE_SYNC_FULL                      = 0x00003
   622  	SQLITE_SYNC_NORMAL                    = 0x00002
   623  	SQLITE_SYSAPI                         = 0
   624  	SQLITE_TESTCTRL_ALWAYS                = 13
   625  	SQLITE_TESTCTRL_ASSERT                = 12
   626  	SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS   = 10
   627  	SQLITE_TESTCTRL_BITVEC_TEST           = 8
   628  	SQLITE_TESTCTRL_BYTEORDER             = 22
   629  	SQLITE_TESTCTRL_EXPLAIN_STMT          = 19
   630  	SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS   = 29
   631  	SQLITE_TESTCTRL_FAULT_INSTALL         = 9
   632  	SQLITE_TESTCTRL_FIRST                 = 5
   633  	SQLITE_TESTCTRL_IMPOSTER              = 25
   634  	SQLITE_TESTCTRL_INTERNAL_FUNCTIONS    = 17
   635  	SQLITE_TESTCTRL_ISINIT                = 23
   636  	SQLITE_TESTCTRL_ISKEYWORD             = 16
   637  	SQLITE_TESTCTRL_LAST                  = 32
   638  	SQLITE_TESTCTRL_LOCALTIME_FAULT       = 18
   639  	SQLITE_TESTCTRL_NEVER_CORRUPT         = 20
   640  	SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD  = 19
   641  	SQLITE_TESTCTRL_OPTIMIZATIONS         = 15
   642  	SQLITE_TESTCTRL_PARSER_COVERAGE       = 26
   643  	SQLITE_TESTCTRL_PENDING_BYTE          = 11
   644  	SQLITE_TESTCTRL_PRNG_RESET            = 7
   645  	SQLITE_TESTCTRL_PRNG_RESTORE          = 6
   646  	SQLITE_TESTCTRL_PRNG_SAVE             = 5
   647  	SQLITE_TESTCTRL_PRNG_SEED             = 28
   648  	SQLITE_TESTCTRL_RESERVE               = 14
   649  	SQLITE_TESTCTRL_RESULT_INTREAL        = 27
   650  	SQLITE_TESTCTRL_SCRATCHMALLOC         = 17
   651  	SQLITE_TESTCTRL_SEEK_COUNT            = 30
   652  	SQLITE_TESTCTRL_SORTER_MMAP           = 24
   653  	SQLITE_TESTCTRL_TRACEFLAGS            = 31
   654  	SQLITE_TESTCTRL_TUNE                  = 32
   655  	SQLITE_TESTCTRL_VDBE_COVERAGE         = 21
   656  	SQLITE_TEXT                           = 3
   657  	SQLITE_THREADSAFE                     = 1
   658  	SQLITE_TOOBIG                         = 18
   659  	SQLITE_TRACE_CLOSE                    = 0x08
   660  	SQLITE_TRACE_PROFILE                  = 0x02
   661  	SQLITE_TRACE_ROW                      = 0x04
   662  	SQLITE_TRACE_STMT                     = 0x01
   663  	SQLITE_TRANSACTION                    = 22
   664  	SQLITE_TXN_NONE                       = 0
   665  	SQLITE_TXN_READ                       = 1
   666  	SQLITE_TXN_WRITE                      = 2
   667  	SQLITE_UPDATE                         = 23
   668  	SQLITE_UTF16                          = 4
   669  	SQLITE_UTF16BE                        = 3
   670  	SQLITE_UTF16LE                        = 2
   671  	SQLITE_UTF16_ALIGNED                  = 8
   672  	SQLITE_UTF8                           = 1
   673  	SQLITE_VERSION                        = "3.36.0"
   674  	SQLITE_VERSION_NUMBER                 = 3036000
   675  	SQLITE_VTAB_CONSTRAINT_SUPPORT        = 1
   676  	SQLITE_VTAB_DIRECTONLY                = 3
   677  	SQLITE_VTAB_INNOCUOUS                 = 2
   678  	SQLITE_WARNING                        = 28
   679  	SQLITE_WARNING_AUTOINDEX              = 284
   680  	SQLITE_WIN32_DATA_DIRECTORY_TYPE      = 1
   681  	SQLITE_WIN32_TEMP_DIRECTORY_TYPE      = 2
   682  	STDERR_FILENO                         = 2
   683  	STDIN_FILENO                          = 0
   684  	STDOUT_FILENO                         = 1
   685  	TMP_MAX                               = 238328
   686  	WCONTINUED                            = 8
   687  	WEXITED                               = 4
   688  	WNOHANG                               = 1
   689  	WNOWAIT                               = 0x01000000
   690  	WSTOPPED                              = 2
   691  	WUNTRACED                             = 2
   692  	W_OK                                  = 2
   693  	X_OK                                  = 1
   694  	X_ALLOCA_H                            = 1
   695  	X_ANSI_STDARG_H_                      = 0
   696  	X_ASM_GENERIC_ERRNO_BASE_H            = 0
   697  	X_ASM_GENERIC_ERRNO_H                 = 0
   698  	X_ASSERT_H                            = 1
   699  	X_ATFILE_SOURCE                       = 1
   700  	X_BITS_BYTESWAP_H                     = 1
   701  	X_BITS_ERRNO_H                        = 1
   702  	X_BITS_FLOATN_COMMON_H                = 0
   703  	X_BITS_FLOATN_H                       = 0
   704  	X_BITS_POSIX_OPT_H                    = 1
   705  	X_BITS_PTHREADTYPES_ARCH_H            = 1
   706  	X_BITS_PTHREADTYPES_COMMON_H          = 1
   707  	X_BITS_STDINT_INTN_H                  = 1
   708  	X_BITS_STDIO_LIM_H                    = 1
   709  	X_BITS_TYPESIZES_H                    = 1
   710  	X_BITS_TYPES_H                        = 1
   711  	X_BITS_TYPES_LOCALE_T_H               = 1
   712  	X_BITS_TYPES___LOCALE_T_H             = 1
   713  	X_BITS_UINTN_IDENTITY_H               = 1
   714  	X_BSD_SIZE_T_                         = 0
   715  	X_BSD_SIZE_T_DEFINED_                 = 0
   716  	X_CTYPE_H                             = 1
   717  	X_DEFAULT_SOURCE                      = 1
   718  	X_ENDIAN_H                            = 1
   719  	X_ERRNO_H                             = 1
   720  	X_FEATURES_H                          = 1
   721  	X_FILE_OFFSET_BITS                    = 64
   722  	X_FTS5_H                              = 0
   723  	X_GCC_SIZE_T                          = 0
   724  	X_GCC_WCHAR_T                         = 0
   725  	X_GETOPT_CORE_H                       = 1
   726  	X_GETOPT_POSIX_H                      = 1
   727  	X_IOFBF                               = 0
   728  	X_IOLBF                               = 1
   729  	X_IONBF                               = 2
   730  	X_IO_EOF_SEEN                         = 0x0010
   731  	X_IO_ERR_SEEN                         = 0x0020
   732  	X_IO_USER_LOCK                        = 0x8000
   733  	X_LFS64_ASYNCHRONOUS_IO               = 1
   734  	X_LFS64_LARGEFILE                     = 1
   735  	X_LFS64_STDIO                         = 1
   736  	X_LFS_ASYNCHRONOUS_IO                 = 1
   737  	X_LFS_LARGEFILE                       = 1
   738  	X_LP64                                = 1
   739  	X_POSIX2_CHAR_TERM                    = 200809
   740  	X_POSIX2_C_BIND                       = 200809
   741  	X_POSIX2_C_DEV                        = 200809
   742  	X_POSIX2_C_VERSION                    = 200809
   743  	X_POSIX2_LOCALEDEF                    = 200809
   744  	X_POSIX2_SW_DEV                       = 200809
   745  	X_POSIX2_VERSION                      = 200809
   746  	X_POSIX_ADVISORY_INFO                 = 200809
   747  	X_POSIX_ASYNCHRONOUS_IO               = 200809
   748  	X_POSIX_ASYNC_IO                      = 1
   749  	X_POSIX_BARRIERS                      = 200809
   750  	X_POSIX_CHOWN_RESTRICTED              = 0
   751  	X_POSIX_CLOCK_SELECTION               = 200809
   752  	X_POSIX_CPUTIME                       = 0
   753  	X_POSIX_C_SOURCE                      = 200809
   754  	X_POSIX_FSYNC                         = 200809
   755  	X_POSIX_IPV6                          = 200809
   756  	X_POSIX_JOB_CONTROL                   = 1
   757  	X_POSIX_MAPPED_FILES                  = 200809
   758  	X_POSIX_MEMLOCK                       = 200809
   759  	X_POSIX_MEMLOCK_RANGE                 = 200809
   760  	X_POSIX_MEMORY_PROTECTION             = 200809
   761  	X_POSIX_MESSAGE_PASSING               = 200809
   762  	X_POSIX_MONOTONIC_CLOCK               = 0
   763  	X_POSIX_NO_TRUNC                      = 1
   764  	X_POSIX_PRIORITIZED_IO                = 200809
   765  	X_POSIX_PRIORITY_SCHEDULING           = 200809
   766  	X_POSIX_RAW_SOCKETS                   = 200809
   767  	X_POSIX_READER_WRITER_LOCKS           = 200809
   768  	X_POSIX_REALTIME_SIGNALS              = 200809
   769  	X_POSIX_REENTRANT_FUNCTIONS           = 1
   770  	X_POSIX_REGEXP                        = 1
   771  	X_POSIX_SAVED_IDS                     = 1
   772  	X_POSIX_SEMAPHORES                    = 200809
   773  	X_POSIX_SHARED_MEMORY_OBJECTS         = 200809
   774  	X_POSIX_SHELL                         = 1
   775  	X_POSIX_SOURCE                        = 1
   776  	X_POSIX_SPAWN                         = 200809
   777  	X_POSIX_SPIN_LOCKS                    = 200809
   778  	X_POSIX_SPORADIC_SERVER               = -1
   779  	X_POSIX_SYNCHRONIZED_IO               = 200809
   780  	X_POSIX_THREADS                       = 200809
   781  	X_POSIX_THREAD_ATTR_STACKADDR         = 200809
   782  	X_POSIX_THREAD_ATTR_STACKSIZE         = 200809
   783  	X_POSIX_THREAD_CPUTIME                = 0
   784  	X_POSIX_THREAD_PRIORITY_SCHEDULING    = 200809
   785  	X_POSIX_THREAD_PRIO_INHERIT           = 200809
   786  	X_POSIX_THREAD_PRIO_PROTECT           = 200809
   787  	X_POSIX_THREAD_PROCESS_SHARED         = 200809
   788  	X_POSIX_THREAD_ROBUST_PRIO_INHERIT    = 200809
   789  	X_POSIX_THREAD_ROBUST_PRIO_PROTECT    = -1
   790  	X_POSIX_THREAD_SAFE_FUNCTIONS         = 200809
   791  	X_POSIX_THREAD_SPORADIC_SERVER        = -1
   792  	X_POSIX_TIMEOUTS                      = 200809
   793  	X_POSIX_TIMERS                        = 200809
   794  	X_POSIX_TRACE                         = -1
   795  	X_POSIX_TRACE_EVENT_FILTER            = -1
   796  	X_POSIX_TRACE_INHERIT                 = -1
   797  	X_POSIX_TRACE_LOG                     = -1
   798  	X_POSIX_TYPED_MEMORY_OBJECTS          = -1
   799  	X_POSIX_V6_LP64_OFF64                 = 1
   800  	X_POSIX_V6_LPBIG_OFFBIG               = -1
   801  	X_POSIX_V7_LP64_OFF64                 = 1
   802  	X_POSIX_V7_LPBIG_OFFBIG               = -1
   803  	X_POSIX_VDISABLE                      = 0
   804  	X_POSIX_VERSION                       = 200809
   805  	X_SIZET_                              = 0
   806  	X_SIZE_T                              = 0
   807  	X_SIZE_T_                             = 0
   808  	X_SIZE_T_DECLARED                     = 0
   809  	X_SIZE_T_DEFINED                      = 0
   810  	X_SIZE_T_DEFINED_                     = 0
   811  	X_SQLITE3RTREE_H_                     = 0
   812  	X_STDARG_H                            = 0
   813  	X_STDC_PREDEF_H                       = 1
   814  	X_STDIO_H                             = 1
   815  	X_STDLIB_H                            = 1
   816  	X_STRINGS_H                           = 1
   817  	X_STRING_H                            = 1
   818  	X_STRUCT_TIMESPEC                     = 1
   819  	X_SYS_CDEFS_H                         = 1
   820  	X_SYS_SELECT_H                        = 1
   821  	X_SYS_SIZE_T_H                        = 0
   822  	X_SYS_TYPES_H                         = 1
   823  	X_THREAD_SHARED_TYPES_H               = 1
   824  	X_T_SIZE                              = 0
   825  	X_T_SIZE_                             = 0
   826  	X_T_WCHAR                             = 0
   827  	X_T_WCHAR_                            = 0
   828  	X_UNISTD_H                            = 1
   829  	X_VA_LIST                             = 0
   830  	X_VA_LIST_                            = 0
   831  	X_VA_LIST_DEFINED                     = 0
   832  	X_VA_LIST_T_H                         = 0
   833  	X_WCHAR_T                             = 0
   834  	X_WCHAR_T_                            = 0
   835  	X_WCHAR_T_DECLARED                    = 0
   836  	X_WCHAR_T_DEFINED                     = 0
   837  	X_WCHAR_T_DEFINED_                    = 0
   838  	X_WCHAR_T_H                           = 0
   839  	X_XBS5_LP64_OFF64                     = 1
   840  	X_XBS5_LPBIG_OFFBIG                   = -1
   841  	X_XOPEN_ENH_I18N                      = 1
   842  	X_XOPEN_LEGACY                        = 1
   843  	X_XOPEN_REALTIME                      = 1
   844  	X_XOPEN_REALTIME_THREADS              = 1
   845  	X_XOPEN_SHM                           = 1
   846  	X_XOPEN_UNIX                          = 1
   847  	X_XOPEN_VERSION                       = 700
   848  	X_XOPEN_XCU_VERSION                   = 4
   849  	X_XOPEN_XPG2                          = 1
   850  	X_XOPEN_XPG3                          = 1
   851  	X_XOPEN_XPG4                          = 1
   852  	Linux                                 = 1
   853  	Unix                                  = 1
   854  )
   855  
   856  // Copyright (C) 1991-2018 Free Software Foundation, Inc.
   857  //    This file is part of the GNU C Library.
   858  //
   859  //    The GNU C Library is free software; you can redistribute it and/or
   860  //    modify it under the terms of the GNU Lesser General Public
   861  //    License as published by the Free Software Foundation; either
   862  //    version 2.1 of the License, or (at your option) any later version.
   863  //
   864  //    The GNU C Library is distributed in the hope that it will be useful,
   865  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   866  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   867  //    Lesser General Public License for more details.
   868  //
   869  //    You should have received a copy of the GNU Lesser General Public
   870  //    License along with the GNU C Library; if not, see
   871  //    <http://www.gnu.org/licenses/>.
   872  
   873  //	ISO C99 Standard: 7.2 Diagnostics	<assert.h>
   874  
   875  // Copyright (C) 1991-2018 Free Software Foundation, Inc.
   876  //    This file is part of the GNU C Library.
   877  //
   878  //    The GNU C Library is free software; you can redistribute it and/or
   879  //    modify it under the terms of the GNU Lesser General Public
   880  //    License as published by the Free Software Foundation; either
   881  //    version 2.1 of the License, or (at your option) any later version.
   882  //
   883  //    The GNU C Library is distributed in the hope that it will be useful,
   884  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   885  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   886  //    Lesser General Public License for more details.
   887  //
   888  //    You should have received a copy of the GNU Lesser General Public
   889  //    License along with the GNU C Library; if not, see
   890  //    <http://www.gnu.org/licenses/>.
   891  
   892  // void assert (int expression);
   893  //
   894  //    If NDEBUG is defined, do nothing.
   895  //    If not, and EXPRESSION is zero, print an error message and abort.
   896  
   897  // void assert_perror (int errnum);
   898  //
   899  //    If NDEBUG is defined, do nothing.  If not, and ERRNUM is not zero, print an
   900  //    error message with the error text for ERRNUM and abort.
   901  //    (This is a GNU extension.)
   902  
   903  // Copyright (C) 1991-2018 Free Software Foundation, Inc.
   904  //    This file is part of the GNU C Library.
   905  //
   906  //    The GNU C Library is free software; you can redistribute it and/or
   907  //    modify it under the terms of the GNU Lesser General Public
   908  //    License as published by the Free Software Foundation; either
   909  //    version 2.1 of the License, or (at your option) any later version.
   910  //
   911  //    The GNU C Library is distributed in the hope that it will be useful,
   912  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   913  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   914  //    Lesser General Public License for more details.
   915  //
   916  //    You should have received a copy of the GNU Lesser General Public
   917  //    License along with the GNU C Library; if not, see
   918  //    <http://www.gnu.org/licenses/>.
   919  
   920  //	ISO C99 Standard 7.4: Character handling	<ctype.h>
   921  
   922  // Copyright (C) 1991-2018 Free Software Foundation, Inc.
   923  //    This file is part of the GNU C Library.
   924  //
   925  //    The GNU C Library is free software; you can redistribute it and/or
   926  //    modify it under the terms of the GNU Lesser General Public
   927  //    License as published by the Free Software Foundation; either
   928  //    version 2.1 of the License, or (at your option) any later version.
   929  //
   930  //    The GNU C Library is distributed in the hope that it will be useful,
   931  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   932  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   933  //    Lesser General Public License for more details.
   934  //
   935  //    You should have received a copy of the GNU Lesser General Public
   936  //    License along with the GNU C Library; if not, see
   937  //    <http://www.gnu.org/licenses/>.
   938  
   939  // bits/types.h -- definitions of __*_t types underlying *_t types.
   940  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
   941  //    This file is part of the GNU C Library.
   942  //
   943  //    The GNU C Library is free software; you can redistribute it and/or
   944  //    modify it under the terms of the GNU Lesser General Public
   945  //    License as published by the Free Software Foundation; either
   946  //    version 2.1 of the License, or (at your option) any later version.
   947  //
   948  //    The GNU C Library is distributed in the hope that it will be useful,
   949  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   950  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   951  //    Lesser General Public License for more details.
   952  //
   953  //    You should have received a copy of the GNU Lesser General Public
   954  //    License along with the GNU C Library; if not, see
   955  //    <http://www.gnu.org/licenses/>.
   956  
   957  // Never include this file directly; use <sys/types.h> instead.
   958  
   959  // These are all the characteristics of characters.
   960  //    If there get to be more than 16 distinct characteristics,
   961  //    many things must be changed that use `unsigned short int's.
   962  //
   963  //    The characteristics are stored always in network byte order (big
   964  //    endian).  We define the bit value interpretations here dependent on the
   965  //    machine's byte order.
   966  
   967  // Copyright (C) 1992-2018 Free Software Foundation, Inc.
   968  //    This file is part of the GNU C Library.
   969  //
   970  //    The GNU C Library is free software; you can redistribute it and/or
   971  //    modify it under the terms of the GNU Lesser General Public
   972  //    License as published by the Free Software Foundation; either
   973  //    version 2.1 of the License, or (at your option) any later version.
   974  //
   975  //    The GNU C Library is distributed in the hope that it will be useful,
   976  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   977  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   978  //    Lesser General Public License for more details.
   979  //
   980  //    You should have received a copy of the GNU Lesser General Public
   981  //    License along with the GNU C Library; if not, see
   982  //    <http://www.gnu.org/licenses/>.
   983  
   984  const ( /* ctype.h:46:1: */
   985  	_ISupper  = 256   // UPPERCASE.
   986  	_ISlower  = 512   // lowercase.
   987  	_ISalpha  = 1024  // Alphabetic.
   988  	_ISdigit  = 2048  // Numeric.
   989  	_ISxdigit = 4096  // Hexadecimal numeric.
   990  	_ISspace  = 8192  // Whitespace.
   991  	_ISprint  = 16384 // Printing.
   992  	_ISgraph  = 32768 // Graphical.
   993  	_ISblank  = 1     // Blank (usually SPC and TAB).
   994  	_IScntrl  = 2     // Control character.
   995  	_ISpunct  = 4     // Punctuation.
   996  	_ISalnum  = 8
   997  )
   998  
   999  // Get the `_PC_*' symbols for the NAME argument to `pathconf' and `fpathconf';
  1000  //    the `_SC_*' symbols for the NAME argument to `sysconf';
  1001  //    and the `_CS_*' symbols for the NAME argument to `confstr'.
  1002  // `sysconf', `pathconf', and `confstr' NAME values.  Generic version.
  1003  //    Copyright (C) 1993-2018 Free Software Foundation, Inc.
  1004  //    This file is part of the GNU C Library.
  1005  //
  1006  //    The GNU C Library is free software; you can redistribute it and/or
  1007  //    modify it under the terms of the GNU Lesser General Public
  1008  //    License as published by the Free Software Foundation; either
  1009  //    version 2.1 of the License, or (at your option) any later version.
  1010  //
  1011  //    The GNU C Library is distributed in the hope that it will be useful,
  1012  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1013  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1014  //    Lesser General Public License for more details.
  1015  //
  1016  //    You should have received a copy of the GNU Lesser General Public
  1017  //    License along with the GNU C Library; if not, see
  1018  //    <http://www.gnu.org/licenses/>.
  1019  
  1020  // Values for the NAME argument to `pathconf' and `fpathconf'.
  1021  const ( /* confname.h:24:1: */
  1022  	_PC_LINK_MAX           = 0
  1023  	_PC_MAX_CANON          = 1
  1024  	_PC_MAX_INPUT          = 2
  1025  	_PC_NAME_MAX           = 3
  1026  	_PC_PATH_MAX           = 4
  1027  	_PC_PIPE_BUF           = 5
  1028  	_PC_CHOWN_RESTRICTED   = 6
  1029  	_PC_NO_TRUNC           = 7
  1030  	_PC_VDISABLE           = 8
  1031  	_PC_SYNC_IO            = 9
  1032  	_PC_ASYNC_IO           = 10
  1033  	_PC_PRIO_IO            = 11
  1034  	_PC_SOCK_MAXBUF        = 12
  1035  	_PC_FILESIZEBITS       = 13
  1036  	_PC_REC_INCR_XFER_SIZE = 14
  1037  	_PC_REC_MAX_XFER_SIZE  = 15
  1038  	_PC_REC_MIN_XFER_SIZE  = 16
  1039  	_PC_REC_XFER_ALIGN     = 17
  1040  	_PC_ALLOC_SIZE_MIN     = 18
  1041  	_PC_SYMLINK_MAX        = 19
  1042  	_PC_2_SYMLINKS         = 20
  1043  )
  1044  
  1045  // Values for the NAME argument to `confstr'.
  1046  const ( /* confname.h:533:1: */
  1047  	_CS_PATH = 0 // The default search path.
  1048  
  1049  	_CS_V6_WIDTH_RESTRICTED_ENVS = 1
  1050  
  1051  	_CS_GNU_LIBC_VERSION       = 2
  1052  	_CS_GNU_LIBPTHREAD_VERSION = 3
  1053  
  1054  	_CS_V5_WIDTH_RESTRICTED_ENVS = 4
  1055  
  1056  	_CS_V7_WIDTH_RESTRICTED_ENVS = 5
  1057  
  1058  	_CS_LFS_CFLAGS      = 1000
  1059  	_CS_LFS_LDFLAGS     = 1001
  1060  	_CS_LFS_LIBS        = 1002
  1061  	_CS_LFS_LINTFLAGS   = 1003
  1062  	_CS_LFS64_CFLAGS    = 1004
  1063  	_CS_LFS64_LDFLAGS   = 1005
  1064  	_CS_LFS64_LIBS      = 1006
  1065  	_CS_LFS64_LINTFLAGS = 1007
  1066  
  1067  	_CS_XBS5_ILP32_OFF32_CFLAGS     = 1100
  1068  	_CS_XBS5_ILP32_OFF32_LDFLAGS    = 1101
  1069  	_CS_XBS5_ILP32_OFF32_LIBS       = 1102
  1070  	_CS_XBS5_ILP32_OFF32_LINTFLAGS  = 1103
  1071  	_CS_XBS5_ILP32_OFFBIG_CFLAGS    = 1104
  1072  	_CS_XBS5_ILP32_OFFBIG_LDFLAGS   = 1105
  1073  	_CS_XBS5_ILP32_OFFBIG_LIBS      = 1106
  1074  	_CS_XBS5_ILP32_OFFBIG_LINTFLAGS = 1107
  1075  	_CS_XBS5_LP64_OFF64_CFLAGS      = 1108
  1076  	_CS_XBS5_LP64_OFF64_LDFLAGS     = 1109
  1077  	_CS_XBS5_LP64_OFF64_LIBS        = 1110
  1078  	_CS_XBS5_LP64_OFF64_LINTFLAGS   = 1111
  1079  	_CS_XBS5_LPBIG_OFFBIG_CFLAGS    = 1112
  1080  	_CS_XBS5_LPBIG_OFFBIG_LDFLAGS   = 1113
  1081  	_CS_XBS5_LPBIG_OFFBIG_LIBS      = 1114
  1082  	_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS = 1115
  1083  
  1084  	_CS_POSIX_V6_ILP32_OFF32_CFLAGS     = 1116
  1085  	_CS_POSIX_V6_ILP32_OFF32_LDFLAGS    = 1117
  1086  	_CS_POSIX_V6_ILP32_OFF32_LIBS       = 1118
  1087  	_CS_POSIX_V6_ILP32_OFF32_LINTFLAGS  = 1119
  1088  	_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS    = 1120
  1089  	_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS   = 1121
  1090  	_CS_POSIX_V6_ILP32_OFFBIG_LIBS      = 1122
  1091  	_CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 1123
  1092  	_CS_POSIX_V6_LP64_OFF64_CFLAGS      = 1124
  1093  	_CS_POSIX_V6_LP64_OFF64_LDFLAGS     = 1125
  1094  	_CS_POSIX_V6_LP64_OFF64_LIBS        = 1126
  1095  	_CS_POSIX_V6_LP64_OFF64_LINTFLAGS   = 1127
  1096  	_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS    = 1128
  1097  	_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS   = 1129
  1098  	_CS_POSIX_V6_LPBIG_OFFBIG_LIBS      = 1130
  1099  	_CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS = 1131
  1100  
  1101  	_CS_POSIX_V7_ILP32_OFF32_CFLAGS     = 1132
  1102  	_CS_POSIX_V7_ILP32_OFF32_LDFLAGS    = 1133
  1103  	_CS_POSIX_V7_ILP32_OFF32_LIBS       = 1134
  1104  	_CS_POSIX_V7_ILP32_OFF32_LINTFLAGS  = 1135
  1105  	_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS    = 1136
  1106  	_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS   = 1137
  1107  	_CS_POSIX_V7_ILP32_OFFBIG_LIBS      = 1138
  1108  	_CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS = 1139
  1109  	_CS_POSIX_V7_LP64_OFF64_CFLAGS      = 1140
  1110  	_CS_POSIX_V7_LP64_OFF64_LDFLAGS     = 1141
  1111  	_CS_POSIX_V7_LP64_OFF64_LIBS        = 1142
  1112  	_CS_POSIX_V7_LP64_OFF64_LINTFLAGS   = 1143
  1113  	_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS    = 1144
  1114  	_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS   = 1145
  1115  	_CS_POSIX_V7_LPBIG_OFFBIG_LIBS      = 1146
  1116  	_CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS = 1147
  1117  
  1118  	_CS_V6_ENV = 1148
  1119  	_CS_V7_ENV = 1149
  1120  )
  1121  
  1122  // Values for the argument to `sysconf'.
  1123  const ( /* confname.h:71:1: */
  1124  	_SC_ARG_MAX               = 0
  1125  	_SC_CHILD_MAX             = 1
  1126  	_SC_CLK_TCK               = 2
  1127  	_SC_NGROUPS_MAX           = 3
  1128  	_SC_OPEN_MAX              = 4
  1129  	_SC_STREAM_MAX            = 5
  1130  	_SC_TZNAME_MAX            = 6
  1131  	_SC_JOB_CONTROL           = 7
  1132  	_SC_SAVED_IDS             = 8
  1133  	_SC_REALTIME_SIGNALS      = 9
  1134  	_SC_PRIORITY_SCHEDULING   = 10
  1135  	_SC_TIMERS                = 11
  1136  	_SC_ASYNCHRONOUS_IO       = 12
  1137  	_SC_PRIORITIZED_IO        = 13
  1138  	_SC_SYNCHRONIZED_IO       = 14
  1139  	_SC_FSYNC                 = 15
  1140  	_SC_MAPPED_FILES          = 16
  1141  	_SC_MEMLOCK               = 17
  1142  	_SC_MEMLOCK_RANGE         = 18
  1143  	_SC_MEMORY_PROTECTION     = 19
  1144  	_SC_MESSAGE_PASSING       = 20
  1145  	_SC_SEMAPHORES            = 21
  1146  	_SC_SHARED_MEMORY_OBJECTS = 22
  1147  	_SC_AIO_LISTIO_MAX        = 23
  1148  	_SC_AIO_MAX               = 24
  1149  	_SC_AIO_PRIO_DELTA_MAX    = 25
  1150  	_SC_DELAYTIMER_MAX        = 26
  1151  	_SC_MQ_OPEN_MAX           = 27
  1152  	_SC_MQ_PRIO_MAX           = 28
  1153  	_SC_VERSION               = 29
  1154  	_SC_PAGESIZE              = 30
  1155  	_SC_RTSIG_MAX             = 31
  1156  	_SC_SEM_NSEMS_MAX         = 32
  1157  	_SC_SEM_VALUE_MAX         = 33
  1158  	_SC_SIGQUEUE_MAX          = 34
  1159  	_SC_TIMER_MAX             = 35
  1160  
  1161  	// Values for the argument to `sysconf'
  1162  	//        corresponding to _POSIX2_* symbols.
  1163  	_SC_BC_BASE_MAX        = 36
  1164  	_SC_BC_DIM_MAX         = 37
  1165  	_SC_BC_SCALE_MAX       = 38
  1166  	_SC_BC_STRING_MAX      = 39
  1167  	_SC_COLL_WEIGHTS_MAX   = 40
  1168  	_SC_EQUIV_CLASS_MAX    = 41
  1169  	_SC_EXPR_NEST_MAX      = 42
  1170  	_SC_LINE_MAX           = 43
  1171  	_SC_RE_DUP_MAX         = 44
  1172  	_SC_CHARCLASS_NAME_MAX = 45
  1173  
  1174  	_SC_2_VERSION   = 46
  1175  	_SC_2_C_BIND    = 47
  1176  	_SC_2_C_DEV     = 48
  1177  	_SC_2_FORT_DEV  = 49
  1178  	_SC_2_FORT_RUN  = 50
  1179  	_SC_2_SW_DEV    = 51
  1180  	_SC_2_LOCALEDEF = 52
  1181  
  1182  	_SC_PII                 = 53
  1183  	_SC_PII_XTI             = 54
  1184  	_SC_PII_SOCKET          = 55
  1185  	_SC_PII_INTERNET        = 56
  1186  	_SC_PII_OSI             = 57
  1187  	_SC_POLL                = 58
  1188  	_SC_SELECT              = 59
  1189  	_SC_UIO_MAXIOV          = 60
  1190  	_SC_IOV_MAX             = 60
  1191  	_SC_PII_INTERNET_STREAM = 61
  1192  	_SC_PII_INTERNET_DGRAM  = 62
  1193  	_SC_PII_OSI_COTS        = 63
  1194  	_SC_PII_OSI_CLTS        = 64
  1195  	_SC_PII_OSI_M           = 65
  1196  	_SC_T_IOV_MAX           = 66
  1197  
  1198  	// Values according to POSIX 1003.1c (POSIX threads).
  1199  	_SC_THREADS                      = 67
  1200  	_SC_THREAD_SAFE_FUNCTIONS        = 68
  1201  	_SC_GETGR_R_SIZE_MAX             = 69
  1202  	_SC_GETPW_R_SIZE_MAX             = 70
  1203  	_SC_LOGIN_NAME_MAX               = 71
  1204  	_SC_TTY_NAME_MAX                 = 72
  1205  	_SC_THREAD_DESTRUCTOR_ITERATIONS = 73
  1206  	_SC_THREAD_KEYS_MAX              = 74
  1207  	_SC_THREAD_STACK_MIN             = 75
  1208  	_SC_THREAD_THREADS_MAX           = 76
  1209  	_SC_THREAD_ATTR_STACKADDR        = 77
  1210  	_SC_THREAD_ATTR_STACKSIZE        = 78
  1211  	_SC_THREAD_PRIORITY_SCHEDULING   = 79
  1212  	_SC_THREAD_PRIO_INHERIT          = 80
  1213  	_SC_THREAD_PRIO_PROTECT          = 81
  1214  	_SC_THREAD_PROCESS_SHARED        = 82
  1215  
  1216  	_SC_NPROCESSORS_CONF = 83
  1217  	_SC_NPROCESSORS_ONLN = 84
  1218  	_SC_PHYS_PAGES       = 85
  1219  	_SC_AVPHYS_PAGES     = 86
  1220  	_SC_ATEXIT_MAX       = 87
  1221  	_SC_PASS_MAX         = 88
  1222  
  1223  	_SC_XOPEN_VERSION     = 89
  1224  	_SC_XOPEN_XCU_VERSION = 90
  1225  	_SC_XOPEN_UNIX        = 91
  1226  	_SC_XOPEN_CRYPT       = 92
  1227  	_SC_XOPEN_ENH_I18N    = 93
  1228  	_SC_XOPEN_SHM         = 94
  1229  
  1230  	_SC_2_CHAR_TERM = 95
  1231  	_SC_2_C_VERSION = 96
  1232  	_SC_2_UPE       = 97
  1233  
  1234  	_SC_XOPEN_XPG2 = 98
  1235  	_SC_XOPEN_XPG3 = 99
  1236  	_SC_XOPEN_XPG4 = 100
  1237  
  1238  	_SC_CHAR_BIT   = 101
  1239  	_SC_CHAR_MAX   = 102
  1240  	_SC_CHAR_MIN   = 103
  1241  	_SC_INT_MAX    = 104
  1242  	_SC_INT_MIN    = 105
  1243  	_SC_LONG_BIT   = 106
  1244  	_SC_WORD_BIT   = 107
  1245  	_SC_MB_LEN_MAX = 108
  1246  	_SC_NZERO      = 109
  1247  	_SC_SSIZE_MAX  = 110
  1248  	_SC_SCHAR_MAX  = 111
  1249  	_SC_SCHAR_MIN  = 112
  1250  	_SC_SHRT_MAX   = 113
  1251  	_SC_SHRT_MIN   = 114
  1252  	_SC_UCHAR_MAX  = 115
  1253  	_SC_UINT_MAX   = 116
  1254  	_SC_ULONG_MAX  = 117
  1255  	_SC_USHRT_MAX  = 118
  1256  
  1257  	_SC_NL_ARGMAX  = 119
  1258  	_SC_NL_LANGMAX = 120
  1259  	_SC_NL_MSGMAX  = 121
  1260  	_SC_NL_NMAX    = 122
  1261  	_SC_NL_SETMAX  = 123
  1262  	_SC_NL_TEXTMAX = 124
  1263  
  1264  	_SC_XBS5_ILP32_OFF32  = 125
  1265  	_SC_XBS5_ILP32_OFFBIG = 126
  1266  	_SC_XBS5_LP64_OFF64   = 127
  1267  	_SC_XBS5_LPBIG_OFFBIG = 128
  1268  
  1269  	_SC_XOPEN_LEGACY           = 129
  1270  	_SC_XOPEN_REALTIME         = 130
  1271  	_SC_XOPEN_REALTIME_THREADS = 131
  1272  
  1273  	_SC_ADVISORY_INFO          = 132
  1274  	_SC_BARRIERS               = 133
  1275  	_SC_BASE                   = 134
  1276  	_SC_C_LANG_SUPPORT         = 135
  1277  	_SC_C_LANG_SUPPORT_R       = 136
  1278  	_SC_CLOCK_SELECTION        = 137
  1279  	_SC_CPUTIME                = 138
  1280  	_SC_THREAD_CPUTIME         = 139
  1281  	_SC_DEVICE_IO              = 140
  1282  	_SC_DEVICE_SPECIFIC        = 141
  1283  	_SC_DEVICE_SPECIFIC_R      = 142
  1284  	_SC_FD_MGMT                = 143
  1285  	_SC_FIFO                   = 144
  1286  	_SC_PIPE                   = 145
  1287  	_SC_FILE_ATTRIBUTES        = 146
  1288  	_SC_FILE_LOCKING           = 147
  1289  	_SC_FILE_SYSTEM            = 148
  1290  	_SC_MONOTONIC_CLOCK        = 149
  1291  	_SC_MULTI_PROCESS          = 150
  1292  	_SC_SINGLE_PROCESS         = 151
  1293  	_SC_NETWORKING             = 152
  1294  	_SC_READER_WRITER_LOCKS    = 153
  1295  	_SC_SPIN_LOCKS             = 154
  1296  	_SC_REGEXP                 = 155
  1297  	_SC_REGEX_VERSION          = 156
  1298  	_SC_SHELL                  = 157
  1299  	_SC_SIGNALS                = 158
  1300  	_SC_SPAWN                  = 159
  1301  	_SC_SPORADIC_SERVER        = 160
  1302  	_SC_THREAD_SPORADIC_SERVER = 161
  1303  	_SC_SYSTEM_DATABASE        = 162
  1304  	_SC_SYSTEM_DATABASE_R      = 163
  1305  	_SC_TIMEOUTS               = 164
  1306  	_SC_TYPED_MEMORY_OBJECTS   = 165
  1307  	_SC_USER_GROUPS            = 166
  1308  	_SC_USER_GROUPS_R          = 167
  1309  	_SC_2_PBS                  = 168
  1310  	_SC_2_PBS_ACCOUNTING       = 169
  1311  	_SC_2_PBS_LOCATE           = 170
  1312  	_SC_2_PBS_MESSAGE          = 171
  1313  	_SC_2_PBS_TRACK            = 172
  1314  	_SC_SYMLOOP_MAX            = 173
  1315  	_SC_STREAMS                = 174
  1316  	_SC_2_PBS_CHECKPOINT       = 175
  1317  
  1318  	_SC_V6_ILP32_OFF32  = 176
  1319  	_SC_V6_ILP32_OFFBIG = 177
  1320  	_SC_V6_LP64_OFF64   = 178
  1321  	_SC_V6_LPBIG_OFFBIG = 179
  1322  
  1323  	_SC_HOST_NAME_MAX      = 180
  1324  	_SC_TRACE              = 181
  1325  	_SC_TRACE_EVENT_FILTER = 182
  1326  	_SC_TRACE_INHERIT      = 183
  1327  	_SC_TRACE_LOG          = 184
  1328  
  1329  	_SC_LEVEL1_ICACHE_SIZE     = 185
  1330  	_SC_LEVEL1_ICACHE_ASSOC    = 186
  1331  	_SC_LEVEL1_ICACHE_LINESIZE = 187
  1332  	_SC_LEVEL1_DCACHE_SIZE     = 188
  1333  	_SC_LEVEL1_DCACHE_ASSOC    = 189
  1334  	_SC_LEVEL1_DCACHE_LINESIZE = 190
  1335  	_SC_LEVEL2_CACHE_SIZE      = 191
  1336  	_SC_LEVEL2_CACHE_ASSOC     = 192
  1337  	_SC_LEVEL2_CACHE_LINESIZE  = 193
  1338  	_SC_LEVEL3_CACHE_SIZE      = 194
  1339  	_SC_LEVEL3_CACHE_ASSOC     = 195
  1340  	_SC_LEVEL3_CACHE_LINESIZE  = 196
  1341  	_SC_LEVEL4_CACHE_SIZE      = 197
  1342  	_SC_LEVEL4_CACHE_ASSOC     = 198
  1343  	_SC_LEVEL4_CACHE_LINESIZE  = 199
  1344  	// Leave room here, maybe we need a few more cache levels some day.
  1345  
  1346  	_SC_IPV6        = 235
  1347  	_SC_RAW_SOCKETS = 236
  1348  
  1349  	_SC_V7_ILP32_OFF32  = 237
  1350  	_SC_V7_ILP32_OFFBIG = 238
  1351  	_SC_V7_LP64_OFF64   = 239
  1352  	_SC_V7_LPBIG_OFFBIG = 240
  1353  
  1354  	_SC_SS_REPL_MAX = 241
  1355  
  1356  	_SC_TRACE_EVENT_NAME_MAX = 242
  1357  	_SC_TRACE_NAME_MAX       = 243
  1358  	_SC_TRACE_SYS_MAX        = 244
  1359  	_SC_TRACE_USER_EVENT_MAX = 245
  1360  
  1361  	_SC_XOPEN_STREAMS = 246
  1362  
  1363  	_SC_THREAD_ROBUST_PRIO_INHERIT = 247
  1364  	_SC_THREAD_ROBUST_PRIO_PROTECT = 248
  1365  )
  1366  
  1367  //  In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
  1368  //     are already defined.
  1369  //  BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
  1370  //  NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.
  1371  
  1372  // A null pointer constant.
  1373  
  1374  // XPG requires a few symbols from <sys/wait.h> being defined.
  1375  // Definitions of flag bits for `waitpid' et al.
  1376  //    Copyright (C) 1992-2018 Free Software Foundation, Inc.
  1377  //    This file is part of the GNU C Library.
  1378  //
  1379  //    The GNU C Library is free software; you can redistribute it and/or
  1380  //    modify it under the terms of the GNU Lesser General Public
  1381  //    License as published by the Free Software Foundation; either
  1382  //    version 2.1 of the License, or (at your option) any later version.
  1383  //
  1384  //    The GNU C Library is distributed in the hope that it will be useful,
  1385  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1386  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1387  //    Lesser General Public License for more details.
  1388  //
  1389  //    You should have received a copy of the GNU Lesser General Public
  1390  //    License along with the GNU C Library; if not, see
  1391  //    <http://www.gnu.org/licenses/>.
  1392  
  1393  // Bits in the third argument to `waitpid'.
  1394  
  1395  // Bits in the fourth argument to `waitid'.
  1396  
  1397  // The following values are used by the `waitid' function.
  1398  
  1399  // The Linux kernel defines these bare, rather than an enum,
  1400  //    which causes a conflict if the include order is reversed.
  1401  
  1402  const ( /* waitflags.h:52:1: */
  1403  	P_ALL  = 0 // Wait for any child.
  1404  	P_PID  = 1 // Wait for specified process.
  1405  	P_PGID = 2
  1406  )
  1407  
  1408  type ptrdiff_t = int64 /* <builtin>:3:26 */
  1409  
  1410  type size_t = uint64 /* <builtin>:9:23 */
  1411  
  1412  type wchar_t = int32 /* <builtin>:15:24 */
  1413  
  1414  // Define the standard macros for the user,
  1415  //    if this invocation was from the user program.
  1416  
  1417  // Define va_list, if desired, from __gnuc_va_list.
  1418  // We deliberately do not define va_list when called from
  1419  //    stdio.h, because ANSI C says that stdio.h is not supposed to define
  1420  //    va_list.  stdio.h needs to have access to that data type,
  1421  //    but must not use that name.  It should use the name __gnuc_va_list,
  1422  //    which is safe because it is reserved for the implementation.
  1423  
  1424  // The macro _VA_LIST_ is the same thing used by this file in Ultrix.
  1425  //    But on BSD NET2 we must not test or define or undef it.
  1426  //    (Note that the comments in NET 2's ansi.h
  1427  //    are incorrect for _VA_LIST_--see stdio.h!)
  1428  // The macro _VA_LIST_DEFINED is used in Windows NT 3.5
  1429  // The macro _VA_LIST is used in SCO Unix 3.2.
  1430  // The macro _VA_LIST_T_H is used in the Bull dpx2
  1431  // The macro __va_list__ is used by BeOS.
  1432  type va_list = uintptr /* stdarg.h:99:24 */
  1433  
  1434  // CAPI3REF: 64-Bit Integer Types
  1435  // KEYWORDS: sqlite_int64 sqlite_uint64
  1436  //
  1437  // Because there is no cross-platform way to specify 64-bit integer types
  1438  // SQLite includes typedefs for 64-bit signed and unsigned integers.
  1439  //
  1440  // The sqlite3_int64 and sqlite3_uint64 are the preferred type definitions.
  1441  // The sqlite_int64 and sqlite_uint64 types are supported for backwards
  1442  // compatibility only.
  1443  //
  1444  // ^The sqlite3_int64 and sqlite_int64 types can store integer values
  1445  // between -9223372036854775808 and +9223372036854775807 inclusive.  ^The
  1446  // sqlite3_uint64 and sqlite_uint64 types can store integer values
  1447  // between 0 and +18446744073709551615 inclusive.
  1448  type sqlite_int64 = int64           /* sqlite3.h:278:25 */
  1449  type sqlite_uint64 = uint64         /* sqlite3.h:279:34 */
  1450  type sqlite3_int64 = sqlite_int64   /* sqlite3.h:281:22 */
  1451  type sqlite3_uint64 = sqlite_uint64 /* sqlite3.h:282:23 */
  1452  
  1453  // The type for a callback function.
  1454  // This is legacy and deprecated.  It is included for historical
  1455  // compatibility and is not documented.
  1456  type sqlite3_callback = uintptr /* sqlite3.h:338:13 */
  1457  
  1458  // CAPI3REF: Result Codes
  1459  // KEYWORDS: {result code definitions}
  1460  //
  1461  // Many SQLite functions return an integer result code from the set shown
  1462  // here in order to indicate success or failure.
  1463  //
  1464  // New error codes may be added in future versions of SQLite.
  1465  //
  1466  // See also: [extended result code definitions]
  1467  // beginning-of-error-codes
  1468  // end-of-error-codes
  1469  
  1470  // CAPI3REF: Extended Result Codes
  1471  // KEYWORDS: {extended result code definitions}
  1472  //
  1473  // In its default configuration, SQLite API routines return one of 30 integer
  1474  // [result codes].  However, experience has shown that many of
  1475  // these result codes are too coarse-grained.  They do not provide as
  1476  // much information about problems as programmers might like.  In an effort to
  1477  // address this, newer versions of SQLite (version 3.3.8 [dateof:3.3.8]
  1478  // and later) include
  1479  // support for additional result codes that provide more detailed information
  1480  // about errors. These [extended result codes] are enabled or disabled
  1481  // on a per database connection basis using the
  1482  // [sqlite3_extended_result_codes()] API.  Or, the extended code for
  1483  // the most recent error can be obtained using
  1484  // [sqlite3_extended_errcode()].
  1485  
  1486  // CAPI3REF: Flags For File Open Operations
  1487  //
  1488  // These bit values are intended for use in the
  1489  // 3rd parameter to the [sqlite3_open_v2()] interface and
  1490  // in the 4th parameter to the [sqlite3_vfs.xOpen] method.
  1491  
  1492  // Reserved:                         0x00F00000
  1493  // Legacy compatibility:
  1494  
  1495  // CAPI3REF: Device Characteristics
  1496  //
  1497  // The xDeviceCharacteristics method of the [sqlite3_io_methods]
  1498  // object returns an integer which is a vector of these
  1499  // bit values expressing I/O characteristics of the mass storage
  1500  // device that holds the file that the [sqlite3_io_methods]
  1501  // refers to.
  1502  //
  1503  // The SQLITE_IOCAP_ATOMIC property means that all writes of
  1504  // any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values
  1505  // mean that writes of blocks that are nnn bytes in size and
  1506  // are aligned to an address which is an integer multiple of
  1507  // nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means
  1508  // that when data is appended to a file, the data is appended
  1509  // first then the size of the file is extended, never the other
  1510  // way around.  The SQLITE_IOCAP_SEQUENTIAL property means that
  1511  // information is written to disk in the same order as calls
  1512  // to xWrite().  The SQLITE_IOCAP_POWERSAFE_OVERWRITE property means that
  1513  // after reboot following a crash or power loss, the only bytes in a
  1514  // file that were written at the application level might have changed
  1515  // and that adjacent bytes, even bytes within the same sector are
  1516  // guaranteed to be unchanged.  The SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN
  1517  // flag indicates that a file cannot be deleted when open.  The
  1518  // SQLITE_IOCAP_IMMUTABLE flag indicates that the file is on
  1519  // read-only media and cannot be changed even by processes with
  1520  // elevated privileges.
  1521  //
  1522  // The SQLITE_IOCAP_BATCH_ATOMIC property means that the underlying
  1523  // filesystem supports doing multiple write operations atomically when those
  1524  // write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and
  1525  // [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE].
  1526  
  1527  // CAPI3REF: File Locking Levels
  1528  //
  1529  // SQLite uses one of these integer values as the second
  1530  // argument to calls it makes to the xLock() and xUnlock() methods
  1531  // of an [sqlite3_io_methods] object.
  1532  
  1533  // CAPI3REF: Synchronization Type Flags
  1534  //
  1535  // When SQLite invokes the xSync() method of an
  1536  // [sqlite3_io_methods] object it uses a combination of
  1537  // these integer values as the second argument.
  1538  //
  1539  // When the SQLITE_SYNC_DATAONLY flag is used, it means that the
  1540  // sync operation only needs to flush data to mass storage.  Inode
  1541  // information need not be flushed. If the lower four bits of the flag
  1542  // equal SQLITE_SYNC_NORMAL, that means to use normal fsync() semantics.
  1543  // If the lower four bits equal SQLITE_SYNC_FULL, that means
  1544  // to use Mac OS X style fullsync instead of fsync().
  1545  //
  1546  // Do not confuse the SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags
  1547  // with the [PRAGMA synchronous]=NORMAL and [PRAGMA synchronous]=FULL
  1548  // settings.  The [synchronous pragma] determines when calls to the
  1549  // xSync VFS method occur and applies uniformly across all platforms.
  1550  // The SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags determine how
  1551  // energetic or rigorous or forceful the sync operations are and
  1552  // only make a difference on Mac OSX for the default SQLite code.
  1553  // (Third-party VFS implementations might also make the distinction
  1554  // between SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL, but among the
  1555  // operating systems natively supported by SQLite, only Mac OSX
  1556  // cares about the difference.)
  1557  
  1558  // CAPI3REF: OS Interface Open File Handle
  1559  //
  1560  // An [sqlite3_file] object represents an open file in the
  1561  // [sqlite3_vfs | OS interface layer].  Individual OS interface
  1562  // implementations will
  1563  // want to subclass this object by appending additional fields
  1564  // for their own use.  The pMethods entry is a pointer to an
  1565  // [sqlite3_io_methods] object that defines methods for performing
  1566  // I/O operations on the open file.
  1567  type sqlite3_file1 = struct{ pMethods uintptr } /* sqlite3.h:684:9 */
  1568  
  1569  // CAPI3REF: Result Codes
  1570  // KEYWORDS: {result code definitions}
  1571  //
  1572  // Many SQLite functions return an integer result code from the set shown
  1573  // here in order to indicate success or failure.
  1574  //
  1575  // New error codes may be added in future versions of SQLite.
  1576  //
  1577  // See also: [extended result code definitions]
  1578  // beginning-of-error-codes
  1579  // end-of-error-codes
  1580  
  1581  // CAPI3REF: Extended Result Codes
  1582  // KEYWORDS: {extended result code definitions}
  1583  //
  1584  // In its default configuration, SQLite API routines return one of 30 integer
  1585  // [result codes].  However, experience has shown that many of
  1586  // these result codes are too coarse-grained.  They do not provide as
  1587  // much information about problems as programmers might like.  In an effort to
  1588  // address this, newer versions of SQLite (version 3.3.8 [dateof:3.3.8]
  1589  // and later) include
  1590  // support for additional result codes that provide more detailed information
  1591  // about errors. These [extended result codes] are enabled or disabled
  1592  // on a per database connection basis using the
  1593  // [sqlite3_extended_result_codes()] API.  Or, the extended code for
  1594  // the most recent error can be obtained using
  1595  // [sqlite3_extended_errcode()].
  1596  
  1597  // CAPI3REF: Flags For File Open Operations
  1598  //
  1599  // These bit values are intended for use in the
  1600  // 3rd parameter to the [sqlite3_open_v2()] interface and
  1601  // in the 4th parameter to the [sqlite3_vfs.xOpen] method.
  1602  
  1603  // Reserved:                         0x00F00000
  1604  // Legacy compatibility:
  1605  
  1606  // CAPI3REF: Device Characteristics
  1607  //
  1608  // The xDeviceCharacteristics method of the [sqlite3_io_methods]
  1609  // object returns an integer which is a vector of these
  1610  // bit values expressing I/O characteristics of the mass storage
  1611  // device that holds the file that the [sqlite3_io_methods]
  1612  // refers to.
  1613  //
  1614  // The SQLITE_IOCAP_ATOMIC property means that all writes of
  1615  // any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values
  1616  // mean that writes of blocks that are nnn bytes in size and
  1617  // are aligned to an address which is an integer multiple of
  1618  // nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means
  1619  // that when data is appended to a file, the data is appended
  1620  // first then the size of the file is extended, never the other
  1621  // way around.  The SQLITE_IOCAP_SEQUENTIAL property means that
  1622  // information is written to disk in the same order as calls
  1623  // to xWrite().  The SQLITE_IOCAP_POWERSAFE_OVERWRITE property means that
  1624  // after reboot following a crash or power loss, the only bytes in a
  1625  // file that were written at the application level might have changed
  1626  // and that adjacent bytes, even bytes within the same sector are
  1627  // guaranteed to be unchanged.  The SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN
  1628  // flag indicates that a file cannot be deleted when open.  The
  1629  // SQLITE_IOCAP_IMMUTABLE flag indicates that the file is on
  1630  // read-only media and cannot be changed even by processes with
  1631  // elevated privileges.
  1632  //
  1633  // The SQLITE_IOCAP_BATCH_ATOMIC property means that the underlying
  1634  // filesystem supports doing multiple write operations atomically when those
  1635  // write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and
  1636  // [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE].
  1637  
  1638  // CAPI3REF: File Locking Levels
  1639  //
  1640  // SQLite uses one of these integer values as the second
  1641  // argument to calls it makes to the xLock() and xUnlock() methods
  1642  // of an [sqlite3_io_methods] object.
  1643  
  1644  // CAPI3REF: Synchronization Type Flags
  1645  //
  1646  // When SQLite invokes the xSync() method of an
  1647  // [sqlite3_io_methods] object it uses a combination of
  1648  // these integer values as the second argument.
  1649  //
  1650  // When the SQLITE_SYNC_DATAONLY flag is used, it means that the
  1651  // sync operation only needs to flush data to mass storage.  Inode
  1652  // information need not be flushed. If the lower four bits of the flag
  1653  // equal SQLITE_SYNC_NORMAL, that means to use normal fsync() semantics.
  1654  // If the lower four bits equal SQLITE_SYNC_FULL, that means
  1655  // to use Mac OS X style fullsync instead of fsync().
  1656  //
  1657  // Do not confuse the SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags
  1658  // with the [PRAGMA synchronous]=NORMAL and [PRAGMA synchronous]=FULL
  1659  // settings.  The [synchronous pragma] determines when calls to the
  1660  // xSync VFS method occur and applies uniformly across all platforms.
  1661  // The SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags determine how
  1662  // energetic or rigorous or forceful the sync operations are and
  1663  // only make a difference on Mac OSX for the default SQLite code.
  1664  // (Third-party VFS implementations might also make the distinction
  1665  // between SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL, but among the
  1666  // operating systems natively supported by SQLite, only Mac OSX
  1667  // cares about the difference.)
  1668  
  1669  // CAPI3REF: OS Interface Open File Handle
  1670  //
  1671  // An [sqlite3_file] object represents an open file in the
  1672  // [sqlite3_vfs | OS interface layer].  Individual OS interface
  1673  // implementations will
  1674  // want to subclass this object by appending additional fields
  1675  // for their own use.  The pMethods entry is a pointer to an
  1676  // [sqlite3_io_methods] object that defines methods for performing
  1677  // I/O operations on the open file.
  1678  type sqlite3_file = sqlite3_file1 /* sqlite3.h:684:29 */
  1679  type sqlite3_io_methods1 = struct {
  1680  	iVersion               int32
  1681  	_                      [4]byte
  1682  	xClose                 uintptr
  1683  	xRead                  uintptr
  1684  	xWrite                 uintptr
  1685  	xTruncate              uintptr
  1686  	xSync                  uintptr
  1687  	xFileSize              uintptr
  1688  	xLock                  uintptr
  1689  	xUnlock                uintptr
  1690  	xCheckReservedLock     uintptr
  1691  	xFileControl           uintptr
  1692  	xSectorSize            uintptr
  1693  	xDeviceCharacteristics uintptr
  1694  	xShmMap                uintptr
  1695  	xShmLock               uintptr
  1696  	xShmBarrier            uintptr
  1697  	xShmUnmap              uintptr
  1698  	xFetch                 uintptr
  1699  	xUnfetch               uintptr
  1700  } /* sqlite3.h:684:9 */
  1701  
  1702  // CAPI3REF: OS Interface File Virtual Methods Object
  1703  //
  1704  // Every file opened by the [sqlite3_vfs.xOpen] method populates an
  1705  // [sqlite3_file] object (or, more commonly, a subclass of the
  1706  // [sqlite3_file] object) with a pointer to an instance of this object.
  1707  // This object defines the methods used to perform various operations
  1708  // against the open file represented by the [sqlite3_file] object.
  1709  //
  1710  // If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element
  1711  // to a non-NULL pointer, then the sqlite3_io_methods.xClose method
  1712  // may be invoked even if the [sqlite3_vfs.xOpen] reported that it failed.  The
  1713  // only way to prevent a call to xClose following a failed [sqlite3_vfs.xOpen]
  1714  // is for the [sqlite3_vfs.xOpen] to set the sqlite3_file.pMethods element
  1715  // to NULL.
  1716  //
  1717  // The flags argument to xSync may be one of [SQLITE_SYNC_NORMAL] or
  1718  // [SQLITE_SYNC_FULL].  The first choice is the normal fsync().
  1719  // The second choice is a Mac OS X style fullsync.  The [SQLITE_SYNC_DATAONLY]
  1720  // flag may be ORed in to indicate that only the data of the file
  1721  // and not its inode needs to be synced.
  1722  //
  1723  // The integer values to xLock() and xUnlock() are one of
  1724  // <ul>
  1725  // <li> [SQLITE_LOCK_NONE],
  1726  // <li> [SQLITE_LOCK_SHARED],
  1727  // <li> [SQLITE_LOCK_RESERVED],
  1728  // <li> [SQLITE_LOCK_PENDING], or
  1729  // <li> [SQLITE_LOCK_EXCLUSIVE].
  1730  // </ul>
  1731  // xLock() increases the lock. xUnlock() decreases the lock.
  1732  // The xCheckReservedLock() method checks whether any database connection,
  1733  // either in this process or in some other process, is holding a RESERVED,
  1734  // PENDING, or EXCLUSIVE lock on the file.  It returns true
  1735  // if such a lock exists and false otherwise.
  1736  //
  1737  // The xFileControl() method is a generic interface that allows custom
  1738  // VFS implementations to directly control an open file using the
  1739  // [sqlite3_file_control()] interface.  The second "op" argument is an
  1740  // integer opcode.  The third argument is a generic pointer intended to
  1741  // point to a structure that may contain arguments or space in which to
  1742  // write return values.  Potential uses for xFileControl() might be
  1743  // functions to enable blocking locks with timeouts, to change the
  1744  // locking strategy (for example to use dot-file locks), to inquire
  1745  // about the status of a lock, or to break stale locks.  The SQLite
  1746  // core reserves all opcodes less than 100 for its own use.
  1747  // A [file control opcodes | list of opcodes] less than 100 is available.
  1748  // Applications that define a custom xFileControl method should use opcodes
  1749  // greater than 100 to avoid conflicts.  VFS implementations should
  1750  // return [SQLITE_NOTFOUND] for file control opcodes that they do not
  1751  // recognize.
  1752  //
  1753  // The xSectorSize() method returns the sector size of the
  1754  // device that underlies the file.  The sector size is the
  1755  // minimum write that can be performed without disturbing
  1756  // other bytes in the file.  The xDeviceCharacteristics()
  1757  // method returns a bit vector describing behaviors of the
  1758  // underlying device:
  1759  //
  1760  // <ul>
  1761  // <li> [SQLITE_IOCAP_ATOMIC]
  1762  // <li> [SQLITE_IOCAP_ATOMIC512]
  1763  // <li> [SQLITE_IOCAP_ATOMIC1K]
  1764  // <li> [SQLITE_IOCAP_ATOMIC2K]
  1765  // <li> [SQLITE_IOCAP_ATOMIC4K]
  1766  // <li> [SQLITE_IOCAP_ATOMIC8K]
  1767  // <li> [SQLITE_IOCAP_ATOMIC16K]
  1768  // <li> [SQLITE_IOCAP_ATOMIC32K]
  1769  // <li> [SQLITE_IOCAP_ATOMIC64K]
  1770  // <li> [SQLITE_IOCAP_SAFE_APPEND]
  1771  // <li> [SQLITE_IOCAP_SEQUENTIAL]
  1772  // <li> [SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN]
  1773  // <li> [SQLITE_IOCAP_POWERSAFE_OVERWRITE]
  1774  // <li> [SQLITE_IOCAP_IMMUTABLE]
  1775  // <li> [SQLITE_IOCAP_BATCH_ATOMIC]
  1776  // </ul>
  1777  //
  1778  // The SQLITE_IOCAP_ATOMIC property means that all writes of
  1779  // any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values
  1780  // mean that writes of blocks that are nnn bytes in size and
  1781  // are aligned to an address which is an integer multiple of
  1782  // nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means
  1783  // that when data is appended to a file, the data is appended
  1784  // first then the size of the file is extended, never the other
  1785  // way around.  The SQLITE_IOCAP_SEQUENTIAL property means that
  1786  // information is written to disk in the same order as calls
  1787  // to xWrite().
  1788  //
  1789  // If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill
  1790  // in the unread portions of the buffer with zeros.  A VFS that
  1791  // fails to zero-fill short reads might seem to work.  However,
  1792  // failure to zero-fill short reads will eventually lead to
  1793  // database corruption.
  1794  type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:783:35 */
  1795  
  1796  // CAPI3REF: OS Interface Object
  1797  //
  1798  // An instance of the sqlite3_vfs object defines the interface between
  1799  // the SQLite core and the underlying operating system.  The "vfs"
  1800  // in the name of the object stands for "virtual file system".  See
  1801  // the [VFS | VFS documentation] for further information.
  1802  //
  1803  // The VFS interface is sometimes extended by adding new methods onto
  1804  // the end.  Each time such an extension occurs, the iVersion field
  1805  // is incremented.  The iVersion value started out as 1 in
  1806  // SQLite [version 3.5.0] on [dateof:3.5.0], then increased to 2
  1807  // with SQLite [version 3.7.0] on [dateof:3.7.0], and then increased
  1808  // to 3 with SQLite [version 3.7.6] on [dateof:3.7.6].  Additional fields
  1809  // may be appended to the sqlite3_vfs object and the iVersion value
  1810  // may increase again in future versions of SQLite.
  1811  // Note that due to an oversight, the structure
  1812  // of the sqlite3_vfs object changed in the transition from
  1813  // SQLite [version 3.5.9] to [version 3.6.0] on [dateof:3.6.0]
  1814  // and yet the iVersion field was not increased.
  1815  //
  1816  // The szOsFile field is the size of the subclassed [sqlite3_file]
  1817  // structure used by this VFS.  mxPathname is the maximum length of
  1818  // a pathname in this VFS.
  1819  //
  1820  // Registered sqlite3_vfs objects are kept on a linked list formed by
  1821  // the pNext pointer.  The [sqlite3_vfs_register()]
  1822  // and [sqlite3_vfs_unregister()] interfaces manage this list
  1823  // in a thread-safe way.  The [sqlite3_vfs_find()] interface
  1824  // searches the list.  Neither the application code nor the VFS
  1825  // implementation should use the pNext pointer.
  1826  //
  1827  // The pNext field is the only field in the sqlite3_vfs
  1828  // structure that SQLite will ever modify.  SQLite will only access
  1829  // or modify this field while holding a particular static mutex.
  1830  // The application should never modify anything within the sqlite3_vfs
  1831  // object once the object has been registered.
  1832  //
  1833  // The zName field holds the name of the VFS module.  The name must
  1834  // be unique across all VFS modules.
  1835  //
  1836  // [[sqlite3_vfs.xOpen]]
  1837  // ^SQLite guarantees that the zFilename parameter to xOpen
  1838  // is either a NULL pointer or string obtained
  1839  // from xFullPathname() with an optional suffix added.
  1840  // ^If a suffix is added to the zFilename parameter, it will
  1841  // consist of a single "-" character followed by no more than
  1842  // 11 alphanumeric and/or "-" characters.
  1843  // ^SQLite further guarantees that
  1844  // the string will be valid and unchanged until xClose() is
  1845  // called. Because of the previous sentence,
  1846  // the [sqlite3_file] can safely store a pointer to the
  1847  // filename if it needs to remember the filename for some reason.
  1848  // If the zFilename parameter to xOpen is a NULL pointer then xOpen
  1849  // must invent its own temporary name for the file.  ^Whenever the
  1850  // xFilename parameter is NULL it will also be the case that the
  1851  // flags parameter will include [SQLITE_OPEN_DELETEONCLOSE].
  1852  //
  1853  // The flags argument to xOpen() includes all bits set in
  1854  // the flags argument to [sqlite3_open_v2()].  Or if [sqlite3_open()]
  1855  // or [sqlite3_open16()] is used, then flags includes at least
  1856  // [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE].
  1857  // If xOpen() opens a file read-only then it sets *pOutFlags to
  1858  // include [SQLITE_OPEN_READONLY].  Other bits in *pOutFlags may be set.
  1859  //
  1860  // ^(SQLite will also add one of the following flags to the xOpen()
  1861  // call, depending on the object being opened:
  1862  //
  1863  // <ul>
  1864  // <li>  [SQLITE_OPEN_MAIN_DB]
  1865  // <li>  [SQLITE_OPEN_MAIN_JOURNAL]
  1866  // <li>  [SQLITE_OPEN_TEMP_DB]
  1867  // <li>  [SQLITE_OPEN_TEMP_JOURNAL]
  1868  // <li>  [SQLITE_OPEN_TRANSIENT_DB]
  1869  // <li>  [SQLITE_OPEN_SUBJOURNAL]
  1870  // <li>  [SQLITE_OPEN_SUPER_JOURNAL]
  1871  // <li>  [SQLITE_OPEN_WAL]
  1872  // </ul>)^
  1873  //
  1874  // The file I/O implementation can use the object type flags to
  1875  // change the way it deals with files.  For example, an application
  1876  // that does not care about crash recovery or rollback might make
  1877  // the open of a journal file a no-op.  Writes to this journal would
  1878  // also be no-ops, and any attempt to read the journal would return
  1879  // SQLITE_IOERR.  Or the implementation might recognize that a database
  1880  // file will be doing page-aligned sector reads and writes in a random
  1881  // order and set up its I/O subsystem accordingly.
  1882  //
  1883  // SQLite might also add one of the following flags to the xOpen method:
  1884  //
  1885  // <ul>
  1886  // <li> [SQLITE_OPEN_DELETEONCLOSE]
  1887  // <li> [SQLITE_OPEN_EXCLUSIVE]
  1888  // </ul>
  1889  //
  1890  // The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be
  1891  // deleted when it is closed.  ^The [SQLITE_OPEN_DELETEONCLOSE]
  1892  // will be set for TEMP databases and their journals, transient
  1893  // databases, and subjournals.
  1894  //
  1895  // ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction
  1896  // with the [SQLITE_OPEN_CREATE] flag, which are both directly
  1897  // analogous to the O_EXCL and O_CREAT flags of the POSIX open()
  1898  // API.  The SQLITE_OPEN_EXCLUSIVE flag, when paired with the
  1899  // SQLITE_OPEN_CREATE, is used to indicate that file should always
  1900  // be created, and that it is an error if it already exists.
  1901  // It is <i>not</i> used to indicate the file should be opened
  1902  // for exclusive access.
  1903  //
  1904  // ^At least szOsFile bytes of memory are allocated by SQLite
  1905  // to hold the [sqlite3_file] structure passed as the third
  1906  // argument to xOpen.  The xOpen method does not have to
  1907  // allocate the structure; it should just fill it in.  Note that
  1908  // the xOpen method must set the sqlite3_file.pMethods to either
  1909  // a valid [sqlite3_io_methods] object or to NULL.  xOpen must do
  1910  // this even if the open fails.  SQLite expects that the sqlite3_file.pMethods
  1911  // element will be valid after xOpen returns regardless of the success
  1912  // or failure of the xOpen call.
  1913  //
  1914  // [[sqlite3_vfs.xAccess]]
  1915  // ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS]
  1916  // to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to
  1917  // test whether a file is readable and writable, or [SQLITE_ACCESS_READ]
  1918  // to test whether a file is at least readable.  The SQLITE_ACCESS_READ
  1919  // flag is never actually used and is not implemented in the built-in
  1920  // VFSes of SQLite.  The file is named by the second argument and can be a
  1921  // directory. The xAccess method returns [SQLITE_OK] on success or some
  1922  // non-zero error code if there is an I/O error or if the name of
  1923  // the file given in the second argument is illegal.  If SQLITE_OK
  1924  // is returned, then non-zero or zero is written into *pResOut to indicate
  1925  // whether or not the file is accessible.
  1926  //
  1927  // ^SQLite will always allocate at least mxPathname+1 bytes for the
  1928  // output buffer xFullPathname.  The exact size of the output buffer
  1929  // is also passed as a parameter to both  methods. If the output buffer
  1930  // is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is
  1931  // handled as a fatal error by SQLite, vfs implementations should endeavor
  1932  // to prevent this by setting mxPathname to a sufficiently large value.
  1933  //
  1934  // The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64()
  1935  // interfaces are not strictly a part of the filesystem, but they are
  1936  // included in the VFS structure for completeness.
  1937  // The xRandomness() function attempts to return nBytes bytes
  1938  // of good-quality randomness into zOut.  The return value is
  1939  // the actual number of bytes of randomness obtained.
  1940  // The xSleep() method causes the calling thread to sleep for at
  1941  // least the number of microseconds given.  ^The xCurrentTime()
  1942  // method returns a Julian Day Number for the current date and time as
  1943  // a floating point value.
  1944  // ^The xCurrentTimeInt64() method returns, as an integer, the Julian
  1945  // Day Number multiplied by 86400000 (the number of milliseconds in
  1946  // a 24-hour day).
  1947  // ^SQLite will use the xCurrentTimeInt64() method to get the current
  1948  // date and time if that method is available (if iVersion is 2 or
  1949  // greater and the function pointer is not NULL) and will fall back
  1950  // to xCurrentTime() if xCurrentTimeInt64() is unavailable.
  1951  //
  1952  // ^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces
  1953  // are not used by the SQLite core.  These optional interfaces are provided
  1954  // by some VFSes to facilitate testing of the VFS code. By overriding
  1955  // system calls with functions under its control, a test program can
  1956  // simulate faults and error conditions that would otherwise be difficult
  1957  // or impossible to induce.  The set of system calls that can be overridden
  1958  // varies from one VFS to another, and from one version of the same VFS to the
  1959  // next.  Applications that use these interfaces must be prepared for any
  1960  // or all of these interfaces to be NULL or for their behavior to change
  1961  // from one release to the next.  Applications must not attempt to access
  1962  // any of these methods if the iVersion of the VFS is less than 3.
  1963  type sqlite3_vfs1 = struct {
  1964  	iVersion          int32
  1965  	szOsFile          int32
  1966  	mxPathname        int32
  1967  	_                 [4]byte
  1968  	pNext             uintptr
  1969  	zName             uintptr
  1970  	pAppData          uintptr
  1971  	xOpen             uintptr
  1972  	xDelete           uintptr
  1973  	xAccess           uintptr
  1974  	xFullPathname     uintptr
  1975  	xDlOpen           uintptr
  1976  	xDlError          uintptr
  1977  	xDlSym            uintptr
  1978  	xDlClose          uintptr
  1979  	xRandomness       uintptr
  1980  	xSleep            uintptr
  1981  	xCurrentTime      uintptr
  1982  	xGetLastError     uintptr
  1983  	xCurrentTimeInt64 uintptr
  1984  	xSetSystemCall    uintptr
  1985  	xGetSystemCall    uintptr
  1986  	xNextSystemCall   uintptr
  1987  } /* sqlite3.h:1387:9 */
  1988  
  1989  // CAPI3REF: OS Interface Object
  1990  //
  1991  // An instance of the sqlite3_vfs object defines the interface between
  1992  // the SQLite core and the underlying operating system.  The "vfs"
  1993  // in the name of the object stands for "virtual file system".  See
  1994  // the [VFS | VFS documentation] for further information.
  1995  //
  1996  // The VFS interface is sometimes extended by adding new methods onto
  1997  // the end.  Each time such an extension occurs, the iVersion field
  1998  // is incremented.  The iVersion value started out as 1 in
  1999  // SQLite [version 3.5.0] on [dateof:3.5.0], then increased to 2
  2000  // with SQLite [version 3.7.0] on [dateof:3.7.0], and then increased
  2001  // to 3 with SQLite [version 3.7.6] on [dateof:3.7.6].  Additional fields
  2002  // may be appended to the sqlite3_vfs object and the iVersion value
  2003  // may increase again in future versions of SQLite.
  2004  // Note that due to an oversight, the structure
  2005  // of the sqlite3_vfs object changed in the transition from
  2006  // SQLite [version 3.5.9] to [version 3.6.0] on [dateof:3.6.0]
  2007  // and yet the iVersion field was not increased.
  2008  //
  2009  // The szOsFile field is the size of the subclassed [sqlite3_file]
  2010  // structure used by this VFS.  mxPathname is the maximum length of
  2011  // a pathname in this VFS.
  2012  //
  2013  // Registered sqlite3_vfs objects are kept on a linked list formed by
  2014  // the pNext pointer.  The [sqlite3_vfs_register()]
  2015  // and [sqlite3_vfs_unregister()] interfaces manage this list
  2016  // in a thread-safe way.  The [sqlite3_vfs_find()] interface
  2017  // searches the list.  Neither the application code nor the VFS
  2018  // implementation should use the pNext pointer.
  2019  //
  2020  // The pNext field is the only field in the sqlite3_vfs
  2021  // structure that SQLite will ever modify.  SQLite will only access
  2022  // or modify this field while holding a particular static mutex.
  2023  // The application should never modify anything within the sqlite3_vfs
  2024  // object once the object has been registered.
  2025  //
  2026  // The zName field holds the name of the VFS module.  The name must
  2027  // be unique across all VFS modules.
  2028  //
  2029  // [[sqlite3_vfs.xOpen]]
  2030  // ^SQLite guarantees that the zFilename parameter to xOpen
  2031  // is either a NULL pointer or string obtained
  2032  // from xFullPathname() with an optional suffix added.
  2033  // ^If a suffix is added to the zFilename parameter, it will
  2034  // consist of a single "-" character followed by no more than
  2035  // 11 alphanumeric and/or "-" characters.
  2036  // ^SQLite further guarantees that
  2037  // the string will be valid and unchanged until xClose() is
  2038  // called. Because of the previous sentence,
  2039  // the [sqlite3_file] can safely store a pointer to the
  2040  // filename if it needs to remember the filename for some reason.
  2041  // If the zFilename parameter to xOpen is a NULL pointer then xOpen
  2042  // must invent its own temporary name for the file.  ^Whenever the
  2043  // xFilename parameter is NULL it will also be the case that the
  2044  // flags parameter will include [SQLITE_OPEN_DELETEONCLOSE].
  2045  //
  2046  // The flags argument to xOpen() includes all bits set in
  2047  // the flags argument to [sqlite3_open_v2()].  Or if [sqlite3_open()]
  2048  // or [sqlite3_open16()] is used, then flags includes at least
  2049  // [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE].
  2050  // If xOpen() opens a file read-only then it sets *pOutFlags to
  2051  // include [SQLITE_OPEN_READONLY].  Other bits in *pOutFlags may be set.
  2052  //
  2053  // ^(SQLite will also add one of the following flags to the xOpen()
  2054  // call, depending on the object being opened:
  2055  //
  2056  // <ul>
  2057  // <li>  [SQLITE_OPEN_MAIN_DB]
  2058  // <li>  [SQLITE_OPEN_MAIN_JOURNAL]
  2059  // <li>  [SQLITE_OPEN_TEMP_DB]
  2060  // <li>  [SQLITE_OPEN_TEMP_JOURNAL]
  2061  // <li>  [SQLITE_OPEN_TRANSIENT_DB]
  2062  // <li>  [SQLITE_OPEN_SUBJOURNAL]
  2063  // <li>  [SQLITE_OPEN_SUPER_JOURNAL]
  2064  // <li>  [SQLITE_OPEN_WAL]
  2065  // </ul>)^
  2066  //
  2067  // The file I/O implementation can use the object type flags to
  2068  // change the way it deals with files.  For example, an application
  2069  // that does not care about crash recovery or rollback might make
  2070  // the open of a journal file a no-op.  Writes to this journal would
  2071  // also be no-ops, and any attempt to read the journal would return
  2072  // SQLITE_IOERR.  Or the implementation might recognize that a database
  2073  // file will be doing page-aligned sector reads and writes in a random
  2074  // order and set up its I/O subsystem accordingly.
  2075  //
  2076  // SQLite might also add one of the following flags to the xOpen method:
  2077  //
  2078  // <ul>
  2079  // <li> [SQLITE_OPEN_DELETEONCLOSE]
  2080  // <li> [SQLITE_OPEN_EXCLUSIVE]
  2081  // </ul>
  2082  //
  2083  // The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be
  2084  // deleted when it is closed.  ^The [SQLITE_OPEN_DELETEONCLOSE]
  2085  // will be set for TEMP databases and their journals, transient
  2086  // databases, and subjournals.
  2087  //
  2088  // ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction
  2089  // with the [SQLITE_OPEN_CREATE] flag, which are both directly
  2090  // analogous to the O_EXCL and O_CREAT flags of the POSIX open()
  2091  // API.  The SQLITE_OPEN_EXCLUSIVE flag, when paired with the
  2092  // SQLITE_OPEN_CREATE, is used to indicate that file should always
  2093  // be created, and that it is an error if it already exists.
  2094  // It is <i>not</i> used to indicate the file should be opened
  2095  // for exclusive access.
  2096  //
  2097  // ^At least szOsFile bytes of memory are allocated by SQLite
  2098  // to hold the [sqlite3_file] structure passed as the third
  2099  // argument to xOpen.  The xOpen method does not have to
  2100  // allocate the structure; it should just fill it in.  Note that
  2101  // the xOpen method must set the sqlite3_file.pMethods to either
  2102  // a valid [sqlite3_io_methods] object or to NULL.  xOpen must do
  2103  // this even if the open fails.  SQLite expects that the sqlite3_file.pMethods
  2104  // element will be valid after xOpen returns regardless of the success
  2105  // or failure of the xOpen call.
  2106  //
  2107  // [[sqlite3_vfs.xAccess]]
  2108  // ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS]
  2109  // to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to
  2110  // test whether a file is readable and writable, or [SQLITE_ACCESS_READ]
  2111  // to test whether a file is at least readable.  The SQLITE_ACCESS_READ
  2112  // flag is never actually used and is not implemented in the built-in
  2113  // VFSes of SQLite.  The file is named by the second argument and can be a
  2114  // directory. The xAccess method returns [SQLITE_OK] on success or some
  2115  // non-zero error code if there is an I/O error or if the name of
  2116  // the file given in the second argument is illegal.  If SQLITE_OK
  2117  // is returned, then non-zero or zero is written into *pResOut to indicate
  2118  // whether or not the file is accessible.
  2119  //
  2120  // ^SQLite will always allocate at least mxPathname+1 bytes for the
  2121  // output buffer xFullPathname.  The exact size of the output buffer
  2122  // is also passed as a parameter to both  methods. If the output buffer
  2123  // is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is
  2124  // handled as a fatal error by SQLite, vfs implementations should endeavor
  2125  // to prevent this by setting mxPathname to a sufficiently large value.
  2126  //
  2127  // The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64()
  2128  // interfaces are not strictly a part of the filesystem, but they are
  2129  // included in the VFS structure for completeness.
  2130  // The xRandomness() function attempts to return nBytes bytes
  2131  // of good-quality randomness into zOut.  The return value is
  2132  // the actual number of bytes of randomness obtained.
  2133  // The xSleep() method causes the calling thread to sleep for at
  2134  // least the number of microseconds given.  ^The xCurrentTime()
  2135  // method returns a Julian Day Number for the current date and time as
  2136  // a floating point value.
  2137  // ^The xCurrentTimeInt64() method returns, as an integer, the Julian
  2138  // Day Number multiplied by 86400000 (the number of milliseconds in
  2139  // a 24-hour day).
  2140  // ^SQLite will use the xCurrentTimeInt64() method to get the current
  2141  // date and time if that method is available (if iVersion is 2 or
  2142  // greater and the function pointer is not NULL) and will fall back
  2143  // to xCurrentTime() if xCurrentTimeInt64() is unavailable.
  2144  //
  2145  // ^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces
  2146  // are not used by the SQLite core.  These optional interfaces are provided
  2147  // by some VFSes to facilitate testing of the VFS code. By overriding
  2148  // system calls with functions under its control, a test program can
  2149  // simulate faults and error conditions that would otherwise be difficult
  2150  // or impossible to induce.  The set of system calls that can be overridden
  2151  // varies from one VFS to another, and from one version of the same VFS to the
  2152  // next.  Applications that use these interfaces must be prepared for any
  2153  // or all of these interfaces to be NULL or for their behavior to change
  2154  // from one release to the next.  Applications must not attempt to access
  2155  // any of these methods if the iVersion of the VFS is less than 3.
  2156  type sqlite3_vfs = sqlite3_vfs1    /* sqlite3.h:1387:28 */
  2157  type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1388:14 */
  2158  
  2159  // CAPI3REF: Memory Allocation Routines
  2160  //
  2161  // An instance of this object defines the interface between SQLite
  2162  // and low-level memory allocation routines.
  2163  //
  2164  // This object is used in only one place in the SQLite interface.
  2165  // A pointer to an instance of this object is the argument to
  2166  // [sqlite3_config()] when the configuration option is
  2167  // [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC].
  2168  // By creating an instance of this object
  2169  // and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC])
  2170  // during configuration, an application can specify an alternative
  2171  // memory allocation subsystem for SQLite to use for all of its
  2172  // dynamic memory needs.
  2173  //
  2174  // Note that SQLite comes with several [built-in memory allocators]
  2175  // that are perfectly adequate for the overwhelming majority of applications
  2176  // and that this object is only useful to a tiny minority of applications
  2177  // with specialized memory allocation requirements.  This object is
  2178  // also used during testing of SQLite in order to specify an alternative
  2179  // memory allocator that simulates memory out-of-memory conditions in
  2180  // order to verify that SQLite recovers gracefully from such
  2181  // conditions.
  2182  //
  2183  // The xMalloc, xRealloc, and xFree methods must work like the
  2184  // malloc(), realloc() and free() functions from the standard C library.
  2185  // ^SQLite guarantees that the second argument to
  2186  // xRealloc is always a value returned by a prior call to xRoundup.
  2187  //
  2188  // xSize should return the allocated size of a memory allocation
  2189  // previously obtained from xMalloc or xRealloc.  The allocated size
  2190  // is always at least as big as the requested size but may be larger.
  2191  //
  2192  // The xRoundup method returns what would be the allocated size of
  2193  // a memory allocation given a particular requested size.  Most memory
  2194  // allocators round up memory allocations at least to the next multiple
  2195  // of 8.  Some allocators round up to a larger multiple or to a power of 2.
  2196  // Every memory allocation request coming in through [sqlite3_malloc()]
  2197  // or [sqlite3_realloc()] first calls xRoundup.  If xRoundup returns 0,
  2198  // that causes the corresponding memory allocation to fail.
  2199  //
  2200  // The xInit method initializes the memory allocator.  For example,
  2201  // it might allocate any required mutexes or initialize internal data
  2202  // structures.  The xShutdown method is invoked (indirectly) by
  2203  // [sqlite3_shutdown()] and should deallocate any resources acquired
  2204  // by xInit.  The pAppData pointer is used as the only parameter to
  2205  // xInit and xShutdown.
  2206  //
  2207  // SQLite holds the [SQLITE_MUTEX_STATIC_MAIN] mutex when it invokes
  2208  // the xInit method, so the xInit method need not be threadsafe.  The
  2209  // xShutdown method is only called from [sqlite3_shutdown()] so it does
  2210  // not need to be threadsafe either.  For all other methods, SQLite
  2211  // holds the [SQLITE_MUTEX_STATIC_MEM] mutex as long as the
  2212  // [SQLITE_CONFIG_MEMSTATUS] configuration option is turned on (which
  2213  // it is by default) and so the methods are automatically serialized.
  2214  // However, if [SQLITE_CONFIG_MEMSTATUS] is disabled, then the other
  2215  // methods must be threadsafe or else make their own arrangements for
  2216  // serialization.
  2217  //
  2218  // SQLite will never invoke xInit() more than once without an intervening
  2219  // call to xShutdown().
  2220  type sqlite3_mem_methods1 = struct {
  2221  	xMalloc   uintptr
  2222  	xFree     uintptr
  2223  	xRealloc  uintptr
  2224  	xSize     uintptr
  2225  	xRoundup  uintptr
  2226  	xInit     uintptr
  2227  	xShutdown uintptr
  2228  	pAppData  uintptr
  2229  } /* sqlite3.h:1685:9 */
  2230  
  2231  // CAPI3REF: Memory Allocation Routines
  2232  //
  2233  // An instance of this object defines the interface between SQLite
  2234  // and low-level memory allocation routines.
  2235  //
  2236  // This object is used in only one place in the SQLite interface.
  2237  // A pointer to an instance of this object is the argument to
  2238  // [sqlite3_config()] when the configuration option is
  2239  // [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC].
  2240  // By creating an instance of this object
  2241  // and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC])
  2242  // during configuration, an application can specify an alternative
  2243  // memory allocation subsystem for SQLite to use for all of its
  2244  // dynamic memory needs.
  2245  //
  2246  // Note that SQLite comes with several [built-in memory allocators]
  2247  // that are perfectly adequate for the overwhelming majority of applications
  2248  // and that this object is only useful to a tiny minority of applications
  2249  // with specialized memory allocation requirements.  This object is
  2250  // also used during testing of SQLite in order to specify an alternative
  2251  // memory allocator that simulates memory out-of-memory conditions in
  2252  // order to verify that SQLite recovers gracefully from such
  2253  // conditions.
  2254  //
  2255  // The xMalloc, xRealloc, and xFree methods must work like the
  2256  // malloc(), realloc() and free() functions from the standard C library.
  2257  // ^SQLite guarantees that the second argument to
  2258  // xRealloc is always a value returned by a prior call to xRoundup.
  2259  //
  2260  // xSize should return the allocated size of a memory allocation
  2261  // previously obtained from xMalloc or xRealloc.  The allocated size
  2262  // is always at least as big as the requested size but may be larger.
  2263  //
  2264  // The xRoundup method returns what would be the allocated size of
  2265  // a memory allocation given a particular requested size.  Most memory
  2266  // allocators round up memory allocations at least to the next multiple
  2267  // of 8.  Some allocators round up to a larger multiple or to a power of 2.
  2268  // Every memory allocation request coming in through [sqlite3_malloc()]
  2269  // or [sqlite3_realloc()] first calls xRoundup.  If xRoundup returns 0,
  2270  // that causes the corresponding memory allocation to fail.
  2271  //
  2272  // The xInit method initializes the memory allocator.  For example,
  2273  // it might allocate any required mutexes or initialize internal data
  2274  // structures.  The xShutdown method is invoked (indirectly) by
  2275  // [sqlite3_shutdown()] and should deallocate any resources acquired
  2276  // by xInit.  The pAppData pointer is used as the only parameter to
  2277  // xInit and xShutdown.
  2278  //
  2279  // SQLite holds the [SQLITE_MUTEX_STATIC_MAIN] mutex when it invokes
  2280  // the xInit method, so the xInit method need not be threadsafe.  The
  2281  // xShutdown method is only called from [sqlite3_shutdown()] so it does
  2282  // not need to be threadsafe either.  For all other methods, SQLite
  2283  // holds the [SQLITE_MUTEX_STATIC_MEM] mutex as long as the
  2284  // [SQLITE_CONFIG_MEMSTATUS] configuration option is turned on (which
  2285  // it is by default) and so the methods are automatically serialized.
  2286  // However, if [SQLITE_CONFIG_MEMSTATUS] is disabled, then the other
  2287  // methods must be threadsafe or else make their own arrangements for
  2288  // serialization.
  2289  //
  2290  // SQLite will never invoke xInit() more than once without an intervening
  2291  // call to xShutdown().
  2292  type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1685:36 */
  2293  
  2294  // CAPI3REF: Constants Defining Special Destructor Behavior
  2295  //
  2296  // These are special values for the destructor that is passed in as the
  2297  // final argument to routines like [sqlite3_result_blob()].  ^If the destructor
  2298  // argument is SQLITE_STATIC, it means that the content pointer is constant
  2299  // and will never change.  It does not need to be destroyed.  ^The
  2300  // SQLITE_TRANSIENT value means that the content will likely change in
  2301  // the near future and that SQLite should make its own private copy of
  2302  // the content before returning.
  2303  //
  2304  // The typedef is necessary to work around problems in certain
  2305  // C++ compilers.
  2306  type sqlite3_destructor_type = uintptr /* sqlite3.h:5665:14 */
  2307  
  2308  // The interface to the virtual-table mechanism is currently considered
  2309  // to be experimental.  The interface might change in incompatible ways.
  2310  // If this is a problem for you, do not use the interface at this time.
  2311  //
  2312  // When the virtual-table mechanism stabilizes, we will declare the
  2313  // interface fixed, support it indefinitely, and remove this comment.
  2314  
  2315  // Structures used by the virtual table interface
  2316  type sqlite3_vtab1 = struct {
  2317  	pModule uintptr
  2318  	nRef    int32
  2319  	_       [4]byte
  2320  	zErrMsg uintptr
  2321  } /* sqlite3.h:6784:9 */
  2322  
  2323  // The interface to the virtual-table mechanism is currently considered
  2324  // to be experimental.  The interface might change in incompatible ways.
  2325  // If this is a problem for you, do not use the interface at this time.
  2326  //
  2327  // When the virtual-table mechanism stabilizes, we will declare the
  2328  // interface fixed, support it indefinitely, and remove this comment.
  2329  
  2330  // Structures used by the virtual table interface
  2331  type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6784:29 */
  2332  type sqlite3_index_info1 = struct {
  2333  	nConstraint      int32
  2334  	_                [4]byte
  2335  	aConstraint      uintptr
  2336  	nOrderBy         int32
  2337  	_                [4]byte
  2338  	aOrderBy         uintptr
  2339  	aConstraintUsage uintptr
  2340  	idxNum           int32
  2341  	_                [4]byte
  2342  	idxStr           uintptr
  2343  	needToFreeIdxStr int32
  2344  	orderByConsumed  int32
  2345  	estimatedCost    float64
  2346  	estimatedRows    sqlite3_int64
  2347  	idxFlags         int32
  2348  	_                [4]byte
  2349  	colUsed          sqlite3_uint64
  2350  } /* sqlite3.h:6785:9 */
  2351  
  2352  type sqlite3_index_info = sqlite3_index_info1       /* sqlite3.h:6785:35 */
  2353  type sqlite3_vtab_cursor1 = struct{ pVtab uintptr } /* sqlite3.h:6786:9 */
  2354  
  2355  type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6786:36 */
  2356  type sqlite3_module1 = struct {
  2357  	iVersion      int32
  2358  	_             [4]byte
  2359  	xCreate       uintptr
  2360  	xConnect      uintptr
  2361  	xBestIndex    uintptr
  2362  	xDisconnect   uintptr
  2363  	xDestroy      uintptr
  2364  	xOpen         uintptr
  2365  	xClose        uintptr
  2366  	xFilter       uintptr
  2367  	xNext         uintptr
  2368  	xEof          uintptr
  2369  	xColumn       uintptr
  2370  	xRowid        uintptr
  2371  	xUpdate       uintptr
  2372  	xBegin        uintptr
  2373  	xSync         uintptr
  2374  	xCommit       uintptr
  2375  	xRollback     uintptr
  2376  	xFindFunction uintptr
  2377  	xRename       uintptr
  2378  	xSavepoint    uintptr
  2379  	xRelease      uintptr
  2380  	xRollbackTo   uintptr
  2381  	xShadowName   uintptr
  2382  } /* sqlite3.h:6784:9 */
  2383  
  2384  type sqlite3_module = sqlite3_module1 /* sqlite3.h:6787:31 */
  2385  
  2386  // CAPI3REF: Virtual Table Indexing Information
  2387  // KEYWORDS: sqlite3_index_info
  2388  //
  2389  // The sqlite3_index_info structure and its substructures is used as part
  2390  // of the [virtual table] interface to
  2391  // pass information into and receive the reply from the [xBestIndex]
  2392  // method of a [virtual table module].  The fields under **Inputs** are the
  2393  // inputs to xBestIndex and are read-only.  xBestIndex inserts its
  2394  // results into the **Outputs** fields.
  2395  //
  2396  // ^(The aConstraint[] array records WHERE clause constraints of the form:
  2397  //
  2398  // <blockquote>column OP expr</blockquote>
  2399  //
  2400  // where OP is =, &lt;, &lt;=, &gt;, or &gt;=.)^  ^(The particular operator is
  2401  // stored in aConstraint[].op using one of the
  2402  // [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^
  2403  // ^(The index of the column is stored in
  2404  // aConstraint[].iColumn.)^  ^(aConstraint[].usable is TRUE if the
  2405  // expr on the right-hand side can be evaluated (and thus the constraint
  2406  // is usable) and false if it cannot.)^
  2407  //
  2408  // ^The optimizer automatically inverts terms of the form "expr OP column"
  2409  // and makes other simplifications to the WHERE clause in an attempt to
  2410  // get as many WHERE clause terms into the form shown above as possible.
  2411  // ^The aConstraint[] array only reports WHERE clause terms that are
  2412  // relevant to the particular virtual table being queried.
  2413  //
  2414  // ^Information about the ORDER BY clause is stored in aOrderBy[].
  2415  // ^Each term of aOrderBy records a column of the ORDER BY clause.
  2416  //
  2417  // The colUsed field indicates which columns of the virtual table may be
  2418  // required by the current scan. Virtual table columns are numbered from
  2419  // zero in the order in which they appear within the CREATE TABLE statement
  2420  // passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62),
  2421  // the corresponding bit is set within the colUsed mask if the column may be
  2422  // required by SQLite. If the table has at least 64 columns and any column
  2423  // to the right of the first 63 is required, then bit 63 of colUsed is also
  2424  // set. In other words, column iCol may be required if the expression
  2425  // (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to
  2426  // non-zero.
  2427  //
  2428  // The [xBestIndex] method must fill aConstraintUsage[] with information
  2429  // about what parameters to pass to xFilter.  ^If argvIndex>0 then
  2430  // the right-hand side of the corresponding aConstraint[] is evaluated
  2431  // and becomes the argvIndex-th entry in argv.  ^(If aConstraintUsage[].omit
  2432  // is true, then the constraint is assumed to be fully handled by the
  2433  // virtual table and might not be checked again by the byte code.)^ ^(The
  2434  // aConstraintUsage[].omit flag is an optimization hint. When the omit flag
  2435  // is left in its default setting of false, the constraint will always be
  2436  // checked separately in byte code.  If the omit flag is change to true, then
  2437  // the constraint may or may not be checked in byte code.  In other words,
  2438  // when the omit flag is true there is no guarantee that the constraint will
  2439  // not be checked again using byte code.)^
  2440  //
  2441  // ^The idxNum and idxPtr values are recorded and passed into the
  2442  // [xFilter] method.
  2443  // ^[sqlite3_free()] is used to free idxPtr if and only if
  2444  // needToFreeIdxPtr is true.
  2445  //
  2446  // ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in
  2447  // the correct order to satisfy the ORDER BY clause so that no separate
  2448  // sorting step is required.
  2449  //
  2450  // ^The estimatedCost value is an estimate of the cost of a particular
  2451  // strategy. A cost of N indicates that the cost of the strategy is similar
  2452  // to a linear scan of an SQLite table with N rows. A cost of log(N)
  2453  // indicates that the expense of the operation is similar to that of a
  2454  // binary search on a unique indexed field of an SQLite table with N rows.
  2455  //
  2456  // ^The estimatedRows value is an estimate of the number of rows that
  2457  // will be returned by the strategy.
  2458  //
  2459  // The xBestIndex method may optionally populate the idxFlags field with a
  2460  // mask of SQLITE_INDEX_SCAN_* flags. Currently there is only one such flag -
  2461  // SQLITE_INDEX_SCAN_UNIQUE. If the xBestIndex method sets this flag, SQLite
  2462  // assumes that the strategy may visit at most one row.
  2463  //
  2464  // Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then
  2465  // SQLite also assumes that if a call to the xUpdate() method is made as
  2466  // part of the same statement to delete or update a virtual table row and the
  2467  // implementation returns SQLITE_CONSTRAINT, then there is no need to rollback
  2468  // any database changes. In other words, if the xUpdate() returns
  2469  // SQLITE_CONSTRAINT, the database contents must be exactly as they were
  2470  // before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not
  2471  // set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by
  2472  // the xUpdate method are automatically rolled back by SQLite.
  2473  //
  2474  // IMPORTANT: The estimatedRows field was added to the sqlite3_index_info
  2475  // structure for SQLite [version 3.8.2] ([dateof:3.8.2]).
  2476  // If a virtual table extension is
  2477  // used with an SQLite version earlier than 3.8.2, the results of attempting
  2478  // to read or write the estimatedRows field are undefined (but are likely
  2479  // to include crashing the application). The estimatedRows field should
  2480  // therefore only be used if [sqlite3_libversion_number()] returns a
  2481  // value greater than or equal to 3008002. Similarly, the idxFlags field
  2482  // was added for [version 3.9.0] ([dateof:3.9.0]).
  2483  // It may therefore only be used if
  2484  // sqlite3_libversion_number() returns a value greater than or equal to
  2485  // 3009000.
  2486  type sqlite3_index_constraint = struct {
  2487  	iColumn     int32
  2488  	op          uint8
  2489  	usable      uint8
  2490  	_           [2]byte
  2491  	iTermOffset int32
  2492  } /* sqlite3.h:6785:9 */
  2493  
  2494  // CAPI3REF: Virtual Table Indexing Information
  2495  // KEYWORDS: sqlite3_index_info
  2496  //
  2497  // The sqlite3_index_info structure and its substructures is used as part
  2498  // of the [virtual table] interface to
  2499  // pass information into and receive the reply from the [xBestIndex]
  2500  // method of a [virtual table module].  The fields under **Inputs** are the
  2501  // inputs to xBestIndex and are read-only.  xBestIndex inserts its
  2502  // results into the **Outputs** fields.
  2503  //
  2504  // ^(The aConstraint[] array records WHERE clause constraints of the form:
  2505  //
  2506  // <blockquote>column OP expr</blockquote>
  2507  //
  2508  // where OP is =, &lt;, &lt;=, &gt;, or &gt;=.)^  ^(The particular operator is
  2509  // stored in aConstraint[].op using one of the
  2510  // [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^
  2511  // ^(The index of the column is stored in
  2512  // aConstraint[].iColumn.)^  ^(aConstraint[].usable is TRUE if the
  2513  // expr on the right-hand side can be evaluated (and thus the constraint
  2514  // is usable) and false if it cannot.)^
  2515  //
  2516  // ^The optimizer automatically inverts terms of the form "expr OP column"
  2517  // and makes other simplifications to the WHERE clause in an attempt to
  2518  // get as many WHERE clause terms into the form shown above as possible.
  2519  // ^The aConstraint[] array only reports WHERE clause terms that are
  2520  // relevant to the particular virtual table being queried.
  2521  //
  2522  // ^Information about the ORDER BY clause is stored in aOrderBy[].
  2523  // ^Each term of aOrderBy records a column of the ORDER BY clause.
  2524  //
  2525  // The colUsed field indicates which columns of the virtual table may be
  2526  // required by the current scan. Virtual table columns are numbered from
  2527  // zero in the order in which they appear within the CREATE TABLE statement
  2528  // passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62),
  2529  // the corresponding bit is set within the colUsed mask if the column may be
  2530  // required by SQLite. If the table has at least 64 columns and any column
  2531  // to the right of the first 63 is required, then bit 63 of colUsed is also
  2532  // set. In other words, column iCol may be required if the expression
  2533  // (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to
  2534  // non-zero.
  2535  //
  2536  // The [xBestIndex] method must fill aConstraintUsage[] with information
  2537  // about what parameters to pass to xFilter.  ^If argvIndex>0 then
  2538  // the right-hand side of the corresponding aConstraint[] is evaluated
  2539  // and becomes the argvIndex-th entry in argv.  ^(If aConstraintUsage[].omit
  2540  // is true, then the constraint is assumed to be fully handled by the
  2541  // virtual table and might not be checked again by the byte code.)^ ^(The
  2542  // aConstraintUsage[].omit flag is an optimization hint. When the omit flag
  2543  // is left in its default setting of false, the constraint will always be
  2544  // checked separately in byte code.  If the omit flag is change to true, then
  2545  // the constraint may or may not be checked in byte code.  In other words,
  2546  // when the omit flag is true there is no guarantee that the constraint will
  2547  // not be checked again using byte code.)^
  2548  //
  2549  // ^The idxNum and idxPtr values are recorded and passed into the
  2550  // [xFilter] method.
  2551  // ^[sqlite3_free()] is used to free idxPtr if and only if
  2552  // needToFreeIdxPtr is true.
  2553  //
  2554  // ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in
  2555  // the correct order to satisfy the ORDER BY clause so that no separate
  2556  // sorting step is required.
  2557  //
  2558  // ^The estimatedCost value is an estimate of the cost of a particular
  2559  // strategy. A cost of N indicates that the cost of the strategy is similar
  2560  // to a linear scan of an SQLite table with N rows. A cost of log(N)
  2561  // indicates that the expense of the operation is similar to that of a
  2562  // binary search on a unique indexed field of an SQLite table with N rows.
  2563  //
  2564  // ^The estimatedRows value is an estimate of the number of rows that
  2565  // will be returned by the strategy.
  2566  //
  2567  // The xBestIndex method may optionally populate the idxFlags field with a
  2568  // mask of SQLITE_INDEX_SCAN_* flags. Currently there is only one such flag -
  2569  // SQLITE_INDEX_SCAN_UNIQUE. If the xBestIndex method sets this flag, SQLite
  2570  // assumes that the strategy may visit at most one row.
  2571  //
  2572  // Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then
  2573  // SQLite also assumes that if a call to the xUpdate() method is made as
  2574  // part of the same statement to delete or update a virtual table row and the
  2575  // implementation returns SQLITE_CONSTRAINT, then there is no need to rollback
  2576  // any database changes. In other words, if the xUpdate() returns
  2577  // SQLITE_CONSTRAINT, the database contents must be exactly as they were
  2578  // before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not
  2579  // set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by
  2580  // the xUpdate method are automatically rolled back by SQLite.
  2581  //
  2582  // IMPORTANT: The estimatedRows field was added to the sqlite3_index_info
  2583  // structure for SQLite [version 3.8.2] ([dateof:3.8.2]).
  2584  // If a virtual table extension is
  2585  // used with an SQLite version earlier than 3.8.2, the results of attempting
  2586  // to read or write the estimatedRows field are undefined (but are likely
  2587  // to include crashing the application). The estimatedRows field should
  2588  // therefore only be used if [sqlite3_libversion_number()] returns a
  2589  // value greater than or equal to 3008002. Similarly, the idxFlags field
  2590  // was added for [version 3.9.0] ([dateof:3.9.0]).
  2591  // It may therefore only be used if
  2592  // sqlite3_libversion_number() returns a value greater than or equal to
  2593  // 3009000.
  2594  type sqlite3_index_orderby = struct {
  2595  	iColumn int32
  2596  	desc    uint8
  2597  	_       [3]byte
  2598  } /* sqlite3.h:6785:9 */
  2599  
  2600  // CAPI3REF: Virtual Table Indexing Information
  2601  // KEYWORDS: sqlite3_index_info
  2602  //
  2603  // The sqlite3_index_info structure and its substructures is used as part
  2604  // of the [virtual table] interface to
  2605  // pass information into and receive the reply from the [xBestIndex]
  2606  // method of a [virtual table module].  The fields under **Inputs** are the
  2607  // inputs to xBestIndex and are read-only.  xBestIndex inserts its
  2608  // results into the **Outputs** fields.
  2609  //
  2610  // ^(The aConstraint[] array records WHERE clause constraints of the form:
  2611  //
  2612  // <blockquote>column OP expr</blockquote>
  2613  //
  2614  // where OP is =, &lt;, &lt;=, &gt;, or &gt;=.)^  ^(The particular operator is
  2615  // stored in aConstraint[].op using one of the
  2616  // [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^
  2617  // ^(The index of the column is stored in
  2618  // aConstraint[].iColumn.)^  ^(aConstraint[].usable is TRUE if the
  2619  // expr on the right-hand side can be evaluated (and thus the constraint
  2620  // is usable) and false if it cannot.)^
  2621  //
  2622  // ^The optimizer automatically inverts terms of the form "expr OP column"
  2623  // and makes other simplifications to the WHERE clause in an attempt to
  2624  // get as many WHERE clause terms into the form shown above as possible.
  2625  // ^The aConstraint[] array only reports WHERE clause terms that are
  2626  // relevant to the particular virtual table being queried.
  2627  //
  2628  // ^Information about the ORDER BY clause is stored in aOrderBy[].
  2629  // ^Each term of aOrderBy records a column of the ORDER BY clause.
  2630  //
  2631  // The colUsed field indicates which columns of the virtual table may be
  2632  // required by the current scan. Virtual table columns are numbered from
  2633  // zero in the order in which they appear within the CREATE TABLE statement
  2634  // passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62),
  2635  // the corresponding bit is set within the colUsed mask if the column may be
  2636  // required by SQLite. If the table has at least 64 columns and any column
  2637  // to the right of the first 63 is required, then bit 63 of colUsed is also
  2638  // set. In other words, column iCol may be required if the expression
  2639  // (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to
  2640  // non-zero.
  2641  //
  2642  // The [xBestIndex] method must fill aConstraintUsage[] with information
  2643  // about what parameters to pass to xFilter.  ^If argvIndex>0 then
  2644  // the right-hand side of the corresponding aConstraint[] is evaluated
  2645  // and becomes the argvIndex-th entry in argv.  ^(If aConstraintUsage[].omit
  2646  // is true, then the constraint is assumed to be fully handled by the
  2647  // virtual table and might not be checked again by the byte code.)^ ^(The
  2648  // aConstraintUsage[].omit flag is an optimization hint. When the omit flag
  2649  // is left in its default setting of false, the constraint will always be
  2650  // checked separately in byte code.  If the omit flag is change to true, then
  2651  // the constraint may or may not be checked in byte code.  In other words,
  2652  // when the omit flag is true there is no guarantee that the constraint will
  2653  // not be checked again using byte code.)^
  2654  //
  2655  // ^The idxNum and idxPtr values are recorded and passed into the
  2656  // [xFilter] method.
  2657  // ^[sqlite3_free()] is used to free idxPtr if and only if
  2658  // needToFreeIdxPtr is true.
  2659  //
  2660  // ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in
  2661  // the correct order to satisfy the ORDER BY clause so that no separate
  2662  // sorting step is required.
  2663  //
  2664  // ^The estimatedCost value is an estimate of the cost of a particular
  2665  // strategy. A cost of N indicates that the cost of the strategy is similar
  2666  // to a linear scan of an SQLite table with N rows. A cost of log(N)
  2667  // indicates that the expense of the operation is similar to that of a
  2668  // binary search on a unique indexed field of an SQLite table with N rows.
  2669  //
  2670  // ^The estimatedRows value is an estimate of the number of rows that
  2671  // will be returned by the strategy.
  2672  //
  2673  // The xBestIndex method may optionally populate the idxFlags field with a
  2674  // mask of SQLITE_INDEX_SCAN_* flags. Currently there is only one such flag -
  2675  // SQLITE_INDEX_SCAN_UNIQUE. If the xBestIndex method sets this flag, SQLite
  2676  // assumes that the strategy may visit at most one row.
  2677  //
  2678  // Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then
  2679  // SQLite also assumes that if a call to the xUpdate() method is made as
  2680  // part of the same statement to delete or update a virtual table row and the
  2681  // implementation returns SQLITE_CONSTRAINT, then there is no need to rollback
  2682  // any database changes. In other words, if the xUpdate() returns
  2683  // SQLITE_CONSTRAINT, the database contents must be exactly as they were
  2684  // before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not
  2685  // set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by
  2686  // the xUpdate method are automatically rolled back by SQLite.
  2687  //
  2688  // IMPORTANT: The estimatedRows field was added to the sqlite3_index_info
  2689  // structure for SQLite [version 3.8.2] ([dateof:3.8.2]).
  2690  // If a virtual table extension is
  2691  // used with an SQLite version earlier than 3.8.2, the results of attempting
  2692  // to read or write the estimatedRows field are undefined (but are likely
  2693  // to include crashing the application). The estimatedRows field should
  2694  // therefore only be used if [sqlite3_libversion_number()] returns a
  2695  // value greater than or equal to 3008002. Similarly, the idxFlags field
  2696  // was added for [version 3.9.0] ([dateof:3.9.0]).
  2697  // It may therefore only be used if
  2698  // sqlite3_libversion_number() returns a value greater than or equal to
  2699  // 3009000.
  2700  type sqlite3_index_constraint_usage = struct {
  2701  	argvIndex int32
  2702  	omit      uint8
  2703  	_         [3]byte
  2704  } /* sqlite3.h:6785:9 */
  2705  
  2706  // CAPI3REF: Mutex Methods Object
  2707  //
  2708  // An instance of this structure defines the low-level routines
  2709  // used to allocate and use mutexes.
  2710  //
  2711  // Usually, the default mutex implementations provided by SQLite are
  2712  // sufficient, however the application has the option of substituting a custom
  2713  // implementation for specialized deployments or systems for which SQLite
  2714  // does not provide a suitable implementation. In this case, the application
  2715  // creates and populates an instance of this structure to pass
  2716  // to sqlite3_config() along with the [SQLITE_CONFIG_MUTEX] option.
  2717  // Additionally, an instance of this structure can be used as an
  2718  // output variable when querying the system for the current mutex
  2719  // implementation, using the [SQLITE_CONFIG_GETMUTEX] option.
  2720  //
  2721  // ^The xMutexInit method defined by this structure is invoked as
  2722  // part of system initialization by the sqlite3_initialize() function.
  2723  // ^The xMutexInit routine is called by SQLite exactly once for each
  2724  // effective call to [sqlite3_initialize()].
  2725  //
  2726  // ^The xMutexEnd method defined by this structure is invoked as
  2727  // part of system shutdown by the sqlite3_shutdown() function. The
  2728  // implementation of this method is expected to release all outstanding
  2729  // resources obtained by the mutex methods implementation, especially
  2730  // those obtained by the xMutexInit method.  ^The xMutexEnd()
  2731  // interface is invoked exactly once for each call to [sqlite3_shutdown()].
  2732  //
  2733  // ^(The remaining seven methods defined by this structure (xMutexAlloc,
  2734  // xMutexFree, xMutexEnter, xMutexTry, xMutexLeave, xMutexHeld and
  2735  // xMutexNotheld) implement the following interfaces (respectively):
  2736  //
  2737  // <ul>
  2738  //   <li>  [sqlite3_mutex_alloc()] </li>
  2739  //   <li>  [sqlite3_mutex_free()] </li>
  2740  //   <li>  [sqlite3_mutex_enter()] </li>
  2741  //   <li>  [sqlite3_mutex_try()] </li>
  2742  //   <li>  [sqlite3_mutex_leave()] </li>
  2743  //   <li>  [sqlite3_mutex_held()] </li>
  2744  //   <li>  [sqlite3_mutex_notheld()] </li>
  2745  // </ul>)^
  2746  //
  2747  // The only difference is that the public sqlite3_XXX functions enumerated
  2748  // above silently ignore any invocations that pass a NULL pointer instead
  2749  // of a valid mutex handle. The implementations of the methods defined
  2750  // by this structure are not required to handle this case. The results
  2751  // of passing a NULL pointer instead of a valid mutex handle are undefined
  2752  // (i.e. it is acceptable to provide an implementation that segfaults if
  2753  // it is passed a NULL pointer).
  2754  //
  2755  // The xMutexInit() method must be threadsafe.  It must be harmless to
  2756  // invoke xMutexInit() multiple times within the same process and without
  2757  // intervening calls to xMutexEnd().  Second and subsequent calls to
  2758  // xMutexInit() must be no-ops.
  2759  //
  2760  // xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()]
  2761  // and its associates).  Similarly, xMutexAlloc() must not use SQLite memory
  2762  // allocation for a static mutex.  ^However xMutexAlloc() may use SQLite
  2763  // memory allocation for a fast or recursive mutex.
  2764  //
  2765  // ^SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is
  2766  // called, but only if the prior call to xMutexInit returned SQLITE_OK.
  2767  // If xMutexInit fails in any way, it is expected to clean up after itself
  2768  // prior to returning.
  2769  type sqlite3_mutex_methods1 = struct {
  2770  	xMutexInit    uintptr
  2771  	xMutexEnd     uintptr
  2772  	xMutexAlloc   uintptr
  2773  	xMutexFree    uintptr
  2774  	xMutexEnter   uintptr
  2775  	xMutexTry     uintptr
  2776  	xMutexLeave   uintptr
  2777  	xMutexHeld    uintptr
  2778  	xMutexNotheld uintptr
  2779  } /* sqlite3.h:7619:9 */
  2780  
  2781  // CAPI3REF: Mutex Methods Object
  2782  //
  2783  // An instance of this structure defines the low-level routines
  2784  // used to allocate and use mutexes.
  2785  //
  2786  // Usually, the default mutex implementations provided by SQLite are
  2787  // sufficient, however the application has the option of substituting a custom
  2788  // implementation for specialized deployments or systems for which SQLite
  2789  // does not provide a suitable implementation. In this case, the application
  2790  // creates and populates an instance of this structure to pass
  2791  // to sqlite3_config() along with the [SQLITE_CONFIG_MUTEX] option.
  2792  // Additionally, an instance of this structure can be used as an
  2793  // output variable when querying the system for the current mutex
  2794  // implementation, using the [SQLITE_CONFIG_GETMUTEX] option.
  2795  //
  2796  // ^The xMutexInit method defined by this structure is invoked as
  2797  // part of system initialization by the sqlite3_initialize() function.
  2798  // ^The xMutexInit routine is called by SQLite exactly once for each
  2799  // effective call to [sqlite3_initialize()].
  2800  //
  2801  // ^The xMutexEnd method defined by this structure is invoked as
  2802  // part of system shutdown by the sqlite3_shutdown() function. The
  2803  // implementation of this method is expected to release all outstanding
  2804  // resources obtained by the mutex methods implementation, especially
  2805  // those obtained by the xMutexInit method.  ^The xMutexEnd()
  2806  // interface is invoked exactly once for each call to [sqlite3_shutdown()].
  2807  //
  2808  // ^(The remaining seven methods defined by this structure (xMutexAlloc,
  2809  // xMutexFree, xMutexEnter, xMutexTry, xMutexLeave, xMutexHeld and
  2810  // xMutexNotheld) implement the following interfaces (respectively):
  2811  //
  2812  // <ul>
  2813  //   <li>  [sqlite3_mutex_alloc()] </li>
  2814  //   <li>  [sqlite3_mutex_free()] </li>
  2815  //   <li>  [sqlite3_mutex_enter()] </li>
  2816  //   <li>  [sqlite3_mutex_try()] </li>
  2817  //   <li>  [sqlite3_mutex_leave()] </li>
  2818  //   <li>  [sqlite3_mutex_held()] </li>
  2819  //   <li>  [sqlite3_mutex_notheld()] </li>
  2820  // </ul>)^
  2821  //
  2822  // The only difference is that the public sqlite3_XXX functions enumerated
  2823  // above silently ignore any invocations that pass a NULL pointer instead
  2824  // of a valid mutex handle. The implementations of the methods defined
  2825  // by this structure are not required to handle this case. The results
  2826  // of passing a NULL pointer instead of a valid mutex handle are undefined
  2827  // (i.e. it is acceptable to provide an implementation that segfaults if
  2828  // it is passed a NULL pointer).
  2829  //
  2830  // The xMutexInit() method must be threadsafe.  It must be harmless to
  2831  // invoke xMutexInit() multiple times within the same process and without
  2832  // intervening calls to xMutexEnd().  Second and subsequent calls to
  2833  // xMutexInit() must be no-ops.
  2834  //
  2835  // xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()]
  2836  // and its associates).  Similarly, xMutexAlloc() must not use SQLite memory
  2837  // allocation for a static mutex.  ^However xMutexAlloc() may use SQLite
  2838  // memory allocation for a fast or recursive mutex.
  2839  //
  2840  // ^SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is
  2841  // called, but only if the prior call to xMutexInit returned SQLITE_OK.
  2842  // If xMutexInit fails in any way, it is expected to clean up after itself
  2843  // prior to returning.
  2844  type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7619:38 */
  2845  
  2846  // CAPI3REF: Custom Page Cache Object
  2847  //
  2848  // The sqlite3_pcache_page object represents a single page in the
  2849  // page cache.  The page cache will allocate instances of this
  2850  // object.  Various methods of the page cache use pointers to instances
  2851  // of this object as parameters or as their return value.
  2852  //
  2853  // See [sqlite3_pcache_methods2] for additional information.
  2854  type sqlite3_pcache_page1 = struct {
  2855  	pBuf   uintptr
  2856  	pExtra uintptr
  2857  } /* sqlite3.h:8375:9 */
  2858  
  2859  // CAPI3REF: Custom Page Cache Object
  2860  //
  2861  // The sqlite3_pcache_page object represents a single page in the
  2862  // page cache.  The page cache will allocate instances of this
  2863  // object.  Various methods of the page cache use pointers to instances
  2864  // of this object as parameters or as their return value.
  2865  //
  2866  // See [sqlite3_pcache_methods2] for additional information.
  2867  type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8375:36 */
  2868  
  2869  // CAPI3REF: Application Defined Page Cache.
  2870  // KEYWORDS: {page cache}
  2871  //
  2872  // ^(The [sqlite3_config]([SQLITE_CONFIG_PCACHE2], ...) interface can
  2873  // register an alternative page cache implementation by passing in an
  2874  // instance of the sqlite3_pcache_methods2 structure.)^
  2875  // In many applications, most of the heap memory allocated by
  2876  // SQLite is used for the page cache.
  2877  // By implementing a
  2878  // custom page cache using this API, an application can better control
  2879  // the amount of memory consumed by SQLite, the way in which
  2880  // that memory is allocated and released, and the policies used to
  2881  // determine exactly which parts of a database file are cached and for
  2882  // how long.
  2883  //
  2884  // The alternative page cache mechanism is an
  2885  // extreme measure that is only needed by the most demanding applications.
  2886  // The built-in page cache is recommended for most uses.
  2887  //
  2888  // ^(The contents of the sqlite3_pcache_methods2 structure are copied to an
  2889  // internal buffer by SQLite within the call to [sqlite3_config].  Hence
  2890  // the application may discard the parameter after the call to
  2891  // [sqlite3_config()] returns.)^
  2892  //
  2893  // [[the xInit() page cache method]]
  2894  // ^(The xInit() method is called once for each effective
  2895  // call to [sqlite3_initialize()])^
  2896  // (usually only once during the lifetime of the process). ^(The xInit()
  2897  // method is passed a copy of the sqlite3_pcache_methods2.pArg value.)^
  2898  // The intent of the xInit() method is to set up global data structures
  2899  // required by the custom page cache implementation.
  2900  // ^(If the xInit() method is NULL, then the
  2901  // built-in default page cache is used instead of the application defined
  2902  // page cache.)^
  2903  //
  2904  // [[the xShutdown() page cache method]]
  2905  // ^The xShutdown() method is called by [sqlite3_shutdown()].
  2906  // It can be used to clean up
  2907  // any outstanding resources before process shutdown, if required.
  2908  // ^The xShutdown() method may be NULL.
  2909  //
  2910  // ^SQLite automatically serializes calls to the xInit method,
  2911  // so the xInit method need not be threadsafe.  ^The
  2912  // xShutdown method is only called from [sqlite3_shutdown()] so it does
  2913  // not need to be threadsafe either.  All other methods must be threadsafe
  2914  // in multithreaded applications.
  2915  //
  2916  // ^SQLite will never invoke xInit() more than once without an intervening
  2917  // call to xShutdown().
  2918  //
  2919  // [[the xCreate() page cache methods]]
  2920  // ^SQLite invokes the xCreate() method to construct a new cache instance.
  2921  // SQLite will typically create one cache instance for each open database file,
  2922  // though this is not guaranteed. ^The
  2923  // first parameter, szPage, is the size in bytes of the pages that must
  2924  // be allocated by the cache.  ^szPage will always a power of two.  ^The
  2925  // second parameter szExtra is a number of bytes of extra storage
  2926  // associated with each page cache entry.  ^The szExtra parameter will
  2927  // a number less than 250.  SQLite will use the
  2928  // extra szExtra bytes on each page to store metadata about the underlying
  2929  // database page on disk.  The value passed into szExtra depends
  2930  // on the SQLite version, the target platform, and how SQLite was compiled.
  2931  // ^The third argument to xCreate(), bPurgeable, is true if the cache being
  2932  // created will be used to cache database pages of a file stored on disk, or
  2933  // false if it is used for an in-memory database. The cache implementation
  2934  // does not have to do anything special based with the value of bPurgeable;
  2935  // it is purely advisory.  ^On a cache where bPurgeable is false, SQLite will
  2936  // never invoke xUnpin() except to deliberately delete a page.
  2937  // ^In other words, calls to xUnpin() on a cache with bPurgeable set to
  2938  // false will always have the "discard" flag set to true.
  2939  // ^Hence, a cache created with bPurgeable false will
  2940  // never contain any unpinned pages.
  2941  //
  2942  // [[the xCachesize() page cache method]]
  2943  // ^(The xCachesize() method may be called at any time by SQLite to set the
  2944  // suggested maximum cache-size (number of pages stored by) the cache
  2945  // instance passed as the first argument. This is the value configured using
  2946  // the SQLite "[PRAGMA cache_size]" command.)^  As with the bPurgeable
  2947  // parameter, the implementation is not required to do anything with this
  2948  // value; it is advisory only.
  2949  //
  2950  // [[the xPagecount() page cache methods]]
  2951  // The xPagecount() method must return the number of pages currently
  2952  // stored in the cache, both pinned and unpinned.
  2953  //
  2954  // [[the xFetch() page cache methods]]
  2955  // The xFetch() method locates a page in the cache and returns a pointer to
  2956  // an sqlite3_pcache_page object associated with that page, or a NULL pointer.
  2957  // The pBuf element of the returned sqlite3_pcache_page object will be a
  2958  // pointer to a buffer of szPage bytes used to store the content of a
  2959  // single database page.  The pExtra element of sqlite3_pcache_page will be
  2960  // a pointer to the szExtra bytes of extra storage that SQLite has requested
  2961  // for each entry in the page cache.
  2962  //
  2963  // The page to be fetched is determined by the key. ^The minimum key value
  2964  // is 1.  After it has been retrieved using xFetch, the page is considered
  2965  // to be "pinned".
  2966  //
  2967  // If the requested page is already in the page cache, then the page cache
  2968  // implementation must return a pointer to the page buffer with its content
  2969  // intact.  If the requested page is not already in the cache, then the
  2970  // cache implementation should use the value of the createFlag
  2971  // parameter to help it determined what action to take:
  2972  //
  2973  // <table border=1 width=85% align=center>
  2974  // <tr><th> createFlag <th> Behavior when page is not already in cache
  2975  // <tr><td> 0 <td> Do not allocate a new page.  Return NULL.
  2976  // <tr><td> 1 <td> Allocate a new page if it easy and convenient to do so.
  2977  //                 Otherwise return NULL.
  2978  // <tr><td> 2 <td> Make every effort to allocate a new page.  Only return
  2979  //                 NULL if allocating a new page is effectively impossible.
  2980  // </table>
  2981  //
  2982  // ^(SQLite will normally invoke xFetch() with a createFlag of 0 or 1.  SQLite
  2983  // will only use a createFlag of 2 after a prior call with a createFlag of 1
  2984  // failed.)^  In between the xFetch() calls, SQLite may
  2985  // attempt to unpin one or more cache pages by spilling the content of
  2986  // pinned pages to disk and synching the operating system disk cache.
  2987  //
  2988  // [[the xUnpin() page cache method]]
  2989  // ^xUnpin() is called by SQLite with a pointer to a currently pinned page
  2990  // as its second argument.  If the third parameter, discard, is non-zero,
  2991  // then the page must be evicted from the cache.
  2992  // ^If the discard parameter is
  2993  // zero, then the page may be discarded or retained at the discretion of
  2994  // page cache implementation. ^The page cache implementation
  2995  // may choose to evict unpinned pages at any time.
  2996  //
  2997  // The cache must not perform any reference counting. A single
  2998  // call to xUnpin() unpins the page regardless of the number of prior calls
  2999  // to xFetch().
  3000  //
  3001  // [[the xRekey() page cache methods]]
  3002  // The xRekey() method is used to change the key value associated with the
  3003  // page passed as the second argument. If the cache
  3004  // previously contains an entry associated with newKey, it must be
  3005  // discarded. ^Any prior cache entry associated with newKey is guaranteed not
  3006  // to be pinned.
  3007  //
  3008  // When SQLite calls the xTruncate() method, the cache must discard all
  3009  // existing cache entries with page numbers (keys) greater than or equal
  3010  // to the value of the iLimit parameter passed to xTruncate(). If any
  3011  // of these pages are pinned, they are implicitly unpinned, meaning that
  3012  // they can be safely discarded.
  3013  //
  3014  // [[the xDestroy() page cache method]]
  3015  // ^The xDestroy() method is used to delete a cache allocated by xCreate().
  3016  // All resources associated with the specified cache should be freed. ^After
  3017  // calling the xDestroy() method, SQLite considers the [sqlite3_pcache*]
  3018  // handle invalid, and will not use it with any other sqlite3_pcache_methods2
  3019  // functions.
  3020  //
  3021  // [[the xShrink() page cache method]]
  3022  // ^SQLite invokes the xShrink() method when it wants the page cache to
  3023  // free up as much of heap memory as possible.  The page cache implementation
  3024  // is not obligated to free any memory, but well-behaved implementations should
  3025  // do their best.
  3026  type sqlite3_pcache_methods21 = struct {
  3027  	iVersion   int32
  3028  	_          [4]byte
  3029  	pArg       uintptr
  3030  	xInit      uintptr
  3031  	xShutdown  uintptr
  3032  	xCreate    uintptr
  3033  	xCachesize uintptr
  3034  	xPagecount uintptr
  3035  	xFetch     uintptr
  3036  	xUnpin     uintptr
  3037  	xRekey     uintptr
  3038  	xTruncate  uintptr
  3039  	xDestroy   uintptr
  3040  	xShrink    uintptr
  3041  } /* sqlite3.h:8540:9 */
  3042  
  3043  // CAPI3REF: Application Defined Page Cache.
  3044  // KEYWORDS: {page cache}
  3045  //
  3046  // ^(The [sqlite3_config]([SQLITE_CONFIG_PCACHE2], ...) interface can
  3047  // register an alternative page cache implementation by passing in an
  3048  // instance of the sqlite3_pcache_methods2 structure.)^
  3049  // In many applications, most of the heap memory allocated by
  3050  // SQLite is used for the page cache.
  3051  // By implementing a
  3052  // custom page cache using this API, an application can better control
  3053  // the amount of memory consumed by SQLite, the way in which
  3054  // that memory is allocated and released, and the policies used to
  3055  // determine exactly which parts of a database file are cached and for
  3056  // how long.
  3057  //
  3058  // The alternative page cache mechanism is an
  3059  // extreme measure that is only needed by the most demanding applications.
  3060  // The built-in page cache is recommended for most uses.
  3061  //
  3062  // ^(The contents of the sqlite3_pcache_methods2 structure are copied to an
  3063  // internal buffer by SQLite within the call to [sqlite3_config].  Hence
  3064  // the application may discard the parameter after the call to
  3065  // [sqlite3_config()] returns.)^
  3066  //
  3067  // [[the xInit() page cache method]]
  3068  // ^(The xInit() method is called once for each effective
  3069  // call to [sqlite3_initialize()])^
  3070  // (usually only once during the lifetime of the process). ^(The xInit()
  3071  // method is passed a copy of the sqlite3_pcache_methods2.pArg value.)^
  3072  // The intent of the xInit() method is to set up global data structures
  3073  // required by the custom page cache implementation.
  3074  // ^(If the xInit() method is NULL, then the
  3075  // built-in default page cache is used instead of the application defined
  3076  // page cache.)^
  3077  //
  3078  // [[the xShutdown() page cache method]]
  3079  // ^The xShutdown() method is called by [sqlite3_shutdown()].
  3080  // It can be used to clean up
  3081  // any outstanding resources before process shutdown, if required.
  3082  // ^The xShutdown() method may be NULL.
  3083  //
  3084  // ^SQLite automatically serializes calls to the xInit method,
  3085  // so the xInit method need not be threadsafe.  ^The
  3086  // xShutdown method is only called from [sqlite3_shutdown()] so it does
  3087  // not need to be threadsafe either.  All other methods must be threadsafe
  3088  // in multithreaded applications.
  3089  //
  3090  // ^SQLite will never invoke xInit() more than once without an intervening
  3091  // call to xShutdown().
  3092  //
  3093  // [[the xCreate() page cache methods]]
  3094  // ^SQLite invokes the xCreate() method to construct a new cache instance.
  3095  // SQLite will typically create one cache instance for each open database file,
  3096  // though this is not guaranteed. ^The
  3097  // first parameter, szPage, is the size in bytes of the pages that must
  3098  // be allocated by the cache.  ^szPage will always a power of two.  ^The
  3099  // second parameter szExtra is a number of bytes of extra storage
  3100  // associated with each page cache entry.  ^The szExtra parameter will
  3101  // a number less than 250.  SQLite will use the
  3102  // extra szExtra bytes on each page to store metadata about the underlying
  3103  // database page on disk.  The value passed into szExtra depends
  3104  // on the SQLite version, the target platform, and how SQLite was compiled.
  3105  // ^The third argument to xCreate(), bPurgeable, is true if the cache being
  3106  // created will be used to cache database pages of a file stored on disk, or
  3107  // false if it is used for an in-memory database. The cache implementation
  3108  // does not have to do anything special based with the value of bPurgeable;
  3109  // it is purely advisory.  ^On a cache where bPurgeable is false, SQLite will
  3110  // never invoke xUnpin() except to deliberately delete a page.
  3111  // ^In other words, calls to xUnpin() on a cache with bPurgeable set to
  3112  // false will always have the "discard" flag set to true.
  3113  // ^Hence, a cache created with bPurgeable false will
  3114  // never contain any unpinned pages.
  3115  //
  3116  // [[the xCachesize() page cache method]]
  3117  // ^(The xCachesize() method may be called at any time by SQLite to set the
  3118  // suggested maximum cache-size (number of pages stored by) the cache
  3119  // instance passed as the first argument. This is the value configured using
  3120  // the SQLite "[PRAGMA cache_size]" command.)^  As with the bPurgeable
  3121  // parameter, the implementation is not required to do anything with this
  3122  // value; it is advisory only.
  3123  //
  3124  // [[the xPagecount() page cache methods]]
  3125  // The xPagecount() method must return the number of pages currently
  3126  // stored in the cache, both pinned and unpinned.
  3127  //
  3128  // [[the xFetch() page cache methods]]
  3129  // The xFetch() method locates a page in the cache and returns a pointer to
  3130  // an sqlite3_pcache_page object associated with that page, or a NULL pointer.
  3131  // The pBuf element of the returned sqlite3_pcache_page object will be a
  3132  // pointer to a buffer of szPage bytes used to store the content of a
  3133  // single database page.  The pExtra element of sqlite3_pcache_page will be
  3134  // a pointer to the szExtra bytes of extra storage that SQLite has requested
  3135  // for each entry in the page cache.
  3136  //
  3137  // The page to be fetched is determined by the key. ^The minimum key value
  3138  // is 1.  After it has been retrieved using xFetch, the page is considered
  3139  // to be "pinned".
  3140  //
  3141  // If the requested page is already in the page cache, then the page cache
  3142  // implementation must return a pointer to the page buffer with its content
  3143  // intact.  If the requested page is not already in the cache, then the
  3144  // cache implementation should use the value of the createFlag
  3145  // parameter to help it determined what action to take:
  3146  //
  3147  // <table border=1 width=85% align=center>
  3148  // <tr><th> createFlag <th> Behavior when page is not already in cache
  3149  // <tr><td> 0 <td> Do not allocate a new page.  Return NULL.
  3150  // <tr><td> 1 <td> Allocate a new page if it easy and convenient to do so.
  3151  //                 Otherwise return NULL.
  3152  // <tr><td> 2 <td> Make every effort to allocate a new page.  Only return
  3153  //                 NULL if allocating a new page is effectively impossible.
  3154  // </table>
  3155  //
  3156  // ^(SQLite will normally invoke xFetch() with a createFlag of 0 or 1.  SQLite
  3157  // will only use a createFlag of 2 after a prior call with a createFlag of 1
  3158  // failed.)^  In between the xFetch() calls, SQLite may
  3159  // attempt to unpin one or more cache pages by spilling the content of
  3160  // pinned pages to disk and synching the operating system disk cache.
  3161  //
  3162  // [[the xUnpin() page cache method]]
  3163  // ^xUnpin() is called by SQLite with a pointer to a currently pinned page
  3164  // as its second argument.  If the third parameter, discard, is non-zero,
  3165  // then the page must be evicted from the cache.
  3166  // ^If the discard parameter is
  3167  // zero, then the page may be discarded or retained at the discretion of
  3168  // page cache implementation. ^The page cache implementation
  3169  // may choose to evict unpinned pages at any time.
  3170  //
  3171  // The cache must not perform any reference counting. A single
  3172  // call to xUnpin() unpins the page regardless of the number of prior calls
  3173  // to xFetch().
  3174  //
  3175  // [[the xRekey() page cache methods]]
  3176  // The xRekey() method is used to change the key value associated with the
  3177  // page passed as the second argument. If the cache
  3178  // previously contains an entry associated with newKey, it must be
  3179  // discarded. ^Any prior cache entry associated with newKey is guaranteed not
  3180  // to be pinned.
  3181  //
  3182  // When SQLite calls the xTruncate() method, the cache must discard all
  3183  // existing cache entries with page numbers (keys) greater than or equal
  3184  // to the value of the iLimit parameter passed to xTruncate(). If any
  3185  // of these pages are pinned, they are implicitly unpinned, meaning that
  3186  // they can be safely discarded.
  3187  //
  3188  // [[the xDestroy() page cache method]]
  3189  // ^The xDestroy() method is used to delete a cache allocated by xCreate().
  3190  // All resources associated with the specified cache should be freed. ^After
  3191  // calling the xDestroy() method, SQLite considers the [sqlite3_pcache*]
  3192  // handle invalid, and will not use it with any other sqlite3_pcache_methods2
  3193  // functions.
  3194  //
  3195  // [[the xShrink() page cache method]]
  3196  // ^SQLite invokes the xShrink() method when it wants the page cache to
  3197  // free up as much of heap memory as possible.  The page cache implementation
  3198  // is not obligated to free any memory, but well-behaved implementations should
  3199  // do their best.
  3200  type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8540:40 */
  3201  
  3202  // This is the obsolete pcache_methods object that has now been replaced
  3203  // by sqlite3_pcache_methods2.  This object is not used by SQLite.  It is
  3204  // retained in the header file for backwards compatibility only.
  3205  type sqlite3_pcache_methods1 = struct {
  3206  	pArg       uintptr
  3207  	xInit      uintptr
  3208  	xShutdown  uintptr
  3209  	xCreate    uintptr
  3210  	xCachesize uintptr
  3211  	xPagecount uintptr
  3212  	xFetch     uintptr
  3213  	xUnpin     uintptr
  3214  	xRekey     uintptr
  3215  	xTruncate  uintptr
  3216  	xDestroy   uintptr
  3217  } /* sqlite3.h:8563:9 */
  3218  
  3219  // This is the obsolete pcache_methods object that has now been replaced
  3220  // by sqlite3_pcache_methods2.  This object is not used by SQLite.  It is
  3221  // retained in the header file for backwards compatibility only.
  3222  type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8563:39 */
  3223  
  3224  // CAPI3REF: Database Snapshot
  3225  // KEYWORDS: {snapshot} {sqlite3_snapshot}
  3226  //
  3227  // An instance of the snapshot object records the state of a [WAL mode]
  3228  // database for some specific point in history.
  3229  //
  3230  // In [WAL mode], multiple [database connections] that are open on the
  3231  // same database file can each be reading a different historical version
  3232  // of the database file.  When a [database connection] begins a read
  3233  // transaction, that connection sees an unchanging copy of the database
  3234  // as it existed for the point in time when the transaction first started.
  3235  // Subsequent changes to the database from other connections are not seen
  3236  // by the reader until a new read transaction is started.
  3237  //
  3238  // The sqlite3_snapshot object records state information about an historical
  3239  // version of the database file so that it is possible to later open a new read
  3240  // transaction that sees that historical version of the database rather than
  3241  // the most recent version.
  3242  type sqlite3_snapshot1 = struct{ hidden [48]uint8 } /* sqlite3.h:9630:9 */
  3243  
  3244  // CAPI3REF: Database Snapshot
  3245  // KEYWORDS: {snapshot} {sqlite3_snapshot}
  3246  //
  3247  // An instance of the snapshot object records the state of a [WAL mode]
  3248  // database for some specific point in history.
  3249  //
  3250  // In [WAL mode], multiple [database connections] that are open on the
  3251  // same database file can each be reading a different historical version
  3252  // of the database file.  When a [database connection] begins a read
  3253  // transaction, that connection sees an unchanging copy of the database
  3254  // as it existed for the point in time when the transaction first started.
  3255  // Subsequent changes to the database from other connections are not seen
  3256  // by the reader until a new read transaction is started.
  3257  //
  3258  // The sqlite3_snapshot object records state information about an historical
  3259  // version of the database file so that it is possible to later open a new read
  3260  // transaction that sees that historical version of the database rather than
  3261  // the most recent version.
  3262  type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9632:3 */
  3263  
  3264  // CAPI3REF: Flags for sqlite3_deserialize()
  3265  //
  3266  // The following are allowed values for 6th argument (the F argument) to
  3267  // the [sqlite3_deserialize(D,S,P,N,M,F)] interface.
  3268  //
  3269  // The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization
  3270  // in the P argument is held in memory obtained from [sqlite3_malloc64()]
  3271  // and that SQLite should take ownership of this memory and automatically
  3272  // free it when it has finished using it.  Without this flag, the caller
  3273  // is responsible for freeing any dynamically allocated memory.
  3274  //
  3275  // The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to
  3276  // grow the size of the database using calls to [sqlite3_realloc64()].  This
  3277  // flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used.
  3278  // Without this flag, the deserialized database cannot increase in size beyond
  3279  // the number of bytes specified by the M parameter.
  3280  //
  3281  // The SQLITE_DESERIALIZE_READONLY flag means that the deserialized database
  3282  // should be treated as read-only.
  3283  
  3284  // Undo the hack that converts floating point types to integer for
  3285  // builds on processors without floating point support.
  3286  
  3287  //******* Begin file sqlite3rtree.h ********
  3288  // 2010 August 30
  3289  //
  3290  // The author disclaims copyright to this source code.  In place of
  3291  // a legal notice, here is a blessing:
  3292  //
  3293  //    May you do good and not evil.
  3294  //    May you find forgiveness for yourself and forgive others.
  3295  //    May you share freely, never taking more than you give.
  3296  //
  3297  //
  3298  
  3299  type sqlite3_rtree_geometry1 = struct {
  3300  	pContext uintptr
  3301  	nParam   int32
  3302  	_        [4]byte
  3303  	aParam   uintptr
  3304  	pUser    uintptr
  3305  	xDelUser uintptr
  3306  } /* sqlite3.h:9957:9 */
  3307  
  3308  // CAPI3REF: Flags for sqlite3_deserialize()
  3309  //
  3310  // The following are allowed values for 6th argument (the F argument) to
  3311  // the [sqlite3_deserialize(D,S,P,N,M,F)] interface.
  3312  //
  3313  // The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization
  3314  // in the P argument is held in memory obtained from [sqlite3_malloc64()]
  3315  // and that SQLite should take ownership of this memory and automatically
  3316  // free it when it has finished using it.  Without this flag, the caller
  3317  // is responsible for freeing any dynamically allocated memory.
  3318  //
  3319  // The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to
  3320  // grow the size of the database using calls to [sqlite3_realloc64()].  This
  3321  // flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used.
  3322  // Without this flag, the deserialized database cannot increase in size beyond
  3323  // the number of bytes specified by the M parameter.
  3324  //
  3325  // The SQLITE_DESERIALIZE_READONLY flag means that the deserialized database
  3326  // should be treated as read-only.
  3327  
  3328  // Undo the hack that converts floating point types to integer for
  3329  // builds on processors without floating point support.
  3330  
  3331  //******* Begin file sqlite3rtree.h ********
  3332  // 2010 August 30
  3333  //
  3334  // The author disclaims copyright to this source code.  In place of
  3335  // a legal notice, here is a blessing:
  3336  //
  3337  //    May you do good and not evil.
  3338  //    May you find forgiveness for yourself and forgive others.
  3339  //    May you share freely, never taking more than you give.
  3340  //
  3341  //
  3342  
  3343  type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:9957:39 */
  3344  type sqlite3_rtree_query_info1 = struct {
  3345  	pContext      uintptr
  3346  	nParam        int32
  3347  	_             [4]byte
  3348  	aParam        uintptr
  3349  	pUser         uintptr
  3350  	xDelUser      uintptr
  3351  	aCoord        uintptr
  3352  	anQueue       uintptr
  3353  	nCoord        int32
  3354  	iLevel        int32
  3355  	mxLevel       int32
  3356  	_             [4]byte
  3357  	iRowid        sqlite3_int64
  3358  	rParentScore  sqlite3_rtree_dbl
  3359  	eParentWithin int32
  3360  	eWithin       int32
  3361  	rScore        sqlite3_rtree_dbl
  3362  	apSqlParam    uintptr
  3363  } /* sqlite3.h:9958:9 */
  3364  
  3365  type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:9958:41 */
  3366  
  3367  // The double-precision datatype used by RTree depends on the
  3368  // SQLITE_RTREE_INT_ONLY compile-time option.
  3369  type sqlite3_rtree_dbl = float64 /* sqlite3.h:9966:18 */
  3370  
  3371  // CAPI3REF: Values for sqlite3session_config().
  3372  
  3373  // Make sure we can call this stuff from C++.
  3374  
  3375  //******* End of sqlite3session.h ********
  3376  //******* Begin file fts5.h ********
  3377  // 2014 May 31
  3378  //
  3379  // The author disclaims copyright to this source code.  In place of
  3380  // a legal notice, here is a blessing:
  3381  //
  3382  //    May you do good and not evil.
  3383  //    May you find forgiveness for yourself and forgive others.
  3384  //    May you share freely, never taking more than you give.
  3385  //
  3386  //
  3387  //
  3388  // Interfaces to extend FTS5. Using the interfaces defined in this file,
  3389  // FTS5 may be extended with:
  3390  //
  3391  //     * custom tokenizers, and
  3392  //     * custom auxiliary functions.
  3393  
  3394  // ************************************************************************
  3395  //
  3396  // CUSTOM AUXILIARY FUNCTIONS
  3397  //
  3398  // Virtual table implementations may overload SQL functions by implementing
  3399  // the sqlite3_module.xFindFunction() method.
  3400  
  3401  type Fts5ExtensionApi1 = struct {
  3402  	iVersion           int32
  3403  	_                  [4]byte
  3404  	xUserData          uintptr
  3405  	xColumnCount       uintptr
  3406  	xRowCount          uintptr
  3407  	xColumnTotalSize   uintptr
  3408  	xTokenize          uintptr
  3409  	xPhraseCount       uintptr
  3410  	xPhraseSize        uintptr
  3411  	xInstCount         uintptr
  3412  	xInst              uintptr
  3413  	xRowid             uintptr
  3414  	xColumnText        uintptr
  3415  	xColumnSize        uintptr
  3416  	xQueryPhrase       uintptr
  3417  	xSetAuxdata        uintptr
  3418  	xGetAuxdata        uintptr
  3419  	xPhraseFirst       uintptr
  3420  	xPhraseNext        uintptr
  3421  	xPhraseFirstColumn uintptr
  3422  	xPhraseNextColumn  uintptr
  3423  } /* sqlite3.h:11813:9 */
  3424  
  3425  // CAPI3REF: Values for sqlite3session_config().
  3426  
  3427  // Make sure we can call this stuff from C++.
  3428  
  3429  //******* End of sqlite3session.h ********
  3430  //******* Begin file fts5.h ********
  3431  // 2014 May 31
  3432  //
  3433  // The author disclaims copyright to this source code.  In place of
  3434  // a legal notice, here is a blessing:
  3435  //
  3436  //    May you do good and not evil.
  3437  //    May you find forgiveness for yourself and forgive others.
  3438  //    May you share freely, never taking more than you give.
  3439  //
  3440  //
  3441  //
  3442  // Interfaces to extend FTS5. Using the interfaces defined in this file,
  3443  // FTS5 may be extended with:
  3444  //
  3445  //     * custom tokenizers, and
  3446  //     * custom auxiliary functions.
  3447  
  3448  // ************************************************************************
  3449  //
  3450  // CUSTOM AUXILIARY FUNCTIONS
  3451  //
  3452  // Virtual table implementations may overload SQL functions by implementing
  3453  // the sqlite3_module.xFindFunction() method.
  3454  
  3455  type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11813:33 */
  3456  type Fts5PhraseIter1 = struct {
  3457  	a uintptr
  3458  	b uintptr
  3459  } /* sqlite3.h:11815:9 */
  3460  
  3461  type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11815:31 */
  3462  
  3463  type fts5_extension_function = uintptr /* sqlite3.h:11817:14 */
  3464  type fts5_tokenizer1 = struct {
  3465  	xCreate   uintptr
  3466  	xDelete   uintptr
  3467  	xTokenize uintptr
  3468  } /* sqlite3.h:12276:9 */
  3469  
  3470  type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12276:31 */
  3471  
  3472  // Flags that may be passed as the third argument to xTokenize()
  3473  
  3474  // Flags that may be passed by the tokenizer implementation back to FTS5
  3475  // as the third argument to the supplied xToken callback.
  3476  
  3477  //
  3478  // END OF CUSTOM TOKENIZERS
  3479  //
  3480  
  3481  // ************************************************************************
  3482  //
  3483  // FTS5 EXTENSION REGISTRATION API
  3484  type fts5_api1 = struct {
  3485  	iVersion         int32
  3486  	_                [4]byte
  3487  	xCreateTokenizer uintptr
  3488  	xFindTokenizer   uintptr
  3489  	xCreateFunction  uintptr
  3490  } /* sqlite3.h:12312:9 */
  3491  
  3492  // Flags that may be passed as the third argument to xTokenize()
  3493  
  3494  // Flags that may be passed by the tokenizer implementation back to FTS5
  3495  // as the third argument to the supplied xToken callback.
  3496  
  3497  //
  3498  // END OF CUSTOM TOKENIZERS
  3499  //
  3500  
  3501  // ************************************************************************
  3502  //
  3503  // FTS5 EXTENSION REGISTRATION API
  3504  type fts5_api = fts5_api1 /* sqlite3.h:12312:25 */
  3505  
  3506  // The tag name of this struct is _G_fpos_t to preserve historic
  3507  //    C++ mangled names for functions taking fpos_t arguments.
  3508  //    That name should not be used in new code.
  3509  type _G_fpos_t = struct {
  3510  	__pos   int64
  3511  	__state struct {
  3512  		__count int32
  3513  		__value struct{ __wch uint32 }
  3514  	}
  3515  } /* __fpos_t.h:10:9 */
  3516  
  3517  // bits/types.h -- definitions of __*_t types underlying *_t types.
  3518  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
  3519  //    This file is part of the GNU C Library.
  3520  //
  3521  //    The GNU C Library is free software; you can redistribute it and/or
  3522  //    modify it under the terms of the GNU Lesser General Public
  3523  //    License as published by the Free Software Foundation; either
  3524  //    version 2.1 of the License, or (at your option) any later version.
  3525  //
  3526  //    The GNU C Library is distributed in the hope that it will be useful,
  3527  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  3528  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  3529  //    Lesser General Public License for more details.
  3530  //
  3531  //    You should have received a copy of the GNU Lesser General Public
  3532  //    License along with the GNU C Library; if not, see
  3533  //    <http://www.gnu.org/licenses/>.
  3534  
  3535  // Never include this file directly; use <sys/types.h> instead.
  3536  
  3537  // The tag name of this struct is _G_fpos64_t to preserve historic
  3538  //    C++ mangled names for functions taking fpos_t and/or fpos64_t
  3539  //    arguments.  That name should not be used in new code.
  3540  type _G_fpos64_t = struct {
  3541  	__pos   int64
  3542  	__state struct {
  3543  		__count int32
  3544  		__value struct{ __wch uint32 }
  3545  	}
  3546  } /* __fpos64_t.h:10:9 */
  3547  
  3548  type _IO_FILE = struct {
  3549  	_flags          int32
  3550  	_               [4]byte
  3551  	_IO_read_ptr    uintptr
  3552  	_IO_read_end    uintptr
  3553  	_IO_read_base   uintptr
  3554  	_IO_write_base  uintptr
  3555  	_IO_write_ptr   uintptr
  3556  	_IO_write_end   uintptr
  3557  	_IO_buf_base    uintptr
  3558  	_IO_buf_end     uintptr
  3559  	_IO_save_base   uintptr
  3560  	_IO_backup_base uintptr
  3561  	_IO_save_end    uintptr
  3562  	_markers        uintptr
  3563  	_chain          uintptr
  3564  	_fileno         int32
  3565  	_flags2         int32
  3566  	_old_offset     int64
  3567  	_cur_column     uint16
  3568  	_vtable_offset  int8
  3569  	_shortbuf       [1]int8
  3570  	_               [4]byte
  3571  	_lock           uintptr
  3572  	_offset         int64
  3573  	_codecvt        uintptr
  3574  	_wide_data      uintptr
  3575  	_freeres_list   uintptr
  3576  	_freeres_buf    uintptr
  3577  	__pad5          size_t
  3578  	_mode           int32
  3579  	_unused2        [20]int8
  3580  } /* __FILE.h:4:1 */
  3581  
  3582  // The opaque type of streams.  This is the definition used elsewhere.
  3583  type FILE = _IO_FILE /* FILE.h:7:25 */
  3584  
  3585  // These macros are used by bits/stdio.h and internal headers.
  3586  
  3587  // Many more flag bits are defined internally.
  3588  
  3589  type off_t = int64 /* stdio.h:65:19 */
  3590  
  3591  type ssize_t = int64 /* stdio.h:77:19 */
  3592  
  3593  // The type of the second argument to `fgetpos' and `fsetpos'.
  3594  type fpos_t = _G_fpos64_t /* stdio.h:86:20 */
  3595  
  3596  // If we are compiling with optimizing read this file.  It contains
  3597  //    several optimizing inline functions and macros.
  3598  
  3599  // Copyright (C) 1991-2018 Free Software Foundation, Inc.
  3600  //    This file is part of the GNU C Library.
  3601  //
  3602  //    The GNU C Library is free software; you can redistribute it and/or
  3603  //    modify it under the terms of the GNU Lesser General Public
  3604  //    License as published by the Free Software Foundation; either
  3605  //    version 2.1 of the License, or (at your option) any later version.
  3606  //
  3607  //    The GNU C Library is distributed in the hope that it will be useful,
  3608  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  3609  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  3610  //    Lesser General Public License for more details.
  3611  //
  3612  //    You should have received a copy of the GNU Lesser General Public
  3613  //    License along with the GNU C Library; if not, see
  3614  //    <http://www.gnu.org/licenses/>.
  3615  
  3616  //	POSIX Standard: 2.10 Symbolic Constants		<unistd.h>
  3617  
  3618  // Copyright (C) 1991-2018 Free Software Foundation, Inc.
  3619  //    This file is part of the GNU C Library.
  3620  //
  3621  //    The GNU C Library is free software; you can redistribute it and/or
  3622  //    modify it under the terms of the GNU Lesser General Public
  3623  //    License as published by the Free Software Foundation; either
  3624  //    version 2.1 of the License, or (at your option) any later version.
  3625  //
  3626  //    The GNU C Library is distributed in the hope that it will be useful,
  3627  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  3628  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  3629  //    Lesser General Public License for more details.
  3630  //
  3631  //    You should have received a copy of the GNU Lesser General Public
  3632  //    License along with the GNU C Library; if not, see
  3633  //    <http://www.gnu.org/licenses/>.
  3634  
  3635  // These may be used to determine what facilities are present at compile time.
  3636  //    Their values can be obtained at run time from `sysconf'.
  3637  
  3638  // POSIX Standard approved as ISO/IEC 9945-1 as of September 2008.
  3639  
  3640  // These are not #ifdef __USE_POSIX2 because they are
  3641  //    in the theoretically application-owned namespace.
  3642  
  3643  // The utilities on GNU systems also correspond to this version.
  3644  
  3645  // The utilities on GNU systems also correspond to this version.
  3646  
  3647  // This symbol was required until the 2001 edition of POSIX.
  3648  
  3649  // If defined, the implementation supports the
  3650  //    C Language Bindings Option.
  3651  
  3652  // If defined, the implementation supports the
  3653  //    C Language Development Utilities Option.
  3654  
  3655  // If defined, the implementation supports the
  3656  //    Software Development Utilities Option.
  3657  
  3658  // If defined, the implementation supports the
  3659  //    creation of locales with the localedef utility.
  3660  
  3661  // X/Open version number to which the library conforms.  It is selectable.
  3662  
  3663  // Commands and utilities from XPG4 are available.
  3664  
  3665  // We are compatible with the old published standards as well.
  3666  
  3667  // The X/Open Unix extensions are available.
  3668  
  3669  // The enhanced internationalization capabilities according to XPG4.2
  3670  //    are present.
  3671  
  3672  // The legacy interfaces are also available.
  3673  
  3674  // Get values of POSIX options:
  3675  //
  3676  //    If these symbols are defined, the corresponding features are
  3677  //    always available.  If not, they may be available sometimes.
  3678  //    The current values can be obtained with `sysconf'.
  3679  //
  3680  //    _POSIX_JOB_CONTROL		Job control is supported.
  3681  //    _POSIX_SAVED_IDS		Processes have a saved set-user-ID
  3682  // 				and a saved set-group-ID.
  3683  //    _POSIX_REALTIME_SIGNALS	Real-time, queued signals are supported.
  3684  //    _POSIX_PRIORITY_SCHEDULING	Priority scheduling is supported.
  3685  //    _POSIX_TIMERS		POSIX.4 clocks and timers are supported.
  3686  //    _POSIX_ASYNCHRONOUS_IO	Asynchronous I/O is supported.
  3687  //    _POSIX_PRIORITIZED_IO	Prioritized asynchronous I/O is supported.
  3688  //    _POSIX_SYNCHRONIZED_IO	Synchronizing file data is supported.
  3689  //    _POSIX_FSYNC			The fsync function is present.
  3690  //    _POSIX_MAPPED_FILES		Mapping of files to memory is supported.
  3691  //    _POSIX_MEMLOCK		Locking of all memory is supported.
  3692  //    _POSIX_MEMLOCK_RANGE		Locking of ranges of memory is supported.
  3693  //    _POSIX_MEMORY_PROTECTION	Setting of memory protections is supported.
  3694  //    _POSIX_MESSAGE_PASSING	POSIX.4 message queues are supported.
  3695  //    _POSIX_SEMAPHORES		POSIX.4 counting semaphores are supported.
  3696  //    _POSIX_SHARED_MEMORY_OBJECTS	POSIX.4 shared memory objects are supported.
  3697  //    _POSIX_THREADS		POSIX.1c pthreads are supported.
  3698  //    _POSIX_THREAD_ATTR_STACKADDR	Thread stack address attribute option supported.
  3699  //    _POSIX_THREAD_ATTR_STACKSIZE	Thread stack size attribute option supported.
  3700  //    _POSIX_THREAD_SAFE_FUNCTIONS	Thread-safe functions are supported.
  3701  //    _POSIX_THREAD_PRIORITY_SCHEDULING
  3702  // 				POSIX.1c thread execution scheduling supported.
  3703  //    _POSIX_THREAD_PRIO_INHERIT	Thread priority inheritance option supported.
  3704  //    _POSIX_THREAD_PRIO_PROTECT	Thread priority protection option supported.
  3705  //    _POSIX_THREAD_PROCESS_SHARED	Process-shared synchronization supported.
  3706  //    _POSIX_PII			Protocol-independent interfaces are supported.
  3707  //    _POSIX_PII_XTI		XTI protocol-indep. interfaces are supported.
  3708  //    _POSIX_PII_SOCKET		Socket protocol-indep. interfaces are supported.
  3709  //    _POSIX_PII_INTERNET		Internet family of protocols supported.
  3710  //    _POSIX_PII_INTERNET_STREAM	Connection-mode Internet protocol supported.
  3711  //    _POSIX_PII_INTERNET_DGRAM	Connectionless Internet protocol supported.
  3712  //    _POSIX_PII_OSI		ISO/OSI family of protocols supported.
  3713  //    _POSIX_PII_OSI_COTS		Connection-mode ISO/OSI service supported.
  3714  //    _POSIX_PII_OSI_CLTS		Connectionless ISO/OSI service supported.
  3715  //    _POSIX_POLL			Implementation supports `poll' function.
  3716  //    _POSIX_SELECT		Implementation supports `select' and `pselect'.
  3717  //
  3718  //    _XOPEN_REALTIME		X/Open realtime support is available.
  3719  //    _XOPEN_REALTIME_THREADS	X/Open realtime thread support is available.
  3720  //    _XOPEN_SHM			Shared memory interface according to XPG4.2.
  3721  //
  3722  //    _XBS5_ILP32_OFF32		Implementation provides environment with 32-bit
  3723  // 				int, long, pointer, and off_t types.
  3724  //    _XBS5_ILP32_OFFBIG		Implementation provides environment with 32-bit
  3725  // 				int, long, and pointer and off_t with at least
  3726  // 				64 bits.
  3727  //    _XBS5_LP64_OFF64		Implementation provides environment with 32-bit
  3728  // 				int, and 64-bit long, pointer, and off_t types.
  3729  //    _XBS5_LPBIG_OFFBIG		Implementation provides environment with at
  3730  // 				least 32 bits int and long, pointer, and off_t
  3731  // 				with at least 64 bits.
  3732  //
  3733  //    If any of these symbols is defined as -1, the corresponding option is not
  3734  //    true for any file.  If any is defined as other than -1, the corresponding
  3735  //    option is true for all files.  If a symbol is not defined at all, the value
  3736  //    for a specific file can be obtained from `pathconf' and `fpathconf'.
  3737  //
  3738  //    _POSIX_CHOWN_RESTRICTED	Only the super user can use `chown' to change
  3739  // 				the owner of a file.  `chown' can only be used
  3740  // 				to change the group ID of a file to a group of
  3741  // 				which the calling process is a member.
  3742  //    _POSIX_NO_TRUNC		Pathname components longer than
  3743  // 				NAME_MAX generate an error.
  3744  //    _POSIX_VDISABLE		If defined, if the value of an element of the
  3745  // 				`c_cc' member of `struct termios' is
  3746  // 				_POSIX_VDISABLE, no character will have the
  3747  // 				effect associated with that element.
  3748  //    _POSIX_SYNC_IO		Synchronous I/O may be performed.
  3749  //    _POSIX_ASYNC_IO		Asynchronous I/O may be performed.
  3750  //    _POSIX_PRIO_IO		Prioritized Asynchronous I/O may be performed.
  3751  //
  3752  //    Support for the Large File Support interface is not generally available.
  3753  //    If it is available the following constants are defined to one.
  3754  //    _LFS64_LARGEFILE		Low-level I/O supports large files.
  3755  //    _LFS64_STDIO			Standard I/O supports large files.
  3756  //
  3757  
  3758  // Define POSIX options for Linux.
  3759  //    Copyright (C) 1996-2018 Free Software Foundation, Inc.
  3760  //    This file is part of the GNU C Library.
  3761  //
  3762  //    The GNU C Library is free software; you can redistribute it and/or
  3763  //    modify it under the terms of the GNU Lesser General Public License as
  3764  //    published by the Free Software Foundation; either version 2.1 of the
  3765  //    License, or (at your option) any later version.
  3766  //
  3767  //    The GNU C Library is distributed in the hope that it will be useful,
  3768  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  3769  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  3770  //    Lesser General Public License for more details.
  3771  //
  3772  //    You should have received a copy of the GNU Lesser General Public
  3773  //    License along with the GNU C Library; see the file COPYING.LIB.  If
  3774  //    not, see <http://www.gnu.org/licenses/>.
  3775  
  3776  // Job control is supported.
  3777  
  3778  // Processes have a saved set-user-ID and a saved set-group-ID.
  3779  
  3780  // Priority scheduling is supported.
  3781  
  3782  // Synchronizing file data is supported.
  3783  
  3784  // The fsync function is present.
  3785  
  3786  // Mapping of files to memory is supported.
  3787  
  3788  // Locking of all memory is supported.
  3789  
  3790  // Locking of ranges of memory is supported.
  3791  
  3792  // Setting of memory protections is supported.
  3793  
  3794  // Some filesystems allow all users to change file ownership.
  3795  
  3796  // `c_cc' member of 'struct termios' structure can be disabled by
  3797  //    using the value _POSIX_VDISABLE.
  3798  
  3799  // Filenames are not silently truncated.
  3800  
  3801  // X/Open realtime support is available.
  3802  
  3803  // X/Open thread realtime support is available.
  3804  
  3805  // XPG4.2 shared memory is supported.
  3806  
  3807  // Tell we have POSIX threads.
  3808  
  3809  // We have the reentrant functions described in POSIX.
  3810  
  3811  // We provide priority scheduling for threads.
  3812  
  3813  // We support user-defined stack sizes.
  3814  
  3815  // We support user-defined stacks.
  3816  
  3817  // We support priority inheritence.
  3818  
  3819  // We support priority protection, though only for non-robust
  3820  //    mutexes.
  3821  
  3822  // We support priority inheritence for robust mutexes.
  3823  
  3824  // We do not support priority protection for robust mutexes.
  3825  
  3826  // We support POSIX.1b semaphores.
  3827  
  3828  // Real-time signals are supported.
  3829  
  3830  // We support asynchronous I/O.
  3831  // Alternative name for Unix98.
  3832  // Support for prioritization is also available.
  3833  
  3834  // The LFS support in asynchronous I/O is also available.
  3835  
  3836  // The rest of the LFS is also available.
  3837  
  3838  // POSIX shared memory objects are implemented.
  3839  
  3840  // CPU-time clocks support needs to be checked at runtime.
  3841  
  3842  // Clock support in threads must be also checked at runtime.
  3843  
  3844  // GNU libc provides regular expression handling.
  3845  
  3846  // Reader/Writer locks are available.
  3847  
  3848  // We have a POSIX shell.
  3849  
  3850  // We support the Timeouts option.
  3851  
  3852  // We support spinlocks.
  3853  
  3854  // The `spawn' function family is supported.
  3855  
  3856  // We have POSIX timers.
  3857  
  3858  // The barrier functions are available.
  3859  
  3860  // POSIX message queues are available.
  3861  
  3862  // Thread process-shared synchronization is supported.
  3863  
  3864  // The monotonic clock might be available.
  3865  
  3866  // The clock selection interfaces are available.
  3867  
  3868  // Advisory information interfaces are available.
  3869  
  3870  // IPv6 support is available.
  3871  
  3872  // Raw socket support is available.
  3873  
  3874  // We have at least one terminal.
  3875  
  3876  // Neither process nor thread sporadic server interfaces is available.
  3877  
  3878  // trace.h is not available.
  3879  
  3880  // Typed memory objects are not available.
  3881  
  3882  // Get the environment definitions from Unix98.
  3883  // Copyright (C) 1999-2018 Free Software Foundation, Inc.
  3884  //    This file is part of the GNU C Library.
  3885  //
  3886  //    The GNU C Library is free software; you can redistribute it and/or
  3887  //    modify it under the terms of the GNU Lesser General Public
  3888  //    License as published by the Free Software Foundation; either
  3889  //    version 2.1 of the License, or (at your option) any later version.
  3890  //
  3891  //    The GNU C Library is distributed in the hope that it will be useful,
  3892  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  3893  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  3894  //    Lesser General Public License for more details.
  3895  //
  3896  //    You should have received a copy of the GNU Lesser General Public
  3897  //    License along with the GNU C Library; if not, see
  3898  //    <http://www.gnu.org/licenses/>.
  3899  
  3900  // Determine the wordsize from the preprocessor defines.
  3901  
  3902  // Both x86-64 and x32 use the 64-bit system call interface.
  3903  
  3904  // This header should define the following symbols under the described
  3905  //    situations.  A value `1' means that the model is always supported,
  3906  //    `-1' means it is never supported.  Undefined means it cannot be
  3907  //    statically decided.
  3908  //
  3909  //    _POSIX_V7_ILP32_OFF32   32bit int, long, pointers, and off_t type
  3910  //    _POSIX_V7_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
  3911  //
  3912  //    _POSIX_V7_LP64_OFF32	   64bit long and pointers and 32bit off_t type
  3913  //    _POSIX_V7_LPBIG_OFFBIG  64bit long and pointers and large off_t type
  3914  //
  3915  //    The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
  3916  //    _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
  3917  //    _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
  3918  //    used in previous versions of the Unix standard and are available
  3919  //    only for compatibility.
  3920  
  3921  // Environments with 32-bit wide pointers are optionally provided.
  3922  //    Therefore following macros aren't defined:
  3923  //    # undef _POSIX_V7_ILP32_OFF32
  3924  //    # undef _POSIX_V7_ILP32_OFFBIG
  3925  //    # undef _POSIX_V6_ILP32_OFF32
  3926  //    # undef _POSIX_V6_ILP32_OFFBIG
  3927  //    # undef _XBS5_ILP32_OFF32
  3928  //    # undef _XBS5_ILP32_OFFBIG
  3929  //    and users need to check at runtime.
  3930  
  3931  // We also have no use (for now) for an environment with bigger pointers
  3932  //    and offsets.
  3933  
  3934  // By default we have 64-bit wide `long int', pointers and `off_t'.
  3935  
  3936  // Standard file descriptors.
  3937  
  3938  // All functions that are not declared anywhere else.
  3939  
  3940  // bits/types.h -- definitions of __*_t types underlying *_t types.
  3941  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
  3942  //    This file is part of the GNU C Library.
  3943  //
  3944  //    The GNU C Library is free software; you can redistribute it and/or
  3945  //    modify it under the terms of the GNU Lesser General Public
  3946  //    License as published by the Free Software Foundation; either
  3947  //    version 2.1 of the License, or (at your option) any later version.
  3948  //
  3949  //    The GNU C Library is distributed in the hope that it will be useful,
  3950  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  3951  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  3952  //    Lesser General Public License for more details.
  3953  //
  3954  //    You should have received a copy of the GNU Lesser General Public
  3955  //    License along with the GNU C Library; if not, see
  3956  //    <http://www.gnu.org/licenses/>.
  3957  
  3958  // Never include this file directly; use <sys/types.h> instead.
  3959  
  3960  // Copyright (C) 1989-2018 Free Software Foundation, Inc.
  3961  //
  3962  // This file is part of GCC.
  3963  //
  3964  // GCC is free software; you can redistribute it and/or modify
  3965  // it under the terms of the GNU General Public License as published by
  3966  // the Free Software Foundation; either version 3, or (at your option)
  3967  // any later version.
  3968  //
  3969  // GCC is distributed in the hope that it will be useful,
  3970  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  3971  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  3972  // GNU General Public License for more details.
  3973  //
  3974  // Under Section 7 of GPL version 3, you are granted additional
  3975  // permissions described in the GCC Runtime Library Exception, version
  3976  // 3.1, as published by the Free Software Foundation.
  3977  //
  3978  // You should have received a copy of the GNU General Public License and
  3979  // a copy of the GCC Runtime Library Exception along with this program;
  3980  // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
  3981  // <http://www.gnu.org/licenses/>.
  3982  
  3983  // ISO C Standard:  7.17  Common definitions  <stddef.h>
  3984  
  3985  // Any one of these symbols __need_* means that GNU libc
  3986  //    wants us just to define one data type.  So don't define
  3987  //    the symbols that indicate this file's entire job has been done.
  3988  
  3989  // This avoids lossage on SunOS but only if stdtypes.h comes first.
  3990  //    There's no way to win with the other order!  Sun lossage.
  3991  
  3992  // On 4.3bsd-net2, make sure ansi.h is included, so we have
  3993  //    one less case to deal with in the following.
  3994  // On FreeBSD 5, machine/ansi.h does not exist anymore...
  3995  
  3996  // In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
  3997  //    defined if the corresponding type is *not* defined.
  3998  //    FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_.
  3999  //    NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_
  4000  
  4001  // Sequent's header files use _PTRDIFF_T_ in some conflicting way.
  4002  //    Just ignore it.
  4003  
  4004  // On VxWorks, <type/vxTypesBase.h> may have defined macros like
  4005  //    _TYPE_size_t which will typedef size_t.  fixincludes patched the
  4006  //    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
  4007  //    not defined, and so that defining this macro defines _GCC_SIZE_T.
  4008  //    If we find that the macros are still defined at this point, we must
  4009  //    invoke them so that the type is defined as expected.
  4010  
  4011  // In case nobody has defined these types, but we aren't running under
  4012  //    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
  4013  //    __WCHAR_TYPE__ have reasonable values.  This can happen if the
  4014  //    parts of GCC is compiled by an older compiler, that actually
  4015  //    include gstddef.h, such as collect2.
  4016  
  4017  // Signed type of difference of two pointers.
  4018  
  4019  // Define this type if we are doing the whole job,
  4020  //    or if we want this type in particular.
  4021  
  4022  // Unsigned type of `sizeof' something.
  4023  
  4024  // Define this type if we are doing the whole job,
  4025  //    or if we want this type in particular.
  4026  
  4027  // Wide character type.
  4028  //    Locale-writers should change this as necessary to
  4029  //    be big enough to hold unique values not between 0 and 127,
  4030  //    and not (wchar_t) -1, for each defined multibyte character.
  4031  
  4032  // Define this type if we are doing the whole job,
  4033  //    or if we want this type in particular.
  4034  
  4035  //  In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
  4036  //     are already defined.
  4037  //  BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
  4038  //  NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.
  4039  
  4040  // A null pointer constant.
  4041  
  4042  // The Single Unix specification says that some more types are
  4043  //    available here.
  4044  type gid_t = uint32 /* unistd.h:232:17 */
  4045  
  4046  type uid_t = uint32 /* unistd.h:237:17 */
  4047  
  4048  type useconds_t = uint32 /* unistd.h:255:22 */
  4049  
  4050  type pid_t = int32 /* unistd.h:260:17 */
  4051  
  4052  type intptr_t = int64 /* unistd.h:267:20 */
  4053  
  4054  type socklen_t = uint32 /* unistd.h:274:21 */
  4055  
  4056  //  In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
  4057  //     are already defined.
  4058  //  BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
  4059  //  NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.
  4060  
  4061  // A null pointer constant.
  4062  
  4063  // XPG requires a few symbols from <sys/wait.h> being defined.
  4064  // Definitions of flag bits for `waitpid' et al.
  4065  //    Copyright (C) 1992-2018 Free Software Foundation, Inc.
  4066  //    This file is part of the GNU C Library.
  4067  //
  4068  //    The GNU C Library is free software; you can redistribute it and/or
  4069  //    modify it under the terms of the GNU Lesser General Public
  4070  //    License as published by the Free Software Foundation; either
  4071  //    version 2.1 of the License, or (at your option) any later version.
  4072  //
  4073  //    The GNU C Library is distributed in the hope that it will be useful,
  4074  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4075  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4076  //    Lesser General Public License for more details.
  4077  //
  4078  //    You should have received a copy of the GNU Lesser General Public
  4079  //    License along with the GNU C Library; if not, see
  4080  //    <http://www.gnu.org/licenses/>.
  4081  
  4082  // Bits in the third argument to `waitpid'.
  4083  
  4084  // Bits in the fourth argument to `waitid'.
  4085  
  4086  // The following values are used by the `waitid' function.
  4087  
  4088  // The Linux kernel defines these bare, rather than an enum,
  4089  //    which causes a conflict if the include order is reversed.
  4090  
  4091  type idtype_t = uint32 /* waitflags.h:57:3 */
  4092  // Definitions of status bits for `wait' et al.
  4093  //    Copyright (C) 1992-2018 Free Software Foundation, Inc.
  4094  //    This file is part of the GNU C Library.
  4095  //
  4096  //    The GNU C Library is free software; you can redistribute it and/or
  4097  //    modify it under the terms of the GNU Lesser General Public
  4098  //    License as published by the Free Software Foundation; either
  4099  //    version 2.1 of the License, or (at your option) any later version.
  4100  //
  4101  //    The GNU C Library is distributed in the hope that it will be useful,
  4102  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4103  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4104  //    Lesser General Public License for more details.
  4105  //
  4106  //    You should have received a copy of the GNU Lesser General Public
  4107  //    License along with the GNU C Library; if not, see
  4108  //    <http://www.gnu.org/licenses/>.
  4109  
  4110  // Everything extant so far uses these same bits.
  4111  
  4112  // If WIFEXITED(STATUS), the low-order 8 bits of the status.
  4113  
  4114  // If WIFSIGNALED(STATUS), the terminating signal.
  4115  
  4116  // If WIFSTOPPED(STATUS), the signal that stopped the child.
  4117  
  4118  // Nonzero if STATUS indicates normal termination.
  4119  
  4120  // Nonzero if STATUS indicates termination by a signal.
  4121  
  4122  // Nonzero if STATUS indicates the child is stopped.
  4123  
  4124  // Nonzero if STATUS indicates the child continued after a stop.  We only
  4125  //    define this if <bits/waitflags.h> provides the WCONTINUED flag bit.
  4126  
  4127  // Nonzero if STATUS indicates the child dumped core.
  4128  
  4129  // Macros for constructing status values.
  4130  
  4131  // Define the macros <sys/wait.h> also would define this way.
  4132  
  4133  // _FloatN API tests for enablement.
  4134  // Macros to control TS 18661-3 glibc features on x86.
  4135  //    Copyright (C) 2017-2018 Free Software Foundation, Inc.
  4136  //    This file is part of the GNU C Library.
  4137  //
  4138  //    The GNU C Library is free software; you can redistribute it and/or
  4139  //    modify it under the terms of the GNU Lesser General Public
  4140  //    License as published by the Free Software Foundation; either
  4141  //    version 2.1 of the License, or (at your option) any later version.
  4142  //
  4143  //    The GNU C Library is distributed in the hope that it will be useful,
  4144  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4145  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4146  //    Lesser General Public License for more details.
  4147  //
  4148  //    You should have received a copy of the GNU Lesser General Public
  4149  //    License along with the GNU C Library; if not, see
  4150  //    <http://www.gnu.org/licenses/>.
  4151  
  4152  // Copyright (C) 1991-2018 Free Software Foundation, Inc.
  4153  //    This file is part of the GNU C Library.
  4154  //
  4155  //    The GNU C Library is free software; you can redistribute it and/or
  4156  //    modify it under the terms of the GNU Lesser General Public
  4157  //    License as published by the Free Software Foundation; either
  4158  //    version 2.1 of the License, or (at your option) any later version.
  4159  //
  4160  //    The GNU C Library is distributed in the hope that it will be useful,
  4161  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4162  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4163  //    Lesser General Public License for more details.
  4164  //
  4165  //    You should have received a copy of the GNU Lesser General Public
  4166  //    License along with the GNU C Library; if not, see
  4167  //    <http://www.gnu.org/licenses/>.
  4168  
  4169  // Defined to 1 if the current compiler invocation provides a
  4170  //    floating-point type with the IEEE 754 binary128 format, and this
  4171  //    glibc includes corresponding *f128 interfaces for it.  The required
  4172  //    libgcc support was added some time after the basic compiler
  4173  //    support, for x86_64 and x86.
  4174  
  4175  // Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct
  4176  //    from the default float, double and long double types in this glibc.
  4177  
  4178  // Defined to 1 if the current compiler invocation provides a
  4179  //    floating-point type with the right format for _Float64x, and this
  4180  //    glibc includes corresponding *f64x interfaces for it.
  4181  
  4182  // Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format
  4183  //    of long double.  Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has
  4184  //    the format of _Float128, which must be different from that of long
  4185  //    double.
  4186  
  4187  // Defined to concatenate the literal suffix to be used with _Float128
  4188  //    types, if __HAVE_FLOAT128 is 1.
  4189  
  4190  // Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.
  4191  
  4192  // The remaining of this file provides support for older compilers.
  4193  
  4194  // The type _Float128 exists only since GCC 7.0.
  4195  
  4196  // __builtin_huge_valf128 doesn't exist before GCC 7.0.
  4197  
  4198  // Older GCC has only a subset of built-in functions for _Float128 on
  4199  //    x86, and __builtin_infq is not usable in static initializers.
  4200  //    Converting a narrower sNaN to _Float128 produces a quiet NaN, so
  4201  //    attempts to use _Float128 sNaNs will not work properly with older
  4202  //    compilers.
  4203  
  4204  // In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*,
  4205  //    e.g.: __builtin_signbitf128, before GCC 6.  However, there has never
  4206  //    been a __builtin_signbitf128 in GCC and the type-generic builtin is
  4207  //    only available since GCC 6.
  4208  
  4209  // Macros to control TS 18661-3 glibc features where the same
  4210  //    definitions are appropriate for all platforms.
  4211  //    Copyright (C) 2017-2018 Free Software Foundation, Inc.
  4212  //    This file is part of the GNU C Library.
  4213  //
  4214  //    The GNU C Library is free software; you can redistribute it and/or
  4215  //    modify it under the terms of the GNU Lesser General Public
  4216  //    License as published by the Free Software Foundation; either
  4217  //    version 2.1 of the License, or (at your option) any later version.
  4218  //
  4219  //    The GNU C Library is distributed in the hope that it will be useful,
  4220  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4221  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4222  //    Lesser General Public License for more details.
  4223  //
  4224  //    You should have received a copy of the GNU Lesser General Public
  4225  //    License along with the GNU C Library; if not, see
  4226  //    <http://www.gnu.org/licenses/>.
  4227  
  4228  // Copyright (C) 1991-2018 Free Software Foundation, Inc.
  4229  //    This file is part of the GNU C Library.
  4230  //
  4231  //    The GNU C Library is free software; you can redistribute it and/or
  4232  //    modify it under the terms of the GNU Lesser General Public
  4233  //    License as published by the Free Software Foundation; either
  4234  //    version 2.1 of the License, or (at your option) any later version.
  4235  //
  4236  //    The GNU C Library is distributed in the hope that it will be useful,
  4237  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4238  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4239  //    Lesser General Public License for more details.
  4240  //
  4241  //    You should have received a copy of the GNU Lesser General Public
  4242  //    License along with the GNU C Library; if not, see
  4243  //    <http://www.gnu.org/licenses/>.
  4244  
  4245  // Properties of long double type.  ldbl-96 version.
  4246  //    Copyright (C) 2016-2018 Free Software Foundation, Inc.
  4247  //    This file is part of the GNU C Library.
  4248  //
  4249  //    The GNU C Library is free software; you can redistribute it and/or
  4250  //    modify it under the terms of the GNU Lesser General Public
  4251  //    License  published by the Free Software Foundation; either
  4252  //    version 2.1 of the License, or (at your option) any later version.
  4253  //
  4254  //    The GNU C Library is distributed in the hope that it will be useful,
  4255  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4256  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4257  //    Lesser General Public License for more details.
  4258  //
  4259  //    You should have received a copy of the GNU Lesser General Public
  4260  //    License along with the GNU C Library; if not, see
  4261  //    <http://www.gnu.org/licenses/>.
  4262  
  4263  // long double is distinct from double, so there is nothing to
  4264  //    define here.
  4265  
  4266  // This header should be included at the bottom of each bits/floatn.h.
  4267  //    It defines the following macros for each _FloatN and _FloatNx type,
  4268  //    where the same definitions, or definitions based only on the macros
  4269  //    in bits/floatn.h, are appropriate for all glibc configurations.
  4270  
  4271  // Defined to 1 if the current compiler invocation provides a
  4272  //    floating-point type with the right format for this type, and this
  4273  //    glibc includes corresponding *fN or *fNx interfaces for it.
  4274  
  4275  // Defined to 1 if the corresponding __HAVE_<type> macro is 1 and the
  4276  //    type is the first with its format in the sequence of (the default
  4277  //    choices for) float, double, long double, _Float16, _Float32,
  4278  //    _Float64, _Float128, _Float32x, _Float64x, _Float128x for this
  4279  //    glibc; that is, if functions present once per floating-point format
  4280  //    rather than once per type are present for this type.
  4281  //
  4282  //    All configurations supported by glibc have _Float32 the same format
  4283  //    as float, _Float64 and _Float32x the same format as double, the
  4284  //    _Float64x the same format as either long double or _Float128.  No
  4285  //    configurations support _Float128x or, as of GCC 7, have compiler
  4286  //    support for a type meeting the requirements for _Float128x.
  4287  
  4288  // Defined to 1 if the corresponding _FloatN type is not binary compatible
  4289  //    with the corresponding ISO C type in the current compilation unit as
  4290  //    opposed to __HAVE_DISTINCT_FLOATN, which indicates the default types built
  4291  //    in glibc.
  4292  
  4293  // Defined to 1 if any _FloatN or _FloatNx types that are not
  4294  //    ABI-distinct are however distinct types at the C language level (so
  4295  //    for the purposes of __builtin_types_compatible_p and _Generic).
  4296  
  4297  // Defined to concatenate the literal suffix to be used with _FloatN
  4298  //    or _FloatNx types, if __HAVE_<type> is 1.  The corresponding
  4299  //    literal suffixes exist since GCC 7, for C only.
  4300  
  4301  // Defined to a complex type if __HAVE_<type> is 1.
  4302  
  4303  // The remaining of this file provides support for older compilers.
  4304  
  4305  // If double, long double and _Float64 all have the same set of
  4306  //    values, TS 18661-3 requires the usual arithmetic conversions on
  4307  //    long double and _Float64 to produce _Float64.  For this to be the
  4308  //    case when building with a compiler without a distinct _Float64
  4309  //    type, _Float64 must be a typedef for long double, not for
  4310  //    double.
  4311  
  4312  // Returned by `div'.
  4313  type div_t = struct {
  4314  	quot int32
  4315  	rem  int32
  4316  } /* stdlib.h:62:5 */
  4317  
  4318  // Returned by `ldiv'.
  4319  type ldiv_t = struct {
  4320  	quot int64
  4321  	rem  int64
  4322  } /* stdlib.h:70:5 */
  4323  
  4324  // Returned by `lldiv'.
  4325  type lldiv_t = struct {
  4326  	quot int64
  4327  	rem  int64
  4328  } /* stdlib.h:80:5 */
  4329  
  4330  // Copyright (C) 1991-2018 Free Software Foundation, Inc.
  4331  //    This file is part of the GNU C Library.
  4332  //
  4333  //    The GNU C Library is free software; you can redistribute it and/or
  4334  //    modify it under the terms of the GNU Lesser General Public
  4335  //    License as published by the Free Software Foundation; either
  4336  //    version 2.1 of the License, or (at your option) any later version.
  4337  //
  4338  //    The GNU C Library is distributed in the hope that it will be useful,
  4339  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4340  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4341  //    Lesser General Public License for more details.
  4342  //
  4343  //    You should have received a copy of the GNU Lesser General Public
  4344  //    License along with the GNU C Library; if not, see
  4345  //    <http://www.gnu.org/licenses/>.
  4346  
  4347  //	POSIX Standard: 2.6 Primitive System Data Types	<sys/types.h>
  4348  
  4349  // Copyright (C) 1991-2018 Free Software Foundation, Inc.
  4350  //    This file is part of the GNU C Library.
  4351  //
  4352  //    The GNU C Library is free software; you can redistribute it and/or
  4353  //    modify it under the terms of the GNU Lesser General Public
  4354  //    License as published by the Free Software Foundation; either
  4355  //    version 2.1 of the License, or (at your option) any later version.
  4356  //
  4357  //    The GNU C Library is distributed in the hope that it will be useful,
  4358  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4359  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4360  //    Lesser General Public License for more details.
  4361  //
  4362  //    You should have received a copy of the GNU Lesser General Public
  4363  //    License along with the GNU C Library; if not, see
  4364  //    <http://www.gnu.org/licenses/>.
  4365  
  4366  // bits/types.h -- definitions of __*_t types underlying *_t types.
  4367  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
  4368  //    This file is part of the GNU C Library.
  4369  //
  4370  //    The GNU C Library is free software; you can redistribute it and/or
  4371  //    modify it under the terms of the GNU Lesser General Public
  4372  //    License as published by the Free Software Foundation; either
  4373  //    version 2.1 of the License, or (at your option) any later version.
  4374  //
  4375  //    The GNU C Library is distributed in the hope that it will be useful,
  4376  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4377  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4378  //    Lesser General Public License for more details.
  4379  //
  4380  //    You should have received a copy of the GNU Lesser General Public
  4381  //    License along with the GNU C Library; if not, see
  4382  //    <http://www.gnu.org/licenses/>.
  4383  
  4384  // Never include this file directly; use <sys/types.h> instead.
  4385  
  4386  type u_char = uint8                    /* types.h:33:18 */
  4387  type u_short = uint16                  /* types.h:34:19 */
  4388  type u_int = uint32                    /* types.h:35:17 */
  4389  type u_long = uint64                   /* types.h:36:18 */
  4390  type quad_t = int64                    /* types.h:37:18 */
  4391  type u_quad_t = uint64                 /* types.h:38:20 */
  4392  type fsid_t = struct{ __val [2]int32 } /* types.h:39:18 */
  4393  type loff_t = int64                    /* types.h:42:18 */
  4394  
  4395  type ino_t = uint64 /* types.h:49:19 */
  4396  
  4397  type dev_t = uint64 /* types.h:59:17 */
  4398  
  4399  type mode_t = uint32 /* types.h:69:18 */
  4400  
  4401  type nlink_t = uint64 /* types.h:74:19 */
  4402  
  4403  type id_t = uint32 /* types.h:103:16 */
  4404  
  4405  type daddr_t = int32   /* types.h:114:19 */
  4406  type caddr_t = uintptr /* types.h:115:19 */
  4407  
  4408  type key_t = int32 /* types.h:121:17 */
  4409  
  4410  // bits/types.h -- definitions of __*_t types underlying *_t types.
  4411  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
  4412  //    This file is part of the GNU C Library.
  4413  //
  4414  //    The GNU C Library is free software; you can redistribute it and/or
  4415  //    modify it under the terms of the GNU Lesser General Public
  4416  //    License as published by the Free Software Foundation; either
  4417  //    version 2.1 of the License, or (at your option) any later version.
  4418  //
  4419  //    The GNU C Library is distributed in the hope that it will be useful,
  4420  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4421  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4422  //    Lesser General Public License for more details.
  4423  //
  4424  //    You should have received a copy of the GNU Lesser General Public
  4425  //    License along with the GNU C Library; if not, see
  4426  //    <http://www.gnu.org/licenses/>.
  4427  
  4428  // Never include this file directly; use <sys/types.h> instead.
  4429  
  4430  // Returned by `clock'.
  4431  type clock_t = int64 /* clock_t.h:7:19 */
  4432  
  4433  // bits/types.h -- definitions of __*_t types underlying *_t types.
  4434  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
  4435  //    This file is part of the GNU C Library.
  4436  //
  4437  //    The GNU C Library is free software; you can redistribute it and/or
  4438  //    modify it under the terms of the GNU Lesser General Public
  4439  //    License as published by the Free Software Foundation; either
  4440  //    version 2.1 of the License, or (at your option) any later version.
  4441  //
  4442  //    The GNU C Library is distributed in the hope that it will be useful,
  4443  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4444  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4445  //    Lesser General Public License for more details.
  4446  //
  4447  //    You should have received a copy of the GNU Lesser General Public
  4448  //    License along with the GNU C Library; if not, see
  4449  //    <http://www.gnu.org/licenses/>.
  4450  
  4451  // Never include this file directly; use <sys/types.h> instead.
  4452  
  4453  // Clock ID used in clock and timer functions.
  4454  type clockid_t = int32 /* clockid_t.h:7:21 */
  4455  
  4456  // bits/types.h -- definitions of __*_t types underlying *_t types.
  4457  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
  4458  //    This file is part of the GNU C Library.
  4459  //
  4460  //    The GNU C Library is free software; you can redistribute it and/or
  4461  //    modify it under the terms of the GNU Lesser General Public
  4462  //    License as published by the Free Software Foundation; either
  4463  //    version 2.1 of the License, or (at your option) any later version.
  4464  //
  4465  //    The GNU C Library is distributed in the hope that it will be useful,
  4466  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4467  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4468  //    Lesser General Public License for more details.
  4469  //
  4470  //    You should have received a copy of the GNU Lesser General Public
  4471  //    License along with the GNU C Library; if not, see
  4472  //    <http://www.gnu.org/licenses/>.
  4473  
  4474  // Never include this file directly; use <sys/types.h> instead.
  4475  
  4476  // Returned by `time'.
  4477  type time_t = int64 /* time_t.h:7:18 */
  4478  
  4479  // bits/types.h -- definitions of __*_t types underlying *_t types.
  4480  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
  4481  //    This file is part of the GNU C Library.
  4482  //
  4483  //    The GNU C Library is free software; you can redistribute it and/or
  4484  //    modify it under the terms of the GNU Lesser General Public
  4485  //    License as published by the Free Software Foundation; either
  4486  //    version 2.1 of the License, or (at your option) any later version.
  4487  //
  4488  //    The GNU C Library is distributed in the hope that it will be useful,
  4489  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4490  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4491  //    Lesser General Public License for more details.
  4492  //
  4493  //    You should have received a copy of the GNU Lesser General Public
  4494  //    License along with the GNU C Library; if not, see
  4495  //    <http://www.gnu.org/licenses/>.
  4496  
  4497  // Never include this file directly; use <sys/types.h> instead.
  4498  
  4499  // Timer ID returned by `timer_create'.
  4500  type timer_t = uintptr /* timer_t.h:7:19 */
  4501  
  4502  // Copyright (C) 1989-2018 Free Software Foundation, Inc.
  4503  //
  4504  // This file is part of GCC.
  4505  //
  4506  // GCC is free software; you can redistribute it and/or modify
  4507  // it under the terms of the GNU General Public License as published by
  4508  // the Free Software Foundation; either version 3, or (at your option)
  4509  // any later version.
  4510  //
  4511  // GCC is distributed in the hope that it will be useful,
  4512  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  4513  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  4514  // GNU General Public License for more details.
  4515  //
  4516  // Under Section 7 of GPL version 3, you are granted additional
  4517  // permissions described in the GCC Runtime Library Exception, version
  4518  // 3.1, as published by the Free Software Foundation.
  4519  //
  4520  // You should have received a copy of the GNU General Public License and
  4521  // a copy of the GCC Runtime Library Exception along with this program;
  4522  // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
  4523  // <http://www.gnu.org/licenses/>.
  4524  
  4525  // ISO C Standard:  7.17  Common definitions  <stddef.h>
  4526  
  4527  // Any one of these symbols __need_* means that GNU libc
  4528  //    wants us just to define one data type.  So don't define
  4529  //    the symbols that indicate this file's entire job has been done.
  4530  
  4531  // This avoids lossage on SunOS but only if stdtypes.h comes first.
  4532  //    There's no way to win with the other order!  Sun lossage.
  4533  
  4534  // On 4.3bsd-net2, make sure ansi.h is included, so we have
  4535  //    one less case to deal with in the following.
  4536  // On FreeBSD 5, machine/ansi.h does not exist anymore...
  4537  
  4538  // In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
  4539  //    defined if the corresponding type is *not* defined.
  4540  //    FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_.
  4541  //    NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_
  4542  
  4543  // Sequent's header files use _PTRDIFF_T_ in some conflicting way.
  4544  //    Just ignore it.
  4545  
  4546  // On VxWorks, <type/vxTypesBase.h> may have defined macros like
  4547  //    _TYPE_size_t which will typedef size_t.  fixincludes patched the
  4548  //    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
  4549  //    not defined, and so that defining this macro defines _GCC_SIZE_T.
  4550  //    If we find that the macros are still defined at this point, we must
  4551  //    invoke them so that the type is defined as expected.
  4552  
  4553  // In case nobody has defined these types, but we aren't running under
  4554  //    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
  4555  //    __WCHAR_TYPE__ have reasonable values.  This can happen if the
  4556  //    parts of GCC is compiled by an older compiler, that actually
  4557  //    include gstddef.h, such as collect2.
  4558  
  4559  // Signed type of difference of two pointers.
  4560  
  4561  // Define this type if we are doing the whole job,
  4562  //    or if we want this type in particular.
  4563  
  4564  // Unsigned type of `sizeof' something.
  4565  
  4566  // Define this type if we are doing the whole job,
  4567  //    or if we want this type in particular.
  4568  
  4569  // Wide character type.
  4570  //    Locale-writers should change this as necessary to
  4571  //    be big enough to hold unique values not between 0 and 127,
  4572  //    and not (wchar_t) -1, for each defined multibyte character.
  4573  
  4574  // Define this type if we are doing the whole job,
  4575  //    or if we want this type in particular.
  4576  
  4577  //  In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
  4578  //     are already defined.
  4579  //  BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
  4580  //  NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.
  4581  
  4582  // A null pointer constant.
  4583  
  4584  // Old compatibility names for C types.
  4585  type ulong = uint64  /* types.h:148:27 */
  4586  type ushort = uint16 /* types.h:149:28 */
  4587  type uint = uint32   /* types.h:150:22 */
  4588  
  4589  // These size-specific names are used by some of the inet code.
  4590  
  4591  // Define intN_t types.
  4592  //    Copyright (C) 2017-2018 Free Software Foundation, Inc.
  4593  //    This file is part of the GNU C Library.
  4594  //
  4595  //    The GNU C Library is free software; you can redistribute it and/or
  4596  //    modify it under the terms of the GNU Lesser General Public
  4597  //    License as published by the Free Software Foundation; either
  4598  //    version 2.1 of the License, or (at your option) any later version.
  4599  //
  4600  //    The GNU C Library is distributed in the hope that it will be useful,
  4601  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4602  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4603  //    Lesser General Public License for more details.
  4604  //
  4605  //    You should have received a copy of the GNU Lesser General Public
  4606  //    License along with the GNU C Library; if not, see
  4607  //    <http://www.gnu.org/licenses/>.
  4608  
  4609  // bits/types.h -- definitions of __*_t types underlying *_t types.
  4610  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
  4611  //    This file is part of the GNU C Library.
  4612  //
  4613  //    The GNU C Library is free software; you can redistribute it and/or
  4614  //    modify it under the terms of the GNU Lesser General Public
  4615  //    License as published by the Free Software Foundation; either
  4616  //    version 2.1 of the License, or (at your option) any later version.
  4617  //
  4618  //    The GNU C Library is distributed in the hope that it will be useful,
  4619  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4620  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4621  //    Lesser General Public License for more details.
  4622  //
  4623  //    You should have received a copy of the GNU Lesser General Public
  4624  //    License along with the GNU C Library; if not, see
  4625  //    <http://www.gnu.org/licenses/>.
  4626  
  4627  // Never include this file directly; use <sys/types.h> instead.
  4628  
  4629  type int8_t = int8   /* stdint-intn.h:24:18 */
  4630  type int16_t = int16 /* stdint-intn.h:25:19 */
  4631  type int32_t = int32 /* stdint-intn.h:26:19 */
  4632  type int64_t = int64 /* stdint-intn.h:27:19 */
  4633  
  4634  // For GCC 2.7 and later, we can use specific type-size attributes.
  4635  
  4636  type u_int8_t = uint32  /* types.h:177:1 */
  4637  type u_int16_t = uint32 /* types.h:178:1 */
  4638  type u_int32_t = uint32 /* types.h:179:1 */
  4639  type u_int64_t = uint32 /* types.h:180:1 */
  4640  
  4641  type register_t = int32 /* types.h:182:13 */
  4642  
  4643  // A set of signals to be blocked, unblocked, or waited for.
  4644  type sigset_t = struct{ __val [16]uint64 } /* sigset_t.h:7:20 */
  4645  
  4646  // Get definition of timer specification structures.
  4647  
  4648  // bits/types.h -- definitions of __*_t types underlying *_t types.
  4649  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
  4650  //    This file is part of the GNU C Library.
  4651  //
  4652  //    The GNU C Library is free software; you can redistribute it and/or
  4653  //    modify it under the terms of the GNU Lesser General Public
  4654  //    License as published by the Free Software Foundation; either
  4655  //    version 2.1 of the License, or (at your option) any later version.
  4656  //
  4657  //    The GNU C Library is distributed in the hope that it will be useful,
  4658  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4659  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4660  //    Lesser General Public License for more details.
  4661  //
  4662  //    You should have received a copy of the GNU Lesser General Public
  4663  //    License along with the GNU C Library; if not, see
  4664  //    <http://www.gnu.org/licenses/>.
  4665  
  4666  // Never include this file directly; use <sys/types.h> instead.
  4667  
  4668  // A time value that is accurate to the nearest
  4669  //    microsecond but also has a range of years.
  4670  type timeval = struct {
  4671  	tv_sec  int64
  4672  	tv_usec int64
  4673  } /* struct_timeval.h:8:1 */
  4674  
  4675  // NB: Include guard matches what <linux/time.h> uses.
  4676  
  4677  // bits/types.h -- definitions of __*_t types underlying *_t types.
  4678  //    Copyright (C) 2002-2018 Free Software Foundation, Inc.
  4679  //    This file is part of the GNU C Library.
  4680  //
  4681  //    The GNU C Library is free software; you can redistribute it and/or
  4682  //    modify it under the terms of the GNU Lesser General Public
  4683  //    License as published by the Free Software Foundation; either
  4684  //    version 2.1 of the License, or (at your option) any later version.
  4685  //
  4686  //    The GNU C Library is distributed in the hope that it will be useful,
  4687  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4688  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4689  //    Lesser General Public License for more details.
  4690  //
  4691  //    You should have received a copy of the GNU Lesser General Public
  4692  //    License along with the GNU C Library; if not, see
  4693  //    <http://www.gnu.org/licenses/>.
  4694  
  4695  // Never include this file directly; use <sys/types.h> instead.
  4696  
  4697  // POSIX.1b structure for a time value.  This is like a `struct timeval' but
  4698  //    has nanoseconds instead of microseconds.
  4699  type timespec = struct {
  4700  	tv_sec  int64
  4701  	tv_nsec int64
  4702  } /* struct_timespec.h:9:1 */
  4703  
  4704  type suseconds_t = int64 /* select.h:43:23 */
  4705  
  4706  // Some versions of <linux/posix_types.h> define this macros.
  4707  // It's easier to assume 8-bit bytes than to get CHAR_BIT.
  4708  
  4709  // fd_set for select and pselect.
  4710  type fd_set = struct{ __fds_bits [16]int64 } /* select.h:70:5 */
  4711  
  4712  // Maximum number of file descriptors in `fd_set'.
  4713  
  4714  // Sometimes the fd_set member is assumed to have this type.
  4715  type fd_mask = int64 /* select.h:77:19 */
  4716  
  4717  // Define some inlines helping to catch common problems.
  4718  
  4719  type blksize_t = int64 /* types.h:202:21 */
  4720  
  4721  // Types from the Large File Support interface.
  4722  type blkcnt_t = int64    /* types.h:222:22 */ // Type to count number of disk blocks.
  4723  type fsblkcnt_t = uint64 /* types.h:226:24 */ // Type to count file system blocks.
  4724  type fsfilcnt_t = uint64 /* types.h:230:24 */ // Type to count file system inodes.
  4725  
  4726  // Now add the thread types.
  4727  // Declaration of common pthread types for all architectures.
  4728  //    Copyright (C) 2017-2018 Free Software Foundation, Inc.
  4729  //    This file is part of the GNU C Library.
  4730  //
  4731  //    The GNU C Library is free software; you can redistribute it and/or
  4732  //    modify it under the terms of the GNU Lesser General Public
  4733  //    License as published by the Free Software Foundation; either
  4734  //    version 2.1 of the License, or (at your option) any later version.
  4735  //
  4736  //    The GNU C Library is distributed in the hope that it will be useful,
  4737  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4738  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4739  //    Lesser General Public License for more details.
  4740  //
  4741  //    You should have received a copy of the GNU Lesser General Public
  4742  //    License along with the GNU C Library; if not, see
  4743  //    <http://www.gnu.org/licenses/>.
  4744  
  4745  // For internal mutex and condition variable definitions.
  4746  // Common threading primitives definitions for both POSIX and C11.
  4747  //    Copyright (C) 2017-2018 Free Software Foundation, Inc.
  4748  //    This file is part of the GNU C Library.
  4749  //
  4750  //    The GNU C Library is free software; you can redistribute it and/or
  4751  //    modify it under the terms of the GNU Lesser General Public
  4752  //    License as published by the Free Software Foundation; either
  4753  //    version 2.1 of the License, or (at your option) any later version.
  4754  //
  4755  //    The GNU C Library is distributed in the hope that it will be useful,
  4756  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4757  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4758  //    Lesser General Public License for more details.
  4759  //
  4760  //    You should have received a copy of the GNU Lesser General Public
  4761  //    License along with the GNU C Library; if not, see
  4762  //    <http://www.gnu.org/licenses/>.
  4763  
  4764  // Arch-specific definitions.  Each architecture must define the following
  4765  //    macros to define the expected sizes of pthread data types:
  4766  //
  4767  //    __SIZEOF_PTHREAD_ATTR_T        - size of pthread_attr_t.
  4768  //    __SIZEOF_PTHREAD_MUTEX_T       - size of pthread_mutex_t.
  4769  //    __SIZEOF_PTHREAD_MUTEXATTR_T   - size of pthread_mutexattr_t.
  4770  //    __SIZEOF_PTHREAD_COND_T        - size of pthread_cond_t.
  4771  //    __SIZEOF_PTHREAD_CONDATTR_T    - size of pthread_condattr_t.
  4772  //    __SIZEOF_PTHREAD_RWLOCK_T      - size of pthread_rwlock_t.
  4773  //    __SIZEOF_PTHREAD_RWLOCKATTR_T  - size of pthread_rwlockattr_t.
  4774  //    __SIZEOF_PTHREAD_BARRIER_T     - size of pthread_barrier_t.
  4775  //    __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t.
  4776  //
  4777  //    Also, the following macros must be define for internal pthread_mutex_t
  4778  //    struct definitions (struct __pthread_mutex_s):
  4779  //
  4780  //    __PTHREAD_COMPAT_PADDING_MID   - any additional members after 'kind'
  4781  // 				    and before '__spin' (for 64 bits) or
  4782  // 				    '__nusers' (for 32 bits).
  4783  //    __PTHREAD_COMPAT_PADDING_END   - any additional members at the end of
  4784  // 				    the internal structure.
  4785  //    __PTHREAD_MUTEX_LOCK_ELISION   - 1 if the architecture supports lock
  4786  // 				    elision or 0 otherwise.
  4787  //    __PTHREAD_MUTEX_NUSERS_AFTER_KIND - control where to put __nusers.  The
  4788  // 				       preferred value for new architectures
  4789  // 				       is 0.
  4790  //    __PTHREAD_MUTEX_USE_UNION      - control whether internal __spins and
  4791  // 				    __list will be place inside a union for
  4792  // 				    linuxthreads compatibility.
  4793  // 				    The preferred value for new architectures
  4794  // 				    is 0.
  4795  //
  4796  //    For a new port the preferred values for the required defines are:
  4797  //
  4798  //    #define __PTHREAD_COMPAT_PADDING_MID
  4799  //    #define __PTHREAD_COMPAT_PADDING_END
  4800  //    #define __PTHREAD_MUTEX_LOCK_ELISION         0
  4801  //    #define __PTHREAD_MUTEX_NUSERS_AFTER_KIND    0
  4802  //    #define __PTHREAD_MUTEX_USE_UNION            0
  4803  //
  4804  //    __PTHREAD_MUTEX_LOCK_ELISION can be set to 1 if the hardware plans to
  4805  //    eventually support lock elision using transactional memory.
  4806  //
  4807  //    The additional macro defines any constraint for the lock alignment
  4808  //    inside the thread structures:
  4809  //
  4810  //    __LOCK_ALIGNMENT - for internal lock/futex usage.
  4811  //
  4812  //    Same idea but for the once locking primitive:
  4813  //
  4814  //    __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition.
  4815  //
  4816  //    And finally the internal pthread_rwlock_t (struct __pthread_rwlock_arch_t)
  4817  //    must be defined.
  4818  //
  4819  // Copyright (C) 2002-2018 Free Software Foundation, Inc.
  4820  //    This file is part of the GNU C Library.
  4821  //
  4822  //    The GNU C Library is free software; you can redistribute it and/or
  4823  //    modify it under the terms of the GNU Lesser General Public
  4824  //    License as published by the Free Software Foundation; either
  4825  //    version 2.1 of the License, or (at your option) any later version.
  4826  //
  4827  //    The GNU C Library is distributed in the hope that it will be useful,
  4828  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4829  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4830  //    Lesser General Public License for more details.
  4831  //
  4832  //    You should have received a copy of the GNU Lesser General Public
  4833  //    License along with the GNU C Library; if not, see
  4834  //    <http://www.gnu.org/licenses/>.
  4835  
  4836  // Determine the wordsize from the preprocessor defines.
  4837  
  4838  // Both x86-64 and x32 use the 64-bit system call interface.
  4839  
  4840  // Definitions for internal mutex struct.
  4841  
  4842  type __pthread_rwlock_arch_t = struct {
  4843  	__readers       uint32
  4844  	__writers       uint32
  4845  	__wrphase_futex uint32
  4846  	__writers_futex uint32
  4847  	__pad3          uint32
  4848  	__pad4          uint32
  4849  	__cur_writer    int32
  4850  	__shared        int32
  4851  	__rwelision     int8
  4852  	__pad1          [7]uint8
  4853  	__pad2          uint64
  4854  	__flags         uint32
  4855  	_               [4]byte
  4856  } /* pthreadtypes-arch.h:65:1 */
  4857  
  4858  // Common definition of pthread_mutex_t.
  4859  
  4860  type __pthread_internal_list = struct {
  4861  	__prev uintptr
  4862  	__next uintptr
  4863  } /* thread-shared-types.h:82:9 */
  4864  
  4865  // Lock elision support.
  4866  
  4867  type __pthread_mutex_s = struct {
  4868  	__lock    int32
  4869  	__count   uint32
  4870  	__owner   int32
  4871  	__nusers  uint32
  4872  	__kind    int32
  4873  	__spins   int16
  4874  	__elision int16
  4875  	__list    struct {
  4876  		__prev uintptr
  4877  		__next uintptr
  4878  	}
  4879  } /* thread-shared-types.h:118:1 */
  4880  
  4881  // Common definition of pthread_cond_t.
  4882  
  4883  type __pthread_cond_s = struct {
  4884  	__0            struct{ __wseq uint64 }
  4885  	__8            struct{ __g1_start uint64 }
  4886  	__g_refs       [2]uint32
  4887  	__g_size       [2]uint32
  4888  	__g1_orig_size uint32
  4889  	__wrefs        uint32
  4890  	__g_signals    [2]uint32
  4891  } /* thread-shared-types.h:171:1 */
  4892  
  4893  // Thread identifiers.  The structure of the attribute type is not
  4894  //    exposed on purpose.
  4895  type pthread_t = uint64 /* pthreadtypes.h:27:27 */
  4896  
  4897  // Data structures for mutex handling.  The structure of the attribute
  4898  //    type is not exposed on purpose.
  4899  type pthread_mutexattr_t = struct {
  4900  	_      [0]uint32
  4901  	__size [4]int8
  4902  } /* pthreadtypes.h:36:3 */
  4903  
  4904  // Data structure for condition variable handling.  The structure of
  4905  //    the attribute type is not exposed on purpose.
  4906  type pthread_condattr_t = struct {
  4907  	_      [0]uint32
  4908  	__size [4]int8
  4909  } /* pthreadtypes.h:45:3 */
  4910  
  4911  // Keys for thread-specific data
  4912  type pthread_key_t = uint32 /* pthreadtypes.h:49:22 */
  4913  
  4914  // Once-only execution
  4915  type pthread_once_t = int32 /* pthreadtypes.h:53:30 */
  4916  
  4917  type pthread_attr_t1 = struct {
  4918  	_      [0]uint64
  4919  	__size [56]int8
  4920  } /* pthreadtypes.h:56:1 */
  4921  
  4922  type pthread_attr_t = pthread_attr_t1 /* pthreadtypes.h:62:30 */
  4923  
  4924  type pthread_mutex_t = struct{ __data __pthread_mutex_s } /* pthreadtypes.h:72:3 */
  4925  
  4926  type pthread_cond_t = struct{ __data __pthread_cond_s } /* pthreadtypes.h:80:3 */
  4927  
  4928  // Data structure for reader-writer lock variable handling.  The
  4929  //    structure of the attribute type is deliberately not exposed.
  4930  type pthread_rwlock_t = struct{ __data __pthread_rwlock_arch_t } /* pthreadtypes.h:91:3 */
  4931  
  4932  type pthread_rwlockattr_t = struct {
  4933  	_      [0]uint64
  4934  	__size [8]int8
  4935  } /* pthreadtypes.h:97:3 */
  4936  
  4937  // POSIX spinlock data type.
  4938  type pthread_spinlock_t = int32 /* pthreadtypes.h:103:22 */
  4939  
  4940  // POSIX barriers data type.  The structure of the type is
  4941  //    deliberately not exposed.
  4942  type pthread_barrier_t = struct {
  4943  	_      [0]uint64
  4944  	__size [32]int8
  4945  } /* pthreadtypes.h:112:3 */
  4946  
  4947  type pthread_barrierattr_t = struct {
  4948  	_      [0]uint32
  4949  	__size [4]int8
  4950  } /* pthreadtypes.h:118:3 */
  4951  
  4952  // Reentrant versions of the `random' family of functions.
  4953  //    These functions all use the following data structure to contain
  4954  //    state, rather than global state variables.
  4955  
  4956  type random_data = struct {
  4957  	fptr      uintptr
  4958  	rptr      uintptr
  4959  	state     uintptr
  4960  	rand_type int32
  4961  	rand_deg  int32
  4962  	rand_sep  int32
  4963  	_         [4]byte
  4964  	end_ptr   uintptr
  4965  } /* stdlib.h:423:1 */
  4966  
  4967  // Data structure for communication with thread safe versions.  This
  4968  //    type is to be regarded as opaque.  It's only exported because users
  4969  //    have to allocate objects of this type.
  4970  type drand48_data = struct {
  4971  	__x     [3]uint16
  4972  	__old_x [3]uint16
  4973  	__c     uint16
  4974  	__init  uint16
  4975  	__a     uint64
  4976  } /* stdlib.h:490:1 */
  4977  
  4978  // POSIX.1-2008 extended locale interface (see locale.h).
  4979  // Definition of locale_t.
  4980  //    Copyright (C) 2017-2018 Free Software Foundation, Inc.
  4981  //    This file is part of the GNU C Library.
  4982  //
  4983  //    The GNU C Library is free software; you can redistribute it and/or
  4984  //    modify it under the terms of the GNU Lesser General Public
  4985  //    License as published by the Free Software Foundation; either
  4986  //    version 2.1 of the License, or (at your option) any later version.
  4987  //
  4988  //    The GNU C Library is distributed in the hope that it will be useful,
  4989  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4990  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  4991  //    Lesser General Public License for more details.
  4992  //
  4993  //    You should have received a copy of the GNU Lesser General Public
  4994  //    License along with the GNU C Library; if not, see
  4995  //    <http://www.gnu.org/licenses/>.
  4996  
  4997  // Definition of struct __locale_struct and __locale_t.
  4998  //    Copyright (C) 1997-2018 Free Software Foundation, Inc.
  4999  //    This file is part of the GNU C Library.
  5000  //    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
  5001  //
  5002  //    The GNU C Library is free software; you can redistribute it and/or
  5003  //    modify it under the terms of the GNU Lesser General Public
  5004  //    License as published by the Free Software Foundation; either
  5005  //    version 2.1 of the License, or (at your option) any later version.
  5006  //
  5007  //    The GNU C Library is distributed in the hope that it will be useful,
  5008  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  5009  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  5010  //    Lesser General Public License for more details.
  5011  //
  5012  //    You should have received a copy of the GNU Lesser General Public
  5013  //    License along with the GNU C Library; if not, see
  5014  //    <http://www.gnu.org/licenses/>.
  5015  
  5016  // POSIX.1-2008: the locale_t type, representing a locale context
  5017  //    (implementation-namespace version).  This type should be treated
  5018  //    as opaque by applications; some details are exposed for the sake of
  5019  //    efficiency in e.g. ctype functions.
  5020  
  5021  type __locale_struct = struct {
  5022  	__locales       [13]uintptr
  5023  	__ctype_b       uintptr
  5024  	__ctype_tolower uintptr
  5025  	__ctype_toupper uintptr
  5026  	__names         [13]uintptr
  5027  } /* __locale_t.h:28:1 */
  5028  
  5029  type locale_t = uintptr /* locale_t.h:24:20 */
  5030  
  5031  // The suffix to append to the child command lines, if any
  5032  
  5033  // The directory separator character(s)
  5034  
  5035  // Mark a parameter as unused to suppress compiler warnings
  5036  
  5037  // Global data
  5038  type Global = struct {
  5039  	argv0            uintptr
  5040  	zVfs             uintptr
  5041  	zDbFile          uintptr
  5042  	db               uintptr
  5043  	zErrLog          uintptr
  5044  	pErrLog          uintptr
  5045  	zLog             uintptr
  5046  	pLog             uintptr
  5047  	zName            [32]int8
  5048  	taskId           int32
  5049  	iTrace           int32
  5050  	bSqlTrace        int32
  5051  	bIgnoreSqlErrors int32
  5052  	nError           int32
  5053  	nTest            int32
  5054  	iTimeout         int32
  5055  	bSync            int32
  5056  } /* mptest.c:72:8 */
  5057  
  5058  // The suffix to append to the child command lines, if any
  5059  
  5060  // The directory separator character(s)
  5061  
  5062  // Mark a parameter as unused to suppress compiler warnings
  5063  
  5064  // Global data
  5065  var g Global /* mptest.c:90:3: */
  5066  
  5067  // Default timeout
  5068  
  5069  // Print a message adding zPrefix[] to the beginning of every line.
  5070  func printWithPrefix(tls *libc.TLS, pOut uintptr, zPrefix uintptr, zMsg uintptr) { /* mptest.c:98:13: */
  5071  	bp := tls.Alloc(24)
  5072  	defer tls.Free(24)
  5073  
  5074  	for (zMsg != 0) && (*(*int8)(unsafe.Pointer(zMsg)) != 0) {
  5075  		var i int32
  5076  		for i = 0; ((*(*int8)(unsafe.Pointer(zMsg + uintptr(i))) != 0) && (int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\n')) && (int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\r'); i++ {
  5077  		}
  5078  		libc.Xfprintf(tls, pOut, ts /* "%s%.*s\n" */, libc.VaList(bp, zPrefix, i, zMsg))
  5079  		zMsg += uintptr(i)
  5080  		for (int32(*(*int8)(unsafe.Pointer(zMsg))) == '\n') || (int32(*(*int8)(unsafe.Pointer(zMsg))) == '\r') {
  5081  			zMsg++
  5082  		}
  5083  	}
  5084  }
  5085  
  5086  // Compare two pointers to strings, where the pointers might be NULL.
  5087  func safe_strcmp(tls *libc.TLS, a uintptr, b uintptr) int32 { /* mptest.c:111:12: */
  5088  	if a == b {
  5089  		return 0
  5090  	}
  5091  	if a == uintptr(0) {
  5092  		return -1
  5093  	}
  5094  	if b == uintptr(0) {
  5095  		return 1
  5096  	}
  5097  	return libc.Xstrcmp(tls, a, b)
  5098  }
  5099  
  5100  // Return TRUE if string z[] matches glob pattern zGlob[].
  5101  // Return FALSE if the pattern does not match.
  5102  //
  5103  // Globbing rules:
  5104  //
  5105  //      '*'       Matches any sequence of zero or more characters.
  5106  //
  5107  //      '?'       Matches exactly one character.
  5108  //
  5109  //     [...]      Matches one character from the enclosed list of
  5110  //                characters.
  5111  //
  5112  //     [^...]     Matches one character not in the enclosed list.
  5113  //
  5114  //      '#'       Matches any sequence of one or more digits with an
  5115  //                optional + or - sign in front
  5116  func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5: */
  5117  	var c int32
  5118  	var c2 int32
  5119  	var invert int32
  5120  	var seen int32
  5121  
  5122  	for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) != 0 {
  5123  		if c == '*' {
  5124  			for ((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) == '*') || (c == '?') {
  5125  				if (c == '?') && ((int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0) {
  5126  					return 0
  5127  				}
  5128  			}
  5129  			if c == 0 {
  5130  				return 1
  5131  			} else if c == '[' {
  5132  				for (*(*int8)(unsafe.Pointer(z)) != 0) && (strglob(tls, (zGlob-uintptr(1)), z) != 0) {
  5133  					z++
  5134  				}
  5135  				return (libc.Bool32((int32(*(*int8)(unsafe.Pointer(z)))) != 0))
  5136  			}
  5137  			for (libc.AssignInt32(&c2, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))))) != 0 {
  5138  				for c2 != c {
  5139  					c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))
  5140  					if c2 == 0 {
  5141  						return 0
  5142  					}
  5143  				}
  5144  				if strglob(tls, zGlob, z) != 0 {
  5145  					return 1
  5146  				}
  5147  			}
  5148  			return 0
  5149  		} else if c == '?' {
  5150  			if (int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0 {
  5151  				return 0
  5152  			}
  5153  		} else if c == '[' {
  5154  			var prior_c int32 = 0
  5155  			seen = 0
  5156  			invert = 0
  5157  			c = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))
  5158  			if c == 0 {
  5159  				return 0
  5160  			}
  5161  			c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
  5162  			if c2 == '^' {
  5163  				invert = 1
  5164  				c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
  5165  			}
  5166  			if c2 == ']' {
  5167  				if c == ']' {
  5168  					seen = 1
  5169  				}
  5170  				c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
  5171  			}
  5172  			for (c2 != 0) && (c2 != ']') {
  5173  				if (((c2 == '-') && (int32(*(*int8)(unsafe.Pointer(zGlob))) != ']')) && (int32(*(*int8)(unsafe.Pointer(zGlob))) != 0)) && (prior_c > 0) {
  5174  					c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
  5175  					if (c >= prior_c) && (c <= c2) {
  5176  						seen = 1
  5177  					}
  5178  					prior_c = 0
  5179  				} else {
  5180  					if c == c2 {
  5181  						seen = 1
  5182  					}
  5183  					prior_c = c2
  5184  				}
  5185  				c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
  5186  			}
  5187  			if (c2 == 0) || ((seen ^ invert) == 0) {
  5188  				return 0
  5189  			}
  5190  		} else if c == '#' {
  5191  			if ((int32(*(*int8)(unsafe.Pointer(z))) == '-') || (int32(*(*int8)(unsafe.Pointer(z))) == '+')) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + 1)))))*2))) & int32(_ISdigit)) != 0) {
  5192  				z++
  5193  			}
  5194  			if !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z)))))*2))) & int32(_ISdigit)) != 0) {
  5195  				return 0
  5196  			}
  5197  			z++
  5198  			for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z)))))*2))) & int32(_ISdigit)) != 0 {
  5199  				z++
  5200  			}
  5201  		} else {
  5202  			if c != (int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) {
  5203  				return 0
  5204  			}
  5205  		}
  5206  	}
  5207  	return (libc.Bool32(int32(*(*int8)(unsafe.Pointer(z))) == 0))
  5208  }
  5209  
  5210  // Close output stream pOut if it is not stdout or stderr
  5211  func maybeClose(tls *libc.TLS, pOut uintptr) { /* mptest.c:208:13: */
  5212  	if (pOut != libc.Xstdout) && (pOut != libc.Xstderr) {
  5213  		libc.Xfclose(tls, pOut)
  5214  	}
  5215  }
  5216  
  5217  // Print an error message
  5218  func errorMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:215:13: */
  5219  	bp := tls.Alloc(38)
  5220  	defer tls.Free(38)
  5221  
  5222  	var ap va_list
  5223  	_ = ap
  5224  	var zMsg uintptr
  5225  	// var zPrefix [30]int8 at bp+8, 30
  5226  
  5227  	ap = va
  5228  	zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
  5229  	_ = ap
  5230  	sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+8 /* "%s:ERROR: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
  5231  	if g.pLog != 0 {
  5232  		printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
  5233  		libc.Xfflush(tls, g.pLog)
  5234  	}
  5235  	if (g.pErrLog != 0) && (safe_strcmp(tls, g.zErrLog, g.zLog) != 0) {
  5236  		printWithPrefix(tls, g.pErrLog, bp+8 /* &zPrefix[0] */, zMsg)
  5237  		libc.Xfflush(tls, g.pErrLog)
  5238  	}
  5239  	sqlite3.Xsqlite3_free(tls, zMsg)
  5240  	g.nError++
  5241  }
  5242  
  5243  // Print an error message and then quit.
  5244  func fatalError(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13: */
  5245  	bp := tls.Alloc(38)
  5246  	defer tls.Free(38)
  5247  
  5248  	var ap va_list
  5249  	_ = ap
  5250  	var zMsg uintptr
  5251  	// var zPrefix [30]int8 at bp+8, 30
  5252  
  5253  	ap = va
  5254  	zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
  5255  	_ = ap
  5256  	sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+19 /* "%s:FATAL: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
  5257  	if g.pLog != 0 {
  5258  		printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
  5259  		libc.Xfflush(tls, g.pLog)
  5260  		maybeClose(tls, g.pLog)
  5261  	}
  5262  	if (g.pErrLog != 0) && (safe_strcmp(tls, g.zErrLog, g.zLog) != 0) {
  5263  		printWithPrefix(tls, g.pErrLog, bp+8 /* &zPrefix[0] */, zMsg)
  5264  		libc.Xfflush(tls, g.pErrLog)
  5265  		maybeClose(tls, g.pErrLog)
  5266  	}
  5267  	sqlite3.Xsqlite3_free(tls, zMsg)
  5268  	if g.db != 0 {
  5269  		var nTry int32 = 0
  5270  		g.iTimeout = 0
  5271  		for (trySql(tls, ts+30 /* "UPDATE client SE..." */, 0) == SQLITE_BUSY) &&
  5272  			((libc.PostIncInt32(&nTry, 1)) < 100) {
  5273  			sqlite3.Xsqlite3_sleep(tls, 10)
  5274  		}
  5275  	}
  5276  	sqlite3.Xsqlite3_close(tls, g.db)
  5277  	libc.Xexit(tls, 1)
  5278  }
  5279  
  5280  // Print a log message
  5281  func logMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:276:13: */
  5282  	bp := tls.Alloc(38)
  5283  	defer tls.Free(38)
  5284  
  5285  	var ap va_list
  5286  	_ = ap
  5287  	var zMsg uintptr
  5288  	// var zPrefix [30]int8 at bp+8, 30
  5289  
  5290  	ap = va
  5291  	zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
  5292  	_ = ap
  5293  	sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+60 /* "%s: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
  5294  	if g.pLog != 0 {
  5295  		printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
  5296  		libc.Xfflush(tls, g.pLog)
  5297  	}
  5298  	sqlite3.Xsqlite3_free(tls, zMsg)
  5299  }
  5300  
  5301  // Return the length of a string omitting trailing whitespace
  5302  func clipLength(tls *libc.TLS, z uintptr) int32 { /* mptest.c:294:12: */
  5303  	var n int32 = int32(libc.Xstrlen(tls, z))
  5304  	for (n > 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n - 1)))))))*2))) & int32(_ISspace)) != 0) {
  5305  		n--
  5306  	}
  5307  	return n
  5308  }
  5309  
  5310  // Auxiliary SQL function to return the name of the VFS
  5311  func vfsNameFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* mptest.c:303:13: */
  5312  	bp := tls.Alloc(8)
  5313  	defer tls.Free(8)
  5314  
  5315  	var db uintptr = sqlite3.Xsqlite3_context_db_handle(tls, context)
  5316  	*(*uintptr)(unsafe.Pointer(bp /* zVfs */)) = uintptr(0)
  5317  	_ = argc
  5318  	_ = argv
  5319  	sqlite3.Xsqlite3_file_control(tls, db, ts+65 /* "main" */, SQLITE_FCNTL_VFSNAME, bp /* &zVfs */)
  5320  	if *(*uintptr)(unsafe.Pointer(bp /* zVfs */)) != 0 {
  5321  		sqlite3.Xsqlite3_result_text(tls, context, *(*uintptr)(unsafe.Pointer(bp /* zVfs */)), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
  5322  	}
  5323  }
  5324  
  5325  // Busy handler with a g.iTimeout-millisecond timeout
  5326  func busyHandler(tls *libc.TLS, pCD uintptr, count int32) int32 { /* mptest.c:321:12: */
  5327  	bp := tls.Alloc(8)
  5328  	defer tls.Free(8)
  5329  
  5330  	_ = pCD
  5331  	if (count * 10) > g.iTimeout {
  5332  		if g.iTimeout > 0 {
  5333  			errorMessage(tls, ts+70 /* "timeout after %d..." */, libc.VaList(bp, g.iTimeout))
  5334  		}
  5335  		return 0
  5336  	}
  5337  	sqlite3.Xsqlite3_sleep(tls, 10)
  5338  	return 1
  5339  }
  5340  
  5341  // SQL Trace callback
  5342  func sqlTraceCallback(tls *libc.TLS, NotUsed1 uintptr, zSql uintptr) { /* mptest.c:334:13: */
  5343  	bp := tls.Alloc(16)
  5344  	defer tls.Free(16)
  5345  
  5346  	_ = NotUsed1
  5347  	logMessage(tls, ts+89 /* "[%.*s]" */, libc.VaList(bp, clipLength(tls, zSql), zSql))
  5348  }
  5349  
  5350  // SQL error log callback
  5351  func sqlErrorCallback(tls *libc.TLS, pArg uintptr, iErrCode int32, zMsg uintptr) { /* mptest.c:342:13: */
  5352  	bp := tls.Alloc(24)
  5353  	defer tls.Free(24)
  5354  
  5355  	_ = pArg
  5356  	if (iErrCode == SQLITE_ERROR) && (g.bIgnoreSqlErrors != 0) {
  5357  		return
  5358  	}
  5359  	if ((iErrCode & 0xff) == SQLITE_SCHEMA) && (g.iTrace < 3) {
  5360  		return
  5361  	}
  5362  	if ((g.iTimeout == 0) && ((iErrCode & 0xff) == SQLITE_BUSY)) && (g.iTrace < 3) {
  5363  		return
  5364  	}
  5365  	if (iErrCode & 0xff) == SQLITE_NOTICE {
  5366  		logMessage(tls, ts+96 /* "(info) %s" */, libc.VaList(bp, zMsg))
  5367  	} else {
  5368  		errorMessage(tls, ts+106 /* "(errcode=%d) %s" */, libc.VaList(bp+8, iErrCode, zMsg))
  5369  	}
  5370  }
  5371  
  5372  // Prepare an SQL statement.  Issue a fatal error if unable.
  5373  func prepareSql(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* mptest.c:357:21: */
  5374  	bp := tls.Alloc(24)
  5375  	defer tls.Free(24)
  5376  
  5377  	var ap va_list
  5378  	_ = ap
  5379  	var zSql uintptr
  5380  	var rc int32
  5381  	*(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)) = uintptr(0)
  5382  	ap = va
  5383  	zSql = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
  5384  	_ = ap
  5385  	rc = sqlite3.Xsqlite3_prepare_v2(tls, g.db, zSql, -1, bp+16 /* &pStmt */, uintptr(0))
  5386  	if rc != SQLITE_OK {
  5387  		sqlite3.Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)))
  5388  		fatalError(tls, ts+122 /* "%s\n%s\n" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db), zSql))
  5389  	}
  5390  	sqlite3.Xsqlite3_free(tls, zSql)
  5391  	return *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */))
  5392  }
  5393  
  5394  // Run arbitrary SQL.  Issue a fatal error on failure.
  5395  func runSql(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:377:13: */
  5396  	bp := tls.Alloc(16)
  5397  	defer tls.Free(16)
  5398  
  5399  	var ap va_list
  5400  	_ = ap
  5401  	var zSql uintptr
  5402  	var rc int32
  5403  	ap = va
  5404  	zSql = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
  5405  	_ = ap
  5406  	rc = sqlite3.Xsqlite3_exec(tls, g.db, zSql, uintptr(0), uintptr(0), uintptr(0))
  5407  	if rc != SQLITE_OK {
  5408  		fatalError(tls, ts+122 /* "%s\n%s\n" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db), zSql))
  5409  	}
  5410  	sqlite3.Xsqlite3_free(tls, zSql)
  5411  }
  5412  
  5413  // Try to run arbitrary SQL.  Return success code.
  5414  func trySql(tls *libc.TLS, zFormat uintptr, va uintptr) int32 { /* mptest.c:394:12: */
  5415  	var ap va_list
  5416  	_ = ap
  5417  	var zSql uintptr
  5418  	var rc int32
  5419  	ap = va
  5420  	zSql = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
  5421  	_ = ap
  5422  	rc = sqlite3.Xsqlite3_exec(tls, g.db, zSql, uintptr(0), uintptr(0), uintptr(0))
  5423  	sqlite3.Xsqlite3_free(tls, zSql)
  5424  	return rc
  5425  }
  5426  
  5427  // Structure for holding an arbitrary length string
  5428  type String1 = struct {
  5429  	z      uintptr
  5430  	n      int32
  5431  	nAlloc int32
  5432  } /* mptest.c:408:9 */
  5433  
  5434  // Structure for holding an arbitrary length string
  5435  type String = String1 /* mptest.c:408:23 */
  5436  
  5437  // Free a string
  5438  func stringFree(tls *libc.TLS, p uintptr) { /* mptest.c:416:13: */
  5439  	if (*String)(unsafe.Pointer(p)).z != 0 {
  5440  		sqlite3.Xsqlite3_free(tls, (*String)(unsafe.Pointer(p)).z)
  5441  	}
  5442  	libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(String{})))
  5443  }
  5444  
  5445  // Append n bytes of text to a string.  If n<0 append the entire string.
  5446  func stringAppend(tls *libc.TLS, p uintptr, z uintptr, n int32) { /* mptest.c:422:13: */
  5447  	if n < 0 {
  5448  		n = int32(libc.Xstrlen(tls, z))
  5449  	}
  5450  	if ((*String)(unsafe.Pointer(p)).n + n) >= (*String)(unsafe.Pointer(p)).nAlloc {
  5451  		var nAlloc int32 = ((((*String)(unsafe.Pointer(p)).nAlloc * 2) + n) + 100)
  5452  		var zNew uintptr = sqlite3.Xsqlite3_realloc(tls, (*String)(unsafe.Pointer(p)).z, nAlloc)
  5453  		if zNew == uintptr(0) {
  5454  			fatalError(tls, ts+129 /* "out of memory" */, 0)
  5455  		}
  5456  		(*String)(unsafe.Pointer(p)).z = zNew
  5457  		(*String)(unsafe.Pointer(p)).nAlloc = nAlloc
  5458  	}
  5459  	libc.Xmemcpy(tls, ((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n)), z, uint64(n))
  5460  	*(*int32)(unsafe.Pointer(p + 8 /* &.n */)) += (n)
  5461  	*(*int8)(unsafe.Pointer((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n))) = int8(0)
  5462  }
  5463  
  5464  // Reset a string to an empty string
  5465  func stringReset(tls *libc.TLS, p uintptr) { /* mptest.c:437:13: */
  5466  	if (*String)(unsafe.Pointer(p)).z == uintptr(0) {
  5467  		stringAppend(tls, p, ts+143 /* " " */, 1)
  5468  	}
  5469  	(*String)(unsafe.Pointer(p)).n = 0
  5470  	*(*int8)(unsafe.Pointer((*String)(unsafe.Pointer(p)).z)) = int8(0)
  5471  }
  5472  
  5473  // Append a new token onto the end of the string
  5474  func stringAppendTerm(tls *libc.TLS, p uintptr, z uintptr) { /* mptest.c:444:13: */
  5475  	var i int32
  5476  	if (*String)(unsafe.Pointer(p)).n != 0 {
  5477  		stringAppend(tls, p, ts+143 /* " " */, 1)
  5478  	}
  5479  	if z == uintptr(0) {
  5480  		stringAppend(tls, p, ts+145 /* "nil" */, 3)
  5481  		return
  5482  	}
  5483  	for i = 0; (*(*int8)(unsafe.Pointer(z + uintptr(i))) != 0) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))))*2))) & int32(_ISspace)) != 0); i++ {
  5484  	}
  5485  	if (i > 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == 0) {
  5486  		stringAppend(tls, p, z, i)
  5487  		return
  5488  	}
  5489  	stringAppend(tls, p, ts+149 /* "'" */, 1)
  5490  	for *(*int8)(unsafe.Pointer(z)) != 0 {
  5491  		for i = 0; (*(*int8)(unsafe.Pointer(z + uintptr(i))) != 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) != '\''); i++ {
  5492  		}
  5493  		if *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0 {
  5494  			stringAppend(tls, p, z, (i + 1))
  5495  			stringAppend(tls, p, ts+149 /* "'" */, 1)
  5496  			z += (uintptr(i + 1))
  5497  		} else {
  5498  			stringAppend(tls, p, z, i)
  5499  			break
  5500  		}
  5501  	}
  5502  	stringAppend(tls, p, ts+149 /* "'" */, 1)
  5503  }
  5504  
  5505  // Callback function for evalSql()
  5506  func evalCallback(tls *libc.TLS, pCData uintptr, argc int32, argv uintptr, azCol uintptr) int32 { /* mptest.c:474:12: */
  5507  	var p uintptr = pCData
  5508  	var i int32
  5509  	_ = azCol
  5510  	for i = 0; i < argc; i++ {
  5511  		stringAppendTerm(tls, p, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
  5512  	}
  5513  	return 0
  5514  }
  5515  
  5516  // Run arbitrary SQL and record the results in an output string
  5517  // given by the first parameter.
  5518  func evalSql(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) int32 { /* mptest.c:486:12: */
  5519  	bp := tls.Alloc(46)
  5520  	defer tls.Free(46)
  5521  
  5522  	var ap va_list
  5523  	_ = ap
  5524  	var zSql uintptr
  5525  	var rc int32
  5526  	*(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)) = uintptr(0)
  5527  	ap = va
  5528  	zSql = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
  5529  	_ = ap
  5530  
  5531  	rc = sqlite3.Xsqlite3_exec(tls, g.db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
  5532  		f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
  5533  	}{evalCallback})), p, bp+8 /* &zErrMsg */)
  5534  	sqlite3.Xsqlite3_free(tls, zSql)
  5535  	if rc != 0 {
  5536  		// var zErr [30]int8 at bp+16, 30
  5537  
  5538  		sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+16 /* &zErr[0] */, ts+151 /* "error(%d)" */, libc.VaList(bp, rc))
  5539  		stringAppendTerm(tls, p, bp+16 /* &zErr[0] */)
  5540  		if *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)) != 0 {
  5541  			stringAppendTerm(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)))
  5542  			sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)))
  5543  		}
  5544  	}
  5545  	return rc
  5546  }
  5547  
  5548  // Auxiliary SQL function to recursively evaluate SQL.
  5549  func evalFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* mptest.c:512:13: */
  5550  	bp := tls.Alloc(24)
  5551  	defer tls.Free(24)
  5552  
  5553  	var db uintptr = sqlite3.Xsqlite3_context_db_handle(tls, context)
  5554  	var zSql uintptr = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
  5555  	// var res String at bp, 16
  5556  
  5557  	*(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)) = uintptr(0)
  5558  	var rc int32
  5559  	_ = argc
  5560  	libc.Xmemset(tls, bp /* &res */, 0, uint64(unsafe.Sizeof(String{})))
  5561  	rc = sqlite3.Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
  5562  		f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
  5563  	}{evalCallback})), bp /* &res */, bp+16 /* &zErrMsg */)
  5564  	if *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)) != 0 {
  5565  		sqlite3.Xsqlite3_result_error(tls, context, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)), -1)
  5566  		sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)))
  5567  	} else if rc != 0 {
  5568  		sqlite3.Xsqlite3_result_error_code(tls, context, rc)
  5569  	} else {
  5570  		sqlite3.Xsqlite3_result_text(tls, context, (*String)(unsafe.Pointer(bp /* &res */)).z, -1, libc.UintptrFromInt32(-1))
  5571  	}
  5572  	stringFree(tls, bp /* &res */)
  5573  }
  5574  
  5575  // Look up the next task for client iClient in the database.
  5576  // Return the task script and the task number and mark that
  5577  // task as being under way.
  5578  func startScript(tls *libc.TLS, iClient int32, pzScript uintptr, pTaskId uintptr, pzTaskName uintptr) int32 { /* mptest.c:541:12: */
  5579  	bp := tls.Alloc(80)
  5580  	defer tls.Free(80)
  5581  
  5582  	var pStmt uintptr = uintptr(0)
  5583  	var taskId int32
  5584  	var rc int32
  5585  	var totalTime int32 = 0
  5586  
  5587  	*(*uintptr)(unsafe.Pointer(pzScript)) = uintptr(0)
  5588  	g.iTimeout = 0
  5589  	for 1 != 0 {
  5590  		rc = trySql(tls, ts+161 /* "BEGIN IMMEDIATE" */, 0)
  5591  		if rc == SQLITE_BUSY {
  5592  			sqlite3.Xsqlite3_sleep(tls, 10)
  5593  			totalTime = totalTime + (10)
  5594  			continue
  5595  		}
  5596  		if rc != SQLITE_OK {
  5597  			fatalError(tls, ts+177 /* "in startScript: ..." */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db)))
  5598  		}
  5599  		if (g.nError != 0) || (g.nTest != 0) {
  5600  			runSql(tls, ts+196, /* "UPDATE counters ..." */
  5601  				libc.VaList(bp+8, g.nError, g.nTest))
  5602  			g.nError = 0
  5603  			g.nTest = 0
  5604  		}
  5605  		pStmt = prepareSql(tls, ts+249 /* "SELECT 1 FROM cl..." */, libc.VaList(bp+24, iClient))
  5606  		rc = sqlite3.Xsqlite3_step(tls, pStmt)
  5607  		sqlite3.Xsqlite3_finalize(tls, pStmt)
  5608  		if rc == SQLITE_ROW {
  5609  			runSql(tls, ts+295 /* "DELETE FROM clie..." */, libc.VaList(bp+32, iClient))
  5610  			g.iTimeout = DEFAULT_TIMEOUT
  5611  			runSql(tls, ts+326 /* "COMMIT TRANSACTI..." */, 0)
  5612  			return SQLITE_DONE
  5613  		}
  5614  		pStmt = prepareSql(tls,
  5615  
  5616  			ts+346 /* "SELECT script, i..." */, libc.VaList(bp+40, iClient))
  5617  		rc = sqlite3.Xsqlite3_step(tls, pStmt)
  5618  		if rc == SQLITE_ROW {
  5619  			var n int32 = sqlite3.Xsqlite3_column_bytes(tls, pStmt, 0)
  5620  			*(*uintptr)(unsafe.Pointer(pzScript)) = sqlite3.Xsqlite3_malloc(tls, (n + 1))
  5621  			libc.Xstrcpy(tls, *(*uintptr)(unsafe.Pointer(pzScript)), sqlite3.Xsqlite3_column_text(tls, pStmt, 0))
  5622  			*(*int32)(unsafe.Pointer(pTaskId)) = libc.AssignInt32(&taskId, sqlite3.Xsqlite3_column_int(tls, pStmt, 1))
  5623  			*(*uintptr)(unsafe.Pointer(pzTaskName)) = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+48, sqlite3.Xsqlite3_column_text(tls, pStmt, 2)))
  5624  			sqlite3.Xsqlite3_finalize(tls, pStmt)
  5625  			runSql(tls,
  5626  
  5627  				ts+441 /* "UPDATE task   SE..." */, libc.VaList(bp+56, taskId))
  5628  			g.iTimeout = DEFAULT_TIMEOUT
  5629  			runSql(tls, ts+326 /* "COMMIT TRANSACTI..." */, 0)
  5630  			return SQLITE_OK
  5631  		}
  5632  		sqlite3.Xsqlite3_finalize(tls, pStmt)
  5633  		if rc == SQLITE_DONE {
  5634  			if totalTime > 30000 {
  5635  				errorMessage(tls, ts+524 /* "Waited over 30 s..." */, 0)
  5636  				runSql(tls, ts+573 /* "DELETE FROM clie..." */, libc.VaList(bp+64, iClient))
  5637  				sqlite3.Xsqlite3_close(tls, g.db)
  5638  				libc.Xexit(tls, 1)
  5639  			}
  5640  			for trySql(tls, ts+613 /* "COMMIT" */, 0) == SQLITE_BUSY {
  5641  				sqlite3.Xsqlite3_sleep(tls, 10)
  5642  				totalTime = totalTime + (10)
  5643  			}
  5644  			sqlite3.Xsqlite3_sleep(tls, 100)
  5645  			totalTime = totalTime + (100)
  5646  			continue
  5647  		}
  5648  		fatalError(tls, ts+438 /* "%s" */, libc.VaList(bp+72, sqlite3.Xsqlite3_errmsg(tls, g.db)))
  5649  	}
  5650  	g.iTimeout = DEFAULT_TIMEOUT
  5651  	return int32(0)
  5652  }
  5653  
  5654  // Mark a script as having finished.   Remove the CLIENT table entry
  5655  // if bShutdown is true.
  5656  func finishScript(tls *libc.TLS, iClient int32, taskId int32, bShutdown int32) int32 { /* mptest.c:623:12: */
  5657  	bp := tls.Alloc(16)
  5658  	defer tls.Free(16)
  5659  
  5660  	runSql(tls,
  5661  
  5662  		ts+620 /* "UPDATE task   SE..." */, libc.VaList(bp, taskId))
  5663  	if bShutdown != 0 {
  5664  		runSql(tls, ts+295 /* "DELETE FROM clie..." */, libc.VaList(bp+8, iClient))
  5665  	}
  5666  	return SQLITE_OK
  5667  }
  5668  
  5669  // Start up a client process for iClient, if it is not already
  5670  // running.  If the client is already running, then this routine
  5671  // is a no-op.
  5672  func startClient(tls *libc.TLS, iClient int32) { /* mptest.c:638:13: */
  5673  	bp := tls.Alloc(96)
  5674  	defer tls.Free(96)
  5675  
  5676  	runSql(tls, ts+701 /* "INSERT OR IGNORE..." */, libc.VaList(bp, iClient))
  5677  	if sqlite3.Xsqlite3_changes(tls, g.db) != 0 {
  5678  		var zSys uintptr
  5679  		var rc int32
  5680  		zSys = sqlite3.Xsqlite3_mprintf(tls, ts+743, /* "%s \"%s\" --client..." */
  5681  			libc.VaList(bp+8, g.argv0, g.zDbFile, iClient, g.iTrace))
  5682  		if g.bSqlTrace != 0 {
  5683  			zSys = sqlite3.Xsqlite3_mprintf(tls, ts+774 /* "%z --sqltrace" */, libc.VaList(bp+40, zSys))
  5684  		}
  5685  		if g.bSync != 0 {
  5686  			zSys = sqlite3.Xsqlite3_mprintf(tls, ts+788 /* "%z --sync" */, libc.VaList(bp+48, zSys))
  5687  		}
  5688  		if g.zVfs != 0 {
  5689  			zSys = sqlite3.Xsqlite3_mprintf(tls, ts+798 /* "%z --vfs \"%s\"" */, libc.VaList(bp+56, zSys, g.zVfs))
  5690  		}
  5691  		if g.iTrace >= 2 {
  5692  			logMessage(tls, ts+812 /* "system('%q')" */, libc.VaList(bp+72, zSys))
  5693  		}
  5694  		zSys = sqlite3.Xsqlite3_mprintf(tls, ts+825 /* "%z &" */, libc.VaList(bp+80, zSys))
  5695  		rc = libc.Xsystem(tls, zSys)
  5696  		if rc != 0 {
  5697  			errorMessage(tls, ts+830 /* "system() fails w..." */, libc.VaList(bp+88, rc))
  5698  		}
  5699  		sqlite3.Xsqlite3_free(tls, zSys)
  5700  	}
  5701  }
  5702  
  5703  // Read the entire content of a file into memory
  5704  func readFile(tls *libc.TLS, zFilename uintptr) uintptr { /* mptest.c:684:13: */
  5705  	bp := tls.Alloc(8)
  5706  	defer tls.Free(8)
  5707  
  5708  	var in uintptr = libc.Xfopen(tls, zFilename, ts+864 /* "rb" */)
  5709  	var sz int64
  5710  	var z uintptr
  5711  	if in == uintptr(0) {
  5712  		fatalError(tls, ts+867 /* "cannot open \"%s\"..." */, libc.VaList(bp, zFilename))
  5713  	}
  5714  	libc.Xfseek(tls, in, int64(0), SEEK_END)
  5715  	sz = libc.Xftell(tls, in)
  5716  	libc.Xrewind(tls, in)
  5717  	z = sqlite3.Xsqlite3_malloc(tls, (int32(sz + int64(1))))
  5718  	sz = int64(libc.Xfread(tls, z, uint64(1), uint64(sz), in))
  5719  	*(*int8)(unsafe.Pointer(z + uintptr(sz))) = int8(0)
  5720  	libc.Xfclose(tls, in)
  5721  	return z
  5722  }
  5723  
  5724  // Return the length of the next token.
  5725  func tokenLength(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:704:12: */
  5726  	var n int32 = 0
  5727  	if ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z)))))*2))) & int32(_ISspace)) != 0) || ((int32(*(*int8)(unsafe.Pointer(z))) == '/') && (int32(*(*int8)(unsafe.Pointer(z + 1))) == '*')) {
  5728  		var inC int32 = 0
  5729  		var c int32
  5730  		if int32(*(*int8)(unsafe.Pointer(z))) == '/' {
  5731  			inC = 1
  5732  			n = 2
  5733  		}
  5734  		for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&n, 1))))))) != 0 {
  5735  			if c == '\n' {
  5736  				(*(*int32)(unsafe.Pointer(pnLine)))++
  5737  			}
  5738  			if (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0 {
  5739  				continue
  5740  			}
  5741  			if ((inC != 0) && (c == '*')) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '/') {
  5742  				n++
  5743  				inC = 0
  5744  			} else if (!(inC != 0) && (c == '/')) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '*') {
  5745  				n++
  5746  				inC = 1
  5747  			} else if !(inC != 0) {
  5748  				break
  5749  			}
  5750  		}
  5751  		n--
  5752  	} else if (int32(*(*int8)(unsafe.Pointer(z))) == '-') && (int32(*(*int8)(unsafe.Pointer(z + 1))) == '-') {
  5753  		for n = 2; (*(*int8)(unsafe.Pointer(z + uintptr(n))) != 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) != '\n'); n++ {
  5754  		}
  5755  		if *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 {
  5756  			(*(*int32)(unsafe.Pointer(pnLine)))++
  5757  			n++
  5758  		}
  5759  	} else if (int32(*(*int8)(unsafe.Pointer(z))) == '"') || (int32(*(*int8)(unsafe.Pointer(z))) == '\'') {
  5760  		var delim int32 = int32(*(*int8)(unsafe.Pointer(z)))
  5761  		for n = 1; *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0; n++ {
  5762  			if int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '\n' {
  5763  				(*(*int32)(unsafe.Pointer(pnLine)))++
  5764  			}
  5765  			if int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == delim {
  5766  				n++
  5767  				if int32(*(*int8)(unsafe.Pointer(z + uintptr((n + 1))))) != delim {
  5768  					break
  5769  				}
  5770  			}
  5771  		}
  5772  	} else {
  5773  		var c int32
  5774  		for n = 1; (((((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))))) != 0) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0)) && (c != '"')) && (c != '\'')) && (c != ';'); n++ {
  5775  		}
  5776  	}
  5777  	return n
  5778  }
  5779  
  5780  // Copy a single token into a string buffer.
  5781  func extractToken(tls *libc.TLS, zIn uintptr, nIn int32, zOut uintptr, nOut int32) int32 { /* mptest.c:749:12: */
  5782  	var i int32
  5783  	if nIn <= 0 {
  5784  		*(*int8)(unsafe.Pointer(zOut)) = int8(0)
  5785  		return 0
  5786  	}
  5787  	for i = 0; ((i < nIn) && (i < (nOut - 1))) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(i))))))*2))) & int32(_ISspace)) != 0); i++ {
  5788  		*(*int8)(unsafe.Pointer(zOut + uintptr(i))) = *(*int8)(unsafe.Pointer(zIn + uintptr(i)))
  5789  	}
  5790  	*(*int8)(unsafe.Pointer(zOut + uintptr(i))) = int8(0)
  5791  	return i
  5792  }
  5793  
  5794  // Find the number of characters up to the start of the next "--end" token.
  5795  func findEnd(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:763:12: */
  5796  	var n int32 = 0
  5797  	for (*(*int8)(unsafe.Pointer(z + uintptr(n))) != 0) && ((libc.Xstrncmp(tls, (z+uintptr(n)), ts+896 /* "--end" */, uint64(5)) != 0) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 5)))))))*2))) & int32(_ISspace)) != 0)) {
  5798  		n = n + (tokenLength(tls, (z + uintptr(n)), pnLine))
  5799  	}
  5800  	return n
  5801  }
  5802  
  5803  // Find the number of characters up to the first character past the
  5804  // of the next "--endif"  or "--else" token. Nested --if commands are
  5805  // also skipped.
  5806  func findEndif(tls *libc.TLS, z uintptr, stopAtElse int32, pnLine uintptr) int32 { /* mptest.c:776:12: */
  5807  	var n int32 = 0
  5808  	for *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 {
  5809  		var len int32 = tokenLength(tls, (z + uintptr(n)), pnLine)
  5810  		if ((libc.Xstrncmp(tls, (z+uintptr(n)), ts+902 /* "--endif" */, uint64(7)) == 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 7)))))))*2))) & int32(_ISspace)) != 0)) ||
  5811  			(((stopAtElse != 0) && (libc.Xstrncmp(tls, (z+uintptr(n)), ts+910 /* "--else" */, uint64(6)) == 0)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 6)))))))*2))) & int32(_ISspace)) != 0)) {
  5812  			return (n + len)
  5813  		}
  5814  		if (libc.Xstrncmp(tls, (z+uintptr(n)), ts+917 /* "--if" */, uint64(4)) == 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 4)))))))*2))) & int32(_ISspace)) != 0) {
  5815  			var skip int32 = findEndif(tls, ((z + uintptr(n)) + uintptr(len)), 0, pnLine)
  5816  			n = n + (skip + len)
  5817  		} else {
  5818  			n = n + (len)
  5819  		}
  5820  	}
  5821  	return n
  5822  }
  5823  
  5824  // Wait for a client process to complete all its tasks
  5825  func waitForClient(tls *libc.TLS, iClient int32, iTimeout int32, zErrPrefix uintptr) { /* mptest.c:798:13: */
  5826  	bp := tls.Alloc(32)
  5827  	defer tls.Free(32)
  5828  
  5829  	var pStmt uintptr
  5830  	var rc int32
  5831  	if iClient > 0 {
  5832  		pStmt = prepareSql(tls,
  5833  
  5834  			ts+922, /* "SELECT 1 FROM ta..." */
  5835  			libc.VaList(bp, iClient))
  5836  	} else {
  5837  		pStmt = prepareSql(tls,
  5838  
  5839  			ts+1018 /* "SELECT 1 FROM ta..." */, 0)
  5840  	}
  5841  	g.iTimeout = 0
  5842  	for (((libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == SQLITE_BUSY) || (rc == SQLITE_ROW)) &&
  5843  		(iTimeout > 0) {
  5844  		sqlite3.Xsqlite3_reset(tls, pStmt)
  5845  		sqlite3.Xsqlite3_sleep(tls, 50)
  5846  		iTimeout = iTimeout - (50)
  5847  	}
  5848  	sqlite3.Xsqlite3_finalize(tls, pStmt)
  5849  	g.iTimeout = DEFAULT_TIMEOUT
  5850  	if rc != SQLITE_DONE {
  5851  		if zErrPrefix == uintptr(0) {
  5852  			zErrPrefix = ts + 1099 /* "" */
  5853  		}
  5854  		if iClient > 0 {
  5855  			errorMessage(tls, ts+1100 /* "%stimeout waitin..." */, libc.VaList(bp+8, zErrPrefix, iClient))
  5856  		} else {
  5857  			errorMessage(tls, ts+1132 /* "%stimeout waitin..." */, libc.VaList(bp+24, zErrPrefix))
  5858  		}
  5859  	}
  5860  }
  5861  
  5862  // Return a pointer to the tail of a filename
  5863  func filenameTail(tls *libc.TLS, z uintptr) uintptr { /* mptest.c:836:13: */
  5864  	var i int32
  5865  	var j int32
  5866  	for i = libc.AssignInt32(&j, 0); *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0; i++ {
  5867  		if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i))))) == '/' {
  5868  			j = (i + 1)
  5869  		}
  5870  	}
  5871  	return (z + uintptr(j))
  5872  }
  5873  
  5874  // Interpret zArg as a boolean value.  Return either 0 or 1.
  5875  func booleanValue(tls *libc.TLS, zArg uintptr) int32 { /* mptest.c:845:12: */
  5876  	bp := tls.Alloc(8)
  5877  	defer tls.Free(8)
  5878  
  5879  	var i int32
  5880  	if zArg == uintptr(0) {
  5881  		return 0
  5882  	}
  5883  	for i = 0; (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) <= '9'); i++ {
  5884  	}
  5885  	if (i > 0) && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) == 0) {
  5886  		return libc.Xatoi(tls, zArg)
  5887  	}
  5888  	if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1166 /* "on" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1169 /* "yes" */) == 0) {
  5889  		return 1
  5890  	}
  5891  	if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1173 /* "off" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1177 /* "no" */) == 0) {
  5892  		return 0
  5893  	}
  5894  	errorMessage(tls, ts+1180 /* "unknown boolean:..." */, libc.VaList(bp, zArg))
  5895  	return 0
  5896  }
  5897  
  5898  // This routine exists as a convenient place to set a debugger
  5899  // breakpoint.
  5900  func test_breakpoint(tls *libc.TLS) { /* mptest.c:864:13: */
  5901  	atomic.AddInt32(&cnt, 1)
  5902  }
  5903  
  5904  var cnt int32 = 0 /* mptest.c:864:56 */
  5905  
  5906  // Maximum number of arguments to a --command
  5907  
  5908  // Run a script.
  5909  func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFilename uintptr) { /* mptest.c:872:13: */
  5910  	bp := tls.Alloc(1610)
  5911  	defer tls.Free(1610)
  5912  
  5913  	*(*int32)(unsafe.Pointer(bp + 376 /* lineno */)) = 1
  5914  	var prevLine int32 = 1
  5915  	var ii int32 = 0
  5916  	var iBegin int32 = 0
  5917  	var n int32
  5918  	var c int32
  5919  	var j int32
  5920  	var len int32
  5921  	var nArg int32
  5922  	// var sResult String at bp+360, 16
  5923  
  5924  	// var zCmd [30]int8 at bp+380, 30
  5925  
  5926  	// var zError [1000]int8 at bp+610, 1000
  5927  
  5928  	// var azArg [2][100]int8 at bp+410, 200
  5929  
  5930  	libc.Xmemset(tls, bp+360 /* &sResult */, 0, uint64(unsafe.Sizeof(String{})))
  5931  	stringReset(tls, bp+360 /* &sResult */)
  5932  	for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii)))))) != 0 {
  5933  		prevLine = *(*int32)(unsafe.Pointer(bp + 376 /* lineno */))
  5934  		len = tokenLength(tls, (zScript + uintptr(ii)), bp+376 /* &lineno */)
  5935  		if ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0) || ((c == '/') && (int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) == '*')) {
  5936  			ii = ii + (len)
  5937  			continue
  5938  		}
  5939  		if ((c != '-') || (int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) != '-')) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 2))))))*2))) & int32(_ISalpha)) != 0) {
  5940  			ii = ii + (len)
  5941  			continue
  5942  		}
  5943  
  5944  		// Run any prior SQL before processing the new --command
  5945  		if ii > iBegin {
  5946  			var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp, (ii-iBegin), (zScript+uintptr(iBegin))))
  5947  			evalSql(tls, bp+360 /* &sResult */, zSql, 0)
  5948  			sqlite3.Xsqlite3_free(tls, zSql)
  5949  			iBegin = (ii + len)
  5950  		}
  5951  
  5952  		// Parse the --command
  5953  		if g.iTrace >= 2 {
  5954  			logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+16, len, (zScript+uintptr(ii))))
  5955  		}
  5956  		n = extractToken(tls, ((zScript + uintptr(ii)) + uintptr(2)), (len - 2), bp+380 /* &zCmd[0] */, int32(unsafe.Sizeof([30]int8{})))
  5957  		for nArg = 0; (n < (len - 2)) && (nArg < MX_ARG); nArg++ {
  5958  			for (n < (len - 2)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr(((ii + 2) + n)))))))*2))) & int32(_ISspace)) != 0) {
  5959  				n++
  5960  			}
  5961  			if n >= (len - 2) {
  5962  				break
  5963  			}
  5964  			n = n + (extractToken(tls, (((zScript + uintptr(ii)) + uintptr(2)) + uintptr(n)), ((len - 2) - n),
  5965  				(bp + 410 /* &azArg[0] */ + uintptr(nArg)*100), int32(unsafe.Sizeof([100]int8{}))))
  5966  		}
  5967  		for j = nArg; j < MX_ARG; j++ {
  5968  			*(*int8)(unsafe.Pointer((bp + 410 /* &azArg[0] */ + uintptr(libc.PostIncInt32(&j, 1))*100))) = int8(0)
  5969  		}
  5970  
  5971  		//  --sleep N
  5972  		//
  5973  		// Pause for N milliseconds
  5974  		if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1207 /* "sleep" */) == 0 {
  5975  			sqlite3.Xsqlite3_sleep(tls, libc.Xatoi(tls, (bp+410 /* &azArg[0] */)))
  5976  		} else
  5977  
  5978  		//   --exit N
  5979  		//
  5980  		// Exit this process.  If N>0 then exit without shutting down
  5981  		// SQLite.  (In other words, simulate a crash.)
  5982  		if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1213 /* "exit" */) == 0 {
  5983  			var rc int32 = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */))
  5984  			finishScript(tls, iClient, taskId, 1)
  5985  			if rc == 0 {
  5986  				sqlite3.Xsqlite3_close(tls, g.db)
  5987  			}
  5988  			libc.Xexit(tls, rc)
  5989  		} else
  5990  
  5991  		//   --testcase NAME
  5992  		//
  5993  		// Begin a new test case.  Announce in the log that the test case
  5994  		// has begun.
  5995  		if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1218 /* "testcase" */) == 0 {
  5996  			if g.iTrace == 1 {
  5997  				logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+32, (len-1), (zScript+uintptr(ii))))
  5998  			}
  5999  			stringReset(tls, bp+360 /* &sResult */)
  6000  		} else
  6001  
  6002  		//   --finish
  6003  		//
  6004  		// Mark the current task as having finished, even if it is not.
  6005  		// This can be used in conjunction with --exit to simulate a crash.
  6006  		if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1227 /* "finish" */) == 0) && (iClient > 0) {
  6007  			finishScript(tls, iClient, taskId, 1)
  6008  		} else
  6009  
  6010  		//  --reset
  6011  		//
  6012  		// Reset accumulated results back to an empty string
  6013  		if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1234 /* "reset" */) == 0 {
  6014  			stringReset(tls, bp+360 /* &sResult */)
  6015  		} else
  6016  
  6017  		//  --match ANSWER...
  6018  		//
  6019  		// Check to see if output matches ANSWER.  Report an error if not.
  6020  		if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1240 /* "match" */) == 0 {
  6021  			var jj int32
  6022  			var zAns uintptr = (zScript + uintptr(ii))
  6023  			for jj = 7; (jj < (len - 1)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj))))))*2))) & int32(_ISspace)) != 0); jj++ {
  6024  			}
  6025  			zAns += uintptr(jj)
  6026  			if (((len - jj) - 1) != (*String)(unsafe.Pointer(bp+360 /* &sResult */)).n) || (libc.Xstrncmp(tls, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z, zAns, (uint64((len-jj)-1))) != 0) {
  6027  				errorMessage(tls, ts+1246, /* "line %d of %s:\nE..." */
  6028  					libc.VaList(bp+48, prevLine, zFilename, ((len-jj)-1), zAns, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
  6029  			}
  6030  			g.nTest++
  6031  			stringReset(tls, bp+360 /* &sResult */)
  6032  		} else
  6033  
  6034  		//  --glob ANSWER...
  6035  		//  --notglob ANSWER....
  6036  		//
  6037  		// Check to see if output does or does not match the glob pattern
  6038  		// ANSWER.
  6039  		if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1291 /* "glob" */) == 0) || (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1296 /* "notglob" */) == 0) {
  6040  			var jj int32
  6041  			var zAns uintptr = (zScript + uintptr(ii))
  6042  			var zCopy uintptr
  6043  			var isGlob int32 = (libc.Bool32(int32(*(*int8)(unsafe.Pointer(bp + 380 /* &zCmd[0] */))) == 'g'))
  6044  			for jj = (9 - (3 * isGlob)); (jj < (len - 1)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj))))))*2))) & int32(_ISspace)) != 0); jj++ {
  6045  			}
  6046  			zAns += uintptr(jj)
  6047  			zCopy = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+88, ((len-jj)-1), zAns))
  6048  			if ((libc.Bool32(sqlite3.Xsqlite3_strglob(tls, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z) == 0)) ^ isGlob) != 0 {
  6049  				errorMessage(tls, ts+1304, /* "line %d of %s:\nE..." */
  6050  					libc.VaList(bp+104, prevLine, zFilename, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
  6051  			}
  6052  			sqlite3.Xsqlite3_free(tls, zCopy)
  6053  			g.nTest++
  6054  			stringReset(tls, bp+360 /* &sResult */)
  6055  		} else
  6056  
  6057  		//  --output
  6058  		//
  6059  		// Output the result of the previous SQL.
  6060  		if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1347 /* "output" */) == 0 {
  6061  			logMessage(tls, ts+438 /* "%s" */, libc.VaList(bp+136, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
  6062  		} else
  6063  
  6064  		//  --source FILENAME
  6065  		//
  6066  		// Run a subscript from a separate file.
  6067  		if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1354 /* "source" */) == 0 {
  6068  			var zNewFile uintptr
  6069  			var zNewScript uintptr
  6070  			var zToDel uintptr = uintptr(0)
  6071  			zNewFile = (bp + 410 /* &azArg[0] */)
  6072  			if !((int32(*(*int8)(unsafe.Pointer(zNewFile)))) == '/') {
  6073  				var k int32
  6074  				for k = (int32(libc.Xstrlen(tls, zFilename)) - 1); (k >= 0) && !((int32(*(*int8)(unsafe.Pointer(zFilename + uintptr(k))))) == '/'); k-- {
  6075  				}
  6076  				if k > 0 {
  6077  					zNewFile = libc.AssignUintptr(&zToDel, sqlite3.Xsqlite3_mprintf(tls, ts+1361 /* "%.*s/%s" */, libc.VaList(bp+144, k, zFilename, zNewFile)))
  6078  				}
  6079  			}
  6080  			zNewScript = readFile(tls, zNewFile)
  6081  			if g.iTrace != 0 {
  6082  				logMessage(tls, ts+1369 /* "begin script [%s..." */, libc.VaList(bp+168, zNewFile))
  6083  			}
  6084  			runScript(tls, 0, 0, zNewScript, zNewFile)
  6085  			sqlite3.Xsqlite3_free(tls, zNewScript)
  6086  			if g.iTrace != 0 {
  6087  				logMessage(tls, ts+1388 /* "end script [%s]\n" */, libc.VaList(bp+176, zNewFile))
  6088  			}
  6089  			sqlite3.Xsqlite3_free(tls, zToDel)
  6090  		} else
  6091  
  6092  		//  --print MESSAGE....
  6093  		//
  6094  		// Output the remainder of the line to the log file
  6095  		if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1405 /* "print" */) == 0 {
  6096  			var jj int32
  6097  			for jj = 7; (jj < len) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + jj)))))))*2))) & int32(_ISspace)) != 0); jj++ {
  6098  			}
  6099  			logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+184, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
  6100  		} else
  6101  
  6102  		//  --if EXPR
  6103  		//
  6104  		// Skip forward to the next matching --endif or --else if EXPR is false.
  6105  		if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1411 /* "if" */) == 0 {
  6106  			var jj int32
  6107  			var rc int32
  6108  			var pStmt uintptr
  6109  			for jj = 4; (jj < len) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + jj)))))))*2))) & int32(_ISspace)) != 0); jj++ {
  6110  			}
  6111  			pStmt = prepareSql(tls, ts+1414 /* "SELECT %.*s" */, libc.VaList(bp+200, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
  6112  			rc = sqlite3.Xsqlite3_step(tls, pStmt)
  6113  			if (rc != SQLITE_ROW) || (sqlite3.Xsqlite3_column_int(tls, pStmt, 0) == 0) {
  6114  				ii = ii + (findEndif(tls, ((zScript + uintptr(ii)) + uintptr(len)), 1, bp+376 /* &lineno */))
  6115  			}
  6116  			sqlite3.Xsqlite3_finalize(tls, pStmt)
  6117  		} else
  6118  
  6119  		//  --else
  6120  		//
  6121  		// This command can only be encountered if currently inside an --if that
  6122  		// is true.  Skip forward to the next matching --endif.
  6123  		if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1426 /* "else" */) == 0 {
  6124  			ii = ii + (findEndif(tls, ((zScript + uintptr(ii)) + uintptr(len)), 0, bp+376 /* &lineno */))
  6125  		} else
  6126  
  6127  		//  --endif
  6128  		//
  6129  		// This command can only be encountered if currently inside an --if that
  6130  		// is true or an --else of a false if.  This is a no-op.
  6131  		if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1431 /* "endif" */) == 0 {
  6132  			// no-op
  6133  		} else
  6134  
  6135  		//  --start CLIENT
  6136  		//
  6137  		// Start up the given client.
  6138  		if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1437 /* "start" */) == 0) && (iClient == 0) {
  6139  			var iNewClient int32 = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */))
  6140  			if iNewClient > 0 {
  6141  				startClient(tls, iNewClient)
  6142  			}
  6143  		} else
  6144  
  6145  		//  --wait CLIENT TIMEOUT
  6146  		//
  6147  		// Wait until all tasks complete for the given client.  If CLIENT is
  6148  		// "all" then wait for all clients to complete.  Wait no longer than
  6149  		// TIMEOUT milliseconds (default 10,000)
  6150  		if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1443 /* "wait" */) == 0) && (iClient == 0) {
  6151  			var iTimeout int32
  6152  			if nArg >= 2 {
  6153  				iTimeout = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */ + 1*100))
  6154  			} else {
  6155  				iTimeout = 10000
  6156  			}
  6157  			sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([1000]int8{})), bp+610 /* &zError[0] */, ts+1448, /* "line %d of %s\n" */
  6158  				libc.VaList(bp+216, prevLine, zFilename))
  6159  			waitForClient(tls, libc.Xatoi(tls, (bp+410 /* &azArg[0] */)), iTimeout, bp+610 /* &zError[0] */)
  6160  		} else
  6161  
  6162  		//  --task CLIENT
  6163  		//     <task-content-here>
  6164  		//  --end
  6165  		//
  6166  		// Assign work to a client.  Start the client if it is not running
  6167  		// already.
  6168  		if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1463 /* "task" */) == 0) && (iClient == 0) {
  6169  			var iTarget int32 = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */))
  6170  			var iEnd int32
  6171  			var zTask uintptr
  6172  			var zTName uintptr
  6173  			iEnd = findEnd(tls, ((zScript + uintptr(ii)) + uintptr(len)), bp+376 /* &lineno */)
  6174  			if iTarget < 0 {
  6175  				errorMessage(tls, ts+1468, /* "line %d of %s: b..." */
  6176  					libc.VaList(bp+232, prevLine, zFilename, iTarget))
  6177  			} else {
  6178  				zTask = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+256, iEnd, ((zScript+uintptr(ii))+uintptr(len))))
  6179  				if nArg > 1 {
  6180  					zTName = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+272, (bp+410 /* &azArg[0] */ +1*100)))
  6181  				} else {
  6182  					zTName = sqlite3.Xsqlite3_mprintf(tls, ts+1505 /* "%s:%d" */, libc.VaList(bp+280, filenameTail(tls, zFilename), prevLine))
  6183  				}
  6184  				startClient(tls, iTarget)
  6185  				runSql(tls,
  6186  					ts+1511 /* "INSERT INTO task..." */, libc.VaList(bp+296, iTarget, zTask, zTName))
  6187  				sqlite3.Xsqlite3_free(tls, zTask)
  6188  				sqlite3.Xsqlite3_free(tls, zTName)
  6189  			}
  6190  			iEnd = iEnd + (tokenLength(tls, (((zScript + uintptr(ii)) + uintptr(len)) + uintptr(iEnd)), bp+376 /* &lineno */))
  6191  			len = len + (iEnd)
  6192  			iBegin = (ii + len)
  6193  		} else
  6194  
  6195  		//  --breakpoint
  6196  		//
  6197  		// This command calls "test_breakpoint()" which is a routine provided
  6198  		// as a convenient place to set a debugger breakpoint.
  6199  		if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1567 /* "breakpoint" */) == 0 {
  6200  			test_breakpoint(tls)
  6201  		} else
  6202  
  6203  		//  --show-sql-errors BOOLEAN
  6204  		//
  6205  		// Turn display of SQL errors on and off.
  6206  		if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1578 /* "show-sql-errors" */) == 0 {
  6207  			g.bIgnoreSqlErrors = func() int32 {
  6208  				if nArg >= 1 {
  6209  					return libc.BoolInt32(!(booleanValue(tls, (bp+410 /* &azArg[0] */)) != 0))
  6210  				}
  6211  				return 1
  6212  			}()
  6213  		} else {
  6214  			errorMessage(tls, ts+1594, /* "line %d of %s: u..." */
  6215  				libc.VaList(bp+320, prevLine, zFilename, bp+380 /* &zCmd[0] */))
  6216  		}
  6217  		ii = ii + (len)
  6218  	}
  6219  	if iBegin < ii {
  6220  		var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+344, (ii-iBegin), (zScript+uintptr(iBegin))))
  6221  		runSql(tls, zSql, 0)
  6222  		sqlite3.Xsqlite3_free(tls, zSql)
  6223  	}
  6224  	stringFree(tls, bp+360 /* &sResult */)
  6225  }
  6226  
  6227  // Look for a command-line option.  If present, return a pointer.
  6228  // Return NULL if missing.
  6229  //
  6230  // hasArg==0 means the option is a flag.  It is either present or not.
  6231  // hasArg==1 means the option has an argument.  Return a pointer to the
  6232  // argument.
  6233  func findOption(tls *libc.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, hasArg int32) uintptr { /* mptest.c:1201:13: */
  6234  	bp := tls.Alloc(8)
  6235  	defer tls.Free(8)
  6236  
  6237  	var i int32
  6238  	var j int32
  6239  	var zReturn uintptr = uintptr(0)
  6240  	var nArg int32 = *(*int32)(unsafe.Pointer(pnArg))
  6241  
  6242  	for i = 0; i < nArg; i++ {
  6243  		var z uintptr
  6244  		if (i + hasArg) >= nArg {
  6245  			break
  6246  		}
  6247  		z = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))
  6248  		if int32(*(*int8)(unsafe.Pointer(z))) != '-' {
  6249  			continue
  6250  		}
  6251  		z++
  6252  		if int32(*(*int8)(unsafe.Pointer(z))) == '-' {
  6253  			if int32(*(*int8)(unsafe.Pointer(z + 1))) == 0 {
  6254  				break
  6255  			}
  6256  			z++
  6257  		}
  6258  		if libc.Xstrcmp(tls, z, zOption) == 0 {
  6259  			if (hasArg != 0) && (i == (nArg - 1)) {
  6260  				fatalError(tls, ts+1630 /* "command-line opt..." */, libc.VaList(bp, z))
  6261  			}
  6262  			if hasArg != 0 {
  6263  				zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*8))
  6264  			} else {
  6265  				zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))
  6266  			}
  6267  			j = ((i + 1) + (libc.Bool32(hasArg != 0)))
  6268  			for j < nArg {
  6269  				*(*uintptr)(unsafe.Pointer(azArg + uintptr(libc.PostIncInt32(&i, 1))*8)) = *(*uintptr)(unsafe.Pointer(azArg + uintptr(libc.PostIncInt32(&j, 1))*8))
  6270  			}
  6271  			*(*int32)(unsafe.Pointer(pnArg)) = i
  6272  			return zReturn
  6273  		}
  6274  	}
  6275  	return zReturn
  6276  }
  6277  
  6278  // Print a usage message for the program and exit
  6279  func usage(tls *libc.TLS, argv0 uintptr) { /* mptest.c:1241:13: */
  6280  	bp := tls.Alloc(8)
  6281  	defer tls.Free(8)
  6282  
  6283  	var i int32
  6284  	var zTail uintptr = argv0
  6285  	for i = 0; *(*int8)(unsafe.Pointer(argv0 + uintptr(i))) != 0; i++ {
  6286  		if (int32(*(*int8)(unsafe.Pointer(argv0 + uintptr(i))))) == '/' {
  6287  			zTail = ((argv0 + uintptr(i)) + uintptr(1))
  6288  		}
  6289  	}
  6290  	libc.Xfprintf(tls, libc.Xstderr, ts+1678 /* "Usage: %s DATABA..." */, libc.VaList(bp, zTail))
  6291  	libc.Xfprintf(tls, libc.Xstderr,
  6292  
  6293  		ts+1717 /* "Options:\n   --er..." */, 0)
  6294  	libc.Xexit(tls, 1)
  6295  }
  6296  
  6297  // Report on unrecognized arguments
  6298  func unrecognizedArguments(tls *libc.TLS, argv0 uintptr, nArg int32, azArg uintptr) { /* mptest.c:1265:13: */
  6299  	bp := tls.Alloc(16)
  6300  	defer tls.Free(16)
  6301  
  6302  	var i int32
  6303  	libc.Xfprintf(tls, libc.Xstderr, ts+2289 /* "%s: unrecognized..." */, libc.VaList(bp, argv0))
  6304  	for i = 0; i < nArg; i++ {
  6305  		libc.Xfprintf(tls, libc.Xstderr, ts+2317 /* " %s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))))
  6306  	}
  6307  	libc.Xfprintf(tls, libc.Xstderr, ts+2321 /* "\n" */, 0)
  6308  	libc.Xexit(tls, 1)
  6309  }
  6310  
  6311  func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18: */
  6312  	bp := tls.Alloc(264)
  6313  	defer tls.Free(264)
  6314  
  6315  	var zClient uintptr
  6316  	var iClient int32
  6317  	// var n int32 at bp+232, 4
  6318  
  6319  	var i int32
  6320  	var openFlags int32 = SQLITE_OPEN_READWRITE
  6321  	var rc int32
  6322  	// var zScript uintptr at bp+240, 8
  6323  
  6324  	// var taskId int32 at bp+248, 4
  6325  
  6326  	var zTrace uintptr
  6327  	var zCOption uintptr
  6328  	var zJMode uintptr
  6329  	var zNRep uintptr
  6330  	var nRep int32 = 1
  6331  	var iRep int32
  6332  	var iTmout int32 = 0 // Default: no timeout
  6333  	var zTmout uintptr
  6334  
  6335  	g.argv0 = *(*uintptr)(unsafe.Pointer(argv))
  6336  	g.iTrace = 1
  6337  	if argc < 2 {
  6338  		usage(tls, *(*uintptr)(unsafe.Pointer(argv)))
  6339  	}
  6340  	g.zDbFile = *(*uintptr)(unsafe.Pointer(argv + 1*8))
  6341  	if strglob(tls, ts+2323 /* "*.test" */, g.zDbFile) != 0 {
  6342  		usage(tls, *(*uintptr)(unsafe.Pointer(argv)))
  6343  	}
  6344  	if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-06-18 18:36..." */) != 0 {
  6345  		libc.Xfprintf(tls, libc.Xstderr,
  6346  
  6347  			ts+2415, /* "SQLite library a..." */
  6348  			libc.VaList(bp, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-06-18 18:36..." */))
  6349  		libc.Xexit(tls, 1)
  6350  	}
  6351  	*(*int32)(unsafe.Pointer(bp + 232 /* n */)) = (argc - 2)
  6352  	sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+64 /* &.zName */, ts+2475 /* "%05d.mptest" */, libc.VaList(bp+16, libc.Xgetpid(tls)))
  6353  	zJMode = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2487 /* "journalmode" */, 1)
  6354  	zNRep = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2499 /* "repeat" */, 1)
  6355  	if zNRep != 0 {
  6356  		nRep = libc.Xatoi(tls, zNRep)
  6357  	}
  6358  	if nRep < 1 {
  6359  		nRep = 1
  6360  	}
  6361  	g.zVfs = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2506 /* "vfs" */, 1)
  6362  	zClient = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2510 /* "client" */, 1)
  6363  	g.zErrLog = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2517 /* "errlog" */, 1)
  6364  	g.zLog = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2524 /* "log" */, 1)
  6365  	zTrace = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2528 /* "trace" */, 1)
  6366  	if zTrace != 0 {
  6367  		g.iTrace = libc.Xatoi(tls, zTrace)
  6368  	}
  6369  	if findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2534 /* "quiet" */, 0) != uintptr(0) {
  6370  		g.iTrace = 0
  6371  	}
  6372  	zTmout = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2540 /* "timeout" */, 1)
  6373  	if zTmout != 0 {
  6374  		iTmout = libc.Xatoi(tls, zTmout)
  6375  	}
  6376  	g.bSqlTrace = (libc.Bool32(findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2548 /* "sqltrace" */, 0) != uintptr(0)))
  6377  	g.bSync = (libc.Bool32(findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2557 /* "sync" */, 0) != uintptr(0)))
  6378  	if g.zErrLog != 0 {
  6379  		g.pErrLog = libc.Xfopen(tls, g.zErrLog, ts+2562 /* "a" */)
  6380  	} else {
  6381  		g.pErrLog = libc.Xstderr
  6382  	}
  6383  	if g.zLog != 0 {
  6384  		g.pLog = libc.Xfopen(tls, g.zLog, ts+2562 /* "a" */)
  6385  	} else {
  6386  		g.pLog = libc.Xstdout
  6387  	}
  6388  
  6389  	sqlite3.Xsqlite3_config(tls, SQLITE_CONFIG_LOG, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(&struct {
  6390  		f func(*libc.TLS, uintptr, int32, uintptr)
  6391  	}{sqlErrorCallback})), 0))
  6392  	if zClient != 0 {
  6393  		iClient = libc.Xatoi(tls, zClient)
  6394  		if iClient < 1 {
  6395  			fatalError(tls, ts+2564 /* "illegal client n..." */, libc.VaList(bp+40, iClient))
  6396  		}
  6397  		sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+64 /* &.zName */, ts+2591, /* "%05d.client%02d" */
  6398  			libc.VaList(bp+48, libc.Xgetpid(tls), iClient))
  6399  	} else {
  6400  		var nTry int32 = 0
  6401  		if g.iTrace > 0 {
  6402  			libc.Xprintf(tls, ts+2607 /* "BEGIN: %s" */, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(argv))))
  6403  			for i = 1; i < argc; i++ {
  6404  				libc.Xprintf(tls, ts+2317 /* " %s" */, libc.VaList(bp+72, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
  6405  			}
  6406  			libc.Xprintf(tls, ts+2321 /* "\n" */, 0)
  6407  			libc.Xprintf(tls, ts+2617 /* "With SQLite 3.36..." */, 0)
  6408  			for i = 0; (libc.AssignUintptr(&zCOption, sqlite3.Xsqlite3_compileoption_get(tls, i))) != uintptr(0); i++ {
  6409  				libc.Xprintf(tls, ts+2722 /* "-DSQLITE_%s\n" */, libc.VaList(bp+80, zCOption))
  6410  			}
  6411  			libc.Xfflush(tls, libc.Xstdout)
  6412  		}
  6413  		iClient = 0
  6414  		for ok := true; ok; ok = (((rc != 0) && ((libc.PreIncInt32(&nTry, 1)) < 60)) && (sqlite3.Xsqlite3_sleep(tls, 1000) > 0)) {
  6415  			if (nTry % 5) == 4 {
  6416  				libc.Xprintf(tls, ts+2735, /* "... %strying to ..." */
  6417  					libc.VaList(bp+88, func() uintptr {
  6418  						if nTry > 5 {
  6419  							return ts + 2764 /* "still " */
  6420  						}
  6421  						return ts + 1099 /* "" */
  6422  					}(), g.zDbFile))
  6423  			}
  6424  			rc = libc.Xunlink(tls, g.zDbFile)
  6425  			if (rc != 0) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == ENOENT) {
  6426  				rc = 0
  6427  			}
  6428  		}
  6429  		if rc != 0 {
  6430  			fatalError(tls, ts+2771, /* "unable to unlink..." */
  6431  				libc.VaList(bp+104, g.zDbFile, nTry))
  6432  		}
  6433  		openFlags = openFlags | (SQLITE_OPEN_CREATE)
  6434  	}
  6435  	rc = sqlite3.Xsqlite3_open_v2(tls, g.zDbFile, (uintptr(unsafe.Pointer(&g)) + 24 /* &.db */), openFlags, g.zVfs)
  6436  	if rc != 0 {
  6437  		fatalError(tls, ts+2812 /* "cannot open [%s]" */, libc.VaList(bp+120, g.zDbFile))
  6438  	}
  6439  	if iTmout > 0 {
  6440  		sqlite3.Xsqlite3_busy_timeout(tls, g.db, iTmout)
  6441  	}
  6442  
  6443  	if zJMode != 0 {
  6444  		runSql(tls, ts+2829 /* "PRAGMA journal_m..." */, libc.VaList(bp+128, zJMode))
  6445  	}
  6446  	if !(g.bSync != 0) {
  6447  		trySql(tls, ts+2853 /* "PRAGMA synchrono..." */, 0)
  6448  	}
  6449  	sqlite3.Xsqlite3_enable_load_extension(tls, g.db, 1)
  6450  	sqlite3.Xsqlite3_busy_handler(tls, g.db, *(*uintptr)(unsafe.Pointer(&struct {
  6451  		f func(*libc.TLS, uintptr, int32) int32
  6452  	}{busyHandler})), uintptr(0))
  6453  	sqlite3.Xsqlite3_create_function(tls, g.db, ts+2876 /* "vfsname" */, 0, SQLITE_UTF8, uintptr(0),
  6454  		*(*uintptr)(unsafe.Pointer(&struct {
  6455  			f func(*libc.TLS, uintptr, int32, uintptr)
  6456  		}{vfsNameFunc})), uintptr(0), uintptr(0))
  6457  	sqlite3.Xsqlite3_create_function(tls, g.db, ts+2884 /* "eval" */, 1, SQLITE_UTF8, uintptr(0),
  6458  		*(*uintptr)(unsafe.Pointer(&struct {
  6459  			f func(*libc.TLS, uintptr, int32, uintptr)
  6460  		}{evalFunc})), uintptr(0), uintptr(0))
  6461  	g.iTimeout = DEFAULT_TIMEOUT
  6462  	if g.bSqlTrace != 0 {
  6463  		sqlite3.Xsqlite3_trace(tls, g.db, *(*uintptr)(unsafe.Pointer(&struct {
  6464  			f func(*libc.TLS, uintptr, uintptr)
  6465  		}{sqlTraceCallback})), uintptr(0))
  6466  	}
  6467  	if iClient > 0 {
  6468  		if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) > 0 {
  6469  			unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), (argv + uintptr(2)*8))
  6470  		}
  6471  		if g.iTrace != 0 {
  6472  			logMessage(tls, ts+2889 /* "start-client" */, 0)
  6473  		}
  6474  		for 1 != 0 {
  6475  			*(*uintptr)(unsafe.Pointer(bp + 256 /* zTaskName */)) = uintptr(0)
  6476  			rc = startScript(tls, iClient, bp+240 /* &zScript */, bp+248 /* &taskId */, bp+256 /* &zTaskName */)
  6477  			if rc == SQLITE_DONE {
  6478  				break
  6479  			}
  6480  			if g.iTrace != 0 {
  6481  				logMessage(tls, ts+2902 /* "begin %s (%d)" */, libc.VaList(bp+136, *(*uintptr)(unsafe.Pointer(bp + 256 /* zTaskName */)), *(*int32)(unsafe.Pointer(bp + 248 /* taskId */))))
  6482  			}
  6483  			runScript(tls, iClient, *(*int32)(unsafe.Pointer(bp + 248 /* taskId */)), *(*uintptr)(unsafe.Pointer(bp + 240 /* zScript */)), *(*uintptr)(unsafe.Pointer(bp + 256 /* zTaskName */)))
  6484  			if g.iTrace != 0 {
  6485  				logMessage(tls, ts+2916 /* "end %s (%d)" */, libc.VaList(bp+152, *(*uintptr)(unsafe.Pointer(bp + 256 /* zTaskName */)), *(*int32)(unsafe.Pointer(bp + 248 /* taskId */))))
  6486  			}
  6487  			finishScript(tls, iClient, *(*int32)(unsafe.Pointer(bp + 248 /* taskId */)), 0)
  6488  			sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 256 /* zTaskName */)))
  6489  			sqlite3.Xsqlite3_sleep(tls, 10)
  6490  		}
  6491  		if g.iTrace != 0 {
  6492  			logMessage(tls, ts+2928 /* "end-client" */, 0)
  6493  		}
  6494  	} else {
  6495  		var pStmt uintptr
  6496  		var iTimeout int32
  6497  		if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) == 0 {
  6498  			fatalError(tls, ts+2939 /* "missing script f..." */, 0)
  6499  		}
  6500  		if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) > 1 {
  6501  			unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), (argv + uintptr(2)*8))
  6502  		}
  6503  		runSql(tls,
  6504  
  6505  			ts+2963 /* "DROP TABLE IF EX..." */, 0)
  6506  		*(*uintptr)(unsafe.Pointer(bp + 240 /* zScript */)) = readFile(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))
  6507  		for iRep = 1; iRep <= nRep; iRep++ {
  6508  			if g.iTrace != 0 {
  6509  				logMessage(tls, ts+3399 /* "begin script [%s..." */, libc.VaList(bp+168, *(*uintptr)(unsafe.Pointer(argv + 2*8)), iRep))
  6510  			}
  6511  			runScript(tls, 0, 0, *(*uintptr)(unsafe.Pointer(bp + 240 /* zScript */)), *(*uintptr)(unsafe.Pointer(argv + 2*8)))
  6512  			if g.iTrace != 0 {
  6513  				logMessage(tls, ts+3427 /* "end script [%s] ..." */, libc.VaList(bp+184, *(*uintptr)(unsafe.Pointer(argv + 2*8)), iRep))
  6514  			}
  6515  		}
  6516  		sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 240 /* zScript */)))
  6517  		waitForClient(tls, 0, 2000, ts+3453 /* "during shutdown...." */)
  6518  		trySql(tls, ts+3473 /* "UPDATE client SE..." */, 0)
  6519  		sqlite3.Xsqlite3_sleep(tls, 10)
  6520  		g.iTimeout = 0
  6521  		iTimeout = 1000
  6522  		for (((libc.AssignInt32(&rc, trySql(tls, ts+3502 /* "SELECT 1 FROM cl..." */, 0))) == SQLITE_BUSY) ||
  6523  			(rc == SQLITE_ROW)) && (iTimeout > 0) {
  6524  			sqlite3.Xsqlite3_sleep(tls, 10)
  6525  			iTimeout = iTimeout - (10)
  6526  		}
  6527  		sqlite3.Xsqlite3_sleep(tls, 100)
  6528  		pStmt = prepareSql(tls, ts+3523 /* "SELECT nError, n..." */, 0)
  6529  		iTimeout = 1000
  6530  		for ((libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == SQLITE_BUSY) && (iTimeout > 0) {
  6531  			sqlite3.Xsqlite3_sleep(tls, 10)
  6532  			iTimeout = iTimeout - (10)
  6533  		}
  6534  		if rc == SQLITE_ROW {
  6535  			*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 112 /* &.nError */)) += (sqlite3.Xsqlite3_column_int(tls, pStmt, 0))
  6536  			*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 116 /* &.nTest */)) += (sqlite3.Xsqlite3_column_int(tls, pStmt, 1))
  6537  		}
  6538  		sqlite3.Xsqlite3_finalize(tls, pStmt)
  6539  	}
  6540  	sqlite3.Xsqlite3_close(tls, g.db)
  6541  	maybeClose(tls, g.pLog)
  6542  	maybeClose(tls, g.pErrLog)
  6543  	if iClient == 0 {
  6544  		libc.Xprintf(tls, ts+3558 /* "Summary: %d erro..." */, libc.VaList(bp+200, g.nError, g.nTest))
  6545  		libc.Xprintf(tls, ts+3594 /* "END: %s" */, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(argv))))
  6546  		for i = 1; i < argc; i++ {
  6547  			libc.Xprintf(tls, ts+2317 /* " %s" */, libc.VaList(bp+224, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
  6548  		}
  6549  		libc.Xprintf(tls, ts+2321 /* "\n" */, 0)
  6550  	}
  6551  	return (libc.Bool32(g.nError > 0))
  6552  }
  6553  
  6554  var ts1 = "%s%.*s\n\x00%s:ERROR: \x00%s:FATAL: \x00UPDATE client SET wantHalt=1;\x00%s: \x00main\x00timeout after %dms\x00[%.*s]\x00(info) %s\x00(errcode=%d) %s\x00%s\n%s\n\x00out of memory\x00 \x00nil\x00'\x00error(%d)\x00BEGIN IMMEDIATE\x00in startScript: %s\x00UPDATE counters SET nError=nError+%d, nTest=nTest+%d\x00SELECT 1 FROM client WHERE id=%d AND wantHalt\x00DELETE FROM client WHERE id=%d\x00COMMIT TRANSACTION;\x00SELECT script, id, name FROM task WHERE client=%d AND starttime IS NULL ORDER BY id LIMIT 1\x00%s\x00UPDATE task   SET starttime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\x00Waited over 30 seconds with no work.  Giving up.\x00DELETE FROM client WHERE id=%d; COMMIT;\x00COMMIT\x00UPDATE task   SET endtime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\x00INSERT OR IGNORE INTO client VALUES(%d,0)\x00%s \"%s\" --client %d --trace %d\x00%z --sqltrace\x00%z --sync\x00%z --vfs \"%s\"\x00system('%q')\x00%z &\x00system() fails with error code %d\x00rb\x00cannot open \"%s\" for reading\x00--end\x00--endif\x00--else\x00--if\x00SELECT 1 FROM task WHERE client=%d   AND client IN (SELECT id FROM client)  AND endtime IS NULL\x00SELECT 1 FROM task WHERE client IN (SELECT id FROM client)   AND endtime IS NULL\x00\x00%stimeout waiting for client %d\x00%stimeout waiting for all clients\x00on\x00yes\x00off\x00no\x00unknown boolean: [%s]\x00%.*s\x00sleep\x00exit\x00testcase\x00finish\x00reset\x00match\x00line %d of %s:\nExpected [%.*s]\n     Got [%s]\x00glob\x00notglob\x00line %d of %s:\nExpected [%s]\n     Got [%s]\x00output\x00source\x00%.*s/%s\x00begin script [%s]\n\x00end script [%s]\n\x00print\x00if\x00SELECT %.*s\x00else\x00endif\x00start\x00wait\x00line %d of %s\n\x00task\x00line %d of %s: bad client number: %d\x00%s:%d\x00INSERT INTO task(client,script,name) VALUES(%d,'%q',%Q)\x00breakpoint\x00show-sql-errors\x00line %d of %s: unknown command --%s\x00command-line option \"--%s\" requires an argument\x00Usage: %s DATABASE ?OPTIONS? ?SCRIPT?\n\x00Options:\n   --errlog FILENAME           Write errors to FILENAME\n   --journalmode MODE          Use MODE as the journal_mode\n   --log FILENAME              Log messages to FILENAME\n   --quiet                     Suppress unnecessary output\n   --vfs NAME                  Use NAME as the VFS\n   --repeat N                  Repeat the test N times\n   --sqltrace                  Enable SQL tracing\n   --sync                      Enable synchronous disk writes\n   --timeout MILLISEC          Busy timeout is MILLISEC\n   --trace BOOLEAN             Enable or disable tracing\n\x00%s: unrecognized arguments:\x00 %s\x00\n\x00*.test\x002021-06-18 18:36:39 5c9a6c06871cb9fe42814af9c039eb6da5427a6ec28f187af7ebfb62eafa66e5\x00SQLite library and header mismatch\nLibrary: %s\nHeader:  %s\n\x00%05d.mptest\x00journalmode\x00repeat\x00vfs\x00client\x00errlog\x00log\x00trace\x00quiet\x00timeout\x00sqltrace\x00sync\x00a\x00illegal client number: %d\n\x00%05d.client%02d\x00BEGIN: %s\x00With SQLite 3.36.0 2021-06-18 18:36:39 5c9a6c06871cb9fe42814af9c039eb6da5427a6ec28f187af7ebfb62eafa66e5\n\x00-DSQLITE_%s\n\x00... %strying to unlink '%s'\n\x00still \x00unable to unlink '%s' after %d attempts\n\x00cannot open [%s]\x00PRAGMA journal_mode=%Q;\x00PRAGMA synchronous=OFF\x00vfsname\x00eval\x00start-client\x00begin %s (%d)\x00end %s (%d)\x00end-client\x00missing script filename\x00DROP TABLE IF EXISTS task;\nDROP TABLE IF EXISTS counters;\nDROP TABLE IF EXISTS client;\nCREATE TABLE task(\n  id INTEGER PRIMARY KEY,\n  name TEXT,\n  client INTEGER,\n  starttime DATE,\n  endtime DATE,\n  script TEXT\n);CREATE INDEX task_i1 ON task(client, starttime);\nCREATE INDEX task_i2 ON task(client, endtime);\nCREATE TABLE counters(nError,nTest);\nINSERT INTO counters VALUES(0,0);\nCREATE TABLE client(id INTEGER PRIMARY KEY, wantHalt);\n\x00begin script [%s] cycle %d\n\x00end script [%s] cycle %d\n\x00during shutdown...\n\x00UPDATE client SET wantHalt=1\x00SELECT 1 FROM client\x00SELECT nError, nTest FROM counters\x00Summary: %d errors out of %d tests\n\x00END: %s\x00"
  6555  var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data