Ruby
3.1.0dev(2021-09-10revisionb76ad15ed0da636161de0243c547ee1e6fc95681)
|
Go to the documentation of this file.
8 if (!RB_SYMBOL_P(
type)) {
10 if (!
NIL_P(type_string)) {
15 if (RB_SYMBOL_P(
type)) {
77 if (type_id == void_id) {
80 else if (type_id == voidp_id) {
83 else if (type_id == char_id) {
86 else if (type_id == short_id) {
89 else if (type_id == int_id) {
92 else if (type_id == long_id) {
96 else if (type_id == long_long_id) {
101 else if (type_id == int8_t_id) {
106 else if (type_id == int16_t_id) {
111 else if (type_id == int32_t_id) {
116 else if (type_id == int64_t_id) {
120 else if (type_id == float_id) {
123 else if (type_id == double_id) {
126 else if (type_id == variadic_id) {
129 else if (type_id == const_string_id) {
132 else if (type_id == size_t_id) {
135 else if (type_id == ssize_t_id) {
138 else if (type_id == ptrdiff_t_id) {
141 else if (type_id == intptr_t_id) {
144 else if (type_id == uintptr_t_id) {
148 type = original_type;
165 #define rb_ffi_type_of(t) (signed_p ? &ffi_type_s##t : &ffi_type_u##t)
169 return &ffi_type_void;
171 return &ffi_type_pointer;
185 return &ffi_type_float;
187 return &ffi_type_double;
189 return &ffi_type_pointer;
193 return &ffi_type_pointer;
237 dst->slong_long =
NUM2LL(*src);
239 case -TYPE_LONG_LONG:
240 dst->ulong_long =
NUM2ULL(*src);
302 return LL2NUM(retval.slong_long);
303 case -TYPE_LONG_LONG:
304 return ULL2NUM(retval.ulong_long);
VALUE rb_const_get(VALUE, ID)
VALUE generic_to_value(VALUE rettype, fiddle_generic retval)
ID rb_intern(const char *)
void value_to_generic(int type, VALUE src, fiddle_generic *dst)
VALUE rb_Integer(VALUE)
Equivalent to Kernel#Integer in Ruby.
void rb_raise(VALUE exc, const char *fmt,...)
VALUE rb_to_symbol(VALUE name)
ffi_type * int_to_ffi_type(int type)
#define RUBY_CONST_ID(var, str)
VALUE rb_check_string_type(VALUE)
char * rb_string_value_cstr(volatile VALUE *)
ffi_type * rb_fiddle_int_to_ffi_type(int type)
void rb_fiddle_value_to_generic(int type, VALUE *src, fiddle_generic *dst)
VALUE rb_to_int(VALUE)
Converts val into Integer.
VALUE rb_funcall(VALUE, ID, int,...)
Calls a method.
#define rb_ffi_type_of(t)
#define rb_str_new_cstr(str)
VALUE rb_fiddle_type_ensure(VALUE type)
#define TYPE_CONST_STRING
VALUE rb_fiddle_generic_to_value(VALUE rettype, fiddle_generic retval)
VALUE type(ANYARGS)
ANYARGS-ed function type.