Wrapping Callback Functions

new topic     » topic index » view thread      » older message » newer message

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 
new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu