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

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