4 $:.unshift File.dirname(__FILE__)
9 "args[#{i}].#{DLTYPE[x][:stmem]}"
12 def output_args(types)
14 types[1..-1].each_with_index{|x,i| t.push(output_arg(x,i))}
18 def output_callfunc(types)
20 stmem = DLTYPE[t][:stmem]
21 ctypes = types2ctypes(types)
23 callstm = "(*f)(#{output_args(types)})"
25 callstm = "ret.#{stmem} = (*f)(#{output_args(types)})"
28 "#{ctypes[0]} (*f)(#{ctypes[1..-1].join(',')}) = func;",
33 def output_case(types)
34 num = types2num(types)
35 callfunc_stm = output_callfunc(types)
39 printf("#{callfunc_stm}\\n");
46 def rec_output(types = [VOID])
47 print output_case(types)
48 if( types.length <= MAX_ARG )
49 DLTYPE.keys.sort.each{|t|
50 if( t != VOID && DLTYPE[t][:sym] )
51 rec_output(types + [t])
57 DLTYPE.keys.sort.each{|t|
59 $stderr.printf(" #{DLTYPE[t][:ctype]}\n")