diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-01-07 12:46:38 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-01-07 12:46:38 +0900 |
| commit | 725b3ca5a74023947d10049eb54576163a781098 (patch) | |
| tree | 19c3d032644490d9d67b8a1f89fca37339042944 /include | |
| parent | 7c82bfa7fe17ef7b44d55f058bb4be14eb7e62e0 (diff) | |
| download | mruby-725b3ca5a74023947d10049eb54576163a781098.tar.gz mruby-725b3ca5a74023947d10049eb54576163a781098.zip | |
move KHASH_DECLARE(ht..) to mruby/hash.h; close #3073
Diffstat (limited to 'include')
| -rw-r--r-- | include/mruby/hash.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/mruby/hash.h b/include/mruby/hash.h index 1d00a33ab..21366c459 100644 --- a/include/mruby/hash.h +++ b/include/mruby/hash.h @@ -8,6 +8,7 @@ #define MRUBY_HASH_H #include "common.h" +#include <mruby/khash.h> /** * Hash class @@ -59,6 +60,15 @@ MRB_API mrb_value mrb_hash_empty_p(mrb_state *mrb, mrb_value self); */ MRB_API mrb_value mrb_hash_clear(mrb_state *mrb, mrb_value hash); +/* declaration of struct kh_ht */ +/* be careful when you touch the internal */ +typedef struct { + mrb_value v; + mrb_int n; +} mrb_hash_value; + +KHASH_DECLARE(ht, mrb_value, mrb_hash_value, TRUE) + /* RHASH_TBL allocates st_table if not available. */ #define RHASH(obj) ((struct RHash*)(mrb_ptr(obj))) #define RHASH_TBL(h) (RHASH(h)->ht) |
