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

/tutorial/plugin/mini_gtk/gtk_initialiser.e

http://github.com/tybor/Liberty
Specman e | 51 lines | 46 code | 5 blank | 0 comment | 0 complexity | d2b7c29e5e3a37222b40fa53932faf87 MD5 | raw file
 1expanded class GTK_INITIALISER
 2
 3insert
 4	GTK_ARGUMENTS
 5
 6creation {} -- for Cecil
 7	init_from_c
 8
 9feature {}
10	init_from_c is
11		local
12			argc, i: INTEGER
13			argv: NATIVE_ARRAY[POINTER]
14			s: STRING
15			p: POINTER
16		do
17			argc := command_arguments.count
18			argv := argv.calloc(argc)
19			from
20				i := argc - 1
21			until
22				i < 0
23			loop
24				s := command_arguments.item(i)
25				argv.put(s.to_external, i)
26				i := i - 1
27			end
28			argc := gtk_init(argc, argv.to_external)
29			command_arguments.resize(argc)
30			from
31				i := argc - 1
32			until
33				i < 0
34			loop
35				p := argv.item(i)
36				create s.from_external_copy(p)
37				command_arguments.put(s, i)
38				i := i - 1
39			end
40		end
41
42	gtk_init (argc: INTEGER; argv: POINTER): INTEGER is
43		external "plug_in"
44		alias "{
45			location: "."
46			module_name: "plugin"
47			feature_name: "mini_gtk_init"
48			}"
49		end
50
51end -- class GTK_INITIALISER