node/lib/metasm/metasm/parse_c.rb
def bitoffsetof(parser, name)
			raise parser, 'undefined structure' if not members
			update_member_cache(parser) if not fldlist
			return @fldbitoffset[name] if fldbitoffset and @fldbitoffset[name]
			return @fldbitoffset[name.name] if fldbitoffset and name.respond_to?(:name) and @fldbitoffset[name.name]
			return if @fldlist[name] or @members.include?(name)
			raise parser, 'undefined union' if not @members
			raise parser, 'unknown union member' if not findmember(name)

			@members.find { |m|
				m.type.untypedef.kind_of?(Union) and m.type.untypedef.findmember(name)
			}.type.untypedef.bitoffsetof(parser, name)
		end
# returns the [bitoffset, bitlength] of the field if it is a bitfield
# this should be added to the offsetof(field)
returns the [bitoffset, bitlength] of the field if it is a bitfield
this should be added to the offsetof(field)
returns the [ bitoffset bitlength ] of the field if it is a bitfield this should be added to the offsetof ( field )
def bitoffsetof(parser, name)
			raise parser, 'undefined structure' if not members
			update_member_cache(parser) if not fldlist
			return @fldbitoffset[name] if fldbitoffset and @fldbitoffset[name]
			return @fldbitoffset[name.name] if fldbitoffset and name.respond_to?(:name) and @fldbitoffset[name.name]
			return if @fldlist[name] or @members.include?(name)
			raise parser, 'undefined union' if not @members
			raise parser, 'unknown union member' if not findmember(name)
			@members.find { |m|
				m.type.untypedef.kind_of?(Union) and m.type.untypedef.findmember(name)
			}.type.untypedef.bitoffsetof(parser, name)
		end
def bitoffsetof ( parser , name ) raise parser , 'undefined structure' if not members update_member_cache ( parser ) if not fldlist return @fldbitoffset [ name ] if fldbitoffset and @fldbitoffset [ name ] return @fldbitoffset [ name . name ] if fldbitoffset and name . respond_to? ( :name ) and @fldbitoffset [ name . name ] return if @fldlist [ name ] or @members . include? ( name ) raise parser , 'undefined union' if not @members raise parser , 'unknown union member' if not findmember ( name ) @members . find { | m | m . type . untypedef . kind_of? ( Union ) and m . type . untypedef . findmember ( name ) } . type . untypedef . bitoffsetof ( parser , name ) end
returns the [bitoffset, bitlength] of the field if it is a bitfield
this should be added to the offsetof(field)
returns the [ bitoffset bitlength ] of the field if it is a bitfield this should be added to the offsetof ( field )
parser
name