mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge doc/api/mruby/hash.h.md docs
This commit is contained in:
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user