lib/ffi/clang/translation_unit.rb in ffi-clang-0.1.3 vs lib/ffi/clang/translation_unit.rb in ffi-clang-0.2.0

- old
+ new

@@ -23,12 +23,13 @@ require 'ffi/clang/cursor' module FFI module Clang class TranslationUnit < AutoPointer - def initialize(pointer) + def initialize(pointer, index) super pointer + @index = index end def self.release(pointer) Lib.dispose_translation_unit(pointer) end @@ -40,10 +41,10 @@ Diagnostic.new(self, Lib.get_diagnostic(self, i)) end end def cursor - Cursor.new(Lib.get_translation_unit_cursor(self)) + Cursor.new(Lib.get_translation_unit_cursor(self), self) end end end end