functions_in_evas_h.rb 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/usr/bin/env ruby
  2. require File.dirname(__FILE__) + "/../lib/rtruckboris"
  3. evas = "/usr/include/evas-1/Evas.h"
  4. headerPaths = `pkg-config --cflags evas`.gsub("-I","").split(" ")
  5. #get gcc include if needed
  6. #gccLibBase='/usr/lib/gcc/' << `llvm-config --host-target`.chomp << "/*"
  7. #gccLib = Dir.glob(gccLibBase ).sort.last + "/include"
  8. #headerPaths << gccLib
  9. parser = Rtruckboris::HeaderParser.new(evas, headerPaths)
  10. parser.parse
  11. structures = parser.structures()
  12. puts "Structures number : #{structures.size}"
  13. structures.each do |s|
  14. puts "Structure Name : #{s.name}"
  15. # puts "\thas name for linkage ? #{s.hasNameForLinkage}"
  16. # puts "\thas linkage ? #{s.hasLinkage}"
  17. # puts "\ttypedef name: #{s.typedefName}"
  18. # fields = s.getFields
  19. # puts "\tfield number: #{fields.size}"
  20. # fields.each do |f|
  21. # puts "\t\t #{f.type.name} #{f.name}"
  22. # end
  23. end
  24. functions = parser.functions()
  25. puts "Functions number : #{functions.size}"
  26. functions.each do |f|
  27. puts "Name : #{f.name}"
  28. puts "Return : #{f.return_type.name}"
  29. params = f.parameters
  30. puts "\t #{params.size.to_s} parameters :"
  31. params.each do |p|
  32. puts "\t\t#{p.type.name} #{p.name}"
  33. end
  34. end