logo       

Re: Supplying default OUTPUT values: msg#00165

programming.swig

Subject: Re: Supplying default OUTPUT values

On Wed, 2004-09-22 at 13:52, William S Fulton wrote:
> > Can I have SWIG assign a default value to *error, such that the value of
> > $err is either zero (preferred), or undef? Alternately, is there a way
> > to have SWIG override 'errno', such that $! in perl would behave as
> > expected (e.g. numeric value from *error, and string value set by
> > another wrapped function log_err())?
> >
>
> Supply a new "in" typemap with your default value...
>
> %include "typemaps.i"
> %typemap(in,numinputs=0) int *OUTPUT(int temp = -1) "$1 = &temp;";
>
> William

William,

Thanks for the reply -- worked like a charm.

Regards,
Cory.


--
Cory Omand <Cory.Omand@xxxxxxx>

_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise