/tutorial/cecil/creation_old/example.e

http://github.com/tybor/Liberty · Specman e · 31 lines · 18 code · 4 blank · 9 comment · 0 complexity · 06536f953c3f2a5946c0cd1180f6d116 MD5 · raw file

  1. class EXAMPLE
  2. --
  3. -- This example shows how to create Eiffel objects from C using a factory.
  4. -- It is now possible (and simpler) to directly create Eiffel objects from
  5. -- C, see the example called "creation".
  6. --
  7. -- To compile this example, use command:
  8. --
  9. -- se c -cecil cecil.se example c_prog.c
  10. --
  11. create {ANY}
  12. make
  13. feature {ANY}
  14. make
  15. local
  16. c_factory: C_FACTORY; string: STRING
  17. do
  18. create c_factory
  19. string := call_c_prog(c_factory)
  20. io.put_string(string)
  21. io.put_new_line
  22. end
  23. call_c_prog (c_factory: C_FACTORY): STRING
  24. external "C"
  25. alias "c_prog"
  26. end
  27. end -- class EXAMPLE