Hi Ian,

Any method call that you can do in Ruby you can do in general in C with
"rb_funcall" (and several variants of it).  So

    anObject.method (arg1, arg2, ...)

can in general be translated to

    rb_funcall (anObject, rb_intern ("method"), n_args, arg1, arg2, ...)

Regards,

Bill
==========================================================================
Ian Macdonald <ian / caliban.org> wrote:
> Hi,

> How do you call pack and unpack from C when writing an extension?

> I would expect there to be rb_ary_pack() and rb_str_unpack() functions
> defined in ruby.h or intern.h, but they're not there.

> As usual, I have the feeling I'm missing something obvious, but we'll
> see.

> Ian
> -- 
> Ian Macdonald               | Have no friends not equal to yourself.   --
> ian / caliban.org             | Confucius 
>                             | 
>                             | 
>                             |