more static sqlite work

Change-Id: I9232a929087cce4a0ae893228bd01cf32ef764fe
This commit is contained in:
Brad Fitzpatrick 2011-07-17 14:33:36 -07:00
parent 936d9e27c7
commit c91c3b1dab
5 changed files with 6743 additions and 14 deletions

View File

@ -6,4 +6,7 @@ CGOFILES=\
vfs.go\
sqlite.go\
CGO_OFILES=\
sqlite3_os_go.o\
include $(GOROOT)/src/Make.pkg

View File

@ -1,17 +1,11 @@
package sqlite
/*
#cgo CFLAGS: -D_GNU_SOURCE -D_XOPEN_SOURCE=500
#cgo LDFLAGS: -ldl -lpthread
#define _POSIX_C_SOURCE 200809L
#include <stdlib.h>
#define SQLITE_OS_OTHER 1
#include "sqlite3.c"
#include "sqlite3_os_go.c"
#include "sqlite3.h"
static int my_bind_text(sqlite3_stmt *stmt, int n, char *p, int np) {
return sqlite3_bind_text(stmt, n, p, np, SQLITE_TRANSIENT);

6734
misc/sqlite/sqlite3.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,7 @@
#define _POSIX_C_SOURCE 200809L
#include "_cgo_export.h"
#define SQLITE_OS_OTHER 1
#include "sqlite3.c"
typedef struct GoFile GoFile;
struct GoFile {

View File

@ -4,11 +4,6 @@ import "C"
//export GoVFSOpen
// fd is -1 on error.
func GoVFSOpen(filename *C.char, flags C.int) (fd int, isReadOnly bool) {
return -1, false
}
//export GoStart
func GoStart(i, xdim, ydim, xstart, xend, ystart, yend C.int, a *C.int, n *C.int) (int, int) {
return 1, 2
func GoVFSOpen(filename *C.char, flags C.int) (int, int) {
return -1, 0
}