85 if( !h )
return value;
236 memmove(v, v+2, (
char*)(h->
data + h->
n_stored) - (
char*)v);
263 memmove(v, v+2, (
char*)(h->
data + h->
n_stored) - (
char*)v);
299 if( d2 == NULL )
return 1;
316 if( ret.
hash == NULL )
return ret;
339static void c_hash_new(
struct VM *vm,
mrbc_value v[],
int argc)
349static void c_hash_get(
struct VM *vm,
mrbc_value v[],
int argc)
365static void c_hash_set(
struct VM *vm,
mrbc_value v[],
int argc)
383static void c_hash_clear(
struct VM *vm,
mrbc_value v[],
int argc)
392static void c_hash_dup(
struct VM *vm,
mrbc_value v[],
int argc)
403static void c_hash_delete(
struct VM *vm,
mrbc_value v[],
int argc)
418static void c_hash_empty(
struct VM *vm,
mrbc_value v[],
int argc)
433static void c_hash_has_key(
struct VM *vm,
mrbc_value v[],
int argc)
448static void c_hash_has_value(
struct VM *vm,
mrbc_value v[],
int argc)
472static void c_hash_key(
struct VM *vm,
mrbc_value v[],
int argc)
497static void c_hash_keys(
struct VM *vm,
mrbc_value v[],
int argc)
515static void c_hash_size(
struct VM *vm,
mrbc_value v[],
int argc)
526static void c_hash_merge(
struct VM *vm,
mrbc_value v[],
int argc)
545static void c_hash_merge_self(
struct VM *vm,
mrbc_value v[],
int argc)
561static void c_hash_values(
struct VM *vm,
mrbc_value v[],
int argc)
580static void c_hash_inspect(
struct VM *vm,
mrbc_value v[],
int argc)
588 if( !ret.
string )
goto RETURN_NIL;
604 s1 =
mrbc_send( vm, v, argc, &kv[1],
"inspect", 0 );
648#include "_autogen_class_hash.h"
void mrbc_raw_free(void *ptr)
int mrbc_array_push(mrbc_value *ary, mrbc_value *set_val)
mrbc_value mrbc_array_new(struct VM *vm, int size)
void mrbc_array_clear(mrbc_value *ary)
void mrbc_array_delete(mrbc_value *ary)
mrbc_value mrbc_hash_get(const mrbc_value *hash, const mrbc_value *key)
mrbc_value * mrbc_hash_search(const mrbc_value *hash, const mrbc_value *key)
mrbc_value mrbc_hash_remove(mrbc_value *hash, const mrbc_value *key)
void mrbc_hash_clear(mrbc_value *hash)
int mrbc_hash_compare(const mrbc_value *v1, const mrbc_value *v2)
mrbc_value * mrbc_hash_get_p(const mrbc_value *hash, const mrbc_value *key)
mrbc_value mrbc_hash_remove_by_id(mrbc_value *hash, mrbc_sym sym_id)
void mrbc_hash_delete(mrbc_value *hash)
mrbc_value * mrbc_hash_search_by_id(const mrbc_value *hash, mrbc_sym sym_id)
mrbc_value mrbc_hash_dup(struct VM *vm, mrbc_value *src)
int mrbc_hash_set(mrbc_value *hash, mrbc_value *key, mrbc_value *val)
mrbc_value mrbc_hash_new(struct VM *vm, int size)
struct RHash mrbc_hash
Hash object.
static mrbc_value * mrbc_hash_i_next(mrbc_hash_iterator *ite)
static int mrbc_hash_size(const mrbc_value *hash)
static int mrbc_hash_i_has_next(mrbc_hash_iterator *ite)
struct RHashIterator mrbc_hash_iterator
Define Hash iterator.
static mrbc_hash_iterator mrbc_hash_iterator_new(const mrbc_value *v)
void mrbc_string_delete(mrbc_value *str)
int mrbc_string_append(mrbc_value *s1, const mrbc_value *s2)
static mrbc_value mrbc_string_new_cstr(struct VM *vm, const char *src)
static int mrbc_string_append_cstr(mrbc_value *s1, const char *s2)
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)
Include at once the necessary header files.
uint16_t data_size
data buffer size.
uint16_t n_stored
num of stored.
mrbc_value * data
pointer to allocated memory.
const char * mrbc_symid_to_str(mrbc_sym sym_id)
int mrbc_compare(const mrbc_value *v1, const mrbc_value *v2)
static void mrbc_decref(mrbc_value *v)
#define MRBC_INIT_OBJECT_HEADER(p, t)
#define SET_INT_RETURN(n)
static void mrbc_incref(mrbc_value *v)
#define SET_TRUE_RETURN()
int16_t mrbc_sym
mruby/c symbol ID
struct RObject mrbc_value
#define SET_FALSE_RETURN()
Global configuration of mruby/c VM's.