ext/dl/handle.c File Reference

#include <ruby.h>
#include "dl.h"

Go to the source code of this file.

Defines

#define RTLD_NEXT   NULL
#define RTLD_DEFAULT   NULL
#define CHECK_DLERROR

Functions

static void dlhandle_free (void *ptr)
static size_t dlhandle_memsize (const void *ptr)
VALUE rb_dlhandle_close (VALUE self)
VALUE rb_dlhandle_s_allocate (VALUE klass)
static VALUE predefined_dlhandle (void *handle)
VALUE rb_dlhandle_initialize (int argc, VALUE argv[], VALUE self)
VALUE rb_dlhandle_enable_close (VALUE self)
VALUE rb_dlhandle_disable_close (VALUE self)
static VALUE rb_dlhandle_close_enabled_p (VALUE self)
VALUE rb_dlhandle_to_i (VALUE self)
static VALUE dlhandle_sym (void *handle, const char *symbol)
VALUE rb_dlhandle_sym (VALUE self, VALUE sym)
VALUE rb_dlhandle_s_sym (VALUE self, VALUE sym)
void Init_dlhandle (void)

Variables

VALUE rb_cDLHandle
static const rb_data_type_t dlhandle_data_type


Define Documentation

#define CHECK_DLERROR

Referenced by dlhandle_sym(), and fiddle_handle_sym().

#define RTLD_DEFAULT   NULL

Definition at line 281 of file handle.c.

Referenced by Init_dlhandle(), and Init_fiddle_handle().

#define RTLD_NEXT   NULL

Definition at line 278 of file handle.c.

Referenced by Init_dlhandle(), Init_fiddle_handle(), rb_dlhandle_s_sym(), and rb_fiddle_handle_s_sym().


Function Documentation

static void dlhandle_free ( void *  ptr  )  [static]

Definition at line 35 of file handle.c.

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

static size_t dlhandle_memsize ( const void *  ptr  )  [static]

Definition at line 45 of file handle.c.

static VALUE dlhandle_sym ( void *  handle,
const char *  symbol 
) [static]

Definition at line 300 of file handle.c.

References CHECK_DLERROR, err, func, len, PTR2NUM, rb_eDLError, rb_raise(), rb_secure(), strlen(), VALUE, xfree, xmalloc, and xrealloc.

Referenced by rb_dlhandle_s_sym(), and rb_dlhandle_sym().

void Init_dlhandle ( void   ) 

Definition at line 365 of file handle.c.

References predefined_dlhandle(), rb_cDLHandle, rb_cObject, rb_define_alloc_func(), rb_define_class_under(), rb_define_const(), rb_define_method(), rb_define_singleton_method(), rb_dlhandle_close(), rb_dlhandle_close_enabled_p(), rb_dlhandle_disable_close(), rb_dlhandle_enable_close(), rb_dlhandle_initialize(), rb_dlhandle_s_allocate(), rb_dlhandle_s_sym(), rb_dlhandle_sym(), rb_dlhandle_to_i(), rb_mDL, RTLD_DEFAULT, and RTLD_NEXT.

Referenced by Init_dl().

static VALUE predefined_dlhandle ( void *  handle  )  [static]

Definition at line 101 of file handle.c.

References DATA_PTR, OBJ_FREEZE, dl_handle::open, dl_handle::ptr, rb_cDLHandle, rb_dlhandle_s_allocate(), and VALUE.

Referenced by Init_dlhandle().

VALUE rb_dlhandle_close ( VALUE  self  ) 

Definition at line 62 of file handle.c.

References dlhandle_data_type, INT2NUM, dl_handle::open, dl_handle::ptr, rb_eDLError, rb_raise(), TypedData_Get_Struct, and UNREACHABLE.

Referenced by Init_dlhandle(), and rb_dlhandle_initialize().

static VALUE rb_dlhandle_close_enabled_p ( VALUE  self  )  [static]

Definition at line 230 of file handle.c.

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

Referenced by Init_dlhandle().

VALUE rb_dlhandle_disable_close ( VALUE  self  ) 

Definition at line 214 of file handle.c.

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

Referenced by Init_dlhandle().

VALUE rb_dlhandle_enable_close ( VALUE  self  ) 

Definition at line 199 of file handle.c.

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

Referenced by Init_dlhandle().

VALUE rb_dlhandle_initialize ( int  argc,
VALUE  argv[],
VALUE  self 
)

Definition at line 120 of file handle.c.

References dlhandle_data_type, dl_handle::enable_close, err, NIL_P, NULL, NUM2INT, dl_handle::open, dl_handle::ptr, Qnil, rb_block_given_p(), rb_bug(), rb_dlhandle_close(), rb_eDLError, rb_ensure(), rb_raise(), rb_scan_args(), rb_secure(), rb_yield(), STRCASECMP, StringValuePtr, TypedData_Get_Struct, and VALUE.

Referenced by Init_dlhandle().

VALUE rb_dlhandle_s_allocate ( VALUE  klass  ) 

Definition at line 87 of file handle.c.

References dlhandle_data_type, dl_handle::enable_close, dl_handle::open, dl_handle::ptr, rb_cDLHandle, TypedData_Make_Struct, and VALUE.

Referenced by Init_dlhandle(), and predefined_dlhandle().

VALUE rb_dlhandle_s_sym ( VALUE  self,
VALUE  sym 
)

Definition at line 294 of file handle.c.

References dlhandle_sym(), RTLD_NEXT, and StringValueCStr.

Referenced by Init_dlhandle().

VALUE rb_dlhandle_sym ( VALUE  self,
VALUE  sym 
)

Definition at line 265 of file handle.c.

References dlhandle_data_type, dlhandle_sym(), dl_handle::open, dl_handle::ptr, rb_eDLError, rb_raise(), StringValueCStr, and TypedData_Get_Struct.

Referenced by Init_dlhandle().

VALUE rb_dlhandle_to_i ( VALUE  self  ) 

Definition at line 246 of file handle.c.

References dlhandle_data_type, PTR2NUM, and TypedData_Get_Struct.

Referenced by Init_dlhandle().


Variable Documentation

const rb_data_type_t dlhandle_data_type [static]

Initial value:

 {
    "dl/handle",
    {0, dlhandle_free, dlhandle_memsize,},
}

Definition at line 50 of file handle.c.

Referenced by rb_dlhandle_close(), rb_dlhandle_close_enabled_p(), rb_dlhandle_disable_close(), rb_dlhandle_enable_close(), rb_dlhandle_initialize(), rb_dlhandle_s_allocate(), rb_dlhandle_sym(), and rb_dlhandle_to_i().

VALUE rb_cDLHandle

Definition at line 8 of file handle.c.


Generated on 19 Jul 2016 for Ruby by  doxygen 1.4.7