Use another language to call a function: Difference between revisions
Use another language to call a function (view source)
Revision as of 17:16, 22 August 2016
, 7 years ago→{{header|Phix}}
Line 808:
=={{header|Pascal}}==
See [[Use_another_language_to_call_a_function#Delphi | Delphi]]
=={{header|Phix}}==
The following code declares a callback for the C code (which I'd expect to be in a .dll or .so) to invoke.<br>
A 32-bit-only or a 64-bit-only version would of course be slightly shorter.
<lang Phix>constant Here_am_I = "Here am I"
function Query(atom pData, atom pLength)
integer len = peekNS(pLength,machine_word(),0)
if poke_string(pData,len,Here_am_I) then
return 0
end if
pokeN(pLength,length(Here_am_I)+1,machine_word())
return 1
end function
constant Query_cb = call_back(routine_id("Query"))</lang>
=={{header|PicoLisp}}==
|