Next: , Previous: Declaring OS-level libraries, Up: C Interface

5.25.6 Callbacks

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 lib-sym, 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.