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

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