#!/usr/bin/ruby # display include files cmd = "grep include[^d] " + ARGV[0] system cmd print "\n" # display macros cmd = "grep define[^d] " + ARGV[0] system cmd # display types and functions line_once = true cmd = "gcc -E " + ARGV[0] p_in = IO.popen(cmd, "r") while ( line = p_in.gets ) case line when /^#/ when /[\S]/ puts line line_once = true else if line_once == true puts line line_once = false end end end p_in.close