[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

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

Alex Katebi

8/7/2008 6:05:00 PM

[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

2 Answers

Tim Hunter

8/7/2008 6:50:00 PM

0

Alex Katebi wrote:
> 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.
--
Posted via http://www.ruby-....

Alex Katebi

8/7/2008 7:07:00 PM

0

[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


On Thu, Aug 7, 2008 at 2:50 PM, Tim Hunter <rmagick@gmail.com> wrote:

> Alex Katebi wrote:
> > 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.
> --
> Posted via http://www.ruby-....
>
>