Ruby 2.0.0p247(2013-06-27revision41674)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions | Variables
fiddle.c File Reference
`#include <fiddle.h>`
Include dependency graph for fiddle.c:

Go to the source code of this file.

## Macros
#define | TYPE_SSIZE_T TYPE_INT
#define | TYPE_SIZE_T (-1*SIGNEDNESS_OF_SIZE_T*TYPE_SSIZE_T)
#define | TYPE_PTRDIFF_T TYPE_INT
#define | TYPE_INTPTR_T TYPE_INT
#define | TYPE_UINTPTR_T (-TYPE_INTPTR_T)

## Functions
void | Init_fiddle_pointer (void)
static VALUE | rb_fiddle_malloc (VALUE self, VALUE size)
static VALUE | rb_fiddle_realloc (VALUE self, VALUE addr, VALUE size)
VALUE | rb_fiddle_free (VALUE self, VALUE addr)
VALUE | rb_fiddle_ptr2value (VALUE self, VALUE addr)
static VALUE | rb_fiddle_value2ptr (VALUE self, VALUE val)
void | Init_fiddle_handle (void)
void | Init_fiddle (void)

## Variables
VALUE | mFiddle
VALUE | rb_eFiddleError

## Macro Definition Documentation

#define TYPE_INTPTR_T TYPE_INT

Definition at line 29 of file fiddle.c.

Referenced by Init_fiddle().

#define TYPE_PTRDIFF_T TYPE_INT

Definition at line 19 of file fiddle.c.

Referenced by Init_fiddle().

#define TYPE_SIZE_T (-1*SIGNEDNESS_OF_SIZE_T*TYPE_SSIZE_T)

Definition at line 15 of file fiddle.c.

Referenced by Init_fiddle().

#define TYPE_SSIZE_T TYPE_INT

Definition at line 8 of file fiddle.c.

Referenced by Init_fiddle().

#define TYPE_UINTPTR_T (-TYPE_INTPTR_T)

Definition at line 36 of file fiddle.c.

Referenced by Init_fiddle().

## Function Documentation

void Init_fiddle | ( | void | ) |  |

Definition at line 133 of file fiddle.c.

References ALIGN_CHAR, ALIGN_DOUBLE, ALIGN_FLOAT, ALIGN_INT, ALIGN_LONG, ALIGN_OF, ALIGN_SHORT, ALIGN_VOIDP, Init_fiddle_closure(), Init_fiddle_function(), Init_fiddle_handle(), Init_fiddle_pointer(), INT2NUM, mFiddle, PTR2NUM, Qfalse, Qtrue, rb_define_class_under(), rb_define_const(), rb_define_module(), rb_define_module_function(), rb_eFiddleError, rb_eStandardError, rb_fiddle_free(), rb_fiddle_malloc(), rb_fiddle_ptr2value(), rb_fiddle_realloc(), rb_fiddle_value2ptr(), rb_str_new2, RUBY_PLATFORM, ruby_xfree(), TYPE_CHAR, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INT, TYPE_INTPTR_T, TYPE_LONG, TYPE_PTRDIFF_T, TYPE_SHORT, TYPE_SIZE_T, TYPE_SSIZE_T, TYPE_UINTPTR_T, TYPE_VOID, and TYPE_VOIDP.

void Init_fiddle_handle | ( | void | ) |  |

Definition at line 368 of file handle.c.

References INT2NUM, mFiddle, predefined_fiddle_handle(), rb_cHandle, rb_cObject, rb_define_alloc_func(), rb_define_class_under(), rb_define_const(), rb_define_method(), rb_define_singleton_method(), 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_s_sym(), rb_fiddle_handle_sym(), rb_fiddle_handle_to_i(), RTLD_DEFAULT, and RTLD_NEXT.

Referenced by Init_fiddle().

void Init_fiddle_pointer | ( | void | ) |  |

Definition at line 673 of file pointer.c.

References id_to_ptr, mFiddle, rb_cObject, rb_cPointer, rb_define_alloc_func(), rb_define_class_under(), rb_define_const(), rb_define_method(), rb_define_singleton_method(), rb_fiddle_ptr_aref(), rb_fiddle_ptr_aset(), rb_fiddle_ptr_cmp(), rb_fiddle_ptr_eql(), rb_fiddle_ptr_free_get(), rb_fiddle_ptr_free_set(), rb_fiddle_ptr_initialize(), rb_fiddle_ptr_inspect(), rb_fiddle_ptr_minus(), rb_fiddle_ptr_new(), rb_fiddle_ptr_null_p(), rb_fiddle_ptr_plus(), rb_fiddle_ptr_ptr(), rb_fiddle_ptr_ref(), rb_fiddle_ptr_s_allocate(), rb_fiddle_ptr_s_malloc(), rb_fiddle_ptr_s_to_ptr(), rb_fiddle_ptr_size_get(), rb_fiddle_ptr_size_set(), rb_fiddle_ptr_to_i(), rb_fiddle_ptr_to_s(), rb_fiddle_ptr_to_str(), rb_fiddle_ptr_to_value(), and rb_intern.

Referenced by Init_fiddle().

VALUE rb_fiddle_free | ( | VALUE | self,
|  | VALUE | addr
| ) |  |

Definition at line 79 of file fiddle.c.

References NUM2PTR, Qnil, rb_secure(), and ruby_xfree().

Referenced by Init_fiddle().

static VALUE rb_fiddle_malloc | ( | VALUE | self,
|  | VALUE | size
| ) |  |
| static

Definition at line 47 of file fiddle.c.

References NUM2INT, PTR2NUM, rb_secure(), and ruby_xmalloc().

Referenced by Init_fiddle().

VALUE rb_fiddle_ptr2value | ( | VALUE | self,
|  | VALUE | addr
| ) |  |

Definition at line 105 of file fiddle.c.

References NUM2PTR, and rb_secure().

Referenced by Init_fiddle().

static VALUE rb_fiddle_realloc | ( | VALUE | self,
|  | VALUE | addr,
|  | VALUE | size
| ) |  |
| static

Definition at line 64 of file fiddle.c.

References NUM2INT, NUM2PTR, PTR2NUM, rb_secure(), and ruby_xrealloc().

Referenced by Init_fiddle().

static VALUE rb_fiddle_value2ptr | ( | VALUE | self,
|  | VALUE | val
| ) |  |
| static

Definition at line 125 of file fiddle.c.

References PTR2NUM.

Referenced by Init_fiddle().

## Variable Documentation

VALUE mFiddle

Definition at line 3 of file fiddle.c.

Referenced by callback(), function_call(), generic_to_value(), Init_fiddle(), Init_fiddle_closure(), Init_fiddle_function(), Init_fiddle_handle(), and Init_fiddle_pointer().

VALUE rb_eFiddleError

Definition at line 4 of file fiddle.c.

Referenced by fiddle_handle_sym(), Init_fiddle(), rb_fiddle_handle_close(), rb_fiddle_handle_initialize(), rb_fiddle_handle_sym(), rb_fiddle_ptr_aref(), rb_fiddle_ptr_aset(), and rb_fiddle_ptr_s_to_ptr().