Subject:
[ruby-ffi] Re: how to execute a pointer?
From:
Wayne Meissner
Date:
6/1/13 1:35 AM
To:
ruby-ffi@googlegroups.com


You should be able to just declare the return type of the function to be an appropriate callback type.

e.g.
  attach_function :function_that_returns_function, [ ], callback([], :int)

fptr = function_that_returns_function()
result = fptr.call()

Or, you can wrap it up in a FFI::Function - see http://ffi.github.io/api/FFI/Function.html

e.g.
ptr = function_that_returns_pointer
fptr = FFI::Function.new(:int, [ ])
result = fptr.call()


On Wednesday, 29 May 2013 06:29:02 UTC+10, Jose Donizetti wrote:
Hi all, 

I mapped a function in ruby which returns a pointer to another function. How can I execute this pointer?

Thanks,
Jose.

--
 
---
You received this message because you are subscribed to the Google Groups "ruby-ffi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-ffi+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.