aboutsummaryrefslogtreecommitdiff
path: root/internal/mptest/main_linux_amd64.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/mptest/main_linux_amd64.go')
-rw-r--r--internal/mptest/main_linux_amd64.go574
1 files changed, 288 insertions, 286 deletions
diff --git a/internal/mptest/main_linux_amd64.go b/internal/mptest/main_linux_amd64.go
index a4c02ae..64de6ad 100644
--- a/internal/mptest/main_linux_amd64.go
+++ b/internal/mptest/main_linux_amd64.go
@@ -1,4 +1,4 @@
-// Code generated by 'ccgo -o internal/mptest/main_linux_amd64.go testdata/sqlite-src-3320300/mptest/mptest.c -Itestdata/sqlite-amalgamation-3320300 -l modernc.org/sqlite/lib -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_DQS=0 -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_MAX_MMAP_SIZE=8589934592 -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_NO_SYNC=1 -DSQLITE_OS_UNIX=1 -DSQLITE_SERIES_CONSTRAINT_VERIFY=1 -DSQLITE_SERVER=1 -DSQLITE_TEMP_STORE=1 -DSQLITE_TEST -DSQLITE_THREADSAFE=1 -ccgo-long-double-is-double', DO NOT EDIT.
+// Code generated by 'ccgo internal/mptest/main_linux_amd64.go testdata/sqlite-src-3330000/mptest/mptest.c -Itestdata/sqlite-amalgamation-3330000 -l modernc.org/sqlite/lib -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -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_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -DSQLITE_SOUNDEX -DSQLITE_TEMP_STORE=1 -DSQLITE_TEST -DSQLITE_THREADSAFE=1 -ccgo-long-double-is-double', DO NOT EDIT.
package main
@@ -7,7 +7,7 @@ import (
"reflect"
"unsafe"
- "modernc.org/crt/v3"
+ "modernc.org/libc"
"modernc.org/sqlite/lib"
)
@@ -15,7 +15,7 @@ var _ = math.Pi
var _ reflect.Kind
var _ unsafe.Pointer
-func main() { crt.Start(main1) }
+func main() { libc.Start(main1) }
// Copyright (C) 1991-2018 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
@@ -654,6 +654,7 @@ type sqlite3_callback = uintptr /* sqlite3.h:338:13 */
// in the 4th parameter to the [sqlite3_vfs.xOpen] method.
// Reserved: 0x00F00000
+// Legacy compatibility:
// CAPI3REF: Device Characteristics
//
@@ -764,6 +765,7 @@ type sqlite3_file1 = struct{ pMethods uintptr }
// in the 4th parameter to the [sqlite3_vfs.xOpen] method.
// Reserved: 0x00F00000
+// Legacy compatibility:
// CAPI3REF: Device Characteristics
//
@@ -837,7 +839,7 @@ type sqlite3_file1 = struct{ pMethods uintptr }
// for their own use. The pMethods entry is a pointer to an
// [sqlite3_io_methods] object that defines methods for performing
// I/O operations on the open file.
-type sqlite3_file = sqlite3_file1 /* sqlite3.h:680:29 */
+type sqlite3_file = sqlite3_file1 /* sqlite3.h:683:29 */
type sqlite3_io_methods1 = struct {
iVersion int32
xClose uintptr
@@ -952,7 +954,7 @@ type sqlite3_io_methods1 = struct {
// fails to zero-fill short reads might seem to work. However,
// failure to zero-fill short reads will eventually lead to
// database corruption.
-type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:779:35 */
+type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:782:35 */
// CAPI3REF: OS Interface Object
//
@@ -1028,7 +1030,7 @@ type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:779:35 */
// <li> [SQLITE_OPEN_TEMP_JOURNAL]
// <li> [SQLITE_OPEN_TRANSIENT_DB]
// <li> [SQLITE_OPEN_SUBJOURNAL]
-// <li> [SQLITE_OPEN_MASTER_JOURNAL]
+// <li> [SQLITE_OPEN_SUPER_JOURNAL]
// <li> [SQLITE_OPEN_WAL]
// </ul>)^
//
@@ -1220,7 +1222,7 @@ type sqlite3_vfs1 = struct {
// <li> [SQLITE_OPEN_TEMP_JOURNAL]
// <li> [SQLITE_OPEN_TRANSIENT_DB]
// <li> [SQLITE_OPEN_SUBJOURNAL]
-// <li> [SQLITE_OPEN_MASTER_JOURNAL]
+// <li> [SQLITE_OPEN_SUPER_JOURNAL]
// <li> [SQLITE_OPEN_WAL]
// </ul>)^
//
@@ -1313,8 +1315,8 @@ type sqlite3_vfs1 = struct {
// or all of these interfaces to be NULL or for their behavior to change
// from one release to the next. Applications must not attempt to access
// any of these methods if the iVersion of the VFS is less than 3.
-type sqlite3_vfs = sqlite3_vfs1 /* sqlite3.h:1364:28 */
-type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1365:14 */
+type sqlite3_vfs = sqlite3_vfs1 /* sqlite3.h:1367:28 */
+type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1368:14 */
// CAPI3REF: Memory Allocation Routines
//
@@ -1364,7 +1366,7 @@ type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1365:14 */
// by xInit. The pAppData pointer is used as the only parameter to
// xInit and xShutdown.
//
-// SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes
+// SQLite holds the [SQLITE_MUTEX_STATIC_MAIN] mutex when it invokes
// the xInit method, so the xInit method need not be threadsafe. The
// xShutdown method is only called from [sqlite3_shutdown()] so it does
// not need to be threadsafe either. For all other methods, SQLite
@@ -1436,7 +1438,7 @@ type sqlite3_mem_methods1 = struct {
// by xInit. The pAppData pointer is used as the only parameter to
// xInit and xShutdown.
//
-// SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes
+// SQLite holds the [SQLITE_MUTEX_STATIC_MAIN] mutex when it invokes
// the xInit method, so the xInit method need not be threadsafe. The
// xShutdown method is only called from [sqlite3_shutdown()] so it does
// not need to be threadsafe either. For all other methods, SQLite
@@ -1449,7 +1451,7 @@ type sqlite3_mem_methods1 = struct {
//
// SQLite will never invoke xInit() more than once without an intervening
// call to xShutdown().
-type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1662:36 */
+type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1665:36 */
// CAPI3REF: Constants Defining Special Destructor Behavior
//
@@ -1463,7 +1465,7 @@ type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1662:36 */
//
// The typedef is necessary to work around problems in certain
// C++ compilers.
-type sqlite3_destructor_type = uintptr /* sqlite3.h:5619:14 */
+type sqlite3_destructor_type = uintptr /* sqlite3.h:5621:14 */
// The interface to the virtual-table mechanism is currently considered
// to be experimental. The interface might change in incompatible ways.
@@ -1487,7 +1489,7 @@ type sqlite3_vtab1 = struct {
// interface fixed, support it indefinitely, and remove this comment.
// Structures used by the virtual table interface
-type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6687:29 */
+type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6689:29 */
type sqlite3_index_info1 = struct {
nConstraint int32
aConstraint uintptr
@@ -1504,10 +1506,10 @@ type sqlite3_index_info1 = struct {
colUsed sqlite3_uint64
}
-type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6688:35 */
+type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6690:35 */
type sqlite3_vtab_cursor1 = struct{ pVtab uintptr }
-type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6689:36 */
+type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6691:36 */
type sqlite3_module1 = struct {
iVersion int32
xCreate uintptr
@@ -1535,7 +1537,7 @@ type sqlite3_module1 = struct {
xShadowName uintptr
}
-type sqlite3_module = sqlite3_module1 /* sqlite3.h:6690:31 */
+type sqlite3_module = sqlite3_module1 /* sqlite3.h:6692:31 */
// CAPI3REF: Virtual Table Indexing Information
// KEYWORDS: sqlite3_index_info
@@ -1994,7 +1996,7 @@ type sqlite3_mutex_methods1 = struct {
// called, but only if the prior call to xMutexInit returned SQLITE_OK.
// If xMutexInit fails in any way, it is expected to clean up after itself
// prior to returning.
-type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7522:38 */
+type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7524:38 */
// CAPI3REF: Custom Page Cache Object
//
@@ -2017,7 +2019,7 @@ type sqlite3_pcache_page1 = struct {
// of this object as parameters or as their return value.
//
// See [sqlite3_pcache_methods2] for additional information.
-type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8271:36 */
+type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8277:36 */
// CAPI3REF: Application Defined Page Cache.
// KEYWORDS: {page cache}
@@ -2349,7 +2351,7 @@ type sqlite3_pcache_methods21 = struct {
// free up as much of heap memory as possible. The page cache implementation
// is not obligated to free any memory, but well-behaved implementations should
// do their best.
-type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8436:40 */
+type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8442:40 */
// This is the obsolete pcache_methods object that has now been replaced
// by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -2371,7 +2373,7 @@ type sqlite3_pcache_methods1 = struct {
// This is the obsolete pcache_methods object that has now been replaced
// by sqlite3_pcache_methods2. This object is not used by SQLite. It is
// retained in the header file for backwards compatibility only.
-type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8459:39 */
+type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8465:39 */
// CAPI3REF: Database Snapshot
// KEYWORDS: {snapshot} {sqlite3_snapshot}
@@ -2411,7 +2413,7 @@ type sqlite3_snapshot1 = struct{ hidden [48]uint8 }
// version of the database file so that it is possible to later open a new read
// transaction that sees that historical version of the database rather than
// the most recent version.
-type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9508:3 */
+type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9514:3 */
// CAPI3REF: Flags for sqlite3_deserialize()
//
@@ -2491,7 +2493,7 @@ type sqlite3_rtree_geometry1 = struct {
//
//
-type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:9833:39 */
+type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:9839:39 */
type sqlite3_rtree_query_info1 = struct {
pContext uintptr
nParam int32
@@ -2511,11 +2513,11 @@ type sqlite3_rtree_query_info1 = struct {
apSqlParam uintptr
}
-type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:9834:41 */
+type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:9840:41 */
// The double-precision datatype used by RTree depends on the
// SQLITE_RTREE_INT_ONLY compile-time option.
-type sqlite3_rtree_dbl = float64 /* sqlite3.h:9842:18 */
+type sqlite3_rtree_dbl = float64 /* sqlite3.h:9848:18 */
// Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin.
@@ -2602,22 +2604,22 @@ type Fts5ExtensionApi1 = struct {
// Virtual table implementations may overload SQL functions by implementing
// the sqlite3_module.xFindFunction() method.
-type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11628:33 */
+type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11634:33 */
type Fts5PhraseIter1 = struct {
a uintptr
b uintptr
}
-type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11630:31 */
+type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11636:31 */
-type fts5_extension_function = uintptr /* sqlite3.h:11632:14 */
+type fts5_extension_function = uintptr /* sqlite3.h:11638:14 */
type fts5_tokenizer1 = struct {
xCreate uintptr
xDelete uintptr
xTokenize uintptr
}
-type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12091:31 */
+type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12097:31 */
// Flags that may be passed as the third argument to xTokenize()
@@ -2650,7 +2652,7 @@ type fts5_api1 = struct {
// ************************************************************************
//
// FTS5 EXTENSION REGISTRATION API
-type fts5_api = fts5_api1 /* sqlite3.h:12127:25 */
+type fts5_api = fts5_api1 /* sqlite3.h:12133:25 */
// The tag name of this struct is _G_fpos_t to preserve historic
// C++ mangled names for functions taking fpos_t arguments.
@@ -4018,7 +4020,7 @@ var g Global /* mptest.c:90:3: */
// Default timeout
// Print a message adding zPrefix[] to the beginning of every line.
-func printWithPrefix(tls *crt.TLS, pOut uintptr, zPrefix uintptr, zMsg uintptr) { /* mptest.c:98:13: */
+func printWithPrefix(tls *libc.TLS, pOut uintptr, zPrefix uintptr, zMsg uintptr) { /* mptest.c:98:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -4026,7 +4028,7 @@ func printWithPrefix(tls *crt.TLS, pOut uintptr, zPrefix uintptr, zMsg uintptr)
var i int32
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++ {
}
- crt.Xfprintf(tls, pOut, ts /* "%s%.*s\n" */, crt.VaList(bp, zPrefix, i, zMsg))
+ libc.Xfprintf(tls, pOut, ts /* "%s%.*s\n" */, libc.VaList(bp, zPrefix, i, zMsg))
zMsg += uintptr(i)
for (int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(0)))) == '\n') || (int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(0)))) == '\r') {
zMsg++
@@ -4035,7 +4037,7 @@ func printWithPrefix(tls *crt.TLS, pOut uintptr, zPrefix uintptr, zMsg uintptr)
}
// Compare two pointers to strings, where the pointers might be NULL.
-func safe_strcmp(tls *crt.TLS, a uintptr, b uintptr) int32 { /* mptest.c:111:12: */
+func safe_strcmp(tls *libc.TLS, a uintptr, b uintptr) int32 { /* mptest.c:111:12: */
if a == b {
return 0
}
@@ -4045,7 +4047,7 @@ func safe_strcmp(tls *crt.TLS, a uintptr, b uintptr) int32 { /* mptest.c:111:12:
if b == uintptr(0) {
return 1
}
- return crt.Xstrcmp(tls, a, b)
+ return libc.Xstrcmp(tls, a, b)
}
// Return TRUE if string z[] matches glob pattern zGlob[].
@@ -4064,16 +4066,16 @@ func safe_strcmp(tls *crt.TLS, a uintptr, b uintptr) int32 { /* mptest.c:111:12:
//
// '#' Matches any sequence of one or more digits with an
// optional + or - sign in front
-func strglob(tls *crt.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5: */
+func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5: */
var c int32
var c2 int32
var invert int32
var seen int32
- for (crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1)))))) != 0 {
+ for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) != 0 {
if c == '*' {
- for ((crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1)))))) == '*') || (c == '?') {
- if (c == '?') && ((int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))) == 0) {
+ for ((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) == '*') || (c == '?') {
+ if (c == '?') && ((int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0) {
return 0
}
}
@@ -4083,11 +4085,11 @@ func strglob(tls *crt.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
for (*(*int8)(unsafe.Pointer(z)) != 0) && (strglob(tls, (zGlob-uintptr(1)), z) != 0) {
z++
}
- return (crt.Bool32((int32(*(*int8)(unsafe.Pointer(z)))) != 0))
+ return (libc.Bool32((int32(*(*int8)(unsafe.Pointer(z)))) != 0))
}
- for (crt.AssignInt32(&c2, int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1)))))) != 0 {
+ for (libc.AssignInt32(&c2, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))))) != 0 {
for c2 != c {
- c2 = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))
+ c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))
if c2 == 0 {
return 0
}
@@ -4098,31 +4100,31 @@ func strglob(tls *crt.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
}
return 0
} else if c == '?' {
- if (int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))) == 0 {
+ if (int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0 {
return 0
}
} else if c == '[' {
var prior_c int32 = 0
seen = 0
invert = 0
- c = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))
+ c = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))
if c == 0 {
return 0
}
- c2 = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1))))
+ c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
if c2 == '^' {
invert = 1
- c2 = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1))))
+ c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
}
if c2 == ']' {
if c == ']' {
seen = 1
}
- c2 = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1))))
+ c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
}
for (c2 != 0) && (c2 != ']') {
if (((c2 == '-') && (int32(*(*int8)(unsafe.Pointer(zGlob + uintptr(0)))) != ']')) && (int32(*(*int8)(unsafe.Pointer(zGlob + uintptr(0)))) != 0)) && (prior_c > 0) {
- c2 = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1))))
+ c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
if (c >= prior_c) && (c <= c2) {
seen = 1
}
@@ -4133,40 +4135,40 @@ func strglob(tls *crt.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
}
prior_c = c2
}
- c2 = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1))))
+ c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
}
if (c2 == 0) || ((seen ^ invert) == 0) {
return 0
}
} else if c == '#' {
- if ((int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '-') || (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '+')) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(1))))))*2))) & int32(_ISdigit)) != 0) {
+ if ((int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '-') || (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '+')) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(1))))))*2))) & int32(_ISdigit)) != 0) {
z++
}
- if !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(0))))))*2))) & int32(_ISdigit)) != 0) {
+ if !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(0))))))*2))) & int32(_ISdigit)) != 0) {
return 0
}
z++
- for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(0))))))*2))) & int32(_ISdigit)) != 0 {
+ for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(0))))))*2))) & int32(_ISdigit)) != 0 {
z++
}
} else {
- if c != (int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))) {
+ if c != (int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) {
return 0
}
}
}
- return (crt.Bool32(int32(*(*int8)(unsafe.Pointer(z))) == 0))
+ return (libc.Bool32(int32(*(*int8)(unsafe.Pointer(z))) == 0))
}
// Close output stream pOut if it is not stdout or stderr
-func maybeClose(tls *crt.TLS, pOut uintptr) { /* mptest.c:208:13: */
- if (pOut != crt.Xstdout) && (pOut != crt.Xstderr) {
- crt.Xfclose(tls, pOut)
+func maybeClose(tls *libc.TLS, pOut uintptr) { /* mptest.c:208:13: */
+ if (pOut != libc.Xstdout) && (pOut != libc.Xstderr) {
+ libc.Xfclose(tls, pOut)
}
}
// Print an error message
-func errorMessage(tls *crt.TLS, zFormat uintptr, va uintptr) { /* mptest.c:215:13: */
+func errorMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:215:13: */
bp := tls.Alloc(38)
defer tls.Free(38)
@@ -4178,21 +4180,21 @@ func errorMessage(tls *crt.TLS, zFormat uintptr, va uintptr) { /* mptest.c:215:1
ap = va
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
_ = ap
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+8 /* "%s:ERROR: " */, crt.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
+ 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 */))
if g.pLog != 0 {
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
- crt.Xfflush(tls, g.pLog)
+ libc.Xfflush(tls, g.pLog)
}
if (g.pErrLog != 0) && (safe_strcmp(tls, g.zErrLog, g.zLog) != 0) {
printWithPrefix(tls, g.pErrLog, bp+8 /* &zPrefix[0] */, zMsg)
- crt.Xfflush(tls, g.pErrLog)
+ libc.Xfflush(tls, g.pErrLog)
}
sqlite3.Xsqlite3_free(tls, zMsg)
g.nError++
}
// Print an error message and then quit.
-func fatalError(tls *crt.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13: */
+func fatalError(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13: */
bp := tls.Alloc(38)
defer tls.Free(38)
@@ -4204,15 +4206,15 @@ func fatalError(tls *crt.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13:
ap = va
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
_ = ap
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+19 /* "%s:FATAL: " */, crt.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
+ 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 */))
if g.pLog != 0 {
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
- crt.Xfflush(tls, g.pLog)
+ libc.Xfflush(tls, g.pLog)
maybeClose(tls, g.pLog)
}
if (g.pErrLog != 0) && (safe_strcmp(tls, g.zErrLog, g.zLog) != 0) {
printWithPrefix(tls, g.pErrLog, bp+8 /* &zPrefix[0] */, zMsg)
- crt.Xfflush(tls, g.pErrLog)
+ libc.Xfflush(tls, g.pErrLog)
maybeClose(tls, g.pErrLog)
}
sqlite3.Xsqlite3_free(tls, zMsg)
@@ -4220,16 +4222,16 @@ func fatalError(tls *crt.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13:
var nTry int32 = 0
g.iTimeout = 0
for (trySql(tls, ts+30 /* "UPDATE client SE..." */, 0) == 5) &&
- ((crt.PostIncInt32(&nTry, 1)) < 100) {
+ ((libc.PostIncInt32(&nTry, 1)) < 100) {
sqlite3.Xsqlite3_sleep(tls, 10)
}
}
sqlite3.Xsqlite3_close(tls, g.db)
- crt.Xexit(tls, 1)
+ libc.Xexit(tls, 1)
}
// Print a log message
-func logMessage(tls *crt.TLS, zFormat uintptr, va uintptr) { /* mptest.c:276:13: */
+func logMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:276:13: */
bp := tls.Alloc(38)
defer tls.Free(38)
@@ -4241,25 +4243,25 @@ func logMessage(tls *crt.TLS, zFormat uintptr, va uintptr) { /* mptest.c:276:13:
ap = va
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
_ = ap
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+60 /* "%s: " */, crt.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
+ 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 */))
if g.pLog != 0 {
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
- crt.Xfflush(tls, g.pLog)
+ libc.Xfflush(tls, g.pLog)
}
sqlite3.Xsqlite3_free(tls, zMsg)
}
// Return the length of a string omitting trailing whitespace
-func clipLength(tls *crt.TLS, z uintptr) int32 { /* mptest.c:294:12: */
- var n int32 = int32(crt.Xstrlen(tls, z))
- for (n > 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n - 1)))))))*2))) & int32(_ISspace)) != 0) {
+func clipLength(tls *libc.TLS, z uintptr) int32 { /* mptest.c:294:12: */
+ var n int32 = int32(libc.Xstrlen(tls, z))
+ 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) {
n--
}
return n
}
// Auxiliary SQL function to return the name of the VFS
-func vfsNameFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* mptest.c:303:13: */
+func vfsNameFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* mptest.c:303:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -4269,19 +4271,19 @@ func vfsNameFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* m
_ = argv
sqlite3.Xsqlite3_file_control(tls, db, ts+65 /* "main" */, 12, bp /* &zVfs */)
if *(*uintptr)(unsafe.Pointer(bp /* zVfs */)) != 0 {
- sqlite3.Xsqlite3_result_text(tls, context, *(*uintptr)(unsafe.Pointer(bp /* zVfs */)), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
+ sqlite3.Xsqlite3_result_text(tls, context, *(*uintptr)(unsafe.Pointer(bp /* zVfs */)), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
}
}
// Busy handler with a g.iTimeout-millisecond timeout
-func busyHandler(tls *crt.TLS, pCD uintptr, count int32) int32 { /* mptest.c:321:12: */
+func busyHandler(tls *libc.TLS, pCD uintptr, count int32) int32 { /* mptest.c:321:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
_ = pCD
if (count * 10) > g.iTimeout {
if g.iTimeout > 0 {
- errorMessage(tls, ts+70 /* "timeout after %d..." */, crt.VaList(bp, g.iTimeout))
+ errorMessage(tls, ts+70 /* "timeout after %d..." */, libc.VaList(bp, g.iTimeout))
}
return 0
}
@@ -4290,16 +4292,16 @@ func busyHandler(tls *crt.TLS, pCD uintptr, count int32) int32 { /* mptest.c:321
}
// SQL Trace callback
-func sqlTraceCallback(tls *crt.TLS, NotUsed1 uintptr, zSql uintptr) { /* mptest.c:334:13: */
+func sqlTraceCallback(tls *libc.TLS, NotUsed1 uintptr, zSql uintptr) { /* mptest.c:334:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
_ = NotUsed1
- logMessage(tls, ts+89 /* "[%.*s]" */, crt.VaList(bp, clipLength(tls, zSql), zSql))
+ logMessage(tls, ts+89 /* "[%.*s]" */, libc.VaList(bp, clipLength(tls, zSql), zSql))
}
// SQL error log callback
-func sqlErrorCallback(tls *crt.TLS, pArg uintptr, iErrCode int32, zMsg uintptr) { /* mptest.c:342:13: */
+func sqlErrorCallback(tls *libc.TLS, pArg uintptr, iErrCode int32, zMsg uintptr) { /* mptest.c:342:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -4314,14 +4316,14 @@ func sqlErrorCallback(tls *crt.TLS, pArg uintptr, iErrCode int32, zMsg uintptr)
return
}
if (iErrCode & 0xff) == 27 {
- logMessage(tls, ts+96 /* "(info) %s" */, crt.VaList(bp, zMsg))
+ logMessage(tls, ts+96 /* "(info) %s" */, libc.VaList(bp, zMsg))
} else {
- errorMessage(tls, ts+106 /* "(errcode=%d) %s" */, crt.VaList(bp+8, iErrCode, zMsg))
+ errorMessage(tls, ts+106 /* "(errcode=%d) %s" */, libc.VaList(bp+8, iErrCode, zMsg))
}
}
// Prepare an SQL statement. Issue a fatal error if unable.
-func prepareSql(tls *crt.TLS, zFormat uintptr, va uintptr) uintptr { /* mptest.c:357:21: */
+func prepareSql(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* mptest.c:357:21: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -4336,14 +4338,14 @@ func prepareSql(tls *crt.TLS, zFormat uintptr, va uintptr) uintptr { /* mptest.c
rc = sqlite3.Xsqlite3_prepare_v2(tls, g.db, zSql, -1, bp+16 /* &pStmt */, uintptr(0))
if rc != 0 {
sqlite3.Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)))
- fatalError(tls, ts+122 /* "%s\n%s\n" */, crt.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db), zSql))
+ fatalError(tls, ts+122 /* "%s\n%s\n" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db), zSql))
}
sqlite3.Xsqlite3_free(tls, zSql)
return *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */))
}
// Run arbitrary SQL. Issue a fatal error on failure.
-func runSql(tls *crt.TLS, zFormat uintptr, va uintptr) { /* mptest.c:377:13: */
+func runSql(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:377:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -4356,13 +4358,13 @@ func runSql(tls *crt.TLS, zFormat uintptr, va uintptr) { /* mptest.c:377:13: */
_ = ap
rc = sqlite3.Xsqlite3_exec(tls, g.db, zSql, uintptr(0), uintptr(0), uintptr(0))
if rc != 0 {
- fatalError(tls, ts+122 /* "%s\n%s\n" */, crt.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db), zSql))
+ fatalError(tls, ts+122 /* "%s\n%s\n" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db), zSql))
}
sqlite3.Xsqlite3_free(tls, zSql)
}
// Try to run arbitrary SQL. Return success code.
-func trySql(tls *crt.TLS, zFormat uintptr, va uintptr) int32 { /* mptest.c:394:12: */
+func trySql(tls *libc.TLS, zFormat uintptr, va uintptr) int32 { /* mptest.c:394:12: */
var ap va_list
_ = ap
var zSql uintptr
@@ -4386,17 +4388,17 @@ type String1 = struct {
type String = String1 /* mptest.c:408:23 */
// Free a string
-func stringFree(tls *crt.TLS, p uintptr) { /* mptest.c:416:13: */
+func stringFree(tls *libc.TLS, p uintptr) { /* mptest.c:416:13: */
if (*String)(unsafe.Pointer(p)).z != 0 {
sqlite3.Xsqlite3_free(tls, (*String)(unsafe.Pointer(p)).z)
}
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(String{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(String{})))
}
// Append n bytes of text to a string. If n<0 append the entire string.
-func stringAppend(tls *crt.TLS, p uintptr, z uintptr, n int32) { /* mptest.c:422:13: */
+func stringAppend(tls *libc.TLS, p uintptr, z uintptr, n int32) { /* mptest.c:422:13: */
if n < 0 {
- n = int32(crt.Xstrlen(tls, z))
+ n = int32(libc.Xstrlen(tls, z))
}
if ((*String)(unsafe.Pointer(p)).n + n) >= (*String)(unsafe.Pointer(p)).nAlloc {
var nAlloc int32 = ((((*String)(unsafe.Pointer(p)).nAlloc * 2) + n) + 100)
@@ -4407,13 +4409,13 @@ func stringAppend(tls *crt.TLS, p uintptr, z uintptr, n int32) { /* mptest.c:422
(*String)(unsafe.Pointer(p)).z = zNew
(*String)(unsafe.Pointer(p)).nAlloc = nAlloc
}
- crt.Xmemcpy(tls, ((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n)), z, uint64(n))
+ libc.Xmemcpy(tls, ((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n)), z, uint64(n))
*(*int32)(unsafe.Pointer(p + 8 /* &.n */)) += (n)
*(*int8)(unsafe.Pointer((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n))) = int8(0)
}
// Reset a string to an empty string
-func stringReset(tls *crt.TLS, p uintptr) { /* mptest.c:437:13: */
+func stringReset(tls *libc.TLS, p uintptr) { /* mptest.c:437:13: */
if (*String)(unsafe.Pointer(p)).z == uintptr(0) {
stringAppend(tls, p, ts+143 /* " " */, 1)
}
@@ -4422,7 +4424,7 @@ func stringReset(tls *crt.TLS, p uintptr) { /* mptest.c:437:13: */
}
// Append a new token onto the end of the string
-func stringAppendTerm(tls *crt.TLS, p uintptr, z uintptr) { /* mptest.c:444:13: */
+func stringAppendTerm(tls *libc.TLS, p uintptr, z uintptr) { /* mptest.c:444:13: */
var i int32
if (*String)(unsafe.Pointer(p)).n != 0 {
stringAppend(tls, p, ts+143 /* " " */, 1)
@@ -4431,7 +4433,7 @@ func stringAppendTerm(tls *crt.TLS, p uintptr, z uintptr) { /* mptest.c:444:13:
stringAppend(tls, p, ts+145 /* "nil" */, 3)
return
}
- for i = 0; (*(*int8)(unsafe.Pointer(z + uintptr(i))) != 0) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))))*2))) & int32(_ISspace)) != 0); i++ {
+ 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++ {
}
if (i > 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == 0) {
stringAppend(tls, p, z, i)
@@ -4454,7 +4456,7 @@ func stringAppendTerm(tls *crt.TLS, p uintptr, z uintptr) { /* mptest.c:444:13:
}
// Callback function for evalSql()
-func evalCallback(tls *crt.TLS, pCData uintptr, argc int32, argv uintptr, azCol uintptr) int32 { /* mptest.c:474:12: */
+func evalCallback(tls *libc.TLS, pCData uintptr, argc int32, argv uintptr, azCol uintptr) int32 { /* mptest.c:474:12: */
var p uintptr = pCData
var i int32
_ = azCol
@@ -4466,7 +4468,7 @@ func evalCallback(tls *crt.TLS, pCData uintptr, argc int32, argv uintptr, azCol
// Run arbitrary SQL and record the results in an output string
// given by the first parameter.
-func evalSql(tls *crt.TLS, p uintptr, zFormat uintptr, va uintptr) int32 { /* mptest.c:486:12: */
+func evalSql(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) int32 { /* mptest.c:486:12: */
bp := tls.Alloc(46)
defer tls.Free(46)
@@ -4480,13 +4482,13 @@ func evalSql(tls *crt.TLS, p uintptr, zFormat uintptr, va uintptr) int32 { /* mp
_ = ap
rc = sqlite3.Xsqlite3_exec(tls, g.db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
}{evalCallback})), p, bp+8 /* &zErrMsg */)
sqlite3.Xsqlite3_free(tls, zSql)
if rc != 0 {
// var zErr [30]int8 at bp+16, 30
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+16 /* &zErr[0] */, ts+151 /* "error(%d)" */, crt.VaList(bp, rc))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+16 /* &zErr[0] */, ts+151 /* "error(%d)" */, libc.VaList(bp, rc))
stringAppendTerm(tls, p, bp+16 /* &zErr[0] */)
if *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)) != 0 {
stringAppendTerm(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)))
@@ -4497,7 +4499,7 @@ func evalSql(tls *crt.TLS, p uintptr, zFormat uintptr, va uintptr) int32 { /* mp
}
// Auxiliary SQL function to recursively evaluate SQL.
-func evalFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* mptest.c:512:13: */
+func evalFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* mptest.c:512:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -4508,9 +4510,9 @@ func evalFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* mpte
*(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)) = uintptr(0)
var rc int32
_ = argc
- crt.Xmemset(tls, bp /* &res */, 0, uint64(unsafe.Sizeof(String{})))
+ libc.Xmemset(tls, bp /* &res */, 0, uint64(unsafe.Sizeof(String{})))
rc = sqlite3.Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
}{evalCallback})), bp /* &res */, bp+16 /* &zErrMsg */)
if *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)) != 0 {
sqlite3.Xsqlite3_result_error(tls, context, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)), -1)
@@ -4518,7 +4520,7 @@ func evalFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* mpte
} else if rc != 0 {
sqlite3.Xsqlite3_result_error_code(tls, context, rc)
} else {
- sqlite3.Xsqlite3_result_text(tls, context, (*String)(unsafe.Pointer(bp /* &res */)).z, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, context, (*String)(unsafe.Pointer(bp /* &res */)).z, -1, libc.UintptrFromInt32(-1))
}
stringFree(tls, bp /* &res */)
}
@@ -4526,7 +4528,7 @@ func evalFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* mpte
// Look up the next task for client iClient in the database.
// Return the task script and the task number and mark that
// task as being under way.
-func startScript(tls *crt.TLS, iClient int32, pzScript uintptr, pTaskId uintptr, pzTaskName uintptr) int32 { /* mptest.c:541:12: */
+func startScript(tls *libc.TLS, iClient int32, pzScript uintptr, pTaskId uintptr, pzTaskName uintptr) int32 { /* mptest.c:541:12: */
bp := tls.Alloc(80)
defer tls.Free(80)
@@ -4545,37 +4547,37 @@ func startScript(tls *crt.TLS, iClient int32, pzScript uintptr, pTaskId uintptr,
continue
}
if rc != 0 {
- fatalError(tls, ts+177 /* "in startScript: ..." */, crt.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db)))
+ fatalError(tls, ts+177 /* "in startScript: ..." */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db)))
}
if (g.nError != 0) || (g.nTest != 0) {
runSql(tls, ts+196, /* "UPDATE counters ..." */
- crt.VaList(bp+8, g.nError, g.nTest))
+ libc.VaList(bp+8, g.nError, g.nTest))
g.nError = 0
g.nTest = 0
}
- pStmt = prepareSql(tls, ts+249 /* "SELECT 1 FROM cl..." */, crt.VaList(bp+24, iClient))
+ pStmt = prepareSql(tls, ts+249 /* "SELECT 1 FROM cl..." */, libc.VaList(bp+24, iClient))
rc = sqlite3.Xsqlite3_step(tls, pStmt)
sqlite3.Xsqlite3_finalize(tls, pStmt)
if rc == 100 {
- runSql(tls, ts+295 /* "DELETE FROM clie..." */, crt.VaList(bp+32, iClient))
+ runSql(tls, ts+295 /* "DELETE FROM clie..." */, libc.VaList(bp+32, iClient))
g.iTimeout = 10000
runSql(tls, ts+326 /* "COMMIT TRANSACTI..." */, 0)
return 101
}
pStmt = prepareSql(tls,
- ts+346 /* "SELECT script, i..." */, crt.VaList(bp+40, iClient))
+ ts+346 /* "SELECT script, i..." */, libc.VaList(bp+40, iClient))
rc = sqlite3.Xsqlite3_step(tls, pStmt)
if rc == 100 {
var n int32 = sqlite3.Xsqlite3_column_bytes(tls, pStmt, 0)
*(*uintptr)(unsafe.Pointer(pzScript)) = sqlite3.Xsqlite3_malloc(tls, (n + 1))
- crt.Xstrcpy(tls, *(*uintptr)(unsafe.Pointer(pzScript)), sqlite3.Xsqlite3_column_text(tls, pStmt, 0))
- *(*int32)(unsafe.Pointer(pTaskId)) = crt.AssignInt32(&taskId, sqlite3.Xsqlite3_column_int(tls, pStmt, 1))
- *(*uintptr)(unsafe.Pointer(pzTaskName)) = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, crt.VaList(bp+48, sqlite3.Xsqlite3_column_text(tls, pStmt, 2)))
+ libc.Xstrcpy(tls, *(*uintptr)(unsafe.Pointer(pzScript)), sqlite3.Xsqlite3_column_text(tls, pStmt, 0))
+ *(*int32)(unsafe.Pointer(pTaskId)) = libc.AssignInt32(&taskId, sqlite3.Xsqlite3_column_int(tls, pStmt, 1))
+ *(*uintptr)(unsafe.Pointer(pzTaskName)) = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+48, sqlite3.Xsqlite3_column_text(tls, pStmt, 2)))
sqlite3.Xsqlite3_finalize(tls, pStmt)
runSql(tls,
- ts+441 /* "UPDATE task SE..." */, crt.VaList(bp+56, taskId))
+ ts+441 /* "UPDATE task SE..." */, libc.VaList(bp+56, taskId))
g.iTimeout = 10000
runSql(tls, ts+326 /* "COMMIT TRANSACTI..." */, 0)
return 0
@@ -4584,9 +4586,9 @@ func startScript(tls *crt.TLS, iClient int32, pzScript uintptr, pTaskId uintptr,
if rc == 101 {
if totalTime > 30000 {
errorMessage(tls, ts+524 /* "Waited over 30 s..." */, 0)
- runSql(tls, ts+573 /* "DELETE FROM clie..." */, crt.VaList(bp+64, iClient))
+ runSql(tls, ts+573 /* "DELETE FROM clie..." */, libc.VaList(bp+64, iClient))
sqlite3.Xsqlite3_close(tls, g.db)
- crt.Xexit(tls, 1)
+ libc.Xexit(tls, 1)
}
for trySql(tls, ts+613 /* "COMMIT" */, 0) == 5 {
sqlite3.Xsqlite3_sleep(tls, 10)
@@ -4596,7 +4598,7 @@ func startScript(tls *crt.TLS, iClient int32, pzScript uintptr, pTaskId uintptr,
totalTime = totalTime + (100)
continue
}
- fatalError(tls, ts+438 /* "%s" */, crt.VaList(bp+72, sqlite3.Xsqlite3_errmsg(tls, g.db)))
+ fatalError(tls, ts+438 /* "%s" */, libc.VaList(bp+72, sqlite3.Xsqlite3_errmsg(tls, g.db)))
}
g.iTimeout = 10000
return int32(0)
@@ -4604,15 +4606,15 @@ func startScript(tls *crt.TLS, iClient int32, pzScript uintptr, pTaskId uintptr,
// Mark a script as having finished. Remove the CLIENT table entry
// if bShutdown is true.
-func finishScript(tls *crt.TLS, iClient int32, taskId int32, bShutdown int32) int32 { /* mptest.c:623:12: */
+func finishScript(tls *libc.TLS, iClient int32, taskId int32, bShutdown int32) int32 { /* mptest.c:623:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
runSql(tls,
- ts+620 /* "UPDATE task SE..." */, crt.VaList(bp, taskId))
+ ts+620 /* "UPDATE task SE..." */, libc.VaList(bp, taskId))
if bShutdown != 0 {
- runSql(tls, ts+295 /* "DELETE FROM clie..." */, crt.VaList(bp+8, iClient))
+ runSql(tls, ts+295 /* "DELETE FROM clie..." */, libc.VaList(bp+8, iClient))
}
return 0
}
@@ -4620,73 +4622,73 @@ func finishScript(tls *crt.TLS, iClient int32, taskId int32, bShutdown int32) in
// Start up a client process for iClient, if it is not already
// running. If the client is already running, then this routine
// is a no-op.
-func startClient(tls *crt.TLS, iClient int32) { /* mptest.c:638:13: */
+func startClient(tls *libc.TLS, iClient int32) { /* mptest.c:638:13: */
bp := tls.Alloc(96)
defer tls.Free(96)
- runSql(tls, ts+701 /* "INSERT OR IGNORE..." */, crt.VaList(bp, iClient))
+ runSql(tls, ts+701 /* "INSERT OR IGNORE..." */, libc.VaList(bp, iClient))
if sqlite3.Xsqlite3_changes(tls, g.db) != 0 {
var zSys uintptr
var rc int32
zSys = sqlite3.Xsqlite3_mprintf(tls, ts+743, /* "%s \"%s\" --client..." */
- crt.VaList(bp+8, g.argv0, g.zDbFile, iClient, g.iTrace))
+ libc.VaList(bp+8, g.argv0, g.zDbFile, iClient, g.iTrace))
if g.bSqlTrace != 0 {
- zSys = sqlite3.Xsqlite3_mprintf(tls, ts+774 /* "%z --sqltrace" */, crt.VaList(bp+40, zSys))
+ zSys = sqlite3.Xsqlite3_mprintf(tls, ts+774 /* "%z --sqltrace" */, libc.VaList(bp+40, zSys))
}
if g.bSync != 0 {
- zSys = sqlite3.Xsqlite3_mprintf(tls, ts+788 /* "%z --sync" */, crt.VaList(bp+48, zSys))
+ zSys = sqlite3.Xsqlite3_mprintf(tls, ts+788 /* "%z --sync" */, libc.VaList(bp+48, zSys))
}
if g.zVfs != 0 {
- zSys = sqlite3.Xsqlite3_mprintf(tls, ts+798 /* "%z --vfs \"%s\"" */, crt.VaList(bp+56, zSys, g.zVfs))
+ zSys = sqlite3.Xsqlite3_mprintf(tls, ts+798 /* "%z --vfs \"%s\"" */, libc.VaList(bp+56, zSys, g.zVfs))
}
if g.iTrace >= 2 {
- logMessage(tls, ts+812 /* "system('%q')" */, crt.VaList(bp+72, zSys))
+ logMessage(tls, ts+812 /* "system('%q')" */, libc.VaList(bp+72, zSys))
}
- zSys = sqlite3.Xsqlite3_mprintf(tls, ts+825 /* "%z &" */, crt.VaList(bp+80, zSys))
- rc = crt.Xsystem(tls, zSys)
+ zSys = sqlite3.Xsqlite3_mprintf(tls, ts+825 /* "%z &" */, libc.VaList(bp+80, zSys))
+ rc = libc.Xsystem(tls, zSys)
if rc != 0 {
- errorMessage(tls, ts+830 /* "system() fails w..." */, crt.VaList(bp+88, rc))
+ errorMessage(tls, ts+830 /* "system() fails w..." */, libc.VaList(bp+88, rc))
}
sqlite3.Xsqlite3_free(tls, zSys)
}
}
// Read the entire content of a file into memory
-func readFile(tls *crt.TLS, zFilename uintptr) uintptr { /* mptest.c:684:13: */
+func readFile(tls *libc.TLS, zFilename uintptr) uintptr { /* mptest.c:684:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
- var in uintptr = crt.Xfopen(tls, zFilename, ts+864 /* "rb" */)
+ var in uintptr = libc.Xfopen(tls, zFilename, ts+864 /* "rb" */)
var sz int64
var z uintptr
if in == uintptr(0) {
- fatalError(tls, ts+867 /* "cannot open \"%s\"..." */, crt.VaList(bp, zFilename))
+ fatalError(tls, ts+867 /* "cannot open \"%s\"..." */, libc.VaList(bp, zFilename))
}
- crt.Xfseek(tls, in, int64(0), 2)
- sz = crt.Xftell(tls, in)
- crt.Xrewind(tls, in)
+ libc.Xfseek(tls, in, int64(0), 2)
+ sz = libc.Xftell(tls, in)
+ libc.Xrewind(tls, in)
z = sqlite3.Xsqlite3_malloc(tls, (int32(sz + int64(1))))
- sz = int64(crt.Xfread(tls, z, uint64(1), uint64(sz), in))
+ sz = int64(libc.Xfread(tls, z, uint64(1), uint64(sz), in))
*(*int8)(unsafe.Pointer(z + uintptr(sz))) = int8(0)
- crt.Xfclose(tls, in)
+ libc.Xfclose(tls, in)
return z
}
// Return the length of the next token.
-func tokenLength(tls *crt.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:704:12: */
+func tokenLength(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:704:12: */
var n int32 = 0
- if ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(0))))))*2))) & int32(_ISspace)) != 0) || ((int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '/') && (int32(*(*int8)(unsafe.Pointer(z + uintptr(1)))) == '*')) {
+ if ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(0))))))*2))) & int32(_ISspace)) != 0) || ((int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '/') && (int32(*(*int8)(unsafe.Pointer(z + uintptr(1)))) == '*')) {
var inC int32 = 0
var c int32
if int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '/' {
inC = 1
n = 2
}
- for (crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&n, 1))))))) != 0 {
+ for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&n, 1))))))) != 0 {
if c == '\n' {
(*(*int32)(unsafe.Pointer(pnLine)))++
}
- if (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0 {
+ if (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0 {
continue
}
if ((inC != 0) && (c == '*')) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '/') {
@@ -4722,20 +4724,20 @@ func tokenLength(tls *crt.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:70
}
} else {
var c int32
- for n = 1; (((((crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))))) != 0) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0)) && (c != '"')) && (c != '\'')) && (c != ';'); n++ {
+ 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++ {
}
}
return n
}
// Copy a single token into a string buffer.
-func extractToken(tls *crt.TLS, zIn uintptr, nIn int32, zOut uintptr, nOut int32) int32 { /* mptest.c:749:12: */
+func extractToken(tls *libc.TLS, zIn uintptr, nIn int32, zOut uintptr, nOut int32) int32 { /* mptest.c:749:12: */
var i int32
if nIn <= 0 {
*(*int8)(unsafe.Pointer(zOut + uintptr(0))) = int8(0)
return 0
}
- for i = 0; ((i < nIn) && (i < (nOut - 1))) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(i))))))*2))) & int32(_ISspace)) != 0); i++ {
+ 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++ {
*(*int8)(unsafe.Pointer(zOut + uintptr(i))) = *(*int8)(unsafe.Pointer(zIn + uintptr(i)))
}
*(*int8)(unsafe.Pointer(zOut + uintptr(i))) = int8(0)
@@ -4743,9 +4745,9 @@ func extractToken(tls *crt.TLS, zIn uintptr, nIn int32, zOut uintptr, nOut int32
}
// Find the number of characters up to the start of the next "--end" token.
-func findEnd(tls *crt.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:763:12: */
+func findEnd(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:763:12: */
var n int32 = 0
- for (*(*int8)(unsafe.Pointer(z + uintptr(n))) != 0) && ((crt.Xstrncmp(tls, (z+uintptr(n)), ts+896 /* "--end" */, uint64(5)) != 0) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 5)))))))*2))) & int32(_ISspace)) != 0)) {
+ 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)) {
n = n + (tokenLength(tls, (z + uintptr(n)), pnLine))
}
return n
@@ -4754,15 +4756,15 @@ func findEnd(tls *crt.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:763:12
// Find the number of characters up to the first character past the
// of the next "--endif" or "--else" token. Nested --if commands are
// also skipped.
-func findEndif(tls *crt.TLS, z uintptr, stopAtElse int32, pnLine uintptr) int32 { /* mptest.c:776:12: */
+func findEndif(tls *libc.TLS, z uintptr, stopAtElse int32, pnLine uintptr) int32 { /* mptest.c:776:12: */
var n int32 = 0
for *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 {
var len int32 = tokenLength(tls, (z + uintptr(n)), pnLine)
- if ((crt.Xstrncmp(tls, (z+uintptr(n)), ts+902 /* "--endif" */, uint64(7)) == 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 7)))))))*2))) & int32(_ISspace)) != 0)) ||
- (((stopAtElse != 0) && (crt.Xstrncmp(tls, (z+uintptr(n)), ts+910 /* "--else" */, uint64(6)) == 0)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 6)))))))*2))) & int32(_ISspace)) != 0)) {
+ 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)) ||
+ (((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)) {
return (n + len)
}
- if (crt.Xstrncmp(tls, (z+uintptr(n)), ts+917 /* "--if" */, uint64(4)) == 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 4)))))))*2))) & int32(_ISspace)) != 0) {
+ 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) {
var skip int32 = findEndif(tls, ((z + uintptr(n)) + uintptr(len)), 0, pnLine)
n = n + (skip + len)
} else {
@@ -4773,7 +4775,7 @@ func findEndif(tls *crt.TLS, z uintptr, stopAtElse int32, pnLine uintptr) int32
}
// Wait for a client process to complete all its tasks
-func waitForClient(tls *crt.TLS, iClient int32, iTimeout int32, zErrPrefix uintptr) { /* mptest.c:798:13: */
+func waitForClient(tls *libc.TLS, iClient int32, iTimeout int32, zErrPrefix uintptr) { /* mptest.c:798:13: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -4783,14 +4785,14 @@ func waitForClient(tls *crt.TLS, iClient int32, iTimeout int32, zErrPrefix uintp
pStmt = prepareSql(tls,
ts+922, /* "SELECT 1 FROM ta..." */
- crt.VaList(bp, iClient))
+ libc.VaList(bp, iClient))
} else {
pStmt = prepareSql(tls,
ts+1018 /* "SELECT 1 FROM ta..." */, 0)
}
g.iTimeout = 0
- for (((crt.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == 5) || (rc == 100)) &&
+ for (((libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == 5) || (rc == 100)) &&
(iTimeout > 0) {
sqlite3.Xsqlite3_reset(tls, pStmt)
sqlite3.Xsqlite3_sleep(tls, 50)
@@ -4803,18 +4805,18 @@ func waitForClient(tls *crt.TLS, iClient int32, iTimeout int32, zErrPrefix uintp
zErrPrefix = ts + 1099 /* "" */
}
if iClient > 0 {
- errorMessage(tls, ts+1100 /* "%stimeout waitin..." */, crt.VaList(bp+8, zErrPrefix, iClient))
+ errorMessage(tls, ts+1100 /* "%stimeout waitin..." */, libc.VaList(bp+8, zErrPrefix, iClient))
} else {
- errorMessage(tls, ts+1132 /* "%stimeout waitin..." */, crt.VaList(bp+24, zErrPrefix))
+ errorMessage(tls, ts+1132 /* "%stimeout waitin..." */, libc.VaList(bp+24, zErrPrefix))
}
}
}
// Return a pointer to the tail of a filename
-func filenameTail(tls *crt.TLS, z uintptr) uintptr { /* mptest.c:836:13: */
+func filenameTail(tls *libc.TLS, z uintptr) uintptr { /* mptest.c:836:13: */
var i int32
var j int32
- for i = crt.AssignInt32(&j, 0); *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0; i++ {
+ for i = libc.AssignInt32(&j, 0); *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0; i++ {
if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i))))) == '/' {
j = (i + 1)
}
@@ -4823,7 +4825,7 @@ func filenameTail(tls *crt.TLS, z uintptr) uintptr { /* mptest.c:836:13: */
}
// Interpret zArg as a boolean value. Return either 0 or 1.
-func booleanValue(tls *crt.TLS, zArg uintptr) int32 { /* mptest.c:845:12: */
+func booleanValue(tls *libc.TLS, zArg uintptr) int32 { /* mptest.c:845:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -4834,7 +4836,7 @@ func booleanValue(tls *crt.TLS, zArg uintptr) int32 { /* mptest.c:845:12: */
for i = 0; (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) <= '9'); i++ {
}
if (i > 0) && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) == 0) {
- return crt.Xatoi(tls, zArg)
+ return libc.Xatoi(tls, zArg)
}
if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1166 /* "on" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1169 /* "yes" */) == 0) {
return 1
@@ -4842,20 +4844,20 @@ func booleanValue(tls *crt.TLS, zArg uintptr) int32 { /* mptest.c:845:12: */
if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1173 /* "off" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1177 /* "no" */) == 0) {
return 0
}
- errorMessage(tls, ts+1180 /* "unknown boolean:..." */, crt.VaList(bp, zArg))
+ errorMessage(tls, ts+1180 /* "unknown boolean:..." */, libc.VaList(bp, zArg))
return 0
}
// This routine exists as a convenient place to set a debugger
// breakpoint.
-func test_breakpoint(tls *crt.TLS) { /* mptest.c:864:13: */ cnt++ }
+func test_breakpoint(tls *libc.TLS) { /* mptest.c:864:13: */ cnt++ }
var cnt int32 = 0 /* mptest.c:864:56 */
// Maximum number of arguments to a --command
// Run a script.
-func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFilename uintptr) { /* mptest.c:872:13: */
+func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFilename uintptr) { /* mptest.c:872:13: */
bp := tls.Alloc(1610)
defer tls.Free(1610)
@@ -4876,23 +4878,23 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
// var azArg [2][100]int8 at bp+410, 200
- crt.Xmemset(tls, bp+360 /* &sResult */, 0, uint64(unsafe.Sizeof(String{})))
+ libc.Xmemset(tls, bp+360 /* &sResult */, 0, uint64(unsafe.Sizeof(String{})))
stringReset(tls, bp+360 /* &sResult */)
- for (crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii)))))) != 0 {
+ for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii)))))) != 0 {
prevLine = *(*int32)(unsafe.Pointer(bp + 376 /* lineno */))
len = tokenLength(tls, (zScript + uintptr(ii)), bp+376 /* &lineno */)
- if ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0) || ((c == '/') && (int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) == '*')) {
+ 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))))) == '*')) {
ii = ii + (len)
continue
}
- if ((c != '-') || (int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) != '-')) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 2))))))*2))) & int32(_ISalpha)) != 0) {
+ 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) {
ii = ii + (len)
continue
}
// Run any prior SQL before processing the new --command
if ii > iBegin {
- var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, crt.VaList(bp, (ii-iBegin), (zScript+uintptr(iBegin))))
+ var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp, (ii-iBegin), (zScript+uintptr(iBegin))))
evalSql(tls, bp+360 /* &sResult */, zSql, 0)
sqlite3.Xsqlite3_free(tls, zSql)
iBegin = (ii + len)
@@ -4900,11 +4902,11 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
// Parse the --command
if g.iTrace >= 2 {
- logMessage(tls, ts+1202 /* "%.*s" */, crt.VaList(bp+16, len, (zScript+uintptr(ii))))
+ logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+16, len, (zScript+uintptr(ii))))
}
n = extractToken(tls, ((zScript + uintptr(ii)) + uintptr(2)), (len - 2), bp+380 /* &zCmd[0] */, int32(unsafe.Sizeof([30]int8{})))
for nArg = 0; (n < (len - 2)) && (nArg < 2); nArg++ {
- for (n < (len - 2)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr(((ii + 2) + n)))))))*2))) & int32(_ISspace)) != 0) {
+ 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) {
n++
}
if n >= (len - 2) {
@@ -4914,36 +4916,36 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
(bp + 410 /* &azArg[0] */ + uintptr(nArg)*100), int32(unsafe.Sizeof([100]int8{}))))
}
for j = nArg; j < 2; j++ {
- *(*int8)(unsafe.Pointer((bp + 410 /* &azArg[0] */ + uintptr(crt.PostIncInt32(&j, 1))*100) + uintptr(0))) = int8(0)
+ *(*int8)(unsafe.Pointer((bp + 410 /* &azArg[0] */ + uintptr(libc.PostIncInt32(&j, 1))*100) + uintptr(0))) = int8(0)
}
// --sleep N
//
// Pause for N milliseconds
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1207 /* "sleep" */) == 0 {
- sqlite3.Xsqlite3_sleep(tls, crt.Xatoi(tls, (bp+410 /* &azArg[0] */ +uintptr(0)*100)))
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1207 /* "sleep" */) == 0 {
+ sqlite3.Xsqlite3_sleep(tls, libc.Xatoi(tls, (bp+410 /* &azArg[0] */ +uintptr(0)*100)))
} else
// --exit N
//
// Exit this process. If N>0 then exit without shutting down
// SQLite. (In other words, simulate a crash.)
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1213 /* "exit" */) == 0 {
- var rc int32 = crt.Xatoi(tls, (bp + 410 /* &azArg[0] */ + uintptr(0)*100))
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1213 /* "exit" */) == 0 {
+ var rc int32 = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */ + uintptr(0)*100))
finishScript(tls, iClient, taskId, 1)
if rc == 0 {
sqlite3.Xsqlite3_close(tls, g.db)
}
- crt.Xexit(tls, rc)
+ libc.Xexit(tls, rc)
} else
// --testcase NAME
//
// Begin a new test case. Announce in the log that the test case
// has begun.
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1218 /* "testcase" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1218 /* "testcase" */) == 0 {
if g.iTrace == 1 {
- logMessage(tls, ts+1202 /* "%.*s" */, crt.VaList(bp+32, (len-1), (zScript+uintptr(ii))))
+ logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+32, (len-1), (zScript+uintptr(ii))))
}
stringReset(tls, bp+360 /* &sResult */)
} else
@@ -4952,29 +4954,29 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
//
// Mark the current task as having finished, even if it is not.
// This can be used in conjunction with --exit to simulate a crash.
- if (crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1227 /* "finish" */) == 0) && (iClient > 0) {
+ if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1227 /* "finish" */) == 0) && (iClient > 0) {
finishScript(tls, iClient, taskId, 1)
} else
// --reset
//
// Reset accumulated results back to an empty string
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1234 /* "reset" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1234 /* "reset" */) == 0 {
stringReset(tls, bp+360 /* &sResult */)
} else
// --match ANSWER...
//
// Check to see if output matches ANSWER. Report an error if not.
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1240 /* "match" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1240 /* "match" */) == 0 {
var jj int32
var zAns uintptr = (zScript + uintptr(ii))
- for jj = 7; (jj < (len - 1)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj))))))*2))) & int32(_ISspace)) != 0); jj++ {
+ 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++ {
}
zAns += uintptr(jj)
- if (((len - jj) - 1) != (*String)(unsafe.Pointer(bp+360 /* &sResult */)).n) || (crt.Xstrncmp(tls, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z, zAns, (uint64((len-jj)-1))) != 0) {
+ 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) {
errorMessage(tls, ts+1246, /* "line %d of %s:\nE..." */
- crt.VaList(bp+48, prevLine, zFilename, ((len-jj)-1), zAns, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
+ libc.VaList(bp+48, prevLine, zFilename, ((len-jj)-1), zAns, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
}
g.nTest++
stringReset(tls, bp+360 /* &sResult */)
@@ -4985,18 +4987,18 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
//
// Check to see if output does or does not match the glob pattern
// ANSWER.
- if (crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1291 /* "glob" */) == 0) || (crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1296 /* "notglob" */) == 0) {
+ if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1291 /* "glob" */) == 0) || (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1296 /* "notglob" */) == 0) {
var jj int32
var zAns uintptr = (zScript + uintptr(ii))
var zCopy uintptr
- var isGlob int32 = (crt.Bool32(int32(*(*int8)(unsafe.Pointer(bp + 380 /* &zCmd[0] */ + uintptr(0)))) == 'g'))
- for jj = (9 - (3 * isGlob)); (jj < (len - 1)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj))))))*2))) & int32(_ISspace)) != 0); jj++ {
+ var isGlob int32 = (libc.Bool32(int32(*(*int8)(unsafe.Pointer(bp + 380 /* &zCmd[0] */ + uintptr(0)))) == 'g'))
+ 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++ {
}
zAns += uintptr(jj)
- zCopy = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, crt.VaList(bp+88, ((len-jj)-1), zAns))
- if ((crt.Bool32(sqlite3.Xsqlite3_strglob(tls, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z) == 0)) ^ isGlob) != 0 {
+ zCopy = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+88, ((len-jj)-1), zAns))
+ if ((libc.Bool32(sqlite3.Xsqlite3_strglob(tls, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z) == 0)) ^ isGlob) != 0 {
errorMessage(tls, ts+1304, /* "line %d of %s:\nE..." */
- crt.VaList(bp+104, prevLine, zFilename, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
+ libc.VaList(bp+104, prevLine, zFilename, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
}
sqlite3.Xsqlite3_free(tls, zCopy)
g.nTest++
@@ -5006,34 +5008,34 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
// --output
//
// Output the result of the previous SQL.
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1347 /* "output" */) == 0 {
- logMessage(tls, ts+438 /* "%s" */, crt.VaList(bp+136, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1347 /* "output" */) == 0 {
+ logMessage(tls, ts+438 /* "%s" */, libc.VaList(bp+136, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
} else
// --source FILENAME
//
// Run a subscript from a separate file.
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1354 /* "source" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1354 /* "source" */) == 0 {
var zNewFile uintptr
var zNewScript uintptr
var zToDel uintptr = uintptr(0)
zNewFile = (bp + 410 /* &azArg[0] */ + uintptr(0)*100)
if !((int32(*(*int8)(unsafe.Pointer(zNewFile + uintptr(0))))) == '/') {
var k int32
- for k = (int32(crt.Xstrlen(tls, zFilename)) - 1); (k >= 0) && !((int32(*(*int8)(unsafe.Pointer(zFilename + uintptr(k))))) == '/'); k-- {
+ for k = (int32(libc.Xstrlen(tls, zFilename)) - 1); (k >= 0) && !((int32(*(*int8)(unsafe.Pointer(zFilename + uintptr(k))))) == '/'); k-- {
}
if k > 0 {
- zNewFile = crt.AssignUintptr(&zToDel, sqlite3.Xsqlite3_mprintf(tls, ts+1361 /* "%.*s/%s" */, crt.VaList(bp+144, k, zFilename, zNewFile)))
+ zNewFile = libc.AssignUintptr(&zToDel, sqlite3.Xsqlite3_mprintf(tls, ts+1361 /* "%.*s/%s" */, libc.VaList(bp+144, k, zFilename, zNewFile)))
}
}
zNewScript = readFile(tls, zNewFile)
if g.iTrace != 0 {
- logMessage(tls, ts+1369 /* "begin script [%s..." */, crt.VaList(bp+168, zNewFile))
+ logMessage(tls, ts+1369 /* "begin script [%s..." */, libc.VaList(bp+168, zNewFile))
}
runScript(tls, 0, 0, zNewScript, zNewFile)
sqlite3.Xsqlite3_free(tls, zNewScript)
if g.iTrace != 0 {
- logMessage(tls, ts+1388 /* "end script [%s]\n" */, crt.VaList(bp+176, zNewFile))
+ logMessage(tls, ts+1388 /* "end script [%s]\n" */, libc.VaList(bp+176, zNewFile))
}
sqlite3.Xsqlite3_free(tls, zToDel)
} else
@@ -5041,23 +5043,23 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
// --print MESSAGE....
//
// Output the remainder of the line to the log file
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1405 /* "print" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1405 /* "print" */) == 0 {
var jj int32
- for jj = 7; (jj < len) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + jj)))))))*2))) & int32(_ISspace)) != 0); jj++ {
+ 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++ {
}
- logMessage(tls, ts+1202 /* "%.*s" */, crt.VaList(bp+184, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
+ logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+184, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
} else
// --if EXPR
//
// Skip forward to the next matching --endif or --else if EXPR is false.
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1411 /* "if" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1411 /* "if" */) == 0 {
var jj int32
var rc int32
var pStmt uintptr
- for jj = 4; (jj < len) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + jj)))))))*2))) & int32(_ISspace)) != 0); jj++ {
+ 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++ {
}
- pStmt = prepareSql(tls, ts+1414 /* "SELECT %.*s" */, crt.VaList(bp+200, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
+ pStmt = prepareSql(tls, ts+1414 /* "SELECT %.*s" */, libc.VaList(bp+200, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
rc = sqlite3.Xsqlite3_step(tls, pStmt)
if (rc != 100) || (sqlite3.Xsqlite3_column_int(tls, pStmt, 0) == 0) {
ii = ii + (findEndif(tls, ((zScript + uintptr(ii)) + uintptr(len)), 1, bp+376 /* &lineno */))
@@ -5069,7 +5071,7 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
//
// This command can only be encountered if currently inside an --if that
// is true. Skip forward to the next matching --endif.
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1426 /* "else" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1426 /* "else" */) == 0 {
ii = ii + (findEndif(tls, ((zScript + uintptr(ii)) + uintptr(len)), 0, bp+376 /* &lineno */))
} else
@@ -5077,14 +5079,14 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
//
// This command can only be encountered if currently inside an --if that
// is true or an --else of a false if. This is a no-op.
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1431 /* "endif" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1431 /* "endif" */) == 0 {
} else
// --start CLIENT
//
// Start up the given client.
- if (crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1437 /* "start" */) == 0) && (iClient == 0) {
- var iNewClient int32 = crt.Xatoi(tls, (bp + 410 /* &azArg[0] */ + uintptr(0)*100))
+ if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1437 /* "start" */) == 0) && (iClient == 0) {
+ var iNewClient int32 = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */ + uintptr(0)*100))
if iNewClient > 0 {
startClient(tls, iNewClient)
}
@@ -5095,16 +5097,16 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
// Wait until all tasks complete for the given client. If CLIENT is
// "all" then wait for all clients to complete. Wait no longer than
// TIMEOUT milliseconds (default 10,000)
- if (crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1443 /* "wait" */) == 0) && (iClient == 0) {
+ if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1443 /* "wait" */) == 0) && (iClient == 0) {
var iTimeout int32
if nArg >= 2 {
- iTimeout = crt.Xatoi(tls, (bp + 410 /* &azArg[0] */ + uintptr(1)*100))
+ iTimeout = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */ + uintptr(1)*100))
} else {
iTimeout = 10000
}
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([1000]int8{})), bp+610 /* &zError[0] */, ts+1448, /* "line %d of %s\n" */
- crt.VaList(bp+216, prevLine, zFilename))
- waitForClient(tls, crt.Xatoi(tls, (bp+410 /* &azArg[0] */ +uintptr(0)*100)), iTimeout, bp+610 /* &zError[0] */)
+ libc.VaList(bp+216, prevLine, zFilename))
+ waitForClient(tls, libc.Xatoi(tls, (bp+410 /* &azArg[0] */ +uintptr(0)*100)), iTimeout, bp+610 /* &zError[0] */)
} else
// --task CLIENT
@@ -5113,25 +5115,25 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
//
// Assign work to a client. Start the client if it is not running
// already.
- if (crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1463 /* "task" */) == 0) && (iClient == 0) {
- var iTarget int32 = crt.Xatoi(tls, (bp + 410 /* &azArg[0] */ + uintptr(0)*100))
+ if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1463 /* "task" */) == 0) && (iClient == 0) {
+ var iTarget int32 = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */ + uintptr(0)*100))
var iEnd int32
var zTask uintptr
var zTName uintptr
iEnd = findEnd(tls, ((zScript + uintptr(ii)) + uintptr(len)), bp+376 /* &lineno */)
if iTarget < 0 {
errorMessage(tls, ts+1468, /* "line %d of %s: b..." */
- crt.VaList(bp+232, prevLine, zFilename, iTarget))
+ libc.VaList(bp+232, prevLine, zFilename, iTarget))
} else {
- zTask = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, crt.VaList(bp+256, iEnd, ((zScript+uintptr(ii))+uintptr(len))))
+ zTask = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+256, iEnd, ((zScript+uintptr(ii))+uintptr(len))))
if nArg > 1 {
- zTName = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, crt.VaList(bp+272, (bp+410 /* &azArg[0] */ +uintptr(1)*100)))
+ zTName = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+272, (bp+410 /* &azArg[0] */ +uintptr(1)*100)))
} else {
- zTName = sqlite3.Xsqlite3_mprintf(tls, ts+1505 /* "%s:%d" */, crt.VaList(bp+280, filenameTail(tls, zFilename), prevLine))
+ zTName = sqlite3.Xsqlite3_mprintf(tls, ts+1505 /* "%s:%d" */, libc.VaList(bp+280, filenameTail(tls, zFilename), prevLine))
}
startClient(tls, iTarget)
runSql(tls,
- ts+1511 /* "INSERT INTO task..." */, crt.VaList(bp+296, iTarget, zTask, zTName))
+ ts+1511 /* "INSERT INTO task..." */, libc.VaList(bp+296, iTarget, zTask, zTName))
sqlite3.Xsqlite3_free(tls, zTask)
sqlite3.Xsqlite3_free(tls, zTName)
}
@@ -5144,28 +5146,28 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
//
// This command calls "test_breakpoint()" which is a routine provided
// as a convenient place to set a debugger breakpoint.
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1567 /* "breakpoint" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1567 /* "breakpoint" */) == 0 {
test_breakpoint(tls)
} else
// --show-sql-errors BOOLEAN
//
// Turn display of SQL errors on and off.
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1578 /* "show-sql-errors" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1578 /* "show-sql-errors" */) == 0 {
g.bIgnoreSqlErrors = func() int32 {
if nArg >= 1 {
- return crt.BoolInt32(!(booleanValue(tls, (bp+410 /* &azArg[0] */ +uintptr(0)*100)) != 0))
+ return libc.BoolInt32(!(booleanValue(tls, (bp+410 /* &azArg[0] */ +uintptr(0)*100)) != 0))
}
return 1
}()
} else {
errorMessage(tls, ts+1594, /* "line %d of %s: u..." */
- crt.VaList(bp+320, prevLine, zFilename, bp+380 /* &zCmd[0] */))
+ libc.VaList(bp+320, prevLine, zFilename, bp+380 /* &zCmd[0] */))
}
ii = ii + (len)
}
if iBegin < ii {
- var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, crt.VaList(bp+344, (ii-iBegin), (zScript+uintptr(iBegin))))
+ var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+344, (ii-iBegin), (zScript+uintptr(iBegin))))
runSql(tls, zSql, 0)
sqlite3.Xsqlite3_free(tls, zSql)
}
@@ -5178,7 +5180,7 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
// hasArg==0 means the option is a flag. It is either present or not.
// hasArg==1 means the option has an argument. Return a pointer to the
// argument.
-func findOption(tls *crt.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, hasArg int32) uintptr { /* mptest.c:1201:13: */
+func findOption(tls *libc.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, hasArg int32) uintptr { /* mptest.c:1201:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -5203,18 +5205,18 @@ func findOption(tls *crt.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, has
}
z++
}
- if crt.Xstrcmp(tls, z, zOption) == 0 {
+ if libc.Xstrcmp(tls, z, zOption) == 0 {
if (hasArg != 0) && (i == (nArg - 1)) {
- fatalError(tls, ts+1630 /* "command-line opt..." */, crt.VaList(bp, z))
+ fatalError(tls, ts+1630 /* "command-line opt..." */, libc.VaList(bp, z))
}
if hasArg != 0 {
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*8))
} else {
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))
}
- j = ((i + 1) + (crt.Bool32(hasArg != 0)))
+ j = ((i + 1) + (libc.Bool32(hasArg != 0)))
for j < nArg {
- *(*uintptr)(unsafe.Pointer(azArg + uintptr(crt.PostIncInt32(&i, 1))*8)) = *(*uintptr)(unsafe.Pointer(azArg + uintptr(crt.PostIncInt32(&j, 1))*8))
+ *(*uintptr)(unsafe.Pointer(azArg + uintptr(libc.PostIncInt32(&i, 1))*8)) = *(*uintptr)(unsafe.Pointer(azArg + uintptr(libc.PostIncInt32(&j, 1))*8))
}
*(*int32)(unsafe.Pointer(pnArg)) = i
return zReturn
@@ -5224,7 +5226,7 @@ func findOption(tls *crt.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, has
}
// Print a usage message for the program and exit
-func usage(tls *crt.TLS, argv0 uintptr) { /* mptest.c:1241:13: */
+func usage(tls *libc.TLS, argv0 uintptr) { /* mptest.c:1241:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -5235,28 +5237,28 @@ func usage(tls *crt.TLS, argv0 uintptr) { /* mptest.c:1241:13: */
zTail = ((argv0 + uintptr(i)) + uintptr(1))
}
}
- crt.Xfprintf(tls, crt.Xstderr, ts+1678 /* "Usage: %s DATABA..." */, crt.VaList(bp, zTail))
- crt.Xfprintf(tls, crt.Xstderr,
+ libc.Xfprintf(tls, libc.Xstderr, ts+1678 /* "Usage: %s DATABA..." */, libc.VaList(bp, zTail))
+ libc.Xfprintf(tls, libc.Xstderr,
ts+1717 /* "Options:\n --er..." */, 0)
- crt.Xexit(tls, 1)
+ libc.Xexit(tls, 1)
}
// Report on unrecognized arguments
-func unrecognizedArguments(tls *crt.TLS, argv0 uintptr, nArg int32, azArg uintptr) { /* mptest.c:1265:13: */
+func unrecognizedArguments(tls *libc.TLS, argv0 uintptr, nArg int32, azArg uintptr) { /* mptest.c:1265:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
var i int32
- crt.Xfprintf(tls, crt.Xstderr, ts+2289 /* "%s: unrecognized..." */, crt.VaList(bp, argv0))
+ libc.Xfprintf(tls, libc.Xstderr, ts+2289 /* "%s: unrecognized..." */, libc.VaList(bp, argv0))
for i = 0; i < nArg; i++ {
- crt.Xfprintf(tls, crt.Xstderr, ts+2317 /* " %s" */, crt.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))))
+ libc.Xfprintf(tls, libc.Xstderr, ts+2317 /* " %s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))))
}
- crt.Xfprintf(tls, crt.Xstderr, ts+2321 /* "\n" */, 0)
- crt.Xexit(tls, 1)
+ libc.Xfprintf(tls, libc.Xstderr, ts+2321 /* "\n" */, 0)
+ libc.Xexit(tls, 1)
}
-func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18: */
+func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18: */
bp := tls.Alloc(264)
defer tls.Free(264)
@@ -5289,19 +5291,19 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
if strglob(tls, ts+2323 /* "*.test" */, g.zDbFile) != 0 {
usage(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
}
- if crt.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2020-06-18 14:00..." */) != 0 {
- crt.Xfprintf(tls, crt.Xstderr,
+ if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2020-08-14 13:23..." */) != 0 {
+ libc.Xfprintf(tls, libc.Xstderr,
ts+2415, /* "SQLite library a..." */
- crt.VaList(bp, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2020-06-18 14:00..." */))
- crt.Xexit(tls, 1)
+ libc.VaList(bp, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2020-08-14 13:23..." */))
+ libc.Xexit(tls, 1)
}
*(*int32)(unsafe.Pointer(bp + 232 /* n */)) = (argc - 2)
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+64 /* &.zName */, ts+2475 /* "%05d.mptest" */, crt.VaList(bp+16, crt.Xgetpid(tls)))
+ 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)))
zJMode = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2487 /* "journalmode" */, 1)
zNRep = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2499 /* "repeat" */, 1)
if zNRep != 0 {
- nRep = crt.Xatoi(tls, zNRep)
+ nRep = libc.Xatoi(tls, zNRep)
}
if nRep < 1 {
nRep = 1
@@ -5312,104 +5314,104 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
g.zLog = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2524 /* "log" */, 1)
zTrace = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2528 /* "trace" */, 1)
if zTrace != 0 {
- g.iTrace = crt.Xatoi(tls, zTrace)
+ g.iTrace = libc.Xatoi(tls, zTrace)
}
if findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2534 /* "quiet" */, 0) != uintptr(0) {
g.iTrace = 0
}
zTmout = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2540 /* "timeout" */, 1)
if zTmout != 0 {
- iTmout = crt.Xatoi(tls, zTmout)
+ iTmout = libc.Xatoi(tls, zTmout)
}
- g.bSqlTrace = (crt.Bool32(findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2548 /* "sqltrace" */, 0) != uintptr(0)))
- g.bSync = (crt.Bool32(findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2557 /* "sync" */, 0) != uintptr(0)))
+ g.bSqlTrace = (libc.Bool32(findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2548 /* "sqltrace" */, 0) != uintptr(0)))
+ g.bSync = (libc.Bool32(findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2557 /* "sync" */, 0) != uintptr(0)))
if g.zErrLog != 0 {
- g.pErrLog = crt.Xfopen(tls, g.zErrLog, ts+2562 /* "a" */)
+ g.pErrLog = libc.Xfopen(tls, g.zErrLog, ts+2562 /* "a" */)
} else {
- g.pErrLog = crt.Xstderr
+ g.pErrLog = libc.Xstderr
}
if g.zLog != 0 {
- g.pLog = crt.Xfopen(tls, g.zLog, ts+2562 /* "a" */)
+ g.pLog = libc.Xfopen(tls, g.zLog, ts+2562 /* "a" */)
} else {
- g.pLog = crt.Xstdout
+ g.pLog = libc.Xstdout
}
- sqlite3.Xsqlite3_config(tls, 16, crt.VaList(bp+24, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ sqlite3.Xsqlite3_config(tls, 16, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{sqlErrorCallback})), 0))
if zClient != 0 {
- iClient = crt.Xatoi(tls, zClient)
+ iClient = libc.Xatoi(tls, zClient)
if iClient < 1 {
- fatalError(tls, ts+2564 /* "illegal client n..." */, crt.VaList(bp+40, iClient))
+ fatalError(tls, ts+2564 /* "illegal client n..." */, libc.VaList(bp+40, iClient))
}
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+64 /* &.zName */, ts+2591, /* "%05d.client%02d" */
- crt.VaList(bp+48, crt.Xgetpid(tls), iClient))
+ libc.VaList(bp+48, libc.Xgetpid(tls), iClient))
} else {
var nTry int32 = 0
if g.iTrace > 0 {
- crt.Xprintf(tls, ts+2607 /* "BEGIN: %s" */, crt.VaList(bp+64, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
+ libc.Xprintf(tls, ts+2607 /* "BEGIN: %s" */, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
for i = 1; i < argc; i++ {
- crt.Xprintf(tls, ts+2317 /* " %s" */, crt.VaList(bp+72, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ libc.Xprintf(tls, ts+2317 /* " %s" */, libc.VaList(bp+72, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
- crt.Xprintf(tls, ts+2321 /* "\n" */, 0)
- crt.Xprintf(tls, ts+2617 /* "With SQLite 3.32..." */, 0)
- for i = 0; (crt.AssignUintptr(&zCOption, sqlite3.Xsqlite3_compileoption_get(tls, i))) != uintptr(0); i++ {
- crt.Xprintf(tls, ts+2722 /* "-DSQLITE_%s\n" */, crt.VaList(bp+80, zCOption))
+ libc.Xprintf(tls, ts+2321 /* "\n" */, 0)
+ libc.Xprintf(tls, ts+2617 /* "With SQLite 3.33..." */, 0)
+ for i = 0; (libc.AssignUintptr(&zCOption, sqlite3.Xsqlite3_compileoption_get(tls, i))) != uintptr(0); i++ {
+ libc.Xprintf(tls, ts+2722 /* "-DSQLITE_%s\n" */, libc.VaList(bp+80, zCOption))
}
- crt.Xfflush(tls, crt.Xstdout)
+ libc.Xfflush(tls, libc.Xstdout)
}
iClient = 0
- for ok := true; ok; ok = (((rc != 0) && ((crt.PreIncInt32(&nTry, 1)) < 60)) && (sqlite3.Xsqlite3_sleep(tls, 1000) > 0)) {
+ for ok := true; ok; ok = (((rc != 0) && ((libc.PreIncInt32(&nTry, 1)) < 60)) && (sqlite3.Xsqlite3_sleep(tls, 1000) > 0)) {
if (nTry % 5) == 4 {
- crt.Xprintf(tls, ts+2735, /* "... %strying to ..." */
- crt.VaList(bp+88, func() uintptr {
+ libc.Xprintf(tls, ts+2735, /* "... %strying to ..." */
+ libc.VaList(bp+88, func() uintptr {
if nTry > 5 {
return ts + 2764 /* "still " */
}
return ts + 1099 /* "" */
}(), g.zDbFile))
}
- rc = crt.Xunlink(tls, g.zDbFile)
- if (rc != 0) && ((*(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))) == 2) {
+ rc = libc.Xunlink(tls, g.zDbFile)
+ if (rc != 0) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == 2) {
rc = 0
}
}
if rc != 0 {
fatalError(tls, ts+2771, /* "unable to unlink..." */
- crt.VaList(bp+104, g.zDbFile, nTry))
+ libc.VaList(bp+104, g.zDbFile, nTry))
}
openFlags = openFlags | (0x00000004)
}
rc = sqlite3.Xsqlite3_open_v2(tls, g.zDbFile, (uintptr(unsafe.Pointer(&g)) + 24 /* &.db */), openFlags, g.zVfs)
if rc != 0 {
- fatalError(tls, ts+2812 /* "cannot open [%s]" */, crt.VaList(bp+120, g.zDbFile))
+ fatalError(tls, ts+2812 /* "cannot open [%s]" */, libc.VaList(bp+120, g.zDbFile))
}
if iTmout > 0 {
sqlite3.Xsqlite3_busy_timeout(tls, g.db, iTmout)
}
if zJMode != 0 {
- runSql(tls, ts+2829 /* "PRAGMA journal_m..." */, crt.VaList(bp+128, zJMode))
+ runSql(tls, ts+2829 /* "PRAGMA journal_m..." */, libc.VaList(bp+128, zJMode))
}
if !(g.bSync != 0) {
trySql(tls, ts+2853 /* "PRAGMA synchrono..." */, 0)
}
sqlite3.Xsqlite3_enable_load_extension(tls, g.db, 1)
sqlite3.Xsqlite3_busy_handler(tls, g.db, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{busyHandler})), uintptr(0))
sqlite3.Xsqlite3_create_function(tls, g.db, ts+2876 /* "vfsname" */, 0, 1, uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{vfsNameFunc})), uintptr(0), uintptr(0))
sqlite3.Xsqlite3_create_function(tls, g.db, ts+2884 /* "eval" */, 1, 1, uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{evalFunc})), uintptr(0), uintptr(0))
g.iTimeout = 10000
if g.bSqlTrace != 0 {
sqlite3.Xsqlite3_trace(tls, g.db, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr)
+ f func(*libc.TLS, uintptr, uintptr)
}{sqlTraceCallback})), uintptr(0))
}
if iClient > 0 {
@@ -5426,11 +5428,11 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
break
}
if g.iTrace != 0 {
- logMessage(tls, ts+2902 /* "begin %s (%d)" */, crt.VaList(bp+136, *(*uintptr)(unsafe.Pointer(bp + 256 /* zTaskName */)), *(*int32)(unsafe.Pointer(bp + 248 /* taskId */))))
+ logMessage(tls, ts+2902 /* "begin %s (%d)" */, libc.VaList(bp+136, *(*uintptr)(unsafe.Pointer(bp + 256 /* zTaskName */)), *(*int32)(unsafe.Pointer(bp + 248 /* taskId */))))
}
runScript(tls, iClient, *(*int32)(unsafe.Pointer(bp + 248 /* taskId */)), *(*uintptr)(unsafe.Pointer(bp + 240 /* zScript */)), *(*uintptr)(unsafe.Pointer(bp + 256 /* zTaskName */)))
if g.iTrace != 0 {
- logMessage(tls, ts+2916 /* "end %s (%d)" */, crt.VaList(bp+152, *(*uintptr)(unsafe.Pointer(bp + 256 /* zTaskName */)), *(*int32)(unsafe.Pointer(bp + 248 /* taskId */))))
+ logMessage(tls, ts+2916 /* "end %s (%d)" */, libc.VaList(bp+152, *(*uintptr)(unsafe.Pointer(bp + 256 /* zTaskName */)), *(*int32)(unsafe.Pointer(bp + 248 /* taskId */))))
}
finishScript(tls, iClient, *(*int32)(unsafe.Pointer(bp + 248 /* taskId */)), 0)
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 256 /* zTaskName */)))
@@ -5454,11 +5456,11 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
*(*uintptr)(unsafe.Pointer(bp + 240 /* zScript */)) = readFile(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)))
for iRep = 1; iRep <= nRep; iRep++ {
if g.iTrace != 0 {
- logMessage(tls, ts+3399 /* "begin script [%s..." */, crt.VaList(bp+168, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), iRep))
+ logMessage(tls, ts+3399 /* "begin script [%s..." */, libc.VaList(bp+168, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), iRep))
}
runScript(tls, 0, 0, *(*uintptr)(unsafe.Pointer(bp + 240 /* zScript */)), *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)))
if g.iTrace != 0 {
- logMessage(tls, ts+3427 /* "end script [%s] ..." */, crt.VaList(bp+184, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), iRep))
+ logMessage(tls, ts+3427 /* "end script [%s] ..." */, libc.VaList(bp+184, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), iRep))
}
}
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 240 /* zScript */)))
@@ -5467,7 +5469,7 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
sqlite3.Xsqlite3_sleep(tls, 10)
g.iTimeout = 0
iTimeout = 1000
- for (((crt.AssignInt32(&rc, trySql(tls, ts+3502 /* "SELECT 1 FROM cl..." */, 0))) == 5) ||
+ for (((libc.AssignInt32(&rc, trySql(tls, ts+3502 /* "SELECT 1 FROM cl..." */, 0))) == 5) ||
(rc == 100)) && (iTimeout > 0) {
sqlite3.Xsqlite3_sleep(tls, 10)
iTimeout = iTimeout - (10)
@@ -5475,7 +5477,7 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
sqlite3.Xsqlite3_sleep(tls, 100)
pStmt = prepareSql(tls, ts+3523 /* "SELECT nError, n..." */, 0)
iTimeout = 1000
- for ((crt.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == 5) && (iTimeout > 0) {
+ for ((libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == 5) && (iTimeout > 0) {
sqlite3.Xsqlite3_sleep(tls, 10)
iTimeout = iTimeout - (10)
}
@@ -5489,15 +5491,15 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
maybeClose(tls, g.pLog)
maybeClose(tls, g.pErrLog)
if iClient == 0 {
- crt.Xprintf(tls, ts+3558 /* "Summary: %d erro..." */, crt.VaList(bp+200, g.nError, g.nTest))
- crt.Xprintf(tls, ts+3594 /* "END: %s" */, crt.VaList(bp+216, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
+ libc.Xprintf(tls, ts+3558 /* "Summary: %d erro..." */, libc.VaList(bp+200, g.nError, g.nTest))
+ libc.Xprintf(tls, ts+3594 /* "END: %s" */, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
for i = 1; i < argc; i++ {
- crt.Xprintf(tls, ts+2317 /* " %s" */, crt.VaList(bp+224, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ libc.Xprintf(tls, ts+2317 /* " %s" */, libc.VaList(bp+224, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
- crt.Xprintf(tls, ts+2321 /* "\n" */, 0)
+ libc.Xprintf(tls, ts+2321 /* "\n" */, 0)
}
- return (crt.Bool32(g.nError > 0))
+ return (libc.Bool32(g.nError > 0))
}
-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\x002020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd\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.32.3 2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd\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"
+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\x002020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f\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.33.0 2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f\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"
var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data