class FFI::Struct

def array_layout(builder, spec)

Returns:
  • (builder) -

Parameters:
  • spec (Array) --
  • builder (StructLayoutBuilder) --
def array_layout(builder, spec)
  i = 0
  while i < spec.size
    name, type = spec[i, 2]
    i += 2
    # If the next param is a Integer, it specifies the offset
    if spec[i].kind_of?(Integer)
      offset = spec[i]
      i += 1
    else
      offset = nil
    end
    builder.add name, find_field_type(type), offset
  end
end