When you want to pass more complicated things than scalars, you basically have two options.
- Create Julia objects from your C code and pass those over to Julia, making sure that ownership and garbage collection is handled correctly.
- Pass pointers to your data and sort it out on the Julia side, living dangerously with
unsafe_loadandunsafe_store!functions.
Unless you’re an experienced C programmer and at least somewhat familiar with the Julia internals, the second approach is likely more tractable.
I have added an array example in Add array example by GunnarFarneback · Pull Request #3 · GunnarFarneback/DynamicallyLoadedEmbedding.jl · GitHub.