PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/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
 1class 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
12create {ANY}
13   make
14
15feature {ANY}
16   make
17      local
18         c_factory: C_FACTORY; string: STRING
19      do
20         create c_factory
21         string := call_c_prog(c_factory)
22         io.put_string(string)
23         io.put_new_line
24      end
25
26   call_c_prog (c_factory: C_FACTORY): STRING
27      external "C"
28      alias "c_prog"
29      end
30
31end -- class EXAMPLE