On Sep 30, 2004, at 2:44 PM, Ken Mankoff wrote:
On Thu, 30 Sep 2004, Charles Yeomans wrote:
First, the stringPtr work is unnecessary; you can pass an Rb String
in the function, and somehow a CString will be what's actually fed to
the function.
OK, that makes sense. Thanks.
It looks to me as if index is being passed inline; thus the
declaration as Ptr will not work, for obvious reasons. If you're
working on a Mac, then you might try the declaration (assuming size_t
is a 4-byte thing)
declare function nc_get_var1_text lib library ( _
ncid as integer, _
varid as integer, _
index1 as Integer, _
index2 as Integer, _
stringPtr as cstring ) _
as integer
If you're working on an x86 machine, then you should get a Mac
because passing structs inline from Rb to an external function
doesn't appear to be possible for x86.
I am on a Mac.
But I am not sure I understand or can use your suggestion for the
indexPtr. I don't know if its inline or not. Its actually an array of
indices that is passed into my function. And whatever is obvious to
you definately is not to me, other than that declares confuse me :/.
I looked at the documentation available on the web for NetCDF. If
index is an array, then the correct declaration should be
declare function nc_get_var1_text lib library ( _
ncid as integer, _
varid as integer, _
indexPtr as ptr, _
stringPtr as cstring ) _
as integer
You didn't say how the declare doesn't work; that would be useful to
know.
Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>
|