Skip to content

Commit

Permalink
Merge doc/api/mruby/hash.h.md docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sagmor committed Oct 8, 2015
1 parent 5dfdd53 commit 11fb10a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions include/mruby/hash.h
Expand Up @@ -24,15 +24,39 @@ struct RHash {
#define mrb_hash_value(p) mrb_obj_value((void*)(p))

MRB_API mrb_value mrb_hash_new_capa(mrb_state*, int);

/*
* Initializes a new hash.
*/
MRB_API mrb_value mrb_hash_new(mrb_state *mrb);

/*
* Sets a keys and values to hashes.
*/
MRB_API void mrb_hash_set(mrb_state *mrb, mrb_value hash, mrb_value key, mrb_value val);

/*
* Gets a value from a key.
*/
MRB_API mrb_value mrb_hash_get(mrb_state *mrb, mrb_value hash, mrb_value key);

MRB_API mrb_value mrb_hash_fetch(mrb_state *mrb, mrb_value hash, mrb_value key, mrb_value def);

/*
* Deletes hash key and value pair.
*/
MRB_API mrb_value mrb_hash_delete_key(mrb_state *mrb, mrb_value hash, mrb_value key);

/*
* Gets an array of keys.
*/
MRB_API mrb_value mrb_hash_keys(mrb_state *mrb, mrb_value hash);
MRB_API mrb_value mrb_check_hash_type(mrb_state *mrb, mrb_value hash);
MRB_API mrb_value mrb_hash_empty_p(mrb_state *mrb, mrb_value self);

/*
* Clears the hash.
*/
MRB_API mrb_value mrb_hash_clear(mrb_state *mrb, mrb_value hash);

/* RHASH_TBL allocates st_table if not available. */
Expand Down

0 comments on commit 11fb10a

Please sign in to comment.