/tutorial/cecil/eiffel_root/example.e
Specman e | 34 lines | 19 code | 5 blank | 10 comment | 0 complexity | be8dce20385e72a17d0135c8963a1b21 MD5 | raw file
1class EXAMPLE 2 -- 3 -- The Eiffel program is running first, then calls the C program which is in charge of calling the 4 -- Eiffel feature `show_values'. 5 -- Note that the Eiffel root object is not passed to the C world. Thus, the C code uses 6 -- predefined `eiffel_root_object' to access the very first created Eiffel object. 7 -- 8 -- To compile this example, use command: 9 -- 10 -- se c -cecil cecil.se example c_prog.c 11 -- 12 13create {ANY} 14 make 15 16feature {ANY} 17 make 18 do 19 do_it 20 call_c_prog 21 end 22 23 do_it 24 do 25 io.put_string("Hi from Eiffel world.%N") 26 end 27 28feature {} 29 call_c_prog 30 external "C" 31 alias "c_prog" 32 end 33 34end -- class EXAMPLE