Skip to content

Instantly share code, notes, and snippets.

@rgchris rgchris/sqlite-version.reb
Last active Jan 11, 2016

What would you like to do?
Obtain SQLite version with Rebol 3
Rebol [
Title: "SQLite Init"
Date: 10-Jan-2016
Author: "Christopher Ross-Gill"
Comment: [
"Ren/C branch build with LibFFI"
stringify: use [libc strlen][
libc: make library! switch/default fourth system/version [
2 [%libc.dylib]
3 [make error! "Don't know where LibC is for Windows"]
strlen: make routine! compose [
s [pointer]
return: [uint64]
(libc) "strlen"
stringify: func [
pointer [integer!]
/local length struct
] [
length: strlen pointer
struct: make struct! [
s: [uint8 [length]] pointer
to string! values-of struct
sqlite3: make object! [
api: make object! [
library: make library! switch/default fourth system/version [
2 [%libsqlite3.dylib]
3 [%sqlite3.dll]
version: make routine! reduce [
[return: [uint64]]
probe to tuple! stringify sqlite3/api/version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.