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

Discussion in 'Ruby' started by Alex Katebi, Aug 7, 2008.

  1. Alex Katebi

    Alex Katebi Guest

    [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
     
    Alex Katebi, Aug 7, 2008
    #1
    1. Advertisements

  2. Alex Katebi

    Tim Hunter Guest

    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.
     
    Tim Hunter, Aug 7, 2008
    #2
    1. Advertisements

  3. Alex Katebi

    Alex Katebi Guest

    [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
     
    Alex Katebi, Aug 7, 2008
    #3
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.