Wrapping Callback Functions
- Posted by Icy_Viking Oct 31, 2020
- 988 views
Hello all,
I need a little help. I'm wondering if this is how you wrap callback functions.
//C Code typedef void* (*NewtonAllocMemory) (int sizeInBytes); typedef void (*NewtonFreeMemory) (void* const ptr, int sizeInBytes);
--Is this correct? constant xNewtonAllocMemory = define_c_func(dll,"NewtonAllocMemry",{C_INT},C_POINTER) public function NewtonAllocMemory(integer size) return c_func(xNewtonAllocMemory,{size}) end function constant xNewtonFreeMemory = define_c_proc(dll,"NewtomFreeMemory",{C_POINTER,C_INT}) public procedure NewtonFreeMemory(atom ptr,integer size) c_proc(xNewtonFreeMemory,{ptr,size}) end procedure