Brijesh
Brijesh

Reputation: 27

The Ruby Fiddle Module has a bunch of constants to represent C data types (eg Fiddle::TYPE_INT == 4), but how do you represent pointer datatypes?

The Ruby doc for Fiddle only has Fiddle::TYPE_VOIDP for representing C pointer data types, but nothing for char* or int* or unsigned int*. How do you represent these data types in Fiddle?

Upvotes: 0

Views: 41

Answers (1)

engineersmnky
engineersmnky

Reputation: 29318

I am not sure what you mean by:

"The Ruby doc for Fiddle only has Fiddle::TYPE_VOIDP"

Here are the Docs for Fiddle::Types which definitely include CHAR, INT, UINT, etc.; and

Here is where they are defined as TYPE_[NAME] constants.

module Fiddle
#...
  Fiddle::Types.constants.each do |type|
    const_set "TYPE_#{type}", Fiddle::Types.const_get(type)
  end
end 

Upvotes: 0

Related Questions