def initialize(mod)
raise ArgumentError, "Class/Module arg is required" unless Module === mod
stack = caller
meth = stack.shift until meth =~ /in .(inline|test_|setup)/ or stack.empty?
raise "Couldn't discover caller" if stack.empty?
real_caller = stack.first
real_caller = stack[3] if real_caller =~ /\(eval\)/
real_caller =~ /(.*):(\d+)/
real_caller = $1
@rb_file = File.expand_path real_caller
@mod = mod
@src = []
@inc = []
@sig = {}
@flags = []
@libs = []
@init_extra = []
@include_ruby_first = true
@inherited_methods = {}
@struct_name = nil
@type_map = TYPE_MAP.dup
end