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

/tutorial/cecil/etl/c_prog.c

http://github.com/tybor/Liberty
C | 23 lines | 16 code | 7 blank | 0 comment | 0 complexity | 6da68b9335ffdf0a4126dd1257c7121a MD5 | raw file
 1#include "eiffel.h"
 2
 3static EIF_OBJ c_side_memory;
 4
 5void send_factory_to_c(EIF_OBJ example) {
 6  c_side_memory = EXAMPLE_new_string(example, "foo\n");
 7}
 8
 9EIF_OBJ string_back_to_eiffel(void) {
10  return c_side_memory;
11}
12
13#define eif_adopt(x) (EIF_STUFF_eif_adopt(0,(x)))
14
15void call_eif_adopt_from_c(void) {
16  eif_adopt(c_side_memory);
17}
18
19#define eif_wean(x) (EIF_STUFF_eif_wean(0,(x)))
20
21void call_eif_wean_from_c(void) {
22  eif_wean(c_side_memory);
23}