use unsafe_load() to convert the value to a julia object, then unsafe_store() to write the new struct back.
at some point, I want to modify unsafe_load/unsafe_store to take a fieldname symbol as the second argument to make this functionality more direct available. however, there hasn't seemed to be a request / issue open for it yet. On Thu Nov 20 2014 at 5:37:25 PM Eric Davies <[email protected]> wrote: > (For context, I'm working on this issue: https://github.com/ > JuliaOpt/ECOS.jl/issues/12 and dealing with these structs: > https://github.com/JuliaOpt/ECOS.jl/blob/master/src/types.jl#L124-L216 ) > > I have a C struct used in a 3rd-party C library mirrored as an immutable > in Julia. A pointer to the C struct is returned in another C struct, and I > get the immutable using pointer_to_array(...)[1]. I want to be able to > modify fields of the struct in-place, but immutables disallow this. How do > I go about this? >
