ext/aix_mksym.rb


DEFINITIONS

This source file includes following functions.


   1  
   2  def uniq(data)
   3    last=nil
   4    data.delete_if do |name|
   5      if last == name
   6        TRUE
   7      else
   8        last = name
   9        FALSE
  10      end
  11    end
  12  end
  13  
  14  def extract(nm, out)
  15    data = nm.readlines.collect{|line|
  16      line = line.split
  17      case line[1]
  18      when "B", "D"
  19        line[0]
  20      else
  21        next
  22      end
  23    }.compact!.sort!
  24    uniq(data)
  25    exp = open(out, "w")
  26    exp.printf "#!\n"
  27    for line in data
  28      exp.printf "%s\n", line
  29    end
  30    exp.close
  31    nm.close
  32  end
  33  extract(open("|/usr/ccs/bin/nm -p ../libruby.a"), "../ruby.imp")