Skip to content

Instantly share code, notes, and snippets.

@jbclements
Created March 30, 2013 00:40
Show Gist options
  • Save jbclements/5274703 to your computer and use it in GitHub Desktop.
Save jbclements/5274703 to your computer and use it in GitHub Desktop.
Linking to the rust library in racket.
;; link to the rust library:
(define rust-lib (ffi-lib (build-path here "libblur-68a2c114141ca-0.0")))
(define rust-blur-fun (get-ffi-obj "blur" rust-lib (_fun _uint _uint _cvector -> _void)))
(define (rust-blur width height data)
(define cvec (list->cvector data _byte))
(rust-blur-fun width height cvec)
(cvector->list cvec))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment