42static void c_integer_bitref(
struct VM *vm,
mrbc_value v[],
int argc)
56static void c_integer_positive(
struct VM *vm,
mrbc_value v[],
int argc)
65static void c_integer_negative(
struct VM *vm,
mrbc_value v[],
int argc)
75static void c_integer_power(
struct VM *vm,
mrbc_value v[],
int argc)
87#if MRBC_USE_FLOAT && MRBC_USE_MATH
98static void c_integer_mod(
struct VM *vm,
mrbc_value v[],
int argc)
115 if( (ret != 0) && ((v0 ^ v1) < 0) ) ret += v1;
123static void c_integer_and(
struct VM *vm,
mrbc_value v[],
int argc)
133static void c_integer_or(
struct VM *vm,
mrbc_value v[],
int argc)
143static void c_integer_xor(
struct VM *vm,
mrbc_value v[],
int argc)
153static void c_integer_not(
struct VM *vm,
mrbc_value v[],
int argc)
166 const int INT_BITS =
sizeof(
mrbc_int_t) * CHAR_BIT;
168 if( y >= INT_BITS )
return 0;
169 if( y >= 0 )
return x << y;
170 if( y <= -INT_BITS )
return 0;
178static void c_integer_lshift(
struct VM *vm,
mrbc_value v[],
int argc)
188static void c_integer_rshift(
struct VM *vm,
mrbc_value v[],
int argc)
198static void c_integer_abs(
struct VM *vm,
mrbc_value v[],
int argc)
212static void c_numeric_clamp(
struct VM *vm,
mrbc_value v[],
int argc)
247static void c_integer_to_f(
struct VM *vm,
mrbc_value v[],
int argc)
259static void c_integer_chr(
struct VM *vm,
mrbc_value v[],
int argc)
271static void c_integer_inspect(
struct VM *vm,
mrbc_value v[],
int argc)
281 if( base < 2 || base > 36 ) {
328#include "_autogen_class_integer.h"
338static void c_float_positive(
struct VM *vm,
mrbc_value v[],
int argc)
347static void c_float_negative(
struct VM *vm,
mrbc_value v[],
int argc)
358static void c_float_power(
struct VM *vm,
mrbc_value v[],
int argc)
375static void c_float_abs(
struct VM *vm,
mrbc_value v[],
int argc)
386static void c_float_to_i(
struct VM *vm,
mrbc_value v[],
int argc)
397static void c_float_inspect(
struct VM *vm,
mrbc_value v[],
int argc)
406 snprintf( buf,
sizeof(buf),
"%g", v->
d );
432#include "_autogen_class_float.h"
static mrbc_int_t shift(mrbc_int_t x, mrbc_int_t y)
mrbc_value mrbc_string_new(struct VM *vm, const void *src, int len)
static mrbc_value mrbc_string_new_cstr(struct VM *vm, const char *src)
int mrbc_printf_int(mrbc_printf_t *pf, mrbc_int_t value, unsigned int base)
static void mrbc_printf_end(mrbc_printf_t *pf)
struct RPrintf mrbc_printf_t
printf tiny (mruby/c) version data container.
static void mrbc_printf_init(mrbc_printf_t *pf, char *buf, int size, const char *fstr)
void mrbc_raise(struct VM *vm, struct RClass *exc_cls, const char *msg)
void mrbc_raisef(struct VM *vm, struct RClass *exc_cls, const char *fstr,...)
Include at once the necessary header files.
const char * mrbc_symid_to_str(mrbc_sym sym_id)
int mrbc_compare(const mrbc_value *v1, const mrbc_value *v2)
#define SET_INT_RETURN(n)
@ MRBC_TT_INTEGER
Integer.
struct RObject mrbc_value
#define SET_FLOAT_RETURN(n)
Global configuration of mruby/c VM's.