mruby/c VM Source Code release 3.4
Loading...
Searching...
No Matches
c_hash.h File Reference

mruby/c Hash class More...

#include "value.h"
#include "c_array.h"
Include dependency graph for c_hash.h:

Go to the source code of this file.

Data Structures

struct  RHash
 Hash object. More...
struct  RHashIterator
 Define Hash iterator. More...

Typedefs

typedef struct RHash mrbc_hash
 Hash object.
typedef struct RHashIterator mrbc_hash_iterator
 Define Hash iterator.

Functions

static int mrbc_hash_size (const mrbc_value *hash)
static int mrbc_hash_resize (mrbc_value *hash, int size)
static mrbc_hash_iterator mrbc_hash_iterator_new (const mrbc_value *v)
static int mrbc_hash_i_has_next (mrbc_hash_iterator *ite)
static mrbc_valuemrbc_hash_i_next (mrbc_hash_iterator *ite)

Detailed Description

mruby/c Hash class

Copyright (C) 2015- Kyushu Institute of Technology.
Copyright (C) 2015- Shimane IT Open-Innovation Center.

This file is distributed under BSD 3-Clause License.

Definition in file c_hash.h.

Typedef Documentation

◆ mrbc_hash

typedef struct RHash mrbc_hash

Hash object.

◆ mrbc_hash_iterator

Define Hash iterator.

Function Documentation

◆ mrbc_hash_i_has_next()

int mrbc_hash_i_has_next ( mrbc_hash_iterator * ite)
inlinestatic

iterator has_next?

Definition at line 133 of file c_hash.h.

Here is the caller graph for this function:

◆ mrbc_hash_i_next()

mrbc_value * mrbc_hash_i_next ( mrbc_hash_iterator * ite)
inlinestatic

iterator getter

Definition at line 141 of file c_hash.h.

Here is the caller graph for this function:

◆ mrbc_hash_iterator_new()

mrbc_hash_iterator mrbc_hash_iterator_new ( const mrbc_value * v)
inlinestatic

iterator constructor

Code example

while( mrbc_hash_i_has_next( &ite ) ) {
// using kv[0] as key, kv[1] as value
}
static mrbc_value * mrbc_hash_i_next(mrbc_hash_iterator *ite)
Definition c_hash.h:141
static int mrbc_hash_i_has_next(mrbc_hash_iterator *ite)
Definition c_hash.h:133
struct RHashIterator mrbc_hash_iterator
Define Hash iterator.
static mrbc_hash_iterator mrbc_hash_iterator_new(const mrbc_value *v)
Definition c_hash.h:120
struct RObject mrbc_value
Definition value.h:174

Definition at line 120 of file c_hash.h.

Here is the caller graph for this function:

◆ mrbc_hash_resize()

int mrbc_hash_resize ( mrbc_value * hash,
int size )
inlinestatic

resize buffer

Definition at line 102 of file c_hash.h.

Here is the call graph for this function:

◆ mrbc_hash_size()

int mrbc_hash_size ( const mrbc_value * hash)
inlinestatic

get size

Definition at line 86 of file c_hash.h.

Here is the caller graph for this function: