parse_signature (C)

    # File lib/inline.rb, line 195
        def parse_signature(src, raw=false)

          sig = self.strip_comments(src)
          # strip preprocessor directives
          sig.gsub!(/^\s*\#.*(\\\n.*)*/, '')
          # strip {}s
          sig.gsub!(/\{[^\}]*\}/, '{ }')
          # clean and collapse whitespace
          sig.gsub!(/\s+/, ' ')

          unless defined? @types then
            @types = 'void|' + @type_map.keys.map{|x| Regexp.escape(x)}.join('|')
          end

          if /(#{@types})\s*(\w+)\s*\(([^)]*)\)/ =~ sig then
            return_type, function_name, arg_string = $1, $2, $3
            args = []
            arg_string.split(',').each do |arg|

              # helps normalize into 'char * varname' form
              arg = arg.gsub(/\s*\*\s*/, ' * ').strip

              if /(((#{@types})\s*\*?)+)\s+(\w+)\s*$/ =~ arg then
                args.push([$4, $1])
              elsif arg != "void" then
                warn "WAR\NING: '#{arg}' not understood"
              end
            end

            arity = args.size
            arity = MAGIC_ARITY if raw

            return {
              'return' => return_type,
              'name'   => function_name,
              'args'   => args,
              'arity'  => arity
            }
          end

          raise SyntaxError, "Can't parse signature: #{sig}"
        end