Mapping C long unsigned integer with swig for ruby

Hi everyone

I want to now how can I indicate to swig to consider a n unsigned long
long
function input/output parameter as a ruby BigNum object.

with python, we use the typemap to do the conversion.: for example

/* Convert from Python --> C */
%typemap(in) int {
$1 = PyInt_AsLong($input);
}

/* Convert from C --> Python */
%typemap(out) int {
$result = PyInt_FromLong($1);

is there something equivalent with ruby

thank you

Hi,

At Fri, 14 Nov 2008 01:10:37 +0900,
Lyes A. wrote in [ruby-talk:320166]:

I want to now how can I indicate to swig to consider a n unsigned long long
function input/output parameter as a ruby BigNum object.

Maybe:

/* Convert from Python --> C */
%typemap(in) int {
$1 = ULL2NUM($input);
}

/* Convert from C --> Python */
%typemap(out) int {
$result = NUM2ULL($1);

On 11/13/08, Nobuyoshi N. [email protected] wrote:

Nobu Nakada
Ok thank you, I will try that

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs