#include <ruby/ruby.h>
#include <ruby/io.h>
#include <ctype.h>
#include "dl.h"
Go to the source code of this file.
static void dlptr_free | ( | void * | ptr | ) | [static] |
Definition at line 27 of file cptr.c.
References ptr_data::free, and ptr_data::ptr.
void dlptr_init | ( | VALUE | val | ) |
Definition at line 50 of file cptr.c.
References OBJ_TAINT, and TypedData_Get_Struct.
Referenced by rb_dlptr_new2().
static size_t dlptr_memsize | ( | const void * | ptr | ) | [static] |
Definition at line 38 of file cptr.c.
References ptr_data::size.
static freefunc_t get_freefunc | ( | VALUE | func | ) | [inline, static] |
Definition at line 13 of file cptr.c.
References NIL_P, NUM2PTR, rb_dlcfunc_kind_p(), rb_Integer(), and RCFUNC_DATA.
Referenced by rb_dlptr_free_set(), rb_dlptr_initialize(), and rb_dlptr_s_malloc().
void Init_dlptr | ( | void | ) |
Definition at line 616 of file cptr.c.
References id_to_ptr, rb_cDLCPtr, rb_cObject, rb_define_alloc_func(), rb_define_class_under(), rb_define_const(), rb_define_method(), rb_define_singleton_method(), rb_dlptr_aref(), rb_dlptr_aset(), rb_dlptr_cmp(), rb_dlptr_eql(), rb_dlptr_free_get(), rb_dlptr_free_set(), rb_dlptr_initialize(), rb_dlptr_inspect(), rb_dlptr_minus(), rb_dlptr_new(), rb_dlptr_null_p(), rb_dlptr_plus(), rb_dlptr_ptr(), rb_dlptr_ref(), rb_dlptr_s_allocate(), rb_dlptr_s_malloc(), rb_dlptr_s_to_ptr(), rb_dlptr_size_get(), rb_dlptr_size_set(), rb_dlptr_to_i(), rb_dlptr_to_s(), rb_dlptr_to_str(), rb_dlptr_to_value(), rb_intern, and rb_mDL.
Referenced by Init_dl().
void* rb_dlptr2cptr | ( | VALUE | val | ) |
Definition at line 92 of file cptr.c.
References ptr_data::ptr, Qnil, rb_cDLCPtr, rb_eTypeError, rb_obj_is_kind_of(), rb_raise(), and TypedData_Get_Struct.
Referenced by rb_dlptr_aset(), rb_dlptr_cmp(), rb_dlptr_eql(), rb_dlptr_minus(), and rb_dlptr_plus().
Definition at line 485 of file cptr.c.
References INT2NUM(), len, NUM2ULONG, ptr_data::ptr, rb_bug(), rb_scan_args(), rb_tainted_str_new(), and RPTR_DATA.
Referenced by Init_dlptr().
Definition at line 517 of file cptr.c.
References len, NUM2PTR, NUM2UINT, NUM2ULONG, ptr_data::ptr, rb_bug(), rb_cDLCPtr, rb_dlptr2cptr(), rb_obj_is_kind_of(), rb_scan_args(), RPTR_DATA, StringValuePtr, T_STRING, and TYPE.
Referenced by Init_dlptr().
Definition at line 425 of file cptr.c.
References INT2FIX, INT2NUM(), rb_cDLCPtr, rb_dlptr2cptr(), rb_obj_is_kind_of(), and SIGNED_VALUE.
Referenced by Init_dlptr().
Definition at line 405 of file cptr.c.
References Qtrue, rb_cDLCPtr, rb_dlptr2cptr(), and rb_obj_is_kind_of().
Referenced by Init_dlptr().
Definition at line 303 of file cptr.c.
References CFUNC_CDECL, DLTYPE_VOID, ptr_data::free, rb_dlcfunc_new(), and TypedData_Get_Struct.
Referenced by Init_dlptr().
Definition at line 287 of file cptr.c.
References ptr_data::free, get_freefunc(), and TypedData_Get_Struct.
Referenced by Init_dlptr().
Definition at line 136 of file cptr.c.
References ptr_data::free, get_freefunc(), NUM2LONG(), NUM2PTR, ptr_data::ptr, rb_bug(), rb_Integer(), rb_scan_args(), ptr_data::size, size, and TypedData_Get_Struct.
Referenced by Init_dlptr().
Definition at line 385 of file cptr.c.
References CLASS_OF, ptr_data::free, ptr_data::ptr, rb_class2name(), rb_str_new2(), ptr_data::size, snprintf, and TypedData_Get_Struct.
Referenced by Init_dlptr().
VALUE rb_dlptr_malloc | ( | long | size, | |
freefunc_t | func | |||
) |
Definition at line 81 of file cptr.c.
References ptr_data::ptr, rb_dlptr_new(), rb_secure(), and ruby_xmalloc().
Referenced by rb_dlptr_s_malloc().
Definition at line 464 of file cptr.c.
References NUM2LONG(), ptr_data::ptr, rb_dlptr2cptr(), rb_dlptr_new(), RPTR_DATA, and size.
Referenced by Init_dlptr().
VALUE rb_dlptr_new | ( | void * | ptr, | |
long | size, | |||
freefunc_t | func | |||
) |
Definition at line 75 of file cptr.c.
References rb_cDLCPtr, and rb_dlptr_new2().
Referenced by Init_dlptr(), rb_dlptr_malloc(), rb_dlptr_minus(), rb_dlptr_plus(), rb_dlptr_ptr(), rb_dlptr_ref(), and rb_dlptr_s_to_ptr().
VALUE rb_dlptr_new2 | ( | VALUE | klass, | |
void * | ptr, | |||
long | size, | |||
freefunc_t | func | |||
) |
Definition at line 59 of file cptr.c.
References dlptr_init(), ptr_data::free, ptr_data::ptr, rb_secure(), ptr_data::size, and TypedData_Make_Struct.
Referenced by rb_dlptr_new().
Definition at line 273 of file cptr.c.
References ptr_data::ptr, Qfalse, and TypedData_Get_Struct.
Referenced by Init_dlptr().
Definition at line 446 of file cptr.c.
References NUM2LONG(), ptr_data::ptr, rb_dlptr2cptr(), rb_dlptr_new(), RPTR_DATA, and size.
Referenced by Init_dlptr().
Definition at line 244 of file cptr.c.
References ptr_data::ptr, rb_dlptr_new(), and TypedData_Get_Struct.
Referenced by Init_dlptr().
Definition at line 259 of file cptr.c.
References ptr_data::ptr, rb_dlptr_new(), and TypedData_Get_Struct.
Referenced by Init_dlptr().
Definition at line 112 of file cptr.c.
References ptr_data::free, ptr_data::ptr, rb_secure(), ptr_data::size, and TypedData_Make_Struct.
Referenced by Init_dlptr().
Definition at line 186 of file cptr.c.
References get_freefunc(), NUM2LONG(), rb_bug(), rb_dlptr_malloc(), rb_scan_args(), and size.
Referenced by Init_dlptr().
Definition at line 583 of file cptr.c.
References GetOpenFile, id_to_ptr, NULL, NUM2PTR, OBJ_INFECT, ptr_data::ptr, rb_cDLCPtr, rb_cIO, rb_cString, rb_dlptr_new(), rb_eDLError, rb_funcall(), rb_Integer(), rb_io_stdio_file(), rb_iv_set(), rb_obj_is_kind_of(), rb_raise(), rb_respond_to(), RSTRING_LEN, RTEST, and StringValuePtr.
Referenced by Init_dlptr().
Definition at line 557 of file cptr.c.
References NUM2LONG(), and RPTR_DATA.
Referenced by Init_dlptr().
Definition at line 216 of file cptr.c.
References ptr_data::ptr, PTR2NUM, and TypedData_Get_Struct.
Referenced by Init_dlptr().
Definition at line 323 of file cptr.c.
References len, NUM2INT, ptr_data::ptr, rb_bug(), rb_scan_args(), rb_tainted_str_new(), rb_tainted_str_new2(), and TypedData_Get_Struct.
Referenced by Init_dlptr().
Definition at line 356 of file cptr.c.
References len, NUM2INT, ptr_data::ptr, rb_bug(), rb_scan_args(), rb_tainted_str_new(), ptr_data::size, and TypedData_Get_Struct.
Referenced by Init_dlptr().
Definition at line 230 of file cptr.c.
References ptr_data::ptr, and TypedData_Get_Struct.
Referenced by Init_dlptr().
const rb_data_type_t dlptr_data_type [static] |
Definition at line 24 of file cptr.c.
Referenced by Init_dlptr(), and rb_dlptr_s_to_ptr().
Definition at line 10 of file cptr.c.
Referenced by Init_dlptr(), rb_dlptr2cptr(), rb_dlptr_aset(), rb_dlptr_cmp(), rb_dlptr_eql(), rb_dlptr_new(), and rb_dlptr_s_to_ptr().