40 0, 0, 0, 0, 0, 0, 0, 0, 0,
111 int diff = strlen(str1) - strlen(str2);
112 int len = diff < 0 ? strlen(str1) : strlen(str2);
113 int res = memcmp(str1, str2, len);
114 return (res != 0) ? res : diff;
150 return -1 + (d1 == d2) + (d1 > d2)*2;
155#if defined(MRBC_ALLOC_VMID)
208 while( (ch = *s++) !=
'\0' ) {
217 if(
'0' <= ch && ch <=
'9' ) {
222 if( n >= base )
break;
224 ret = ret * base + n;
227 if( sign ) ret = -ret;
244 if( n <= 0 )
return 0;
247 if( (*dest++ = *src++) == 0 )
goto RETURN;
252 return destsize - n - 1;
266 snprintf(buf, bufsiz,
"%g", flo);
267 if( strpbrk(buf,
".e") )
return;
269 int len = strlen(buf);
287 if( val == NULL )
return 0;
338 if( val == NULL )
return 0;
389 if( val == NULL )
return 0;
437 if( val == NULL )
return 0;
481 if( val == NULL )
return 0;
523 if( val == NULL )
return 0;
563 "wrong number of arguments (given %d, expected %d)", argc, n);
587 "wrong number of arguments (given %d, expected %d)", argc, n);
624 if( argc < n )
return default_value;
646 "wrong number of arguments (given %d, expected %d)", argc, n);
683 if( argc < n )
return default_value;
705 "wrong number of arguments (given %d, expected %d)", argc, n);
737 if( argc < n )
return default_value;
759 "wrong number of arguments (given %d, expected %d)", argc, n);
794 if( argc < n )
return default_value;
static void mrbc_set_float(mrbc_value *p, mrbc_float_t d)
struct RObject mrbc_value
Value object. Default version.
static void mrbc_set_integer(mrbc_value *p, mrbc_int_t n)
int mrbc_array_compare(const mrbc_value *v1, const mrbc_value *v2)
void mrbc_array_delete(mrbc_value *ary)
int mrbc_hash_compare(const mrbc_value *v1, const mrbc_value *v2)
void mrbc_hash_delete(mrbc_value *hash)
void mrbc_proc_delete(mrbc_value *val)
void mrbc_range_delete(mrbc_value *v)
int mrbc_range_compare(const mrbc_value *v1, const mrbc_value *v2)
void mrbc_string_delete(mrbc_value *str)
static char * mrbc_string_cstr(const mrbc_value *v)
static int mrbc_string_compare(const mrbc_value *v1, const mrbc_value *v2)
void mrbc_instance_delete(mrbc_value *v)
mrbc_value mrbc_send(struct VM *vm, mrbc_value *v, int argc, mrbc_value *recv, const char *method_name, int n_params,...)
void mrbc_raise(struct VM *vm, struct RClass *exc_cls, const char *msg)
void mrbc_exception_delete(mrbc_value *value)
void mrbc_raisef(struct VM *vm, struct RClass *exc_cls, const char *fstr,...)
#define mrbc_israised(vm)
Include at once the necessary header files.
const char * mrbc_symid_to_str(mrbc_sym sym_id)
int mrbc_arg_b2(struct VM *vm, mrbc_value v[], int argc, int n, int default_value)
char * mrbc_to_s(struct VM *vm, mrbc_value v[], int argc, mrbc_value *val)
const char * mrbc_val_s2(struct VM *vm, const mrbc_value *val, const char *default_value)
void(*const mrbc_delfunc[])(mrbc_value *)
mrbc_int_t mrbc_to_i(struct VM *vm, mrbc_value v[], int argc, mrbc_value *val)
mrbc_int_t mrbc_val_i(struct VM *vm, const mrbc_value *val)
const char * mrbc_val_s(struct VM *vm, const mrbc_value *val)
mrbc_value * mrbc_arg(struct VM *vm, mrbc_value v[], int argc, int n)
double mrbc_val_f2(struct VM *vm, const mrbc_value *val, double default_value)
const char * mrbc_arg_s(struct VM *vm, mrbc_value v[], int argc, int n)
int mrbc_compare(const mrbc_value *v1, const mrbc_value *v2)
mrbc_float_t mrbc_arg_f(struct VM *vm, mrbc_value v[], int argc, int n)
mrbc_int_t mrbc_arg_i2(struct VM *vm, mrbc_value v[], int argc, int n, mrbc_int_t default_value)
int mrbc_arg_b(struct VM *vm, mrbc_value v[], int argc, int n)
mrbc_int_t mrbc_val_i2(struct VM *vm, const mrbc_value *val, mrbc_int_t default_value)
mrbc_float_t mrbc_to_f(struct VM *vm, mrbc_value v[], int argc, mrbc_value *val)
int mrbc_strcpy(char *dest, int destsize, const char *src)
mrbc_int_t mrbc_atoi(const char *s, int base)
mrbc_float_t mrbc_arg_f2(struct VM *vm, mrbc_value v[], int argc, int n, mrbc_float_t default_value)
const char * mrbc_arg_s2(struct VM *vm, mrbc_value v[], int argc, int n, const char *default_value)
mrbc_int_t mrbc_arg_i(struct VM *vm, mrbc_value v[], int argc, int n)
void mrbc_format_float(char *buf, int bufsiz, mrbc_float_t flo)
double mrbc_val_f(struct VM *vm, const mrbc_value *val)
static void mrbc_decref(mrbc_value *v)
@ MRBC_TT_FALSE
FalseClass.
@ MRBC_TT_INTEGER
Integer.
@ MRBC_TT_OBJECT
General instance.
Global configuration of mruby/c VM's.