summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2018-08-25 09:08:16 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2018-08-25 09:41:21 +0900
commit3554fc54de68e2cf92121147df071b57b50663b1 (patch)
tree60761e2f1e6a63d381ac91a8854d83ce5a488df2 /include
parentb06dad43fa37ea0edc870202c5d3ad271efacf03 (diff)
downloadmruby-3554fc54de68e2cf92121147df071b57b50663b1.tar.gz
mruby-3554fc54de68e2cf92121147df071b57b50663b1.zip
Add a new function `mrb_hash_merge()`.
Diffstat (limited to 'include')
-rw-r--r--include/mruby/hash.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/mruby/hash.h b/include/mruby/hash.h
index 9a3812850..2026c8e0d 100644
--- a/include/mruby/hash.h
+++ b/include/mruby/hash.h
@@ -174,6 +174,16 @@ MRB_API mrb_value mrb_hash_clear(mrb_state *mrb, mrb_value hash);
*/
MRB_API mrb_value mrb_hash_dup(mrb_state *mrb, mrb_value hash);
+/*
+ * Merges two hashes. The first hash will be modified by the
+ * second hash.
+ *
+ * @param mrb The mruby state reference.
+ * @param hash1 The target hash.
+ * @param hash2 Updating hash
+ */
+MRB_API void mrb_hash_merge(mrb_state *mrb, mrb_value hash1, mrb_value hash2);
+
/* declaration of struct kh_ht */
/* be careful when you touch the internal */
typedef struct {