sqlite.go 555 B

1234567891011121314151617181920212223242526
  1. package sqlite
  2. //#include "sqlite.h"
  3. //#define _GNU_SOURCE
  4. //#include <stdint.h>
  5. //extern int64_t uhaha_unixCurrentTimeInt64();
  6. import "C"
  7. import (
  8. "log"
  9. "os"
  10. )
  11. func init() {
  12. log.SetOutput(os.Stdout)
  13. log.SetFlags(log.Ldate | log.Ltime | log.Lmicroseconds)
  14. }
  15. func Test_SQLite() {
  16. log.Println("Test_SQLite")
  17. C.sqlite3_initialize()
  18. log.Println("C.sqlite3_initialize", "returned")
  19. x := C.uhaha_unixCurrentTimeInt64()
  20. log.Println("C.uhaha_unixCurrentTimeInt64", "returned", x)
  21. C.sqlite3_shutdown()
  22. log.Println("C.sqlite3_shutdown", "returned")
  23. }