Re: Quick question

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

I think this does what Pete wanted:

include std/dll.e   
include std/machine.e 
 
atom signed_buffer = allocate( 4 ) 
 
function f( atom i )  
    poke4( signed_buffer, i )	 
    printf( 1, "i = %d (#%08x)\n", peek4s( signed_buffer ) )  
    return 0  
end function  
  
constant r_f  = routine_id( "f")  
printf( 1, "r_f = %d\n", {r_f} )  
  
constant cb_f = call_back( r_f )  
printf( 1, "cb_f = #%08x\n", {cb_f} )  
  
constant c_f = define_c_func( {}, cb_f, {C_INT}, E_INTEGER )  
printf( 1, "c_f = %d\n", {c_f} )  
  
? c_func( c_f, {-1} )  
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu