Reducing pyrun.swg and splitting python.swg into different files

for clarity and for easier maintainance.

pyrun.swg almost the same than 1.3.20, therefore there will be
compatible again.

code generated is reduced by the use and reuse of %fragments.

as usual, all the test-suite is compiling and a much bigger
"test project" too.

with the new typemaps definition should be much eaiser and
uniform add stl/std and user types.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5706 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-02-10 09:50:24 +00:00
commit 68024b15ce
17 changed files with 1465 additions and 1250 deletions

View file

@ -1,17 +1,19 @@
#ifndef __python_ccomplex_i__
#define __python_ccomplex_i__
%include "complex_common.i"
/*
* C complex wrap
* ISO C99: 7.3 Complex arithmetic <complex.h>
* ISO C99: 7.3 Complex arithmetic <complex.h>
*/
%{
#include <complex.h>
%}
/*
*** swig workaround ***
the %{}% around these typedefs must be removed once
swig parser supports 'float complex'...
*/
@ -20,19 +22,18 @@
typedef double complex double_complex;
%}
/* C complex constructor */
#define CCplxConst(r, i) ((r) + I*(i))
%include "complex_common.i"
%swig_cplxflt_conv(float_complex, CCplxFlt,
CCplxConst, creal, cimag);
#define CCOMPLEX(r, i) ((r) + I*(i))
%swig_cplxflt_conv(float_complex, CCplxFlt, CCOMPLEX, creal, cimag)
%swig_cplxdbl_conv(double_complex, CCplxDbl, CCOMPLEX, creal, cimag)
%swig_cplxdbl_conv(double_complex, CCplxDbl,
CCplxConst, creal, cimag);
/* declaring the typemaps */
%typemap_asfrom(float_complex, CPLXFLT,
SWIG_PyObj_AsCCplxFlt, SWIG_PyObj_FromCCplxFlt);
%typemap_asfrom(double_complex, CPLXDBL,
SWIG_PyObj_AsCCplxDbl, SWIG_PyObj_FromCCplxDbl);
%typemap_stype(float_complex, CPLXFLT, CCplxFlt);
%typemap_stype(double_complex, CPLXDBL, CCplxDbl);
%apply double_complex { complex };