[Gridflow-cvs] [svn] commit: r5116 - in /trunk/src: MacErrors2.i MacErrorsCollect.rb

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Mon Mar 15 15:57:45 EDT 2010


Author: matju
Date: Mon Mar 15 15:57:45 2010
New Revision: 5116

Log:
generate .i file from Apple's .h; use undefined macro OSERR; remove duplicates (take only first)

Added:
    trunk/src/MacErrors2.i
Modified:
    trunk/src/MacErrorsCollect.rb

Modified: trunk/src/MacErrorsCollect.rb
==============================================================================
--- trunk/src/MacErrorsCollect.rb (original)
+++ trunk/src/MacErrorsCollect.rb Mon Mar 15 15:57:45 2010
@@ -2,10 +2,19 @@
 
 pattern = %r{\s*(\w+)\s*=\s*(-\d+),\s+/\*\s*(.*)\s*\*/}
 
-File.open("MacErrors.h") {|f|
-  f.each {|line|
-    if m = pattern.match(line)
-      puts "erreur \# #{m[2]} est #{m[1]} : « #{m[3]} »"
+f = File.open("MacErrors.h")
+g = File.open("MacErrors2.i","w")
+g.puts "// automatically made from a headerfile copyrighted by Apple."
+
+table = {}
+
+f.each {|line|
+  if m = pattern.match(line)
+    if table[m[2]] then
+      puts "#{m[2]} est en double"
+    else
+      g.puts "OSERR(#{m[2]},\"#{m[1]}\",\"#{m[3]}\")"
+      table[m[2]] = [m[1],m[3]]
     end
-  }
+  end
 }



More information about the Gridflow-cvs mailing list