I have a C app on MacOS and I call functions in a swift dylib. I want to register callback functions in C to be called in swift when some event happens. Is there some example on how to do this?
I have this callback declaration in C:
typedef int (*event_cb_t)(int evt, char *data);
I want to register the callback in swift like this:
//callback function defined in C
int callback(int evt, char *data)
{
return 0;
}