home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / lib_show / cecil / example7 / example.e < prev    next >
Encoding:
Text File  |  1999-06-05  |  1.0 KB  |  37 lines

  1. class EXAMPLE
  2.    --
  3.    -- This example shows how to start execution from outside (external
  4.    -- C code starts the execution before calling Eiffel code).
  5.    --
  6.    -- Obviously, external C code must provide the C main function.
  7.    -- In order to avoid double definition of the main function, one
  8.    -- must use option -no_main of command `compile_to_c'.
  9.    -- In such a case, the Eiffel root object is accessible only via
  10.    -- the predefined C variable `eiffel_root_object'.
  11.    --
  12.    -- One must also keep in mind that some internal Eiffel runtime
  13.    -- information have to be initialized before calling any Eiffel
  14.    -- feature. Thus, before the first Eiffel call, the external C code
  15.    -- have to call C function `initialize_eiffel_runtime(argc,argv)'.
  16.    --
  17.    --
  18.    -- To compile this example, use command :
  19.    --
  20.    --         compile -no_main -cecil cecil.se example c_prog.c
  21.    --
  22.  
  23. creation make
  24.  
  25. feature
  26.  
  27.    make is
  28.       do
  29.       end;
  30.  
  31.    do_it is
  32.       do
  33.          io.put_string("Hi from Eiffel world.%N");
  34.       end;
  35.  
  36. end -- EXAMPLE
  37.