Ruby  2.1.10p492(2016-04-01revision54464)
Data Structures | Macros | Functions | Variables
handle.c File Reference
#include <ruby.h>
#include <fiddle.h>

Go to the source code of this file.

Data Structures

struct  dl_handle
 

Macros

#define SafeStringValueCStr(v)   (rb_check_safe_obj(rb_string_value(&v)), StringValueCStr(v))
 
#define RTLD_NEXT   NULL
 
#define RTLD_DEFAULT   NULL
 
#define CHECK_DLERROR
 

Functions

static void fiddle_handle_free (void *ptr)
 
static size_t fiddle_handle_memsize (const void *ptr)
 
static VALUE rb_fiddle_handle_close (VALUE self)
 
static VALUE rb_fiddle_handle_s_allocate (VALUE klass)
 
static VALUE predefined_fiddle_handle (void *handle)
 
static VALUE rb_fiddle_handle_initialize (int argc, VALUE argv[], VALUE self)
 
static VALUE rb_fiddle_handle_enable_close (VALUE self)
 
static VALUE rb_fiddle_handle_disable_close (VALUE self)
 
static VALUE rb_fiddle_handle_close_enabled_p (VALUE self)
 
static VALUE rb_fiddle_handle_to_i (VALUE self)
 
static VALUE fiddle_handle_sym (void *handle, VALUE symbol)
 
static VALUE rb_fiddle_handle_sym (VALUE self, VALUE sym)
 
static VALUE rb_fiddle_handle_s_sym (VALUE self, VALUE sym)
 
void Init_fiddle_handle (void)
 

Variables

VALUE rb_cHandle
 
static const rb_data_type_t fiddle_handle_data_type
 

Macro Definition Documentation

◆ CHECK_DLERROR

#define CHECK_DLERROR

Referenced by fiddle_handle_sym().

◆ RTLD_DEFAULT

#define RTLD_DEFAULT   NULL

Definition at line 294 of file handle.c.

Referenced by Init_fiddle_handle().

◆ RTLD_NEXT

#define RTLD_NEXT   NULL

Definition at line 291 of file handle.c.

Referenced by Init_fiddle_handle(), and rb_fiddle_handle_s_sym().

◆ SafeStringValueCStr

#define SafeStringValueCStr (   v)    (rb_check_safe_obj(rb_string_value(&v)), StringValueCStr(v))

Definition at line 4 of file handle.c.

Referenced by fiddle_handle_sym(), and rb_fiddle_handle_initialize().

Function Documentation

◆ fiddle_handle_free()

static void fiddle_handle_free ( void *  ptr)
static

Definition at line 39 of file handle.c.

References dl_handle::enable_close, dl_handle::open, dl_handle::ptr, and xfree().

◆ fiddle_handle_memsize()

static size_t fiddle_handle_memsize ( const void *  ptr)
static

Definition at line 49 of file handle.c.

References dl_handle::ptr.

◆ fiddle_handle_sym()

static VALUE fiddle_handle_sym ( void *  handle,
VALUE  symbol 
)
static

◆ Init_fiddle_handle()

void Init_fiddle_handle ( void  )

◆ predefined_fiddle_handle()

static VALUE predefined_fiddle_handle ( void *  handle)
static

◆ rb_fiddle_handle_close()

static VALUE rb_fiddle_handle_close ( VALUE  self)
static

◆ rb_fiddle_handle_close_enabled_p()

static VALUE rb_fiddle_handle_close_enabled_p ( VALUE  self)
static

Definition at line 244 of file handle.c.

References dl_handle::enable_close, fiddle_handle_data_type, Qfalse, Qtrue, and TypedData_Get_Struct.

Referenced by Init_fiddle_handle().

◆ rb_fiddle_handle_disable_close()

static VALUE rb_fiddle_handle_disable_close ( VALUE  self)
static

Definition at line 227 of file handle.c.

References dl_handle::enable_close, fiddle_handle_data_type, Qnil, and TypedData_Get_Struct.

Referenced by Init_fiddle_handle().

◆ rb_fiddle_handle_enable_close()

static VALUE rb_fiddle_handle_enable_close ( VALUE  self)
static

Definition at line 212 of file handle.c.

References dl_handle::enable_close, fiddle_handle_data_type, Qnil, and TypedData_Get_Struct.

Referenced by Init_fiddle_handle().

◆ rb_fiddle_handle_initialize()

static VALUE rb_fiddle_handle_initialize ( int  argc,
VALUE  argv[],
VALUE  self 
)
static

◆ rb_fiddle_handle_s_allocate()

static VALUE rb_fiddle_handle_s_allocate ( VALUE  klass)
static

◆ rb_fiddle_handle_s_sym()

static VALUE rb_fiddle_handle_s_sym ( VALUE  self,
VALUE  sym 
)
static

Definition at line 308 of file handle.c.

References fiddle_handle_sym(), RTLD_NEXT, and sym.

Referenced by Init_fiddle_handle().

◆ rb_fiddle_handle_sym()

static VALUE rb_fiddle_handle_sym ( VALUE  self,
VALUE  sym 
)
static

◆ rb_fiddle_handle_to_i()

static VALUE rb_fiddle_handle_to_i ( VALUE  self)
static

Definition at line 260 of file handle.c.

References fiddle_handle_data_type, PTR2NUM, and TypedData_Get_Struct.

Referenced by Init_fiddle_handle().

Variable Documentation

◆ fiddle_handle_data_type

const rb_data_type_t fiddle_handle_data_type
static
Initial value:
= {
"fiddle/handle",
}
static size_t fiddle_handle_memsize(const void *ptr)
Definition: handle.c:49
static void fiddle_handle_free(void *ptr)
Definition: handle.c:39

Definition at line 54 of file handle.c.

Referenced by rb_fiddle_handle_close(), rb_fiddle_handle_close_enabled_p(), rb_fiddle_handle_disable_close(), rb_fiddle_handle_enable_close(), rb_fiddle_handle_initialize(), rb_fiddle_handle_s_allocate(), rb_fiddle_handle_sym(), and rb_fiddle_handle_to_i().

◆ rb_cHandle

VALUE rb_cHandle