How can I write bindings for the given C structure using dart ffi?

159 Views Asked by At

I was trying to write dart ffi bindings for the following C structure but I'm getting errors of all sorts. Can somebody help me with this?

 typedef struct {
   enum CXCursorKind kind;
   int xdata;
   const void *data[3];
 } CXCursor;

Also for the following code

 typedef void *CXIndex;

I was using it as Pointer<Void> but I want to able to use it as CXIndex.

This is for a package that provides bindings to libclang in dart. Your suggestions are welcome.

Thanks for the help in advance.

0

There are 0 best solutions below