Awesome - that makes sense.  Thank you!

I had an issue where I was trying to set procFunc and resetFunc to 
'nothing', but that didn't work.  I made a NULLPTR object with 
'NULLPTR=convert(Ptr{Void},0).  Thanks again!

Here is code that works for my example:
immutable my_t
       a::Cint
       b::Cint
       c::Cint
       bufs::Ptr{Ptr{Void}}
       flags::Cint
       procFunc::Ptr{Void}
       resetFunc::Ptr{Void}
end
blocksize = 128
buf1 = convert( Array{Cfloat}, zeros(blocksize) );
buf2 = convert( Array{Cfloat}, zeros(blocksize) );
bufptrs = Array{Ptr{Void}}(2,)
bufptrs[1] = convert(Ptr{Void},pointer(buf1))
bufptrs[2] = convert(Ptr{Void},pointer(buf2))
NULLPTR = convert(Ptr{Void},0)
@show bufptrs
@show pointer(bufptrs)
@show my_instance = my_t(1,1,0,pointer(bufptrs),0, NULLPTR, NULLPTR)




On Tuesday, July 21, 2015 at 9:26:41 PM UTC-4, Isaiah wrote:
>
> immutable my_t
>        a::Cint
>        b::Cint
>        c::Cint
>        bufs::Ptr{Ptr{Void}}
>        flags::Cint
>        procFunc::Ptr{Void}
>        resetFunc::Ptr{Void}
> end
>
>
> On Tue, Jul 21, 2015 at 7:21 PM, Dave C <[email protected] <javascript:>> 
> wrote:
>
>> I'm trying to wrap some C code that has a struct in a header.  I'm trying 
>> to create a Julia type that emulates the following struct:
>>
>> typedef struct 
>> {
>>   int a;
>>   int b;         
>>   int c;
>>   void* *bufs;
>>   int flags; 
>>   void* procFunc;
>>   void* resetFunc;
>> } my_t;
>>
>> I'm fine with everything except how to handle:
>> void* *bufs;
>>
>> Any advice or general thoughts? Thanks in advance - Dave.
>>
>
>

Reply via email to