gitlab.com/CoiaPrant/sqlite3@v1.19.1/vfs/vfs_windows_amd64.go (about)

     1  // Code generated by 'ccgo3 -o vfs_linux_amd64.go vfs.c -I../testdata/sqlite-amalgamation-3380500 -lgitlab.com/CoiaPrant/sqlite3/lib -pkgname vfs -nocapi -export-externs X -D SQLITE_OS_UNIX -hide=vfsFullPathname -hide=vfsOpen -hide=vfsRead -hide=vfsAccess -hide=vfsFileSize -hide=vfsClose', DO NOT EDIT.
     2  
     3  package vfs
     4  
     5  import (
     6  	"math"
     7  	"reflect"
     8  	"sync/atomic"
     9  	"unsafe"
    10  
    11  	"modernc.org/libc"
    12  	"modernc.org/libc/sys/types"
    13  	"gitlab.com/CoiaPrant/sqlite3/lib"
    14  )
    15  
    16  var _ = math.Pi
    17  var _ reflect.Kind
    18  var _ atomic.Value
    19  var _ unsafe.Pointer
    20  var _ *libc.TLS
    21  var _ types.Size_t
    22  
    23  const (
    24  	_PC_LINK_MAX           = 0
    25  	_PC_MAX_CANON          = 1
    26  	_PC_MAX_INPUT          = 2
    27  	_PC_NAME_MAX           = 3
    28  	_PC_PATH_MAX           = 4
    29  	_PC_PIPE_BUF           = 5
    30  	_PC_CHOWN_RESTRICTED   = 6
    31  	_PC_NO_TRUNC           = 7
    32  	_PC_VDISABLE           = 8
    33  	_PC_SYNC_IO            = 9
    34  	_PC_ASYNC_IO           = 10
    35  	_PC_PRIO_IO            = 11
    36  	_PC_SOCK_MAXBUF        = 12
    37  	_PC_FILESIZEBITS       = 13
    38  	_PC_REC_INCR_XFER_SIZE = 14
    39  	_PC_REC_MAX_XFER_SIZE  = 15
    40  	_PC_REC_MIN_XFER_SIZE  = 16
    41  	_PC_REC_XFER_ALIGN     = 17
    42  	_PC_ALLOC_SIZE_MIN     = 18
    43  	_PC_SYMLINK_MAX        = 19
    44  	_PC_2_SYMLINKS         = 20
    45  )
    46  
    47  const (
    48  	_CS_PATH = 0
    49  
    50  	_CS_V6_WIDTH_RESTRICTED_ENVS = 1
    51  
    52  	_CS_GNU_LIBC_VERSION       = 2
    53  	_CS_GNU_LIBPTHREAD_VERSION = 3
    54  
    55  	_CS_V5_WIDTH_RESTRICTED_ENVS = 4
    56  
    57  	_CS_V7_WIDTH_RESTRICTED_ENVS = 5
    58  
    59  	_CS_LFS_CFLAGS      = 1000
    60  	_CS_LFS_LDFLAGS     = 1001
    61  	_CS_LFS_LIBS        = 1002
    62  	_CS_LFS_LINTFLAGS   = 1003
    63  	_CS_LFS64_CFLAGS    = 1004
    64  	_CS_LFS64_LDFLAGS   = 1005
    65  	_CS_LFS64_LIBS      = 1006
    66  	_CS_LFS64_LINTFLAGS = 1007
    67  
    68  	_CS_XBS5_ILP32_OFF32_CFLAGS     = 1100
    69  	_CS_XBS5_ILP32_OFF32_LDFLAGS    = 1101
    70  	_CS_XBS5_ILP32_OFF32_LIBS       = 1102
    71  	_CS_XBS5_ILP32_OFF32_LINTFLAGS  = 1103
    72  	_CS_XBS5_ILP32_OFFBIG_CFLAGS    = 1104
    73  	_CS_XBS5_ILP32_OFFBIG_LDFLAGS   = 1105
    74  	_CS_XBS5_ILP32_OFFBIG_LIBS      = 1106
    75  	_CS_XBS5_ILP32_OFFBIG_LINTFLAGS = 1107
    76  	_CS_XBS5_LP64_OFF64_CFLAGS      = 1108
    77  	_CS_XBS5_LP64_OFF64_LDFLAGS     = 1109
    78  	_CS_XBS5_LP64_OFF64_LIBS        = 1110
    79  	_CS_XBS5_LP64_OFF64_LINTFLAGS   = 1111
    80  	_CS_XBS5_LPBIG_OFFBIG_CFLAGS    = 1112
    81  	_CS_XBS5_LPBIG_OFFBIG_LDFLAGS   = 1113
    82  	_CS_XBS5_LPBIG_OFFBIG_LIBS      = 1114
    83  	_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS = 1115
    84  
    85  	_CS_POSIX_V6_ILP32_OFF32_CFLAGS     = 1116
    86  	_CS_POSIX_V6_ILP32_OFF32_LDFLAGS    = 1117
    87  	_CS_POSIX_V6_ILP32_OFF32_LIBS       = 1118
    88  	_CS_POSIX_V6_ILP32_OFF32_LINTFLAGS  = 1119
    89  	_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS    = 1120
    90  	_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS   = 1121
    91  	_CS_POSIX_V6_ILP32_OFFBIG_LIBS      = 1122
    92  	_CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 1123
    93  	_CS_POSIX_V6_LP64_OFF64_CFLAGS      = 1124
    94  	_CS_POSIX_V6_LP64_OFF64_LDFLAGS     = 1125
    95  	_CS_POSIX_V6_LP64_OFF64_LIBS        = 1126
    96  	_CS_POSIX_V6_LP64_OFF64_LINTFLAGS   = 1127
    97  	_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS    = 1128
    98  	_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS   = 1129
    99  	_CS_POSIX_V6_LPBIG_OFFBIG_LIBS      = 1130
   100  	_CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS = 1131
   101  
   102  	_CS_POSIX_V7_ILP32_OFF32_CFLAGS     = 1132
   103  	_CS_POSIX_V7_ILP32_OFF32_LDFLAGS    = 1133
   104  	_CS_POSIX_V7_ILP32_OFF32_LIBS       = 1134
   105  	_CS_POSIX_V7_ILP32_OFF32_LINTFLAGS  = 1135
   106  	_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS    = 1136
   107  	_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS   = 1137
   108  	_CS_POSIX_V7_ILP32_OFFBIG_LIBS      = 1138
   109  	_CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS = 1139
   110  	_CS_POSIX_V7_LP64_OFF64_CFLAGS      = 1140
   111  	_CS_POSIX_V7_LP64_OFF64_LDFLAGS     = 1141
   112  	_CS_POSIX_V7_LP64_OFF64_LIBS        = 1142
   113  	_CS_POSIX_V7_LP64_OFF64_LINTFLAGS   = 1143
   114  	_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS    = 1144
   115  	_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS   = 1145
   116  	_CS_POSIX_V7_LPBIG_OFFBIG_LIBS      = 1146
   117  	_CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS = 1147
   118  
   119  	_CS_V6_ENV = 1148
   120  	_CS_V7_ENV = 1149
   121  )
   122  
   123  const (
   124  	_SC_ARG_MAX               = 0
   125  	_SC_CHILD_MAX             = 1
   126  	_SC_CLK_TCK               = 2
   127  	_SC_NGROUPS_MAX           = 3
   128  	_SC_OPEN_MAX              = 4
   129  	_SC_STREAM_MAX            = 5
   130  	_SC_TZNAME_MAX            = 6
   131  	_SC_JOB_CONTROL           = 7
   132  	_SC_SAVED_IDS             = 8
   133  	_SC_REALTIME_SIGNALS      = 9
   134  	_SC_PRIORITY_SCHEDULING   = 10
   135  	_SC_TIMERS                = 11
   136  	_SC_ASYNCHRONOUS_IO       = 12
   137  	_SC_PRIORITIZED_IO        = 13
   138  	_SC_SYNCHRONIZED_IO       = 14
   139  	_SC_FSYNC                 = 15
   140  	_SC_MAPPED_FILES          = 16
   141  	_SC_MEMLOCK               = 17
   142  	_SC_MEMLOCK_RANGE         = 18
   143  	_SC_MEMORY_PROTECTION     = 19
   144  	_SC_MESSAGE_PASSING       = 20
   145  	_SC_SEMAPHORES            = 21
   146  	_SC_SHARED_MEMORY_OBJECTS = 22
   147  	_SC_AIO_LISTIO_MAX        = 23
   148  	_SC_AIO_MAX               = 24
   149  	_SC_AIO_PRIO_DELTA_MAX    = 25
   150  	_SC_DELAYTIMER_MAX        = 26
   151  	_SC_MQ_OPEN_MAX           = 27
   152  	_SC_MQ_PRIO_MAX           = 28
   153  	_SC_VERSION               = 29
   154  	_SC_PAGESIZE              = 30
   155  	_SC_RTSIG_MAX             = 31
   156  	_SC_SEM_NSEMS_MAX         = 32
   157  	_SC_SEM_VALUE_MAX         = 33
   158  	_SC_SIGQUEUE_MAX          = 34
   159  	_SC_TIMER_MAX             = 35
   160  
   161  	_SC_BC_BASE_MAX        = 36
   162  	_SC_BC_DIM_MAX         = 37
   163  	_SC_BC_SCALE_MAX       = 38
   164  	_SC_BC_STRING_MAX      = 39
   165  	_SC_COLL_WEIGHTS_MAX   = 40
   166  	_SC_EQUIV_CLASS_MAX    = 41
   167  	_SC_EXPR_NEST_MAX      = 42
   168  	_SC_LINE_MAX           = 43
   169  	_SC_RE_DUP_MAX         = 44
   170  	_SC_CHARCLASS_NAME_MAX = 45
   171  
   172  	_SC_2_VERSION   = 46
   173  	_SC_2_C_BIND    = 47
   174  	_SC_2_C_DEV     = 48
   175  	_SC_2_FORT_DEV  = 49
   176  	_SC_2_FORT_RUN  = 50
   177  	_SC_2_SW_DEV    = 51
   178  	_SC_2_LOCALEDEF = 52
   179  
   180  	_SC_PII                 = 53
   181  	_SC_PII_XTI             = 54
   182  	_SC_PII_SOCKET          = 55
   183  	_SC_PII_INTERNET        = 56
   184  	_SC_PII_OSI             = 57
   185  	_SC_POLL                = 58
   186  	_SC_SELECT              = 59
   187  	_SC_UIO_MAXIOV          = 60
   188  	_SC_IOV_MAX             = 60
   189  	_SC_PII_INTERNET_STREAM = 61
   190  	_SC_PII_INTERNET_DGRAM  = 62
   191  	_SC_PII_OSI_COTS        = 63
   192  	_SC_PII_OSI_CLTS        = 64
   193  	_SC_PII_OSI_M           = 65
   194  	_SC_T_IOV_MAX           = 66
   195  
   196  	_SC_THREADS                      = 67
   197  	_SC_THREAD_SAFE_FUNCTIONS        = 68
   198  	_SC_GETGR_R_SIZE_MAX             = 69
   199  	_SC_GETPW_R_SIZE_MAX             = 70
   200  	_SC_LOGIN_NAME_MAX               = 71
   201  	_SC_TTY_NAME_MAX                 = 72
   202  	_SC_THREAD_DESTRUCTOR_ITERATIONS = 73
   203  	_SC_THREAD_KEYS_MAX              = 74
   204  	_SC_THREAD_STACK_MIN             = 75
   205  	_SC_THREAD_THREADS_MAX           = 76
   206  	_SC_THREAD_ATTR_STACKADDR        = 77
   207  	_SC_THREAD_ATTR_STACKSIZE        = 78
   208  	_SC_THREAD_PRIORITY_SCHEDULING   = 79
   209  	_SC_THREAD_PRIO_INHERIT          = 80
   210  	_SC_THREAD_PRIO_PROTECT          = 81
   211  	_SC_THREAD_PROCESS_SHARED        = 82
   212  
   213  	_SC_NPROCESSORS_CONF = 83
   214  	_SC_NPROCESSORS_ONLN = 84
   215  	_SC_PHYS_PAGES       = 85
   216  	_SC_AVPHYS_PAGES     = 86
   217  	_SC_ATEXIT_MAX       = 87
   218  	_SC_PASS_MAX         = 88
   219  
   220  	_SC_XOPEN_VERSION     = 89
   221  	_SC_XOPEN_XCU_VERSION = 90
   222  	_SC_XOPEN_UNIX        = 91
   223  	_SC_XOPEN_CRYPT       = 92
   224  	_SC_XOPEN_ENH_I18N    = 93
   225  	_SC_XOPEN_SHM         = 94
   226  
   227  	_SC_2_CHAR_TERM = 95
   228  	_SC_2_C_VERSION = 96
   229  	_SC_2_UPE       = 97
   230  
   231  	_SC_XOPEN_XPG2 = 98
   232  	_SC_XOPEN_XPG3 = 99
   233  	_SC_XOPEN_XPG4 = 100
   234  
   235  	_SC_CHAR_BIT   = 101
   236  	_SC_CHAR_MAX   = 102
   237  	_SC_CHAR_MIN   = 103
   238  	_SC_INT_MAX    = 104
   239  	_SC_INT_MIN    = 105
   240  	_SC_LONG_BIT   = 106
   241  	_SC_WORD_BIT   = 107
   242  	_SC_MB_LEN_MAX = 108
   243  	_SC_NZERO      = 109
   244  	_SC_SSIZE_MAX  = 110
   245  	_SC_SCHAR_MAX  = 111
   246  	_SC_SCHAR_MIN  = 112
   247  	_SC_SHRT_MAX   = 113
   248  	_SC_SHRT_MIN   = 114
   249  	_SC_UCHAR_MAX  = 115
   250  	_SC_UINT_MAX   = 116
   251  	_SC_ULONG_MAX  = 117
   252  	_SC_USHRT_MAX  = 118
   253  
   254  	_SC_NL_ARGMAX  = 119
   255  	_SC_NL_LANGMAX = 120
   256  	_SC_NL_MSGMAX  = 121
   257  	_SC_NL_NMAX    = 122
   258  	_SC_NL_SETMAX  = 123
   259  	_SC_NL_TEXTMAX = 124
   260  
   261  	_SC_XBS5_ILP32_OFF32  = 125
   262  	_SC_XBS5_ILP32_OFFBIG = 126
   263  	_SC_XBS5_LP64_OFF64   = 127
   264  	_SC_XBS5_LPBIG_OFFBIG = 128
   265  
   266  	_SC_XOPEN_LEGACY           = 129
   267  	_SC_XOPEN_REALTIME         = 130
   268  	_SC_XOPEN_REALTIME_THREADS = 131
   269  
   270  	_SC_ADVISORY_INFO          = 132
   271  	_SC_BARRIERS               = 133
   272  	_SC_BASE                   = 134
   273  	_SC_C_LANG_SUPPORT         = 135
   274  	_SC_C_LANG_SUPPORT_R       = 136
   275  	_SC_CLOCK_SELECTION        = 137
   276  	_SC_CPUTIME                = 138
   277  	_SC_THREAD_CPUTIME         = 139
   278  	_SC_DEVICE_IO              = 140
   279  	_SC_DEVICE_SPECIFIC        = 141
   280  	_SC_DEVICE_SPECIFIC_R      = 142
   281  	_SC_FD_MGMT                = 143
   282  	_SC_FIFO                   = 144
   283  	_SC_PIPE                   = 145
   284  	_SC_FILE_ATTRIBUTES        = 146
   285  	_SC_FILE_LOCKING           = 147
   286  	_SC_FILE_SYSTEM            = 148
   287  	_SC_MONOTONIC_CLOCK        = 149
   288  	_SC_MULTI_PROCESS          = 150
   289  	_SC_SINGLE_PROCESS         = 151
   290  	_SC_NETWORKING             = 152
   291  	_SC_READER_WRITER_LOCKS    = 153
   292  	_SC_SPIN_LOCKS             = 154
   293  	_SC_REGEXP                 = 155
   294  	_SC_REGEX_VERSION          = 156
   295  	_SC_SHELL                  = 157
   296  	_SC_SIGNALS                = 158
   297  	_SC_SPAWN                  = 159
   298  	_SC_SPORADIC_SERVER        = 160
   299  	_SC_THREAD_SPORADIC_SERVER = 161
   300  	_SC_SYSTEM_DATABASE        = 162
   301  	_SC_SYSTEM_DATABASE_R      = 163
   302  	_SC_TIMEOUTS               = 164
   303  	_SC_TYPED_MEMORY_OBJECTS   = 165
   304  	_SC_USER_GROUPS            = 166
   305  	_SC_USER_GROUPS_R          = 167
   306  	_SC_2_PBS                  = 168
   307  	_SC_2_PBS_ACCOUNTING       = 169
   308  	_SC_2_PBS_LOCATE           = 170
   309  	_SC_2_PBS_MESSAGE          = 171
   310  	_SC_2_PBS_TRACK            = 172
   311  	_SC_SYMLOOP_MAX            = 173
   312  	_SC_STREAMS                = 174
   313  	_SC_2_PBS_CHECKPOINT       = 175
   314  
   315  	_SC_V6_ILP32_OFF32  = 176
   316  	_SC_V6_ILP32_OFFBIG = 177
   317  	_SC_V6_LP64_OFF64   = 178
   318  	_SC_V6_LPBIG_OFFBIG = 179
   319  
   320  	_SC_HOST_NAME_MAX      = 180
   321  	_SC_TRACE              = 181
   322  	_SC_TRACE_EVENT_FILTER = 182
   323  	_SC_TRACE_INHERIT      = 183
   324  	_SC_TRACE_LOG          = 184
   325  
   326  	_SC_LEVEL1_ICACHE_SIZE     = 185
   327  	_SC_LEVEL1_ICACHE_ASSOC    = 186
   328  	_SC_LEVEL1_ICACHE_LINESIZE = 187
   329  	_SC_LEVEL1_DCACHE_SIZE     = 188
   330  	_SC_LEVEL1_DCACHE_ASSOC    = 189
   331  	_SC_LEVEL1_DCACHE_LINESIZE = 190
   332  	_SC_LEVEL2_CACHE_SIZE      = 191
   333  	_SC_LEVEL2_CACHE_ASSOC     = 192
   334  	_SC_LEVEL2_CACHE_LINESIZE  = 193
   335  	_SC_LEVEL3_CACHE_SIZE      = 194
   336  	_SC_LEVEL3_CACHE_ASSOC     = 195
   337  	_SC_LEVEL3_CACHE_LINESIZE  = 196
   338  	_SC_LEVEL4_CACHE_SIZE      = 197
   339  	_SC_LEVEL4_CACHE_ASSOC     = 198
   340  	_SC_LEVEL4_CACHE_LINESIZE  = 199
   341  
   342  	_SC_IPV6        = 235
   343  	_SC_RAW_SOCKETS = 236
   344  
   345  	_SC_V7_ILP32_OFF32  = 237
   346  	_SC_V7_ILP32_OFFBIG = 238
   347  	_SC_V7_LP64_OFF64   = 239
   348  	_SC_V7_LPBIG_OFFBIG = 240
   349  
   350  	_SC_SS_REPL_MAX = 241
   351  
   352  	_SC_TRACE_EVENT_NAME_MAX = 242
   353  	_SC_TRACE_NAME_MAX       = 243
   354  	_SC_TRACE_SYS_MAX        = 244
   355  	_SC_TRACE_USER_EVENT_MAX = 245
   356  
   357  	_SC_XOPEN_STREAMS = 246
   358  
   359  	_SC_THREAD_ROBUST_PRIO_INHERIT = 247
   360  	_SC_THREAD_ROBUST_PRIO_PROTECT = 248
   361  )
   362  
   363  const (
   364  	SIGEV_SIGNAL = 0
   365  	SIGEV_NONE   = 1
   366  	SIGEV_THREAD = 2
   367  
   368  	SIGEV_THREAD_ID = 4
   369  )
   370  
   371  const (
   372  	SEGV_MAPERR  = 1
   373  	SEGV_ACCERR  = 2
   374  	SEGV_BNDERR  = 3
   375  	SEGV_PKUERR  = 4
   376  	SEGV_ACCADI  = 5
   377  	SEGV_ADIDERR = 6
   378  	SEGV_ADIPERR = 7
   379  )
   380  
   381  const (
   382  	BUS_ADRALN    = 1
   383  	BUS_ADRERR    = 2
   384  	BUS_OBJERR    = 3
   385  	BUS_MCEERR_AR = 4
   386  	BUS_MCEERR_AO = 5
   387  )
   388  
   389  const (
   390  	CLD_EXITED    = 1
   391  	CLD_KILLED    = 2
   392  	CLD_DUMPED    = 3
   393  	CLD_TRAPPED   = 4
   394  	CLD_STOPPED   = 5
   395  	CLD_CONTINUED = 6
   396  )
   397  
   398  const (
   399  	POLL_IN  = 1
   400  	POLL_OUT = 2
   401  	POLL_MSG = 3
   402  	POLL_ERR = 4
   403  	POLL_PRI = 5
   404  	POLL_HUP = 6
   405  )
   406  
   407  const (
   408  	SI_ASYNCNL  = -60
   409  	SI_DETHREAD = -7
   410  
   411  	SI_TKILL   = -6
   412  	SI_SIGIO   = -5
   413  	SI_ASYNCIO = -4
   414  	SI_MESGQ   = -3
   415  	SI_TIMER   = -2
   416  	SI_QUEUE   = -1
   417  	SI_USER    = 0
   418  	SI_KERNEL  = 128
   419  )
   420  
   421  const (
   422  	ILL_ILLOPC   = 1
   423  	ILL_ILLOPN   = 2
   424  	ILL_ILLADR   = 3
   425  	ILL_ILLTRP   = 4
   426  	ILL_PRVOPC   = 5
   427  	ILL_PRVREG   = 6
   428  	ILL_COPROC   = 7
   429  	ILL_BADSTK   = 8
   430  	ILL_BADIADDR = 9
   431  )
   432  
   433  const (
   434  	FPE_INTDIV   = 1
   435  	FPE_INTOVF   = 2
   436  	FPE_FLTDIV   = 3
   437  	FPE_FLTOVF   = 4
   438  	FPE_FLTUND   = 5
   439  	FPE_FLTRES   = 6
   440  	FPE_FLTINV   = 7
   441  	FPE_FLTSUB   = 8
   442  	FPE_FLTUNK   = 14
   443  	FPE_CONDTRAP = 15
   444  )
   445  
   446  const (
   447  	SS_ONSTACK = 1
   448  	SS_DISABLE = 2
   449  )
   450  
   451  type ptrdiff_t = int64
   452  
   453  type size_t = uint64
   454  
   455  type wchar_t = int32
   456  
   457  type va_list = uintptr
   458  
   459  type sqlite_int64 = int64
   460  type sqlite_uint64 = uint64
   461  type sqlite3_int64 = sqlite_int64
   462  type sqlite3_uint64 = sqlite_uint64
   463  
   464  type sqlite3_callback = uintptr
   465  
   466  type sqlite3_file1 = struct{ pMethods uintptr }
   467  
   468  type sqlite3_file = sqlite3_file1
   469  type sqlite3_io_methods1 = struct {
   470  	iVersion               int32
   471  	_                      [4]byte
   472  	xClose                 uintptr
   473  	xRead                  uintptr
   474  	xWrite                 uintptr
   475  	xTruncate              uintptr
   476  	xSync                  uintptr
   477  	xFileSize              uintptr
   478  	xLock                  uintptr
   479  	xUnlock                uintptr
   480  	xCheckReservedLock     uintptr
   481  	xFileControl           uintptr
   482  	xSectorSize            uintptr
   483  	xDeviceCharacteristics uintptr
   484  	xShmMap                uintptr
   485  	xShmLock               uintptr
   486  	xShmBarrier            uintptr
   487  	xShmUnmap              uintptr
   488  	xFetch                 uintptr
   489  	xUnfetch               uintptr
   490  }
   491  
   492  type sqlite3_io_methods = sqlite3_io_methods1
   493  
   494  type sqlite3_vfs1 = struct {
   495  	iVersion          int32
   496  	szOsFile          int32
   497  	mxPathname        int32
   498  	_                 [4]byte
   499  	pNext             uintptr
   500  	zName             uintptr
   501  	pAppData          uintptr
   502  	xOpen             uintptr
   503  	xDelete           uintptr
   504  	xAccess           uintptr
   505  	xFullPathname     uintptr
   506  	xDlOpen           uintptr
   507  	xDlError          uintptr
   508  	xDlSym            uintptr
   509  	xDlClose          uintptr
   510  	xRandomness       uintptr
   511  	xSleep            uintptr
   512  	xCurrentTime      uintptr
   513  	xGetLastError     uintptr
   514  	xCurrentTimeInt64 uintptr
   515  	xSetSystemCall    uintptr
   516  	xGetSystemCall    uintptr
   517  	xNextSystemCall   uintptr
   518  }
   519  
   520  type sqlite3_vfs = sqlite3_vfs1
   521  type sqlite3_syscall_ptr = uintptr
   522  
   523  type sqlite3_mem_methods1 = struct {
   524  	xMalloc   uintptr
   525  	xFree     uintptr
   526  	xRealloc  uintptr
   527  	xSize     uintptr
   528  	xRoundup  uintptr
   529  	xInit     uintptr
   530  	xShutdown uintptr
   531  	pAppData  uintptr
   532  }
   533  
   534  type sqlite3_mem_methods = sqlite3_mem_methods1
   535  
   536  type sqlite3_destructor_type = uintptr
   537  
   538  type sqlite3_vtab1 = struct {
   539  	pModule uintptr
   540  	nRef    int32
   541  	_       [4]byte
   542  	zErrMsg uintptr
   543  }
   544  
   545  type sqlite3_vtab = sqlite3_vtab1
   546  type sqlite3_index_info1 = struct {
   547  	nConstraint      int32
   548  	_                [4]byte
   549  	aConstraint      uintptr
   550  	nOrderBy         int32
   551  	_                [4]byte
   552  	aOrderBy         uintptr
   553  	aConstraintUsage uintptr
   554  	idxNum           int32
   555  	_                [4]byte
   556  	idxStr           uintptr
   557  	needToFreeIdxStr int32
   558  	orderByConsumed  int32
   559  	estimatedCost    float64
   560  	estimatedRows    sqlite3_int64
   561  	idxFlags         int32
   562  	_                [4]byte
   563  	colUsed          sqlite3_uint64
   564  }
   565  
   566  type sqlite3_index_info = sqlite3_index_info1
   567  type sqlite3_vtab_cursor1 = struct{ pVtab uintptr }
   568  
   569  type sqlite3_vtab_cursor = sqlite3_vtab_cursor1
   570  type sqlite3_module1 = struct {
   571  	iVersion      int32
   572  	_             [4]byte
   573  	xCreate       uintptr
   574  	xConnect      uintptr
   575  	xBestIndex    uintptr
   576  	xDisconnect   uintptr
   577  	xDestroy      uintptr
   578  	xOpen         uintptr
   579  	xClose        uintptr
   580  	xFilter       uintptr
   581  	xNext         uintptr
   582  	xEof          uintptr
   583  	xColumn       uintptr
   584  	xRowid        uintptr
   585  	xUpdate       uintptr
   586  	xBegin        uintptr
   587  	xSync         uintptr
   588  	xCommit       uintptr
   589  	xRollback     uintptr
   590  	xFindFunction uintptr
   591  	xRename       uintptr
   592  	xSavepoint    uintptr
   593  	xRelease      uintptr
   594  	xRollbackTo   uintptr
   595  	xShadowName   uintptr
   596  }
   597  
   598  type sqlite3_module = sqlite3_module1
   599  
   600  type sqlite3_index_constraint = struct {
   601  	iColumn     int32
   602  	op          uint8
   603  	usable      uint8
   604  	_           [2]byte
   605  	iTermOffset int32
   606  }
   607  
   608  type sqlite3_index_orderby = struct {
   609  	iColumn int32
   610  	desc    uint8
   611  	_       [3]byte
   612  }
   613  
   614  type sqlite3_index_constraint_usage = struct {
   615  	argvIndex int32
   616  	omit      uint8
   617  	_         [3]byte
   618  }
   619  
   620  type sqlite3_mutex_methods1 = struct {
   621  	xMutexInit    uintptr
   622  	xMutexEnd     uintptr
   623  	xMutexAlloc   uintptr
   624  	xMutexFree    uintptr
   625  	xMutexEnter   uintptr
   626  	xMutexTry     uintptr
   627  	xMutexLeave   uintptr
   628  	xMutexHeld    uintptr
   629  	xMutexNotheld uintptr
   630  }
   631  
   632  type sqlite3_mutex_methods = sqlite3_mutex_methods1
   633  
   634  type sqlite3_pcache_page1 = struct {
   635  	pBuf   uintptr
   636  	pExtra uintptr
   637  }
   638  
   639  type sqlite3_pcache_page = sqlite3_pcache_page1
   640  
   641  type sqlite3_pcache_methods21 = struct {
   642  	iVersion   int32
   643  	_          [4]byte
   644  	pArg       uintptr
   645  	xInit      uintptr
   646  	xShutdown  uintptr
   647  	xCreate    uintptr
   648  	xCachesize uintptr
   649  	xPagecount uintptr
   650  	xFetch     uintptr
   651  	xUnpin     uintptr
   652  	xRekey     uintptr
   653  	xTruncate  uintptr
   654  	xDestroy   uintptr
   655  	xShrink    uintptr
   656  }
   657  
   658  type sqlite3_pcache_methods2 = sqlite3_pcache_methods21
   659  
   660  type sqlite3_pcache_methods1 = struct {
   661  	pArg       uintptr
   662  	xInit      uintptr
   663  	xShutdown  uintptr
   664  	xCreate    uintptr
   665  	xCachesize uintptr
   666  	xPagecount uintptr
   667  	xFetch     uintptr
   668  	xUnpin     uintptr
   669  	xRekey     uintptr
   670  	xTruncate  uintptr
   671  	xDestroy   uintptr
   672  }
   673  
   674  type sqlite3_pcache_methods = sqlite3_pcache_methods1
   675  
   676  type sqlite3_snapshot1 = struct{ hidden [48]uint8 }
   677  
   678  type sqlite3_snapshot = sqlite3_snapshot1
   679  
   680  type sqlite3_rtree_geometry1 = struct {
   681  	pContext uintptr
   682  	nParam   int32
   683  	_        [4]byte
   684  	aParam   uintptr
   685  	pUser    uintptr
   686  	xDelUser uintptr
   687  }
   688  
   689  type sqlite3_rtree_geometry = sqlite3_rtree_geometry1
   690  type sqlite3_rtree_query_info1 = struct {
   691  	pContext      uintptr
   692  	nParam        int32
   693  	_             [4]byte
   694  	aParam        uintptr
   695  	pUser         uintptr
   696  	xDelUser      uintptr
   697  	aCoord        uintptr
   698  	anQueue       uintptr
   699  	nCoord        int32
   700  	iLevel        int32
   701  	mxLevel       int32
   702  	_             [4]byte
   703  	iRowid        sqlite3_int64
   704  	rParentScore  sqlite3_rtree_dbl
   705  	eParentWithin int32
   706  	eWithin       int32
   707  	rScore        sqlite3_rtree_dbl
   708  	apSqlParam    uintptr
   709  }
   710  
   711  type sqlite3_rtree_query_info = sqlite3_rtree_query_info1
   712  
   713  type sqlite3_rtree_dbl = float64
   714  
   715  type Fts5ExtensionApi1 = struct {
   716  	iVersion           int32
   717  	_                  [4]byte
   718  	xUserData          uintptr
   719  	xColumnCount       uintptr
   720  	xRowCount          uintptr
   721  	xColumnTotalSize   uintptr
   722  	xTokenize          uintptr
   723  	xPhraseCount       uintptr
   724  	xPhraseSize        uintptr
   725  	xInstCount         uintptr
   726  	xInst              uintptr
   727  	xRowid             uintptr
   728  	xColumnText        uintptr
   729  	xColumnSize        uintptr
   730  	xQueryPhrase       uintptr
   731  	xSetAuxdata        uintptr
   732  	xGetAuxdata        uintptr
   733  	xPhraseFirst       uintptr
   734  	xPhraseNext        uintptr
   735  	xPhraseFirstColumn uintptr
   736  	xPhraseNextColumn  uintptr
   737  }
   738  
   739  type Fts5ExtensionApi = Fts5ExtensionApi1
   740  type Fts5PhraseIter1 = struct {
   741  	a uintptr
   742  	b uintptr
   743  }
   744  
   745  type Fts5PhraseIter = Fts5PhraseIter1
   746  
   747  type fts5_extension_function = uintptr
   748  type fts5_tokenizer1 = struct {
   749  	xCreate   uintptr
   750  	xDelete   uintptr
   751  	xTokenize uintptr
   752  }
   753  
   754  type fts5_tokenizer = fts5_tokenizer1
   755  
   756  type fts5_api1 = struct {
   757  	iVersion         int32
   758  	_                [4]byte
   759  	xCreateTokenizer uintptr
   760  	xFindTokenizer   uintptr
   761  	xCreateFunction  uintptr
   762  }
   763  
   764  type fts5_api = fts5_api1
   765  
   766  type __locale_struct = struct {
   767  	__locales       [13]uintptr
   768  	__ctype_b       uintptr
   769  	__ctype_tolower uintptr
   770  	__ctype_toupper uintptr
   771  	__names         [13]uintptr
   772  }
   773  
   774  type locale_t = uintptr
   775  
   776  type u_char = uint8
   777  type u_short = uint16
   778  type u_int = uint32
   779  type u_long = uint64
   780  type quad_t = int64
   781  type u_quad_t = uint64
   782  type fsid_t = struct{ __val [2]int32 }
   783  type loff_t = int64
   784  
   785  type ino_t = uint64
   786  
   787  type dev_t = uint64
   788  
   789  type gid_t = uint32
   790  
   791  type mode_t = uint32
   792  
   793  type nlink_t = uint64
   794  
   795  type uid_t = uint32
   796  
   797  type off_t = int64
   798  
   799  type pid_t = int32
   800  
   801  type id_t = uint32
   802  
   803  type ssize_t = int64
   804  
   805  type daddr_t = int32
   806  type caddr_t = uintptr
   807  
   808  type key_t = int32
   809  
   810  type clock_t = int64
   811  
   812  type clockid_t = int32
   813  
   814  type time_t = int64
   815  
   816  type timer_t = uintptr
   817  
   818  type ulong = uint64
   819  type ushort = uint16
   820  type uint = uint32
   821  
   822  type int8_t = int8
   823  type int16_t = int16
   824  type int32_t = int32
   825  type int64_t = int64
   826  
   827  type u_int8_t = uint8
   828  type u_int16_t = uint16
   829  type u_int32_t = uint32
   830  type u_int64_t = uint64
   831  
   832  type register_t = int32
   833  
   834  type sigset_t = struct{ __val [16]uint64 }
   835  
   836  type timeval = struct {
   837  	tv_sec  int64
   838  	tv_usec int64
   839  }
   840  
   841  type timespec = struct {
   842  	tv_sec  int64
   843  	tv_nsec int64
   844  }
   845  
   846  type suseconds_t = int64
   847  
   848  type fd_set = struct{ __fds_bits [16]int64 }
   849  
   850  type fd_mask = int64
   851  
   852  type blksize_t = int64
   853  
   854  type blkcnt_t = int64
   855  type fsblkcnt_t = uint64
   856  type fsfilcnt_t = uint64
   857  
   858  type __pthread_internal_list = struct {
   859  	__prev uintptr
   860  	__next uintptr
   861  }
   862  
   863  type __pthread_internal_slist = struct{ __next uintptr }
   864  
   865  type __pthread_mutex_s = struct {
   866  	__lock    int32
   867  	__count   uint32
   868  	__owner   int32
   869  	__nusers  uint32
   870  	__kind    int32
   871  	__spins   int16
   872  	__elision int16
   873  	__list    struct {
   874  		__prev uintptr
   875  		__next uintptr
   876  	}
   877  }
   878  
   879  type __pthread_rwlock_arch_t = struct {
   880  	__readers       uint32
   881  	__writers       uint32
   882  	__wrphase_futex uint32
   883  	__writers_futex uint32
   884  	__pad3          uint32
   885  	__pad4          uint32
   886  	__cur_writer    int32
   887  	__shared        int32
   888  	__rwelision     int8
   889  	__pad1          [7]uint8
   890  	__pad2          uint64
   891  	__flags         uint32
   892  	_               [4]byte
   893  }
   894  
   895  type __pthread_cond_s = struct {
   896  	__0            struct{ __wseq uint64 }
   897  	__8            struct{ __g1_start uint64 }
   898  	__g_refs       [2]uint32
   899  	__g_size       [2]uint32
   900  	__g1_orig_size uint32
   901  	__wrefs        uint32
   902  	__g_signals    [2]uint32
   903  }
   904  
   905  type pthread_t = uint64
   906  
   907  type pthread_mutexattr_t = struct {
   908  	_      [0]uint32
   909  	__size [4]int8
   910  }
   911  
   912  type pthread_condattr_t = struct {
   913  	_      [0]uint32
   914  	__size [4]int8
   915  }
   916  
   917  type pthread_key_t = uint32
   918  
   919  type pthread_once_t = int32
   920  
   921  type pthread_attr_t1 = struct {
   922  	_      [0]uint64
   923  	__size [56]int8
   924  }
   925  
   926  type pthread_attr_t = pthread_attr_t1
   927  
   928  type pthread_mutex_t = struct{ __data __pthread_mutex_s }
   929  
   930  type pthread_cond_t = struct{ __data __pthread_cond_s }
   931  
   932  type pthread_rwlock_t = struct{ __data __pthread_rwlock_arch_t }
   933  
   934  type pthread_rwlockattr_t = struct {
   935  	_      [0]uint64
   936  	__size [8]int8
   937  }
   938  
   939  type pthread_spinlock_t = int32
   940  
   941  type pthread_barrier_t = struct {
   942  	_      [0]uint64
   943  	__size [32]int8
   944  }
   945  
   946  type pthread_barrierattr_t = struct {
   947  	_      [0]uint32
   948  	__size [4]int8
   949  }
   950  
   951  type stat = struct {
   952  	st_dev     uint64
   953  	st_ino     uint64
   954  	st_nlink   uint64
   955  	st_mode    uint32
   956  	st_uid     uint32
   957  	st_gid     uint32
   958  	__pad0     int32
   959  	st_rdev    uint64
   960  	st_size    int64
   961  	st_blksize int64
   962  	st_blocks  int64
   963  	st_atim    struct {
   964  		tv_sec  int64
   965  		tv_nsec int64
   966  	}
   967  	st_mtim struct {
   968  		tv_sec  int64
   969  		tv_nsec int64
   970  	}
   971  	st_ctim struct {
   972  		tv_sec  int64
   973  		tv_nsec int64
   974  	}
   975  	__glibc_reserved [3]int64
   976  }
   977  
   978  type flock = struct {
   979  	l_type   int16
   980  	l_whence int16
   981  	_        [4]byte
   982  	l_start  int64
   983  	l_len    int64
   984  	l_pid    int32
   985  	_        [4]byte
   986  }
   987  
   988  type sig_atomic_t = int32
   989  
   990  type sigval = struct {
   991  	_         [0]uint64
   992  	sival_int int32
   993  	_         [4]byte
   994  }
   995  
   996  type siginfo_t = struct {
   997  	si_signo  int32
   998  	si_errno  int32
   999  	si_code   int32
  1000  	__pad0    int32
  1001  	_sifields struct {
  1002  		_    [0]uint64
  1003  		_pad [28]int32
  1004  	}
  1005  }
  1006  
  1007  type sigval_t = sigval
  1008  
  1009  type sigevent = struct {
  1010  	sigev_value struct {
  1011  		_         [0]uint64
  1012  		sival_int int32
  1013  		_         [4]byte
  1014  	}
  1015  	sigev_signo  int32
  1016  	sigev_notify int32
  1017  	_sigev_un    struct {
  1018  		_    [0]uint64
  1019  		_pad [12]int32
  1020  	}
  1021  }
  1022  
  1023  type sigevent_t = sigevent
  1024  
  1025  type sig_t = uintptr
  1026  
  1027  type sigaction = struct {
  1028  	__sigaction_handler struct{ sa_handler uintptr }
  1029  	sa_mask             struct{ __val [16]uint64 }
  1030  	sa_flags            int32
  1031  	_                   [4]byte
  1032  	sa_restorer         uintptr
  1033  }
  1034  
  1035  type _fpx_sw_bytes = struct {
  1036  	magic1            uint32
  1037  	extended_size     uint32
  1038  	xstate_bv         uint64
  1039  	xstate_size       uint32
  1040  	__glibc_reserved1 [7]uint32
  1041  }
  1042  
  1043  type _fpreg = struct {
  1044  	significand [4]uint16
  1045  	exponent    uint16
  1046  }
  1047  
  1048  type _fpxreg = struct {
  1049  	significand       [4]uint16
  1050  	exponent          uint16
  1051  	__glibc_reserved1 [3]uint16
  1052  }
  1053  
  1054  type _xmmreg = struct{ element [4]uint32 }
  1055  
  1056  type _fpstate = struct {
  1057  	cwd       uint16
  1058  	swd       uint16
  1059  	ftw       uint16
  1060  	fop       uint16
  1061  	rip       uint64
  1062  	rdp       uint64
  1063  	mxcsr     uint32
  1064  	mxcr_mask uint32
  1065  	_st       [8]struct {
  1066  		significand       [4]uint16
  1067  		exponent          uint16
  1068  		__glibc_reserved1 [3]uint16
  1069  	}
  1070  	_xmm              [16]struct{ element [4]uint32 }
  1071  	__glibc_reserved1 [24]uint32
  1072  }
  1073  
  1074  type sigcontext = struct {
  1075  	r8          uint64
  1076  	r9          uint64
  1077  	r10         uint64
  1078  	r11         uint64
  1079  	r12         uint64
  1080  	r13         uint64
  1081  	r14         uint64
  1082  	r15         uint64
  1083  	rdi         uint64
  1084  	rsi         uint64
  1085  	rbp         uint64
  1086  	rbx         uint64
  1087  	rdx         uint64
  1088  	rax         uint64
  1089  	rcx         uint64
  1090  	rsp         uint64
  1091  	rip         uint64
  1092  	eflags      uint64
  1093  	cs          uint16
  1094  	gs          uint16
  1095  	fs          uint16
  1096  	__pad0      uint16
  1097  	err         uint64
  1098  	trapno      uint64
  1099  	oldmask     uint64
  1100  	cr2         uint64
  1101  	__184       struct{ fpstate uintptr }
  1102  	__reserved1 [8]uint64
  1103  }
  1104  
  1105  type _xsave_hdr = struct {
  1106  	xstate_bv         uint64
  1107  	__glibc_reserved1 [2]uint64
  1108  	__glibc_reserved2 [5]uint64
  1109  }
  1110  
  1111  type _ymmh_state = struct{ ymmh_space [64]uint32 }
  1112  
  1113  type _xstate = struct {
  1114  	fpstate struct {
  1115  		cwd       uint16
  1116  		swd       uint16
  1117  		ftw       uint16
  1118  		fop       uint16
  1119  		rip       uint64
  1120  		rdp       uint64
  1121  		mxcsr     uint32
  1122  		mxcr_mask uint32
  1123  		_st       [8]struct {
  1124  			significand       [4]uint16
  1125  			exponent          uint16
  1126  			__glibc_reserved1 [3]uint16
  1127  		}
  1128  		_xmm              [16]struct{ element [4]uint32 }
  1129  		__glibc_reserved1 [24]uint32
  1130  	}
  1131  	xstate_hdr struct {
  1132  		xstate_bv         uint64
  1133  		__glibc_reserved1 [2]uint64
  1134  		__glibc_reserved2 [5]uint64
  1135  	}
  1136  	ymmh struct{ ymmh_space [64]uint32 }
  1137  }
  1138  
  1139  type stack_t = struct {
  1140  	ss_sp    uintptr
  1141  	ss_flags int32
  1142  	_        [4]byte
  1143  	ss_size  size_t
  1144  }
  1145  
  1146  type greg_t = int64
  1147  
  1148  type gregset_t = [23]greg_t
  1149  
  1150  type _libc_fpxreg = struct {
  1151  	significand       [4]uint16
  1152  	exponent          uint16
  1153  	__glibc_reserved1 [3]uint16
  1154  }
  1155  
  1156  type _libc_xmmreg = struct{ element [4]uint32 }
  1157  
  1158  type _libc_fpstate = struct {
  1159  	cwd       uint16
  1160  	swd       uint16
  1161  	ftw       uint16
  1162  	fop       uint16
  1163  	rip       uint64
  1164  	rdp       uint64
  1165  	mxcsr     uint32
  1166  	mxcr_mask uint32
  1167  	_st       [8]struct {
  1168  		significand       [4]uint16
  1169  		exponent          uint16
  1170  		__glibc_reserved1 [3]uint16
  1171  	}
  1172  	_xmm              [16]struct{ element [4]uint32 }
  1173  	__glibc_reserved1 [24]uint32
  1174  }
  1175  
  1176  type fpregset_t = uintptr
  1177  
  1178  type mcontext_t = struct {
  1179  	gregs       gregset_t
  1180  	fpregs      fpregset_t
  1181  	__reserved1 [8]uint64
  1182  }
  1183  
  1184  type ucontext_t1 = struct {
  1185  	uc_flags     uint64
  1186  	uc_link      uintptr
  1187  	uc_stack     stack_t
  1188  	uc_mcontext  mcontext_t
  1189  	uc_sigmask   sigset_t
  1190  	__fpregs_mem struct {
  1191  		cwd       uint16
  1192  		swd       uint16
  1193  		ftw       uint16
  1194  		fop       uint16
  1195  		rip       uint64
  1196  		rdp       uint64
  1197  		mxcsr     uint32
  1198  		mxcr_mask uint32
  1199  		_st       [8]struct {
  1200  			significand       [4]uint16
  1201  			exponent          uint16
  1202  			__glibc_reserved1 [3]uint16
  1203  		}
  1204  		_xmm              [16]struct{ element [4]uint32 }
  1205  		__glibc_reserved1 [24]uint32
  1206  	}
  1207  	__ssp [4]uint64
  1208  }
  1209  
  1210  type ucontext_t = ucontext_t1
  1211  
  1212  type sigstack = struct {
  1213  	ss_sp      uintptr
  1214  	ss_onstack int32
  1215  	_          [4]byte
  1216  }
  1217  
  1218  type useconds_t = uint32
  1219  
  1220  type intptr_t = int64
  1221  
  1222  type socklen_t = uint32
  1223  
  1224  type tm = struct {
  1225  	tm_sec    int32
  1226  	tm_min    int32
  1227  	tm_hour   int32
  1228  	tm_mday   int32
  1229  	tm_mon    int32
  1230  	tm_year   int32
  1231  	tm_wday   int32
  1232  	tm_yday   int32
  1233  	tm_isdst  int32
  1234  	_         [4]byte
  1235  	tm_gmtoff int64
  1236  	tm_zone   uintptr
  1237  }
  1238  
  1239  type itimerspec = struct {
  1240  	it_interval struct {
  1241  		tv_sec  int64
  1242  		tv_nsec int64
  1243  	}
  1244  	it_value struct {
  1245  		tv_sec  int64
  1246  		tv_nsec int64
  1247  	}
  1248  }
  1249  
  1250  type VFSFile1 = struct {
  1251  	base        sqlite3_file
  1252  	fsFile      uintptr
  1253  	fd          int32
  1254  	_           [4]byte
  1255  	aBuffer     uintptr
  1256  	nBuffer     int32
  1257  	_           [4]byte
  1258  	iBufferOfst sqlite3_int64
  1259  }
  1260  
  1261  type VFSFile = VFSFile1
  1262  
  1263  func vfsDirectWrite(tls *libc.TLS, p uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 {
  1264  	bp := tls.Alloc(16)
  1265  	defer tls.Free(16)
  1266  
  1267  	var ofst off_t
  1268  	var nWrite size_t
  1269  
  1270  	libc.X__builtin_printf(tls, ts, libc.VaList(bp, uintptr(unsafe.Pointer(&__func__)), 180))
  1271  	libc.X__builtin_abort(tls)
  1272  	ofst = libc.Xlseek(tls, (*VFSFile)(unsafe.Pointer(p)).fd, iOfst, 0)
  1273  	if ofst != iOfst {
  1274  		return 10 | int32(3)<<8
  1275  	}
  1276  
  1277  	nWrite = size_t(libc.Xwrite(tls, (*VFSFile)(unsafe.Pointer(p)).fd, zBuf, uint32(iAmt)))
  1278  	if nWrite != size_t(iAmt) {
  1279  		return 10 | int32(3)<<8
  1280  	}
  1281  
  1282  	return 0
  1283  }
  1284  
  1285  var __func__ = *(*[15]int8)(unsafe.Pointer(ts + 13))
  1286  
  1287  func vfsFlushBuffer(tls *libc.TLS, p uintptr) int32 {
  1288  	bp := tls.Alloc(16)
  1289  	defer tls.Free(16)
  1290  
  1291  	libc.X__builtin_printf(tls, ts, libc.VaList(bp, uintptr(unsafe.Pointer(&__func__1)), 200))
  1292  	libc.X__builtin_abort(tls)
  1293  	var rc int32 = 0
  1294  	if (*VFSFile)(unsafe.Pointer(p)).nBuffer != 0 {
  1295  		rc = vfsDirectWrite(tls, p, (*VFSFile)(unsafe.Pointer(p)).aBuffer, (*VFSFile)(unsafe.Pointer(p)).nBuffer, (*VFSFile)(unsafe.Pointer(p)).iBufferOfst)
  1296  		(*VFSFile)(unsafe.Pointer(p)).nBuffer = 0
  1297  	}
  1298  	return rc
  1299  }
  1300  
  1301  var __func__1 = *(*[15]int8)(unsafe.Pointer(ts + 28))
  1302  
  1303  func vfsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 {
  1304  	bp := tls.Alloc(16)
  1305  	defer tls.Free(16)
  1306  
  1307  	libc.X__builtin_printf(tls, ts, libc.VaList(bp, uintptr(unsafe.Pointer(&__func__4)), 275))
  1308  	libc.X__builtin_abort(tls)
  1309  	var p uintptr = pFile
  1310  
  1311  	if (*VFSFile)(unsafe.Pointer(p)).aBuffer != 0 {
  1312  		var z uintptr = zBuf
  1313  		var n int32 = iAmt
  1314  		var i sqlite3_int64 = iOfst
  1315  
  1316  		for n > 0 {
  1317  			var nCopy int32
  1318  
  1319  			if (*VFSFile)(unsafe.Pointer(p)).nBuffer == 8192 || (*VFSFile)(unsafe.Pointer(p)).iBufferOfst+sqlite3_int64((*VFSFile)(unsafe.Pointer(p)).nBuffer) != i {
  1320  				var rc int32 = vfsFlushBuffer(tls, p)
  1321  				if rc != 0 {
  1322  					return rc
  1323  				}
  1324  			}
  1325  			if (*VFSFile)(unsafe.Pointer(p)).nBuffer == 0 || (*VFSFile)(unsafe.Pointer(p)).iBufferOfst+sqlite3_int64((*VFSFile)(unsafe.Pointer(p)).nBuffer) == i {
  1326  			} else {
  1327  				libc.X__assert_fail(tls, ts+43, ts+89, uint32(296), uintptr(unsafe.Pointer(&__func__4)))
  1328  			}
  1329  			(*VFSFile)(unsafe.Pointer(p)).iBufferOfst = i - sqlite3_int64((*VFSFile)(unsafe.Pointer(p)).nBuffer)
  1330  
  1331  			nCopy = 8192 - (*VFSFile)(unsafe.Pointer(p)).nBuffer
  1332  			if nCopy > n {
  1333  				nCopy = n
  1334  			}
  1335  			libc.Xmemcpy(tls, (*VFSFile)(unsafe.Pointer(p)).aBuffer+uintptr((*VFSFile)(unsafe.Pointer(p)).nBuffer), z, uint64(nCopy))
  1336  			*(*int32)(unsafe.Pointer(p + 32)) += nCopy
  1337  
  1338  			n = n - nCopy
  1339  			i = i + sqlite3_int64(nCopy)
  1340  			z += uintptr(nCopy)
  1341  		}
  1342  	} else {
  1343  		return vfsDirectWrite(tls, p, zBuf, iAmt, iOfst)
  1344  	}
  1345  
  1346  	return 0
  1347  }
  1348  
  1349  var __func__4 = *(*[9]int8)(unsafe.Pointer(ts + 95))
  1350  
  1351  func vfsTruncate(tls *libc.TLS, pFile uintptr, size sqlite_int64) int32 {
  1352  	return 0
  1353  }
  1354  
  1355  func vfsSync(tls *libc.TLS, pFile uintptr, flags int32) int32 {
  1356  	bp := tls.Alloc(16)
  1357  	defer tls.Free(16)
  1358  
  1359  	libc.X__builtin_printf(tls, ts, libc.VaList(bp, uintptr(unsafe.Pointer(&__func__5)), 333))
  1360  	libc.X__builtin_abort(tls)
  1361  	var p uintptr = pFile
  1362  	var rc int32
  1363  
  1364  	rc = vfsFlushBuffer(tls, p)
  1365  	if rc != 0 {
  1366  		return rc
  1367  	}
  1368  
  1369  	rc = libc.Xfsync(tls, (*VFSFile)(unsafe.Pointer(p)).fd)
  1370  	return func() int32 {
  1371  		if rc == 0 {
  1372  			return 0
  1373  		}
  1374  		return 10 | int32(4)<<8
  1375  	}()
  1376  }
  1377  
  1378  var __func__5 = *(*[8]int8)(unsafe.Pointer(ts + 104))
  1379  
  1380  func vfsLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 {
  1381  	return 0
  1382  }
  1383  
  1384  func vfsUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 {
  1385  	return 0
  1386  }
  1387  
  1388  func vfsCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 {
  1389  	*(*int32)(unsafe.Pointer(pResOut)) = 0
  1390  	return 0
  1391  }
  1392  
  1393  func vfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 {
  1394  	return 12
  1395  }
  1396  
  1397  func vfsSectorSize(tls *libc.TLS, pFile uintptr) int32 {
  1398  	return 0
  1399  }
  1400  
  1401  func vfsDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 {
  1402  	return 0
  1403  }
  1404  
  1405  func vfsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 {
  1406  	bp := tls.Alloc(4129)
  1407  	defer tls.Free(4129)
  1408  
  1409  	libc.X__builtin_printf(tls, ts, libc.VaList(bp, uintptr(unsafe.Pointer(&__func__8)), 475))
  1410  	libc.X__builtin_abort(tls)
  1411  	var rc int32
  1412  
  1413  	rc = libc.Xunlink(tls, zPath)
  1414  	if rc != 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == 2 {
  1415  		return 0
  1416  	}
  1417  
  1418  	if rc == 0 && dirSync != 0 {
  1419  		var dfd int32
  1420  		var i int32
  1421  
  1422  		sqlite3.Xsqlite3_snprintf(tls, 4096, bp+32, ts+112, libc.VaList(bp+16, zPath))
  1423  		*(*int8)(unsafe.Pointer(bp + 32 + 4096)) = int8(0)
  1424  		for i = int32(libc.Xstrlen(tls, bp+32)); i > 1 && int32(*(*int8)(unsafe.Pointer(bp + 32 + uintptr(i)))) != '/'; i++ {
  1425  		}
  1426  		*(*int8)(unsafe.Pointer(bp + 32 + uintptr(i))) = int8(0)
  1427  
  1428  		dfd = libc.Xopen(tls, bp+32, 00, libc.VaList(bp+24, 0))
  1429  		if dfd < 0 {
  1430  			rc = -1
  1431  		} else {
  1432  			rc = libc.Xfsync(tls, dfd)
  1433  			libc.Xclose(tls, dfd)
  1434  		}
  1435  	}
  1436  	return func() int32 {
  1437  		if rc == 0 {
  1438  			return 0
  1439  		}
  1440  		return 10 | int32(10)<<8
  1441  	}()
  1442  }
  1443  
  1444  var __func__8 = *(*[10]int8)(unsafe.Pointer(ts + 115))
  1445  
  1446  func vfsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr {
  1447  	return uintptr(0)
  1448  }
  1449  
  1450  func vfsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) {
  1451  	sqlite3.Xsqlite3_snprintf(tls, nByte, zErrMsg, ts+125, 0)
  1452  	*(*int8)(unsafe.Pointer(zErrMsg + uintptr(nByte-1))) = int8(0)
  1453  }
  1454  
  1455  func vfsDlSym(tls *libc.TLS, pVfs uintptr, pH uintptr, z uintptr) uintptr {
  1456  	return uintptr(0)
  1457  }
  1458  
  1459  func vfsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) {
  1460  	return
  1461  }
  1462  
  1463  func vfsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zByte uintptr) int32 {
  1464  	return 0
  1465  }
  1466  
  1467  func vfsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 {
  1468  	libc.Xsleep(tls, uint32(nMicro/1000000))
  1469  	libc.Xusleep(tls, uint32(nMicro%1000000))
  1470  	return nMicro
  1471  }
  1472  
  1473  func vfsCurrentTime(tls *libc.TLS, pVfs uintptr, pTime uintptr) int32 {
  1474  	var t time_t = libc.Xtime(tls, uintptr(0))
  1475  	*(*float64)(unsafe.Pointer(pTime)) = float64(t)/86400.0 + 2440587.5
  1476  	return 0
  1477  }
  1478  
  1479  func Xsqlite3_fsFS(tls *libc.TLS, zName uintptr, pAppData uintptr) uintptr {
  1480  	var p uintptr = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(sqlite3_vfs{})))
  1481  	if !(p != 0) {
  1482  		return uintptr(0)
  1483  	}
  1484  
  1485  	*(*sqlite3_vfs)(unsafe.Pointer(p)) = sqlite3_vfs{
  1486  		iVersion:   1,
  1487  		szOsFile:   int32(unsafe.Sizeof(VFSFile{})),
  1488  		mxPathname: 4096,
  1489  		zName:      zName,
  1490  		pAppData:   pAppData,
  1491  		xOpen: *(*uintptr)(unsafe.Pointer(&struct {
  1492  			f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
  1493  		}{vfsOpen})),
  1494  		xDelete: *(*uintptr)(unsafe.Pointer(&struct {
  1495  			f func(*libc.TLS, uintptr, uintptr, int32) int32
  1496  		}{vfsDelete})),
  1497  		xAccess: *(*uintptr)(unsafe.Pointer(&struct {
  1498  			f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
  1499  		}{vfsAccess})),
  1500  		xFullPathname: *(*uintptr)(unsafe.Pointer(&struct {
  1501  			f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
  1502  		}{vfsFullPathname})),
  1503  		xDlOpen: *(*uintptr)(unsafe.Pointer(&struct {
  1504  			f func(*libc.TLS, uintptr, uintptr) uintptr
  1505  		}{vfsDlOpen})),
  1506  		xDlError: *(*uintptr)(unsafe.Pointer(&struct {
  1507  			f func(*libc.TLS, uintptr, int32, uintptr)
  1508  		}{vfsDlError})),
  1509  		xDlSym: *(*uintptr)(unsafe.Pointer(&struct {
  1510  			f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
  1511  		}{vfsDlSym})),
  1512  		xDlClose: *(*uintptr)(unsafe.Pointer(&struct {
  1513  			f func(*libc.TLS, uintptr, uintptr)
  1514  		}{vfsDlClose})),
  1515  		xRandomness: *(*uintptr)(unsafe.Pointer(&struct {
  1516  			f func(*libc.TLS, uintptr, int32, uintptr) int32
  1517  		}{vfsRandomness})),
  1518  		xSleep: *(*uintptr)(unsafe.Pointer(&struct {
  1519  			f func(*libc.TLS, uintptr, int32) int32
  1520  		}{vfsSleep})),
  1521  		xCurrentTime: *(*uintptr)(unsafe.Pointer(&struct {
  1522  			f func(*libc.TLS, uintptr, uintptr) int32
  1523  		}{vfsCurrentTime}))}
  1524  	return p
  1525  }
  1526  
  1527  var ts1 = "TODO %s:%i:\n\x00vfsDirectWrite\x00vfsFlushBuffer\x00p->nBuffer==0 || p->iBufferOfst+p->nBuffer==i\x00vfs.c\x00vfsWrite\x00vfsSync\x00%s\x00vfsDelete\x00Loadable extensions are not supported\x00"
  1528  var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data