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

  1. class EXAMPLE
  2.    --
  3.    -- The Eiffel program is running first, then call the C program
  4.    -- which is in charge to print the contents of `animals' using
  5.    -- `lower'/`upper'/`item' of ARRAY[ANIMAL].
  6.    --
  7.    -- To compile this example, use command :
  8.    --
  9.    --         compile -cecil cecil.se example c_prog.c
  10.    --
  11.  
  12. creation make
  13.  
  14. feature
  15.  
  16.    make is
  17.       local
  18.          cat: CAT;
  19.          dog: DOG;
  20.       do
  21.          !!cat;
  22.          !!dog;
  23.          animals := <<cat,dog,cat>>;
  24.          call_c_prog(animals);
  25.       end;
  26.  
  27. feature {NONE}
  28.  
  29.    animals: ARRAY[ANIMAL];
  30.  
  31.    call_c_prog(a: like animals) is
  32.       external "C_WithoutCurrent"
  33.       alias "c_prog"
  34.       end;
  35.  
  36. end -- EXAMPLE
  37.