B
Bill Kelly
Hi,
I'm trying to copy all the key/value pairs from a Ruby
hash into an STL hash. (BTW, I'm using Ruby 1.8.4 and
cannot change the ruby version easily.)
It looks like rb_hash_foreach() in hash.c does exactly
what I want--allows me to pass in a function pointer,
which it will invoke yielding each key/value pair--but
it's declared static in hash.c.
I looked at duplicating that functionality in my own
C code, but it requires "st.h" as well as constants
such as HASH_DELETED which are defined privately in
hash.c.
Is there a different way I should be going about this?
Thanks for any help,
Bill
I'm trying to copy all the key/value pairs from a Ruby
hash into an STL hash. (BTW, I'm using Ruby 1.8.4 and
cannot change the ruby version easily.)
It looks like rb_hash_foreach() in hash.c does exactly
what I want--allows me to pass in a function pointer,
which it will invoke yielding each key/value pair--but
it's declared static in hash.c.
I looked at duplicating that functionality in my own
C code, but it requires "st.h" as well as constants
such as HASH_DELETED which are defined privately in
hash.c.
Is there a different way I should be going about this?
Thanks for any help,
Bill