Module: RubyHToGo::TypeHelper

Included in:
ArgumentDefinition, TyperefDefinition
Defined in:
_tools/ruby_h_to_go/lib/ruby_h_to_go/type_helper.rb

Overview

type attribute helper

Instance Method Summary collapse

Instance Method Details

#cast_to_cgo_typeString

Cast C type to cgo type. (Used in wrapper function)

Returns:

  • (String)


16
17
18
# File '_tools/ruby_h_to_go/lib/ruby_h_to_go/type_helper.rb', line 16

def cast_to_cgo_type
  GoUtil.cast_to_cgo_type(type)
end

#ruby_c_type_to_go_type(pos: nil, pointer: nil, pointer_length: 0) ⇒ String

Parameters:

  • pos (Symbol, nil) (defaults to: nil)

    :arg, :typeref, :return

  • pointer (Symbol, nil) (defaults to: nil)

    pointer hint (:ref, :array, :ref_array, :function, :sref, :str_array, :in_ref, :raw)

  • pointer_length (Integer) (defaults to: 0)

Returns:

  • (String)


10
11
12
# File '_tools/ruby_h_to_go/lib/ruby_h_to_go/type_helper.rb', line 10

def ruby_c_type_to_go_type(pos: nil, pointer: nil, pointer_length: 0)
  GoUtil.ruby_c_type_to_go_type(type, pos:, pointer:, pointer_length:)
end