Passing multiple C arguments to Julia function

When you want to pass more complicated things than scalars, you basically have two options.

  1. Create Julia objects from your C code and pass those over to Julia, making sure that ownership and garbage collection is handled correctly.
  2. Pass pointers to your data and sort it out on the Julia side, living dangerously with unsafe_load and unsafe_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.