added support for callbacks in some C functions

(callbacks are still inoperable, however)