Hello…
I have a C function that has a pointer as one of the parameters. The function structure looks as follows:
int fn(..., void** result){ // body... *result = some_bytes; // body... }
In Julia, part of the ccall
parameter is Ptr{Ptr{Void}}
that matches the result
argument in the function above.
This result
argument is actually modified by the C
funtion.To represent the result
argument in Julia
, I use a variable, say julia_result = Ref{Ptr{Void}}(C_NULL)
. I’ve also trued removing the C_NULL
there. After executing the ccall
, all other parameters seem to work as expected but unsafe_load(julia_result[])
always returns nothing. Given the output of the function, I would expect that the julia_result
variable would also contain some data.What would be the appropriate way to pass this variable in order to read the value written onto it? Thanks