Created
January 31, 2012 14:03
-
-
Save saranyan/1710638 to your computer and use it in GitHub Desktop.
Testing Ruby FFI - Ruby Wrapper
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
# mylibrary.rb | |
TESTVAR = 2 | |
module MyLibrary | |
extend FFI::Library | |
ffi_lib "mylibrary.so" | |
attach_function :calculate_something, [:int, :float], :double | |
attach_function :test_function_1, [:string], :string | |
attach_function :test_function_2, [:double, :pointer, :string], :int | |
attach_function :test_function_3, [], :void | |
attach_function :test_function_4, [:pointer], :void | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment