Callbacks are not yet supported by the documented C interface. You can use the undocumented lib.fs interface for callbacks.
In some cases you have to pass a function pointer to a C function,
i.e., the library wants to call back to your application (and the
pointed-to function is called a callback function). You can pass the
address of an existing C function (that you get with
see Low-Level C Interface Words), but if there is no appropriate C
function, you probably want to define the function as a Forth word.