|
Supplying default OUTPUT values: msg#00146programming.swig
I am attempting to wrap a function which opens a log file for use with Perl. The function signature is: log_t * log_open(int version, const char *path, int *err); In my SWIG interface file, I've specified this as: %include "typemap.i" %apply int *OUTPUT { int *error }; extern log_t * log_open(int, const char *, int *error); When I compile the module and use this function as: ($ptr, $err) = log_open($version, $path); I get a random value in $err if the operation was successful. When an actual error occurs, $err is set properly. 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())? Thanks in advance, 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> |
|---|---|---|
| Previous by Date: | Re: Java char *INOUT doesn't OUT: 00146, William S Fulton |
|---|---|
| Next by Date: | Re: Supplying default OUTPUT values: 00146, William S Fulton |
| Previous by Thread: | Java char *INOUT doesn't OUTi: 00146, Gary Nissen |
| Next by Thread: | Re: Supplying default OUTPUT values: 00146, William S Fulton |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |