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

     1  // Copyright 2022 The Sqlite Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build 386 || arm
     6  // +build 386 arm
     7  
     8  package vfs
     9  
    10  import (
    11  	"unsafe"
    12  
    13  	"modernc.org/libc"
    14  	sqlite3 "gitlab.com/CoiaPrant/sqlite3/lib"
    15  )
    16  
    17  func init() {
    18  	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfsio)) + 4)) = vfsClose
    19  	*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfsio)) + 8)) = vfsRead
    20  	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfsio)) + 24)) = vfsFileSize
    21  	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfsio)) + 28)) = vfsLock
    22  	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfsio)) + 32)) = vfsUnlock
    23  	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfsio)) + 36)) = vfsCheckReservedLock
    24  	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfsio)) + 40)) = vfsFileControl
    25  	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfsio)) + 44)) = vfsSectorSize
    26  	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfsio)) + 48)) = vfsDeviceCharacteristics
    27  }
    28  
    29  func vfsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nPathOut int32, zPathOut uintptr) int32 {
    30  	libc.Xstrncpy(tls, zPathOut, zPath, uint32(nPathOut))
    31  	return sqlite3.SQLITE_OK
    32  }