| Path: | dl/mkcall.rb |
| Last Update: | Sun Jun 01 17:53:14 -0500 2008 |
-*- ruby -*-
# File dl/mkcall.rb, line 12 def output_args(types) t = [] types[1..-1].each_with_index{|x,i| t.push(output_arg(x,i))} t.join(",") end
# File dl/mkcall.rb, line 18 def output_callfunc(types) t = types[0] stmem = DLTYPE[t][:stmem] ctypes = types2ctypes(types) if( t == VOID ) callstm = "(*f)(#{output_args(types)})" else callstm = "ret.#{stmem} = (*f)(#{output_args(types)})" end [ "{", "#{ctypes[0]} (*f)(#{ctypes[1..-1].join(',')}) = func;", "#{callstm};", "}"].join(" ") end
# File dl/mkcall.rb, line 33 def output_case(types) num = types2num(types) callfunc_stm = output_callfunc(types) " case \#{num}:\n#ifdef DEBUG\n printf(\"\#{callfunc_stm}\\\\n\");\n#endif\n \#{callfunc_stm};\n break;\n" end
ruby-doc.org is a service of James Britt and Happy Camper Studios, a Ruby application development company in Phoenix, AZ.
Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.
For more information on the Ruby programming language, visit ruby-lang.org.
Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.