Hey guys!
I am trying to write my own small module to interface a C package to my existing Julia code. This C package is working, and I have compiled it with all the necessary flags so it’s a .so file. My problem is that one of the inputs for a function that I have to call uses a structure which is defined inside of the C package. The struct is defined by a long chain of ints, doubles and a pointer to a double :
‘’’
int max_deg;
int min_deg ;
int damping;
double thresh_ext;
double thresh_int;
double intvtol;
int type;
double *mu;
double cc;
double dd;
double gam;
double bar;
int deg ;
‘’’
Should I build a Julia structure with the same names and pattern and use it as input type? I’m not sure how I should write the Julia function which uses ccall to do this.
Also, if in general I’ll have to interface the code with other functions which use structs that may also have a pointer to a couple of arrays, so I guess if my general question would be how to interface the ccall with a generic type using ccall?
Thanks a lot for your help