Merge branch 'master' into gsoc2009-matevz
parser.y still to be fixed up Conflicts: Doc/Devel/engineering.html Examples/Makefile.in Lib/allegrocl/allegrocl.swg Lib/csharp/csharp.swg Lib/csharp/enums.swg Lib/csharp/enumsimple.swg Lib/csharp/enumtypesafe.swg Lib/java/java.swg Lib/python/pydocs.swg Lib/r/rtype.swg Source/Include/swigwarn.h Source/Modules/octave.cxx Source/Modules/python.cxx Source/Modules/ruby.cxx Source/Swig/scanner.c Source/Swig/stype.c Source/Swig/swig.h configure.ac
This commit is contained in:
commit
e805d5f925
1074 changed files with 54339 additions and 20134 deletions
192
Lib/r/rtype.swg
192
Lib/r/rtype.swg
|
|
@ -4,24 +4,9 @@
|
|||
*/
|
||||
|
||||
%typemap("rtype") int, int *, int & "integer";
|
||||
%apply int {size_t}
|
||||
%apply int {std::size_t}
|
||||
%apply int {ptrdiff_t}
|
||||
%apply int {std::ptrdiff_t}
|
||||
%apply int {signed int}
|
||||
%apply int {unsigned int}
|
||||
%apply int {short}
|
||||
%apply int {unsigned short}
|
||||
|
||||
%typemap("rtype") long, long *, long & "integer";
|
||||
%apply long {long long}
|
||||
%apply long {signed long long}
|
||||
%apply long {unsigned long long}
|
||||
%apply long {signed long}
|
||||
%apply long {unsigned long}
|
||||
|
||||
%typemap("rtype") float, float*, float & "numeric";
|
||||
%typemap("rtype") double, double*, double & "numeric";
|
||||
%typemap("rtype") float, float *, float & "numeric";
|
||||
%typemap("rtype") char *, char ** "character";
|
||||
%typemap("rtype") char "character";
|
||||
%typemap("rtype") string, string *, string & "character";
|
||||
|
|
@ -38,8 +23,44 @@
|
|||
%typemap("rtype") SWIGTYPE && "$R_class";
|
||||
%typemap("rtype") SWIGTYPE "$&R_class";
|
||||
|
||||
%typemap("rtypecheck") int, int &, long, long &
|
||||
%{ (is.integer($arg) || is.numeric($arg)) && length($arg) == 1 %}
|
||||
%typemap("rtypecheck") int *, long *
|
||||
%{ is.integer($arg) || is.numeric($arg) %}
|
||||
|
||||
|
||||
%typemap("rtypecheck") float, double
|
||||
%{ is.numeric($arg) && length($arg) == 1 %}
|
||||
%typemap("rtypecheck") float *, double *
|
||||
%{ is.numeric($arg) %}
|
||||
|
||||
%typemap("rtypecheck") bool, bool &
|
||||
%{ is.logical($arg) && length($arg) == 1 %}
|
||||
%typemap("rtypecheck") bool *
|
||||
%{ is.logical($arg) %}
|
||||
|
||||
/*
|
||||
Set up type checks to insure overloading precedence.
|
||||
We would like non pointer items to shadow pointer items, so that
|
||||
they get called if length = 1
|
||||
*/
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_BOOL) bool {}
|
||||
%typecheck(SWIG_TYPECHECK_UINT32) unsigned int {}
|
||||
%typecheck(SWIG_TYPECHECK_INTEGER) int {}
|
||||
%typecheck(SWIG_TYPECHECK_FLOAT) float {}
|
||||
%typecheck(SWIG_TYPECHECK_DOUBLE) double {}
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_BOOL_PTR) bool * {}
|
||||
%typecheck(SWIG_TYPECHECK_INT32_PTR) int * {}
|
||||
%typecheck(SWIG_TYPECHECK_FLOAT_PTR) float * {}
|
||||
%typecheck(SWIG_TYPECHECK_DOUBLE_PTR) double * {}
|
||||
%typecheck(SWIG_TYPECHECK_CHAR_PTR) char * {}
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_INT32_ARRAY) int[ANY] {}
|
||||
%typecheck(SWIG_TYPECHECK_FLOAT_ARRAY) float[ANY] {}
|
||||
%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY) double [ANY] {}
|
||||
|
||||
/* Have to be careful that as(x, "numeric") is different from as.numeric(x).
|
||||
The latter makes a REALSXP, whereas the former leaves an INTSXP as an
|
||||
INTSXP.
|
||||
|
|
@ -53,9 +74,8 @@
|
|||
%{ $input = as.integer($input); %}
|
||||
%typemap(scoercein) long, long *, long &
|
||||
%{ $input = as.integer($input); %}
|
||||
%typemap(scoercein) double, double *, double &
|
||||
%{ %}
|
||||
%typemap(scoercein) float, float *, float &
|
||||
%typemap(scoercein) float, float*, float &,
|
||||
double, double *, double &
|
||||
%{ %}
|
||||
%typemap(scoercein) char, char *, char &
|
||||
%{ $input = as($input, "character"); %}
|
||||
|
|
@ -74,9 +94,8 @@
|
|||
%typemap(scoercein) enum SWIGTYPE *const
|
||||
%{ $input = enumToInteger($input, "$R_class"); %}
|
||||
|
||||
|
||||
%typemap(scoercein) SWIGTYPE, SWIGTYPE *, SWIGTYPE *const, SWIGTYPE &, SWIGTYPE &&
|
||||
%{ %}
|
||||
%{ if (inherits($input, "ExternalReference")) $input = slot($input,"ref") %}
|
||||
|
||||
/*
|
||||
%typemap(scoercein) SWIGTYPE *, SWIGTYPE *const
|
||||
|
|
@ -106,12 +125,10 @@
|
|||
%typemap(scoercein) int,
|
||||
int *,
|
||||
int &,
|
||||
int[ANY],
|
||||
long,
|
||||
long *,
|
||||
long &,
|
||||
long[ANY]
|
||||
"$input = as.integer($input); ";
|
||||
long &
|
||||
"$input = as.integer($input);";
|
||||
|
||||
%typemap(scoercein) char *, string, std::string,
|
||||
string &, std::string &
|
||||
|
|
@ -132,30 +149,44 @@ string &, std::string &
|
|||
%typemap(scoerceout) enum SWIGTYPE *const
|
||||
%{ $result = enumToInteger($result, "$R_class"); %}
|
||||
|
||||
#%typemap(scoerceout) SWIGTYPE
|
||||
# %{ class($result) <- "$&R_class"; %}
|
||||
|
||||
%typemap(scoerceout) SWIGTYPE
|
||||
%{ class($result) <- "$&R_class"; %}
|
||||
#%typemap(scoerceout) SWIGTYPE &
|
||||
# %{ class($result) <- "$R_class"; %}
|
||||
|
||||
%typemap(scoerceout) SWIGTYPE &
|
||||
%{ class($result) <- "$R_class"; %}
|
||||
#%typemap(scoerceout) SWIGTYPE *
|
||||
# %{ class($result) <- "$R_class"; %}
|
||||
|
||||
%typemap(scoerceout) SWIGTYPE &&
|
||||
%{ class($result) <- "$R_class"; %}
|
||||
#%typemap(scoerceout) SWIGTYPE *const
|
||||
# %{ class($result) <- "$R_class"; %}
|
||||
|
||||
%typemap(scoerceout) SWIGTYPE *
|
||||
%{ class($result) <- "$R_class"; %}
|
||||
%typemap(scoerceout) SWIGTYPE
|
||||
%{ $result <- new("$&R_class", ref=$result); %}
|
||||
|
||||
%typemap(scoerceout) SWIGTYPE &
|
||||
%{ $result <- new("$R_class", ref=$result) ; %}
|
||||
|
||||
%typemap(scoerceout) SWIGTYPE &&
|
||||
%{ $result <- new("$R_class", ref=$result) ; %}
|
||||
|
||||
%typemap(scoerceout) SWIGTYPE *
|
||||
%{ $result <- new("$R_class", ref=$result) ; %}
|
||||
|
||||
%typemap(scoerceout) SWIGTYPE *const
|
||||
%{ $result <- new("$R_class", ref=$result) ; %}
|
||||
|
||||
%typemap(scoerceout) SWIGTYPE *const
|
||||
%{ class($result) <- "$R_class"; %}
|
||||
|
||||
/* Override the SWIGTYPE * above. */
|
||||
%typemap(scoerceout) char,
|
||||
char *,
|
||||
char &,
|
||||
double,
|
||||
double &,
|
||||
float,
|
||||
double,
|
||||
float*,
|
||||
double*,
|
||||
float &,
|
||||
double &,
|
||||
int,
|
||||
int &,
|
||||
long,
|
||||
|
|
@ -183,9 +214,94 @@ string &, std::string &
|
|||
signed long,
|
||||
signed long &,
|
||||
unsigned long,
|
||||
unsigned long &
|
||||
unsigned long &,
|
||||
signed char,
|
||||
signed char &,
|
||||
unsigned char,
|
||||
unsigned char &
|
||||
%{ %}
|
||||
|
||||
%apply int {size_t,
|
||||
std::size_t,
|
||||
ptrdiff_t,
|
||||
std::ptrdiff_t,
|
||||
signed int,
|
||||
unsigned int,
|
||||
short,
|
||||
unsigned short,
|
||||
signed char,
|
||||
unsigned char}
|
||||
|
||||
%apply int* {size_t[],
|
||||
std::size_t[],
|
||||
ptrdiff_t[],
|
||||
std::ptrdiff_t[],
|
||||
signed int[],
|
||||
unsigned int[],
|
||||
short[],
|
||||
unsigned short[],
|
||||
signed char[],
|
||||
unsigned char[]}
|
||||
|
||||
%apply int* {size_t[ANY],
|
||||
std::size_t[ANY],
|
||||
ptrdiff_t[ANY],
|
||||
std::ptrdiff_t[ANY],
|
||||
signed int[ANY],
|
||||
unsigned int[ANY],
|
||||
short[ANY],
|
||||
unsigned short[ANY],
|
||||
signed char[ANY],
|
||||
unsigned char[ANY]}
|
||||
|
||||
%apply int* {size_t*,
|
||||
std::size_t*,
|
||||
ptrdiff_t*,
|
||||
std::ptrdiff_t*,
|
||||
signed int*,
|
||||
unsigned int*,
|
||||
short*,
|
||||
unsigned short*,
|
||||
signed char*,
|
||||
unsigned char*}
|
||||
|
||||
%apply long {
|
||||
long long,
|
||||
signed long long,
|
||||
unsigned long long,
|
||||
signed long,
|
||||
unsigned long}
|
||||
|
||||
%apply long* {
|
||||
long long*,
|
||||
signed long long*,
|
||||
unsigned long long*,
|
||||
signed long*,
|
||||
unsigned long*,
|
||||
long long[],
|
||||
signed long long[],
|
||||
unsigned long long[],
|
||||
signed long[],
|
||||
unsigned long[],
|
||||
long long[ANY],
|
||||
signed long long[ANY],
|
||||
unsigned long long[ANY],
|
||||
signed long[ANY],
|
||||
unsigned long[ANY]}
|
||||
|
||||
%apply float* {
|
||||
float[],
|
||||
float[ANY]
|
||||
}
|
||||
%apply double * {
|
||||
double[],
|
||||
double[ANY]
|
||||
}
|
||||
|
||||
%apply bool* {
|
||||
bool[],
|
||||
bool[ANY]
|
||||
}
|
||||
|
||||
#if 0
|
||||
Just examining the values for a SWIGTYPE.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue