Re: Calling call_back addresses

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

Why is this in the Code Golf thread?

SDPringle said...

I would like to call a call back address from EUPHORIA to simulate a call from C.

So, suppose I have a function like:

function five()  
  return 5 
end function 
 
atom five_cb = call_back("five") 

How do I call five using five_cb?

Shawn

include std/machine.e 
include std/dll.e 
 
function five() 
return 5 
end function 
 
atom five_cb = call_back(routine_id("five")) 
 
integer cb = define_c_func("", {'+', five_cb}, {}, C_INT) 
 
? c_func(cb, {}) 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu