How to save 32bit and 64 bit integers in ruby extension

A

Alex Katebi

[Note: parts of this message were removed to make it a legal post.]

Hi All,

How can I read and write 32bit or 64bit values into my C extension.

Thanks,
-Alex
 
T

Tim Hunter

Alex said:
Hi All,

How can I read and write 32bit or 64bit values into my C extension.

Thanks,
-Alex

Check out the ruby.h header file. Look for macros for converting C
numeric values to Ruby numeric values, such as LONG2NUM/NUM2LONG and
LL2NUM/NUM2LL.
 
A

Alex Katebi

[Note: parts of this message were removed to make it a legal post.]

Hi Tim,

LL2NUM/NUM2LL did the job. Since I did not see this in the README.EXT of
the 1.9 code base I assumed it did not exist. Next time I will read the
header files better.

Thanks so much!
-Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top