Suppose I have a type
mutable struct MyCType
a::Cint
b::Ptr{Cdouble}
end
corresponding exactly to a struct in C. Then I call a C library which has functions like
void modify_struct(myctype *a)
which mutates a
. I want to call these functions from Julia and need to know which ::T
to specify it as in the @ccall
.
T*
(where T represents an appropriately defined type) … Ref{T}` (T may be safely mutated only if T is an isbits type)|
Which, because MyCType
is not an isbits
type and I want to use the C code to mutate it, makes it sounds like I cannot use
typeof(a) == MyCType # true
@ccall modify_struct(a::Ref{MyCType})::Cvoid
However this seems to work completely fine. What am I missing?