// Code generated by modernc.org/undup from the per-target sqlite_*.go files; DO NOT EDIT. //go:build (linux && 386) || (linux && amd64) || (linux && arm) || (linux && arm64) || (linux && loong64) || (linux && ppc64le) || (linux && riscv64) package sqlite3 import ( "unsafe" "modernc.org/libc" ) // C documentation // // /* // ** Open a new database handle. // */ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { var pVal, zFilename8 uintptr var rc int32 var v1 Tu8 _, _, _, _ = pVal, rc, zFilename8, v1 **(**uintptr)(__ccgo_up(ppDb)) = uintptr(0) rc = Xsqlite3_initialize(tls) if rc != 0 { return rc } if zFilename == uintptr(0) { zFilename = __ccgo_ts + 26292 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) zFilename8 = _sqlite3ValueText(tls, pVal, uint8(SQLITE_UTF8)) if zFilename8 != 0 { rc = _openDatabase(tls, zFilename8, ppDb, libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OPEN_READWRITE)|libc.Int32FromInt32(SQLITE_OPEN_CREATE)), uintptr(0)) if rc == SQLITE_OK && !(libc.Int32FromUint16((*TSchema)(unsafe.Pointer((**(**TDb)(__ccgo_up((*Tsqlite3)(unsafe.Pointer(**(**uintptr)(__ccgo_up(ppDb)))).FaDb))).FpSchema)).FschemaFlags)&libc.Int32FromInt32(DB_SchemaLoaded) == libc.Int32FromInt32(DB_SchemaLoaded)) { v1 = libc.Uint8FromInt32(SQLITE_UTF16LE) (*Tsqlite3)(unsafe.Pointer(**(**uintptr)(__ccgo_up(ppDb)))).Fenc = v1 (*TSchema)(unsafe.Pointer((**(**TDb)(__ccgo_up((*Tsqlite3)(unsafe.Pointer(**(**uintptr)(__ccgo_up(ppDb)))).FaDb))).FpSchema)).Fenc = v1 } } else { rc = int32(SQLITE_NOMEM) } _sqlite3ValueFree(tls, pVal) return rc & int32(0xff) } const __BYTE_ORDER = 1234 const __GNUC_WIDE_EXECUTION_CHARSET_NAME = "UTF-32LE" // C documentation // // /* // ** Attempt to parse the given string into a julian day number. Return // ** the number of errors. // ** // ** The following are acceptable forms for the input string: // ** // ** YYYY-MM-DD HH:MM:SS.FFF +/-HH:MM // ** DDDD.DD // ** now // ** // ** In the first form, the +/-HH:MM is always optional. The fractional // ** seconds extension (the ".FFF") is optional. The seconds portion // ** (":SS.FFF") is option. The year and date can be omitted as long // ** as there is a time string. The time string can be omitted as long // ** as there is a year and date. // */ func _parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* r at bp+0 */ float64 if _parseYyyyMmDd(tls, zDate, p) == 0 { return 0 } else { if _parseHhMmSs(tls, zDate, p) == 0 { return 0 } else { if _sqlite3StrICmp(tls, zDate, __ccgo_ts+1228) == 0 && _sqlite3NotPureFunc(tls, context) != 0 { return _setDateTimeToCurrent(tls, context, p) } else { if _sqlite3AtoF(tls, zDate, bp) > 0 { _setRawDateNumber(tls, p, **(**float64)(__ccgo_up(bp))) return 0 } else { if (_sqlite3StrICmp(tls, zDate, __ccgo_ts+1232) == 0 || _sqlite3StrICmp(tls, zDate, __ccgo_ts+1239) == 0) && _sqlite3NotPureFunc(tls, context) != 0 { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 2, 0x4) return _setDateTimeToCurrent(tls, context, p) } } } } } return int32(1) } /* The julian day number for 9999-12-31 23:59:59.999 is 5373484.4999999. ** Multiplying this by 86400000 gives 464269060799999 as the maximum value ** for DateTime.iJD. ** ** But some older compilers (ex: gcc 4.2.1 on older Macs) cannot deal with ** such a large integer literal, so we have to encode it. */