Created
June 20, 2015 13:50
-
-
Save aj07/7b6247d588371745e067 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MyLibrary | |
extend FFI::Library | |
ffi_lib "./mylibrary.so" | |
attach_function :createLight, [],:pointer | |
attach_function :destroyLight, [:pointer], :void | |
attach_function :toggleLight, [:pointer], :void | |
attach_function :declareLight, [:pointer], :void |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
require 'ffi'
module MyLib
extend FFI::Library
ffi_lib 'c'
attach_function :puts, [ :string ], :int
end
MyLib.puts 'Hello, World using libc!'