FFI - can I access external constants?

John M McIntosh johnmci at smalltalkconsulting.com
Tue Feb 13 22:59:28 UTC 2007


Ah, of course obviously if there is some way to expose the value via  
a library call, you could do that in FFI.
Like use dlsym() to get the address of the constant, then memcpy to a  
squeak external data object....


On Feb 13, 2007, at 1:34 PM, Andreas Raab wrote:

> Jim McLoughlin wrote:
>> I want to access some constant structures defined in my external lib.
>> If there was a function that returned them, it would be no problem,
>> but I don't see any obvious way to directly access them.
>
> Unfortunately, there isn't. The FFI doesn't expose the direct  
> equivalent of dlsym() but only uses it implicitly when invoking an  
> FFI call. I guess this should be considered a bug...
>
> Cheers,
>   - Andreas
>

--
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===





More information about the Squeak-dev mailing list