parse_struct_signature(signature, tymap=nil)
public
# File ext/fiddle/lib/fiddle/cparser.rb, line 35
def parse_struct_signature(signature, tymap=nil)
if signature.is_a?(String)
signature = split_arguments(signature, /[,;]/)
end
mems = []
tys = []
signature.each{|msig|
msig = compact(msig)
case msig
when /^[\w\*\s]+[\*\s](\w+)$/
mems.push($1)
tys.push(parse_ctype(msig, tymap))
when /^[\w\*\s]+\(\*(\w+)\)\(.*?\)$/
mems.push($1)
tys.push(parse_ctype(msig, tymap))
when /^([\w\*\s]+[\*\s])(\w+)\[(\d+)\]$/
mems.push($2)
tys.push([parse_ctype($1.strip, tymap), $3.to_i])
when /^([\w\*\s]+)\[(\d+)\](\w+)$/
mems.push($3)
tys.push([parse_ctype($1.strip, tymap), $2.to_i])
else
raise(RuntimeError,"can't parse the struct member: #{msig}")
end
}
return tys, mems
end