Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

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

Go to the source code of this file.

## Functions
static void | deallocate (void *p)
static size_t | function_memsize (const void *p)
static VALUE | allocate (VALUE klass)
VALUE | rb_fiddle_new_function (VALUE address, VALUE arg_types, VALUE ret_type)
static int | parse_keyword_arg_i (VALUE key, VALUE value, VALUE self)
static VALUE | initialize (int argc, VALUE argv[], VALUE self)
static VALUE | function_call (int argc, VALUE argv[], VALUE self)
void | Init_fiddle_function (void)

## Variables
VALUE | cFiddleFunction
const rb_data_type_t | function_data_type

## Function Documentation

static VALUE allocate | ( | VALUE | klass | ) |
| static

Definition at line 34 of file function.c.

References TypedData_Make_Struct.

Referenced by Init_fiddle_function().

static void deallocate | ( | void * | p | ) |
| static

Definition at line 6 of file function.c.

References p, ptr, and xfree.

static VALUE function_call | ( | int | argc,
|  | VALUE | argv[],
|  | VALUE | self
| ) |  |
| static

Definition at line 109 of file function.c.

References argc, CLASS_OF, errno, GENERIC2VALUE, i, INT2NUM, mFiddle, NIL_P(), NULL, NUM2INT, NUM2PTR, OBJ_TAINTED, RARRAY_LENINT, RARRAY_PTR(), rb_const_get(), rb_eArgError, rb_eSecurityError, rb_funcall(), rb_Integer(), rb_intern, rb_iv_get(), rb_raise(), rb_safe_level, retval, src, type, TYPE_VOIDP, TypedData_Get_Struct, VALUE2GENERIC, xcalloc, and xfree.

Referenced by Init_fiddle_function().

static size_t function_memsize | ( | const void * | p | ) |
| static

Definition at line 14 of file function.c.

References ptr, and size.

void Init_fiddle_function | ( | void |  | ) |

Definition at line 173 of file function.c.

References allocate(), cFiddleFunction, function_call(), initialize(), INT2NUM, mFiddle, rb_cObject, rb_define_alloc_func(), rb_define_class_under(), rb_define_const(), and rb_define_method().

Referenced by Init_fiddle().

static VALUE initialize | ( | int | argc,
|  | VALUE | argv[],
|  | VALUE | self
| ) |  |
| static

Definition at line 65 of file function.c.

References args, Check_Type, i, INT2FFI_TYPE, INT2NUM, NIL_P(), NULL, NUM2INT, parse_keyword_arg_i(), ptr, RARRAY_LEN, RARRAY_LENINT, RARRAY_PTR(), rb_eRuntimeError, rb_hash_foreach(), rb_iv_set(), rb_raise(), rb_scan_args(), result, T_ARRAY, type, TypedData_Get_Struct, and xcalloc.

Referenced by Init_fiddle_function().

static int parse_keyword_arg_i | ( | VALUE | key,
|  | VALUE | value,
|  | VALUE | self
| ) |  |
| static

Definition at line 54 of file function.c.

References ID2SYM, PRIsVALUE, rb_eArgError, rb_intern, rb_iv_set(), rb_raise(), and ST_CONTINUE.

Referenced by initialize().

VALUE rb_fiddle_new_function | ( | VALUE | address,
|  | VALUE | arg_types,
|  | VALUE | ret_type
| ) |  |

Definition at line 42 of file function.c.

References argv, cFiddleFunction, and rb_class_new_instance().

Referenced by rb_fiddle_ptr_free_get().

## Variable Documentation

VALUE cFiddleFunction

Definition at line 3 of file function.c.

Referenced by Init_fiddle_function(), and rb_fiddle_new_function().

const rb_data_type_t function_data_type

Initial value:
= {
"fiddle/function",
{0, deallocate, function_memsize,},
}
deallocate
static void deallocate(void *p)
Definition: function.c:6
function_memsize
static size_t function_memsize(const void *p)
Definition: function.c:14

Definition at line 28 of file function.c.