|
Re: typemaps for python lists (double,int) as function arguments: msg#00182programming.swig
At 12:15 PM 1/31/03 +0000, Marcus Stojek wrote: Now what do I have to do, if I want to pass an array Marcus, I'm puzzled. Before even taking SWIG into the picture, how would the C function know the length of the array you're passing? Is it some kind of global variable, does the array use some kind of terminator, or (more likely) is the function actually declared as int calc( double*, int size ) ? In the first case, you can simply use the global variable; in the second case, you'll have to use PyList_Size and build the array, including the terminator; in the third case (which I do hope is the one you're using) you can write a typemap for both arguments at once (see http://www.swig.org/Doc1.3/Typemaps.html#n40 for details). Hope this helps, Luigi _______________________________________________ Swig maillist - Swig@xxxxxxxxxxxxxxx http://mailman.cs.uchicago.edu/mailman/listinfo/swig |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [Newbie]:swig wrappers for bootstrapped classes: 00182, Sharma K M |
|---|---|
| Next by Date: | [Newbie]:swig wrappers for bootstrapped classes: 00182, David Beazley |
| Previous by Thread: | typemaps for python lists (double,int) as function argumentsi: 00182, Marcus Stojek |
| Next by Thread: | AW: typemaps for python lists (double,int) as function arguments: 00182, Marcus Stojek |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |