node/lib/metasm/metasm/parse_c.rb
def compare_deep(o, seen = [])
			return true if o.object_id == self.object_id
			return if o.class != self.class or o.name != self.name or o.attributes != self.attributes
			o.members.to_a.zip(self.members.to_a).each { |om, sm|
				return if om.name != sm.name
				return if om.type != sm.type
				if om.type.pointer?
					ot = om.type
					st = sm.type
					500.times {	# limit for selfpointers (shouldnt happen)
						break if not ot.pointer?
						ot = ot.pointed.untypedef
						st = st.pointed.untypedef
					}
					if ot.kind_of?(C::Union) and ot.name and not seen.include?(ot)
						return if not st.compare_deep(ot, seen+[ot])
					end
				end
			}
			true
		end
# compare to another structure, comparing members recursively (names and type)
# returns true if the self is same as o
compare to another structure, comparing members recursively (names and type)
returns true if the self is same as o
compare to another structure comparing members recursively ( names and type ) returns true if the self is same as o
def compare_deep(o, seen = [])
			return true if o.object_id == self.object_id
			return if o.class != self.class or o.name != self.name or o.attributes != self.attributes
			o.members.to_a.zip(self.members.to_a).each { |om, sm|
				return if om.name != sm.name
				return if om.type != sm.type
				if om.type.pointer?
					ot = om.type
					st = sm.type
					500.times {	
						break if not ot.pointer?
						ot = ot.pointed.untypedef
						st = st.pointed.untypedef
					}
					if ot.kind_of?(C::Union) and ot.name and not seen.include?(ot)
						return if not st.compare_deep(ot, seen+[ot])
					end
				end
			}
			true
		end
def compare_deep ( o , seen = [ ] ) return true if o . object_id == self . object_id return if o . class != self . class or o . name != self . name or o . attributes != self . attributes o . members . to_a . zip ( self . members . to_a ) . each { | om , sm | return if om . name != sm . name return if om . type != sm . type if om . type . pointer? ot = om . type st = sm . type 500 . times { break if not ot . pointer? ot = ot . pointed . untypedef st = st . pointed . untypedef } if ot . kind_of? ( C :: Union ) and ot . name and not seen . include? ( ot ) return if not st . compare_deep ( ot , seen + [ ot ] ) end end } true end
compare to another structure, comparing members recursively (names and type)
returns true if the self is same as o
compare to another structure comparing members recursively ( names and type ) returns true if the self is same as o
# limit for selfpointers (shouldnt happen)
o
seen