Ruby: ext/fiddle/fiddle.h File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Macros | Functions | Variables
fiddle.h File Reference
`#include <ruby.h>`
`#include <errno.h>`
`#include <ffi.h>`
`#include <closure.h>`
`#include <conversions.h>`
`#include <function.h>`

Go to the source code of this file.

## Macros
#define | TYPE_VOID 0
#define | TYPE_VOIDP 1
#define | TYPE_CHAR 2
#define | TYPE_SHORT 3
#define | TYPE_INT 4
#define | TYPE_LONG 5
#define | TYPE_FLOAT 7
#define | TYPE_DOUBLE 8
#define | TYPE_VARIADIC 9
#define | TYPE_CONST_STRING 10
#define | TYPE_INT8_T TYPE_CHAR
#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)
#define | ALIGN_OF(type) offsetof(struct {char align_c; type align_x;}, align_x)
#define | ALIGN_VOIDP ALIGN_OF(void*)
#define | ALIGN_CHAR ALIGN_OF(char)
#define | ALIGN_SHORT ALIGN_OF(short)
#define | ALIGN_INT ALIGN_OF(int)
#define | ALIGN_LONG ALIGN_OF(long)
#define | ALIGN_FLOAT ALIGN_OF(float)
#define | ALIGN_DOUBLE ALIGN_OF(double)
#define | ALIGN_INT8_T ALIGN_OF(int8_t)
#define | ALIGN_INT16_T ALIGN_OF(int16_t)
#define | ALIGN_INT32_T ALIGN_OF(int32_t)
#define | ALIGN_INT64_T ALIGN_OF(int64_t)

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

## Variables
VALUE | mFiddle
VALUE | rb_eFiddleDLError

## Macro Definition Documentation

## ◆ ALIGN_CHAR

#define ALIGN_CHAR ALIGN_OF(char)

Definition at line 177 of file fiddle.h.

## ◆ ALIGN_DOUBLE

#define ALIGN_DOUBLE ALIGN_OF(double)

Definition at line 185 of file fiddle.h.

## ◆ ALIGN_FLOAT

#define ALIGN_FLOAT ALIGN_OF(float)

Definition at line 184 of file fiddle.h.

## ◆ ALIGN_INT

#define ALIGN_INT ALIGN_OF(int)

Definition at line 179 of file fiddle.h.

## ◆ ALIGN_INT16_T

#define ALIGN_INT16_T ALIGN_OF(int16_t)

Definition at line 188 of file fiddle.h.

## ◆ ALIGN_INT32_T

#define ALIGN_INT32_T ALIGN_OF(int32_t)

Definition at line 189 of file fiddle.h.

## ◆ ALIGN_INT64_T

#define ALIGN_INT64_T ALIGN_OF(int64_t)

Definition at line 190 of file fiddle.h.

## ◆ ALIGN_INT8_T

#define ALIGN_INT8_T ALIGN_OF(int8_t)

Definition at line 187 of file fiddle.h.

## ◆ ALIGN_LONG

#define ALIGN_LONG ALIGN_OF(long)

Definition at line 180 of file fiddle.h.

## ◆ ALIGN_OF

#define ALIGN_OF | ( |  | type | ) | offsetof(struct {char align_c; type align_x;}, align_x)

Definition at line 174 of file fiddle.h.

## ◆ ALIGN_SHORT

#define ALIGN_SHORT ALIGN_OF(short)

Definition at line 178 of file fiddle.h.

## ◆ ALIGN_VOIDP

#define ALIGN_VOIDP ALIGN_OF(void*)

Definition at line 176 of file fiddle.h.

## ◆ TYPE_CHAR

#define TYPE_CHAR 2

Definition at line 109 of file fiddle.h.

## ◆ TYPE_CONST_STRING

#define TYPE_CONST_STRING 10

Definition at line 119 of file fiddle.h.

## ◆ TYPE_DOUBLE

#define TYPE_DOUBLE 8

Definition at line 117 of file fiddle.h.

## ◆ TYPE_FLOAT

#define TYPE_FLOAT 7

Definition at line 116 of file fiddle.h.

## ◆ TYPE_INT

#define TYPE_INT 4

Definition at line 111 of file fiddle.h.

## ◆ TYPE_INT8_T

#define TYPE_INT8_T TYPE_CHAR

Definition at line 121 of file fiddle.h.

## ◆ TYPE_INTPTR_T

#define TYPE_INTPTR_T TYPE_INT

Definition at line 165 of file fiddle.h.

## ◆ TYPE_LONG

#define TYPE_LONG 5

Definition at line 112 of file fiddle.h.

## ◆ TYPE_PTRDIFF_T

#define TYPE_PTRDIFF_T TYPE_INT

Definition at line 155 of file fiddle.h.

## ◆ TYPE_SHORT

#define TYPE_SHORT 3

Definition at line 110 of file fiddle.h.

## ◆ TYPE_SIZE_T

#define TYPE_SIZE_T (-1*SIGNEDNESS_OF_SIZE_T*TYPE_SSIZE_T)

Definition at line 151 of file fiddle.h.

## ◆ TYPE_SSIZE_T

#define TYPE_SSIZE_T TYPE_INT

Definition at line 144 of file fiddle.h.

## ◆ TYPE_UINTPTR_T

#define TYPE_UINTPTR_T (-TYPE_INTPTR_T)

Definition at line 172 of file fiddle.h.

## ◆ TYPE_VARIADIC

#define TYPE_VARIADIC 9

Definition at line 118 of file fiddle.h.

## ◆ TYPE_VOID

#define TYPE_VOID 0

Definition at line 107 of file fiddle.h.

## ◆ TYPE_VOIDP

#define TYPE_VOIDP 1

Definition at line 108 of file fiddle.h.

## Function Documentation

## ◆ rb_fiddle_new_function()

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

Definition at line 69 of file function.c.

References argv, cFiddleFunction, and rb_class_new_instance().

## Variable Documentation

## ◆ mFiddle

VALUE mFiddle
| extern

Definition at line 3 of file fiddle.c.

Referenced by Init_fiddle(), Init_fiddle_closure(), Init_fiddle_function(), Init_fiddle_handle(), Init_fiddle_pinned(), Init_fiddle_pointer(), and rb_fiddle_generic_to_value().

## ◆ rb_eFiddleDLError

VALUE rb_eFiddleDLError
| extern

Definition at line 4 of file fiddle.c.

Referenced by Init_fiddle().