2000-08-03 13:55:54 +04:00
|
|
|
#!./miniruby -s
|
|
|
|
|
|
|
|
SYM = {}
|
|
|
|
|
|
|
|
objs = ARGV.collect {|s| s.tr('/', '\\')}
|
|
|
|
IO.foreach("|dumpbin -symbols " + objs.join(' ')) do |l|
|
|
|
|
next if /^[0-9A-F]+ 0+ UNDEF / =~ l
|
|
|
|
next unless l.sub!(/.*\sExternal\s+\|\s+/, '')
|
|
|
|
if l.sub!(/^_/, '')
|
2002-03-26 08:08:56 +03:00
|
|
|
next if /@.*@/ =~ l || /@[0-9a-f]{16}$/ =~ l
|
2002-06-18 14:23:31 +04:00
|
|
|
elsif !l.sub!(/^(\S+) \([^@?\`\']*\)$/, '\1')
|
2000-08-03 13:55:54 +04:00
|
|
|
next
|
|
|
|
end
|
|
|
|
SYM[l.strip] = true
|
|
|
|
end
|
|
|
|
|
|
|
|
exports = []
|
|
|
|
if $name
|
|
|
|
exports << "Name " + $name
|
|
|
|
elsif $library
|
|
|
|
exports << "Library " + $library
|
|
|
|
end
|
|
|
|
exports << "Description " + $description.dump if $description
|
|
|
|
exports << "EXPORTS" << SYM.keys.sort
|
|
|
|
|
|
|
|
if $output
|
2001-10-30 12:23:14 +03:00
|
|
|
open($output, 'w') {|f| f.puts exports.join("\n")}
|
2000-08-03 13:55:54 +04:00
|
|
|
else
|
2001-10-30 12:23:14 +03:00
|
|
|
puts exports.join("\n")
|
2000-08-03 13:55:54 +04:00
|
|
|
end
|