mruby/c value definitions More...
#include "boxing_no.h"Go to the source code of this file.
Data Structures | |
| struct | RBasic |
Typedefs | |
| typedef int32_t | mrbc_int_t |
| typedef uint32_t | mrbc_uint_t |
| typedef float | mrbc_float_t |
| typedef int16_t | mrbc_sym |
| mruby/c symbol ID | |
| typedef void(* | mrbc_func_t) (struct VM *vm, struct RObject *v, int argc) |
| typedef struct RObject | mrbc_object |
Enumerations | |
| enum | mrbc_vtype { MRBC_TT_JMPUW = -5 , MRBC_TT_BREAK = -4 , MRBC_TT_RETURN_BLK = -3 , MRBC_TT_RETURN = -2 , MRBC_TT_HANDLE = -1 , MRBC_TT_EMPTY = 0 , MRBC_TT_NIL = 1 , MRBC_TT_FALSE = 2 , MRBC_TT_TRUE = 3 , MRBC_TT_INTEGER = 4 , MRBC_TT_FIXNUM = 4 , MRBC_TT_FLOAT = 5 , MRBC_TT_SYMBOL = 6 , MRBC_TT_CLASS = 7 , MRBC_TT_MODULE = 8 , MRBC_TT_OBJECT = 9 , MRBC_TT_PROC = 10 , MRBC_TT_ARRAY = 11 , MRBC_TT_STRING = 12 , MRBC_TT_RANGE = 13 , MRBC_TT_HASH = 14 , MRBC_TT_EXCEPTION = 15 } |
| enum | mrbc_error_code { E_NOMEMORY_ERROR = 1 , E_RUNTIME_ERROR , E_TYPE_ERROR , E_ARGUMENT_ERROR , E_INDEX_ERROR , E_RANGE_ERROR , E_NAME_ERROR , E_NOMETHOD_ERROR , E_SCRIPT_ERROR , E_SYNTAX_ERROR , E_LOCALJUMP_ERROR , E_REGEXP_ERROR , E_NOTIMP_ERROR , E_FLOATDOMAIN_ERROR , E_KEY_ERROR , E_BYTECODE_ERROR } |
Functions | |
| static void | mrbc_incref (mrbc_value *v) |
| static void | mrbc_decref (mrbc_value *v) |
| static void | mrbc_decref_empty (mrbc_value *v) |
| static void | mrbc_delete (mrbc_value *v) |
| static uint16_t | bin_to_uint16 (const void *s) |
| static uint32_t | bin_to_uint32 (const void *s) |
| static double | bin_to_double64 (const void *s) |
| static void | uint32_to_bin (uint32_t v, void *d) |
| static void | uint16_to_bin (uint16_t v, void *d) |
Variables | |
| void(*const | mrbc_delfunc [])(mrbc_value *) |
mruby/c value definitions
Copyright (C) 2015- Kyushu Institute of Technology. Copyright (C) 2015-2026 Shimane IT Open-Innovation Center. Copyright (C) 2026- Shimane Institute for Industrial Technology. This file is distributed under BSD 3-Clause License.
Definition in file value.h.
| #define MRBC_ARG | ( | n | ) |
| #define MRBC_ARG_B | ( | ... | ) |
(beta) Get a N'th True/False argument as a C integer.
Examples:
| #define MRBC_ARG_F | ( | ... | ) |
(beta) Get a N'th argument as a C float (double).
Examples:
| #define MRBC_ARG_I | ( | ... | ) |
(beta) Get a N'th argument as a C integer.
Examples:
| #define MRBC_ARG_S | ( | ... | ) |
(beta) Get a N'th argument as a C string.
Examples:
| #define MRBC_INIT_OBJECT_HEADER | ( | p, | |
| t ) |
| #define MRBC_INIT_OBJECT_HEADER_DI | ( | t | ) |
| #define MRBC_ISNUMERIC | ( | val | ) |
Check the val is numeric.
| #define MRBC_KW_ARG | ( | ... | ) |
Get keyword arguments and define mrbc_value with same name. Up to 30 arguments can be specified.
| #define MRBC_KW_ARG_decl1 | ( | kw | ) |
| #define MRBC_KW_ARG_decl2 | ( | kw | ) |
| #define MRBC_KW_DELETE | ( | ... | ) |
Delete retrieved keyword arguments.
| #define MRBC_KW_DELETE_decl | ( | kw | ) |
| #define MRBC_KW_DICT | ( | dict | ) |
Get remaining keyword arguments as hash.
| #define MRBC_KW_END | ( | ) |
Check for excess keyword arguments. If excess keyword argument are given, return False(=0) and set ArgumentError.
| #define MRBC_KW_ISVALID | ( | kw | ) |
Check if argument is valid.
| #define MRBC_KW_MANDATORY | ( | ... | ) |
Check if mandatory keyword arguments are given. If not, return False(=0) and set ArgumentError.
| #define MRBC_KW_MANDATORY_decl1 | ( | kw | ) |
| #define MRBC_PTR_TO_UINT32 | ( | p | ) |
| #define MRBC_TO_F | ( | val | ) |
(beta) Convert mrbc_value to Float. and return C double value.
| #define MRBC_TO_FLOAT | ( | val | ) |
Convert mrbc_value to C-lang double.
| #define MRBC_TO_I | ( | val | ) |
(beta) Convert mrbc_value to Integer. and return C integer value.
| #define MRBC_TO_INT | ( | val | ) |
Convert mrbc_value to C-lang int.
| #define MRBC_TO_S | ( | val | ) |
(beta) Convert mrbc_value to String. and return C const char *.
| #define MRBC_TT_INC_DEC_THRESHOLD MRBC_TT_MODULE |
| #define MRBC_TT_MAXVAL MRBC_TT_EXCEPTION |
| #define MRBC_VAL_F | ( | ... | ) |
(beta) get a C double value from mrbc_value.
Examples:
| #define MRBC_VAL_I | ( | ... | ) |
(beta) get a C integer value from mrbc_value.
Examples:
| #define MRBC_VAL_S | ( | ... | ) |
(beta) get a const char * from mrbc_value.
Examples:
| #define SET_BOOL_RETURN | ( | n | ) |
| #define SET_FALSE_RETURN | ( | ) |
| #define SET_FLOAT_RETURN | ( | n | ) |
set a float return value when writing a method by C.
| #define SET_INT_RETURN | ( | n | ) |
set an integer return value when writing a method by C.
| #define SET_NIL_RETURN | ( | ) |
| #define SET_RETURN | ( | n | ) |
set a return value when writing a method by C.
| #define SET_TRUE_RETURN | ( | ) |
| typedef float mrbc_float_t |
| typedef int32_t mrbc_int_t |
| typedef struct RObject mrbc_object |
| typedef uint32_t mrbc_uint_t |
| enum mrbc_error_code |
| enum mrbc_vtype |
value type in mrbc_value.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Decrement reference counter
| v | Pointer to target mrbc_value |
|
inlinestatic |
Decrement reference counter with set TT_EMPTY.
| v | Pointer to target mrbc_value |
Definition at line 579 of file value.h.
|
inlinestatic |
delete value but same as mrbc_decref() function.
| v | Pointer to target mrbc_value |
Definition at line 591 of file value.h.
|
inlinestatic |
Increment reference counter
| v | Pointer to mrbc_value |
Definition at line 546 of file value.h.
|
inlinestatic |
|
inlinestatic |
|
extern |
function table for object delete.