Re: Quick question
- Posted by mattlewis (admin) Sep 17, 2014
- 1626 views
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} )