From: Edward Liu Date: 2008-01-12T04:12:59+09:00 Subject: Using ruby.h to generate C++ vectors and maps I am trying to use ruby.h to extend Ruby with C/C++. I understand how to deal with numbers and strings, but I am having trouble finding documentation about vectors and maps. Let's say I have this function for example: VALUE read_values(VALUE self, VALUE object); The 'object' variable can represent either a Ruby array or a Ruby hash. If it is a Ruby array, I want to translate it to a vector. If it is a Ruby hash, I want to translate it to a map. I know for integers, there is a macro called NUM2INT that converts a Ruby number into a C/C++ integer. For strings, I know that the function StringValueCStr does what I want. I couldn't find it in the ruby.h documentation, but is there any similar functionality in ruby.h for translating to vectors and maps? If so, what is the functionality? If there is not a direct translation, what would be the best approach to do my task? I'd like to avoid using another protocol, like SWIG, for this task, if possible. Thanks, Edward -- Posted via http://www.ruby-forum.com/.