Ruby
2.0.0p648(2015-12-16revision53162)
|
#include <ruby.h>
Go to the source code of this file.
Data Structures | |
struct | dl_handle |
struct | cfunc_data |
struct | ptr_data |
Typedefs | |
typedef void(* | freefunc_t) (void *) |
Functions | |
VALUE | rb_dlcfunc_new (void(*func)(), int dltype, const char *name, ID calltype) |
int | rb_dlcfunc_kind_p (VALUE func) |
VALUE | rb_dlptr_new (void *ptr, long size, freefunc_t func) |
VALUE | rb_dlptr_new2 (VALUE klass, void *ptr, long size, freefunc_t func) |
VALUE | rb_dlptr_malloc (long size, freefunc_t func) |
Variables | |
VALUE | rb_mDL |
VALUE | rb_cDLHandle |
VALUE | rb_cDLSymbol |
VALUE | rb_eDLError |
VALUE | rb_eDLTypeError |
ID | rbdl_id_cdecl |
ID | rbdl_id_stdcall |
#define ALIGN_CHAR ALIGN_OF(char) |
Definition at line 141 of file dl.h.
Referenced by Init_dl(), and Init_fiddle().
#define ALIGN_DOUBLE ALIGN_OF(double) |
Definition at line 148 of file dl.h.
Referenced by Init_dl(), and Init_fiddle().
#define ALIGN_FLOAT ALIGN_OF(float) |
Definition at line 147 of file dl.h.
Referenced by Init_dl(), and Init_fiddle().
#define ALIGN_INT ALIGN_OF(int) |
Definition at line 142 of file dl.h.
Referenced by Init_dl(), and Init_fiddle().
#define ALIGN_LONG ALIGN_OF(long) |
Definition at line 143 of file dl.h.
Referenced by Init_dl(), and Init_fiddle().
Definition at line 137 of file dl.h.
Referenced by Init_dl(), and Init_fiddle().
#define ALIGN_SHORT ALIGN_OF(short) |
Definition at line 140 of file dl.h.
Referenced by Init_dl(), and Init_fiddle().
#define ALIGN_VOIDP ALIGN_OF(void*) |
Definition at line 139 of file dl.h.
Referenced by Init_dl(), and Init_fiddle().
#define CFUNC_CDECL (rbdl_id_cdecl) |
Definition at line 197 of file dl.h.
Referenced by rb_dlcfunc_call(), rb_dlcfunc_initialize(), rb_dlcfunc_s_allocate(), and rb_dlptr_free_get().
#define CFUNC_STDCALL (rbdl_id_stdcall) |
Definition at line 198 of file dl.h.
Referenced by rb_dlcfunc_call().
#define DLALIGN | ( | ptr, | |
offset, | |||
align | |||
) | ((offset) += ((align) - ((uintptr_t)((char *)(ptr) + (offset))) % (align)) % (align)) |
#define DLSTACK_ARGS | ( | stack | ) |
#define DLSTACK_ARGS10 | ( | stack | ) | DLSTACK_ARGS9(stack), (stack)[9] |
#define DLSTACK_ARGS11 | ( | stack | ) | DLSTACK_ARGS10(stack), (stack)[10] |
#define DLSTACK_ARGS12 | ( | stack | ) | DLSTACK_ARGS11(stack), (stack)[11] |
#define DLSTACK_ARGS13 | ( | stack | ) | DLSTACK_ARGS12(stack), (stack)[12] |
#define DLSTACK_ARGS14 | ( | stack | ) | DLSTACK_ARGS13(stack), (stack)[13] |
#define DLSTACK_ARGS15 | ( | stack | ) | DLSTACK_ARGS14(stack), (stack)[14] |
#define DLSTACK_ARGS16 | ( | stack | ) | DLSTACK_ARGS15(stack), (stack)[15] |
#define DLSTACK_ARGS17 | ( | stack | ) | DLSTACK_ARGS16(stack), (stack)[16] |
#define DLSTACK_ARGS18 | ( | stack | ) | DLSTACK_ARGS17(stack), (stack)[17] |
#define DLSTACK_ARGS19 | ( | stack | ) | DLSTACK_ARGS18(stack), (stack)[18] |
#define DLSTACK_ARGS2 | ( | stack | ) | DLSTACK_ARGS1(stack), (stack)[1] |
#define DLSTACK_ARGS20 | ( | stack | ) | DLSTACK_ARGS19(stack), (stack)[19] |
#define DLSTACK_ARGS3 | ( | stack | ) | DLSTACK_ARGS2(stack), (stack)[2] |
#define DLSTACK_ARGS4 | ( | stack | ) | DLSTACK_ARGS3(stack), (stack)[3] |
#define DLSTACK_ARGS5 | ( | stack | ) | DLSTACK_ARGS4(stack), (stack)[4] |
#define DLSTACK_ARGS6 | ( | stack | ) | DLSTACK_ARGS5(stack), (stack)[5] |
#define DLSTACK_ARGS7 | ( | stack | ) | DLSTACK_ARGS6(stack), (stack)[6] |
#define DLSTACK_ARGS8 | ( | stack | ) | DLSTACK_ARGS7(stack), (stack)[7] |
#define DLSTACK_ARGS9 | ( | stack | ) | DLSTACK_ARGS8(stack), (stack)[8] |
#define DLSTACK_PROTO |
#define DLSTACK_PROTO1 DLSTACK_PROTO1_, ... |
#define DLSTACK_PROTO10 DLSTACK_PROTO10_, ... |
#define DLSTACK_PROTO10_ DLSTACK_PROTO9_, DLSTACK_TYPE |
#define DLSTACK_PROTO11 DLSTACK_PROTO11_, ... |
#define DLSTACK_PROTO11_ DLSTACK_PROTO10_, DLSTACK_TYPE |
#define DLSTACK_PROTO12 DLSTACK_PROTO12_, ... |
#define DLSTACK_PROTO12_ DLSTACK_PROTO11_, DLSTACK_TYPE |
#define DLSTACK_PROTO13 DLSTACK_PROTO13_, ... |
#define DLSTACK_PROTO13_ DLSTACK_PROTO12_, DLSTACK_TYPE |
#define DLSTACK_PROTO14 DLSTACK_PROTO14_, ... |
#define DLSTACK_PROTO14 DLSTACK_PROTO14_, ... |
#define DLSTACK_PROTO14_ DLSTACK_PROTO13_, DLSTACK_TYPE |
#define DLSTACK_PROTO14_ DLSTACK_PROTO13_, DLSTACK_TYPE |
#define DLSTACK_PROTO15 DLSTACK_PROTO15_, ... |
#define DLSTACK_PROTO15_ DLSTACK_PROTO14_, DLSTACK_TYPE |
#define DLSTACK_PROTO16 DLSTACK_PROTO16_, ... |
#define DLSTACK_PROTO16_ DLSTACK_PROTO15_, DLSTACK_TYPE |
#define DLSTACK_PROTO17 DLSTACK_PROTO17_, ... |
#define DLSTACK_PROTO17_ DLSTACK_PROTO16_, DLSTACK_TYPE |
#define DLSTACK_PROTO18 DLSTACK_PROTO18_, ... |
#define DLSTACK_PROTO18_ DLSTACK_PROTO17_, DLSTACK_TYPE |
#define DLSTACK_PROTO19 DLSTACK_PROTO19_, ... |
#define DLSTACK_PROTO19_ DLSTACK_PROTO18_, DLSTACK_TYPE |
#define DLSTACK_PROTO1_ DLSTACK_TYPE |
#define DLSTACK_PROTO2 DLSTACK_PROTO2_, ... |
#define DLSTACK_PROTO20 DLSTACK_PROTO20_, ... |
#define DLSTACK_PROTO20_ DLSTACK_PROTO19_, DLSTACK_TYPE |
#define DLSTACK_PROTO2_ DLSTACK_PROTO1_, DLSTACK_TYPE |
#define DLSTACK_PROTO3 DLSTACK_PROTO3_, ... |
#define DLSTACK_PROTO3_ DLSTACK_PROTO2_, DLSTACK_TYPE |
#define DLSTACK_PROTO4 DLSTACK_PROTO4_, ... |
#define DLSTACK_PROTO4 DLSTACK_PROTO4_, ... |
#define DLSTACK_PROTO4_ DLSTACK_PROTO3_, DLSTACK_TYPE |
#define DLSTACK_PROTO4_ DLSTACK_PROTO3_, DLSTACK_TYPE |
#define DLSTACK_PROTO5 DLSTACK_PROTO5_, ... |
#define DLSTACK_PROTO5_ DLSTACK_PROTO4_, DLSTACK_TYPE |
#define DLSTACK_PROTO6 DLSTACK_PROTO6_, ... |
#define DLSTACK_PROTO6_ DLSTACK_PROTO5_, DLSTACK_TYPE |
#define DLSTACK_PROTO7 DLSTACK_PROTO7_, ... |
#define DLSTACK_PROTO7_ DLSTACK_PROTO6_, DLSTACK_TYPE |
#define DLSTACK_PROTO8 DLSTACK_PROTO8_, ... |
#define DLSTACK_PROTO8_ DLSTACK_PROTO7_, DLSTACK_TYPE |
#define DLSTACK_PROTO9 DLSTACK_PROTO9_, ... |
#define DLSTACK_PROTO9_ DLSTACK_PROTO8_, DLSTACK_TYPE |
#define DLSTACK_SIZE (20) |
Definition at line 36 of file dl.h.
Referenced by Init_dl(), and rb_dlcfunc_call().
#define DLSTACK_TYPE SIGNED_VALUE |
Definition at line 35 of file dl.h.
Referenced by rb_dlcfunc_call().
#define DLTYPE_CHAR 2 |
Definition at line 156 of file dl.h.
Referenced by Init_dl(), and rb_dlcfunc_call().
#define DLTYPE_DOUBLE 8 |
Definition at line 164 of file dl.h.
Referenced by Init_dl(), and rb_dlcfunc_call().
#define DLTYPE_FLOAT 7 |
Definition at line 163 of file dl.h.
Referenced by Init_dl(), and rb_dlcfunc_call().
#define DLTYPE_INT 4 |
Definition at line 158 of file dl.h.
Referenced by Init_dl(), and rb_dlcfunc_call().
#define DLTYPE_LONG 5 |
Definition at line 159 of file dl.h.
Referenced by Init_dl(), and rb_dlcfunc_call().
#define DLTYPE_SHORT 3 |
Definition at line 157 of file dl.h.
Referenced by Init_dl(), and rb_dlcfunc_call().
#define DLTYPE_VOID 0 |
Definition at line 154 of file dl.h.
Referenced by Init_dl(), rb_dlcfunc_call(), rb_dlcfunc_initialize(), and rb_dlptr_free_get().
#define DLTYPE_VOIDP 1 |
Definition at line 155 of file dl.h.
Referenced by Init_dl(), and rb_dlcfunc_call().
#define NUM2PTR | ( | x | ) | ((void*)(NUM2ULONG(x))) |
Definition at line 169 of file dl.h.
Referenced by callback(), function_call(), get_freefunc(), rb_dl_free(), rb_dl_ptr2value(), rb_dl_realloc(), rb_dlcfunc_initialize(), rb_dlcfunc_set_ptr(), rb_dlptr_aset(), rb_dlptr_initialize(), rb_dlptr_s_to_ptr(), rb_fiddle_free(), rb_fiddle_ptr2value(), rb_fiddle_ptr_aset(), rb_fiddle_ptr_initialize(), rb_fiddle_ptr_s_to_ptr(), rb_fiddle_realloc(), and value_to_generic().
#define PTR2NUM | ( | x | ) | (ULONG2NUM((unsigned long)(x))) |
Definition at line 168 of file dl.h.
Referenced by callback(), dlhandle_sym(), fiddle_handle_sym(), generic_to_value(), Init_dl(), Init_fiddle(), rb_dl_malloc(), rb_dl_realloc(), rb_dl_value2ptr(), rb_dlcfunc_ptr(), rb_dlcfunc_to_i(), rb_dlhandle_to_i(), rb_dlptr_to_i(), rb_fiddle_handle_to_i(), rb_fiddle_malloc(), rb_fiddle_ptr_free_get(), rb_fiddle_ptr_to_i(), rb_fiddle_realloc(), rb_fiddle_value2ptr(), and to_i().
#define RCFUNC_DATA | ( | obj | ) | ((struct cfunc_data *)(DATA_PTR(obj))) |
Definition at line 208 of file dl.h.
Referenced by get_freefunc().
Definition at line 209 of file dl.h.
Referenced by rb_dlptr_minus(), rb_dlptr_plus(), rb_dlptr_s_malloc(), rb_dlptr_s_to_ptr(), rb_dlptr_size_get(), and rb_dlptr_size_set().
int rb_dlcfunc_kind_p | ( | VALUE | func | ) |
Definition at line 140 of file cfunc.c.
References rb_typeddata_is_kind_of().
Referenced by get_freefunc().
Definition at line 84 of file cfunc.c.
References cfunc_data::calltype, func, cfunc_data::name, NULL, cfunc_data::ptr, Qnil, rb_cDLCFunc, rb_secure(), strdup, type, cfunc_data::type, TypedData_Make_Struct, and val.
Referenced by rb_dlptr_free_get().
VALUE rb_dlptr_malloc | ( | long | size, |
freefunc_t | func | ||
) |
Definition at line 90 of file cptr.c.
References ptr_data::ptr, rb_dlptr_new(), rb_secure(), and ruby_xmalloc().
Referenced by rb_dlptr_s_malloc().
VALUE rb_dlptr_new | ( | void * | ptr, |
long | size, | ||
freefunc_t | func | ||
) |
Definition at line 84 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 68 of file cptr.c.
References ptr_data::free, func, OBJ_TAINT, ptr_data::ptr, rb_secure(), size, ptr_data::size, TypedData_Make_Struct, and val.
Referenced by rb_dlptr_new().
VALUE rb_cDLHandle |
Definition at line 10 of file handle.c.
Referenced by Init_dlhandle(), predefined_dlhandle(), rb_dl_dlopen(), and rb_dlhandle_s_allocate().
VALUE rb_cDLSymbol |
VALUE rb_eDLError |
Definition at line 14 of file dl.c.
Referenced by dlhandle_sym(), Init_dl(), rb_dlcfunc_call(), rb_dlhandle_close(), rb_dlhandle_initialize(), rb_dlhandle_sym(), rb_dlptr_aref(), rb_dlptr_aset(), and rb_dlptr_s_to_ptr().
VALUE rb_eDLTypeError |
Definition at line 15 of file dl.c.
Referenced by Init_dl(), and rb_dlcfunc_call().
VALUE rb_mDL |
Definition at line 13 of file dl.c.
Referenced by Init_dl(), Init_dlcfunc(), Init_dlhandle(), and Init_dlptr().