Ruby  2.5.0dev(2017-10-22revision60238)
Data Structures | Macros | Functions
conversions.h File Reference
#include <fiddle.h>

Go to the source code of this file.

Data Structures

union  fiddle_generic
 

Macros

#define VALUE2GENERIC(_type, _src, _dst)   value_to_generic((_type), (_src), (_dst))
 
#define INT2FFI_TYPE(_type)   int_to_ffi_type(_type)
 
#define GENERIC2VALUE(_type, _retval)   generic_to_value((_type), (_retval))
 
#define PTR2NUM(x)   (LONG2NUM((long)(x)))
 
#define NUM2PTR(x)   ((void*)(NUM2ULONG(x)))
 

Functions

ffi_type * int_to_ffi_type (int type)
 
void value_to_generic (int type, VALUE src, fiddle_generic *dst)
 
VALUE generic_to_value (VALUE rettype, fiddle_generic retval)
 

Macro Definition Documentation

◆ GENERIC2VALUE

#define GENERIC2VALUE (   _type,
  _retval 
)    generic_to_value((_type), (_retval))

Definition at line 33 of file conversions.h.

◆ INT2FFI_TYPE

#define INT2FFI_TYPE (   _type)    int_to_ffi_type(_type)

Definition at line 32 of file conversions.h.

◆ NUM2PTR

#define NUM2PTR (   x)    ((void*)(NUM2ULONG(x)))

Definition at line 37 of file conversions.h.

Referenced by rb_fiddle_free(), rb_fiddle_ptr2value(), and value_to_generic().

◆ PTR2NUM

#define PTR2NUM (   x)    (LONG2NUM((long)(x)))

Definition at line 36 of file conversions.h.

Referenced by generic_to_value(), and Init_fiddle().

◆ VALUE2GENERIC

#define VALUE2GENERIC (   _type,
  _src,
  _dst 
)    value_to_generic((_type), (_src), (_dst))

Definition at line 31 of file conversions.h.

Function Documentation

◆ generic_to_value()

VALUE generic_to_value ( VALUE  rettype,
fiddle_generic  retval 
)

◆ int_to_ffi_type()

ffi_type* int_to_ffi_type ( int  type)

◆ value_to_generic()

void value_to_generic ( int  type,
VALUE  src,
fiddle_generic dst 
)