/usr/lib/ruby/vendor_ruby/cstruct/field.rb is in ruby-cstruct 1.0.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | class CStruct
class Field #:nodoc: all
attr_accessor:tag
attr_accessor:size
attr_accessor:offset
attr_accessor:sign
attr_accessor:dimension
def initialize(tag,size,offset,sign,dimension = nil,*args)
@tag = tag
@size = size
@offset = offset
@sign = sign
@dimension = dimension
@byte_size = size
if @dimension
@byte_size = @size * dimension.inject(1){|m,i| m*=i}
@sign = :struct_array if @sign == :struct
end
end
def byte_size
@byte_size
end
def is_float?
@sign == :float
end
def is_double?
@sign == :double
end
def is_struct?
@sign == :struct
end
def is_union?
@sign == :union
end
end
end
|