diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /devtools/swigwin-1.3.34/Lib/r | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'devtools/swigwin-1.3.34/Lib/r')
20 files changed, 1629 insertions, 0 deletions
diff --git a/devtools/swigwin-1.3.34/Lib/r/cdata.i b/devtools/swigwin-1.3.34/Lib/r/cdata.i new file mode 100644 index 0000000..3679659 --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/cdata.i @@ -0,0 +1 @@ +%include <typemaps/cdata.swg> diff --git a/devtools/swigwin-1.3.34/Lib/r/exception.i b/devtools/swigwin-1.3.34/Lib/r/exception.i new file mode 100644 index 0000000..39cb095 --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/exception.i @@ -0,0 +1,8 @@ +%include <typemaps/exception.swg> + + +%insert("runtime") { + %define_as(SWIG_exception(code, msg), +%block(switch (code) {case SWIG_IndexError: return Rf_ScalarLogical(NA_LOGICAL); default: %error(code, msg); SWIG_fail;} )) +} + diff --git a/devtools/swigwin-1.3.34/Lib/r/r.swg b/devtools/swigwin-1.3.34/Lib/r/r.swg new file mode 100644 index 0000000..3095529 --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/r.swg @@ -0,0 +1,208 @@ +/* */ + + +%insert("header") "swiglabels.swg" + +%insert("header") "swigerrors.swg" +%insert("init") "swiginit.swg" +%insert("runtime") "swigrun.swg" +%insert("runtime") "rrun.swg" + +%init %{ +SWIGEXPORT void SWIG_init(void) { +%} + +#define %Rruntime %insert("s") + +#define SWIG_Object SEXP +#define VOID_Object R_NilValue + +#define %append_output(obj) SET_VECTOR_ELT($result, $n, obj) + +%define %set_constant(name, obj) %begin_block + SEXP _obj = obj; + assign(name, _obj); +%end_block %enddef + +%define %raise(obj,type,desc) +return R_NilValue; +%enddef + +%insert("sinit") "srun.swg" + +%insert("sinitroutine") %{ +SWIG_init(); +SWIG_InitializeModule(0); +%} + +%include <typemaps/swigmacros.swg> +%typemap(in) (double *x, int len) %{ + $1 = REAL(x); + $2 = Rf_length(x); +%} + +/* XXX + Need to worry about inheritance, e.g. if B extends A + and we are looking for an A[], then B elements are okay. +*/ +%typemap(scheck) SWIGTYPE[ANY] + %{ +# assert(length($input) > $1_dim0) + assert(all(sapply($input, class) == "$R_class")) + %} + +%typemap(out) void ""; + +%typemap(in) int *, int[ANY] %{ + $1 = INTEGER($input); +%} + +%typemap(in) double *, double[ANY] %{ + $1 = REAL($input); +%} + +/* Shoul dwe recycle to make the length correct. + And warn if length() > the dimension. +*/ +%typemap(scheck) SWIGTYPE [ANY] %{ +# assert(length($input) >= $1_dim0) +%} + +/* Handling vector case to avoid warnings, + although we just use the first one. */ +%typemap(scheck) unsigned int %{ + assert(length($input) == 1 && $input >= 0, "All values must be non-negative") +%} + + +%typemap(scheck) int %{ + if(length($input) > 1) { + Rf_warning("using only the first element of $input") + } +%} + + +%include <typemaps/swigmacros.swg> +%include <typemaps/fragments.swg> +%include <rfragments.swg> +%include <ropers.swg> +%include <typemaps/swigtypemaps.swg> +%include <rtype.swg> + +%apply int[ANY] { enum SWIGTYPE[ANY] }; + +%typemap(in,noblock=1) enum SWIGTYPE[ANY] { + $1 = %reinterpret_cast(INTEGER($input), $1_ltype); +} + +%typemap(in,noblock=1,fragment="SWIG_strdup") char* { + $1 = %reinterpret_cast(SWIG_strdup(CHAR(STRING_ELT($input, 0))), $1_ltype); +} + +%typemap(freearg,noblock=1) char* { + free($1); +} + +%typemap(in,noblock=1,fragment="SWIG_strdup") char *[ANY] { + $1 = %reinterpret_cast(SWIG_strdup(CHAR(STRING_ELT($input, 0))), $1_ltype); +} + +%typemap(freearg,noblock=1) char *[ANY] { + free($1); +} + +%typemap(in,noblock=1,fragment="SWIG_strdup") char[ANY] { + $1 = SWIG_strdup(CHAR(STRING_ELT($input, 0))); +} + +%typemap(freearg,noblock=1) char[ANY] { + free($1); +} + +%typemap(in,noblock=1,fragment="SWIG_strdup") char[] { + $1 = SWIG_strdup(CHAR(STRING_ELT($input, 0))); +} + +%typemap(freearg,noblock=1) char[] { + free($1); +} + + +%typemap(memberin) char[] %{ +if ($input) strcpy($1, $input); +else +strcpy($1, ""); +%} + +%typemap(globalin) char[] %{ +if ($input) strcpy($1, $input); +else +strcpy($1, ""); +%} + +%typemap(out,noblock=1) char* + { $result = $1 ? Rf_mkString(%reinterpret_cast($1,char *)) : R_NilValue; } + +%typemap(in,noblock=1) char { +$1 = %static_cast(CHAR(STRING_ELT($input, 0))[0],$1_ltype); +} + +%typemap(out) char + { + char tmp[2] = "x"; + tmp[0] = $1; + $result = Rf_mkString(tmp); + } + + +%typemap(in,noblock=1) int { + $1 = %static_cast(INTEGER($input)[0], $1_ltype); +} + +%typemap(out,noblock=1) int + "$result = Rf_ScalarInteger($1);"; + + +%typemap(in,noblock=1) bool + "$1 = LOGICAL($input)[0] ? true : false;"; + + +%typemap(out,noblock=1) bool + "$result = Rf_ScalarLogical($1);"; + +%typemap(in,noblock=1) unsigned int, + unsigned long, + float, + double, + long +{ + $1 = %static_cast(REAL($input)[0], $1_ltype); +} + + +%typemap(out,noblock=1) unsigned int * + "$result = ScalarReal(*($1));"; + +%Rruntime %{ +setMethod('[', "ExternalReference", +function(x,i,j, ..., drop=TRUE) +if (!is.null(x$"__getitem__")) +sapply(i, function(n) x$"__getitem__"(i=as.integer(n-1)))) + +setMethod('[<-' , "ExternalReference", +function(x,i,j, ..., value) +if (!is.null(x$"__setitem__")) { +sapply(1:length(i), function(n) +x$"__setitem__"(i=as.integer(i[n]-1), x=value[n])) +x +}) + +setAs('ExternalReference', 'character', +function(from) {if (!is.null(from$"__str__")) from$"__str__"()}) + +setMethod('print', 'ExternalReference', +function(x) {print(as(x, "character"))}) +%} + + + diff --git a/devtools/swigwin-1.3.34/Lib/r/rcontainer.swg b/devtools/swigwin-1.3.34/Lib/r/rcontainer.swg new file mode 100644 index 0000000..d6d54d7 --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/rcontainer.swg @@ -0,0 +1,198 @@ + +// +// Common fragments +// + + +/**** The python container methods ****/ + + + +%fragment("RSequence_Base","header") +{ +%#include <functional> +namespace swig { + inline size_t + check_index(ptrdiff_t i, size_t size, bool insert = false) { + if ( i < 0 ) { + if ((size_t) (-i) <= size) + return (size_t) (i + size); + } else if ( (size_t) i < size ) { + return (size_t) i; + } else if (insert && ((size_t) i == size)) { + return size; + } + + throw std::out_of_range("index out of range"); + } + + inline size_t + slice_index(ptrdiff_t i, size_t size) { + if ( i < 0 ) { + if ((size_t) (-i) <= size) { + return (size_t) (i + size); + } else { + throw std::out_of_range("index out of range"); + } + } else { + return ( (size_t) i < size ) ? ((size_t) i) : size; + } + } + + template <class Sequence, class Difference> + inline typename Sequence::iterator + getpos(Sequence* self, Difference i) { + typename Sequence::iterator pos = self->begin(); + std::advance(pos, check_index(i,self->size())); + return pos; + } + + template <class Sequence, class Difference> + inline typename Sequence::const_iterator + cgetpos(const Sequence* self, Difference i) { + typename Sequence::const_iterator pos = self->begin(); + std::advance(pos, check_index(i,self->size())); + return pos; + } + + template <class Sequence, class Difference> + inline Sequence* + getslice(const Sequence* self, Difference i, Difference j) { + typename Sequence::size_type size = self->size(); + typename Sequence::size_type ii = swig::check_index(i, size); + typename Sequence::size_type jj = swig::slice_index(j, size); + + if (jj > ii) { + typename Sequence::const_iterator vb = self->begin(); + typename Sequence::const_iterator ve = self->begin(); + std::advance(vb,ii); + std::advance(ve,jj); + return new Sequence(vb, ve); + } else { + return new Sequence(); + } + } + + template <class Sequence, class Difference, class InputSeq> + inline void + setslice(Sequence* self, Difference i, Difference j, const InputSeq& v) { + typename Sequence::size_type size = self->size(); + typename Sequence::size_type ii = swig::check_index(i, size, true); + typename Sequence::size_type jj = swig::slice_index(j, size); + if (jj < ii) jj = ii; + size_t ssize = jj - ii; + if (ssize <= v.size()) { + typename Sequence::iterator sb = self->begin(); + typename InputSeq::const_iterator vmid = v.begin(); + std::advance(sb,ii); + std::advance(vmid, jj - ii); + self->insert(std::copy(v.begin(), vmid, sb), vmid, v.end()); + } else { + typename Sequence::iterator sb = self->begin(); + typename Sequence::iterator se = self->begin(); + std::advance(sb,ii); + std::advance(se,jj); + self->erase(sb,se); + self->insert(sb, v.begin(), v.end()); + } + } + + template <class Sequence, class Difference> + inline void + delslice(Sequence* self, Difference i, Difference j) { + typename Sequence::size_type size = self->size(); + typename Sequence::size_type ii = swig::check_index(i, size, true); + typename Sequence::size_type jj = swig::slice_index(j, size); + if (jj > ii) { + typename Sequence::iterator sb = self->begin(); + typename Sequence::iterator se = self->begin(); + std::advance(sb,ii); + std::advance(se,jj); + self->erase(sb,se); + } + } +} +} + +%define %swig_container_methods(Container...) + + %newobject __getslice__; + + %extend { + bool __nonzero__() const { + return !(self->empty()); + } + + size_type __len__() const { + return self->size(); + } + } +%enddef + +%define %swig_sequence_methods_common(Sequence...) +// %swig_sequence_iterator(%arg(Sequence)) + %swig_container_methods(%arg(Sequence)) + + %fragment("RSequence_Base"); + + %extend { + value_type pop() throw (std::out_of_range) { + if (self->size() == 0) + throw std::out_of_range("pop from empty container"); + Sequence::value_type x = self->back(); + self->pop_back(); + return x; + } + + Sequence* __getslice__(difference_type i, difference_type j) throw (std::out_of_range) { + return swig::getslice(self, i, j); + } + + void __setslice__(difference_type i, difference_type j, const Sequence& v) + throw (std::out_of_range, std::invalid_argument) { + swig::setslice(self, i, j, v); + } + + void __delslice__(difference_type i, difference_type j) throw (std::out_of_range) { + swig::delslice(self, i, j); + } + + void __delitem__(difference_type i) throw (std::out_of_range) { + self->erase(swig::getpos(self,i)); + } + } +%enddef + +%define %swig_sequence_methods(Sequence...) + %swig_sequence_methods_common(%arg(Sequence)) + %extend { + const value_type& __getitem__(difference_type i) const throw (std::out_of_range) { + return *(swig::cgetpos(self, i)); + } + + void __setitem__(difference_type i, const value_type& x) throw (std::out_of_range) { + *(swig::getpos(self,i)) = x; + } + + void append(const value_type& x) { + self->push_back(x); + } + } +%enddef + +%define %swig_sequence_methods_val(Sequence...) + %swig_sequence_methods_common(%arg(Sequence)) + %extend { + value_type __getitem__(difference_type i) throw (std::out_of_range) { + return *(swig::cgetpos(self, i)); + } + + void __setitem__(difference_type i, value_type x) throw (std::out_of_range) { + *(swig::getpos(self,i)) = x; + } + + void append(value_type x) { + self->push_back(x); + } + } +%enddef diff --git a/devtools/swigwin-1.3.34/Lib/r/rfragments.swg b/devtools/swigwin-1.3.34/Lib/r/rfragments.swg new file mode 100644 index 0000000..67944b2 --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/rfragments.swg @@ -0,0 +1,177 @@ +#define SWIG_Error(code, msg) Rf_warning(msg); return Rf_ScalarLogical(NA_LOGICAL) + +#define SWIG_fail return Rf_ScalarLogical(NA_LOGICAL) + +/* for raw pointers */ +#define SWIG_ConvertPtr(oc, ptr, ty, flags) SWIG_R_ConvertPtr(oc, ptr, ty, flags) +#define SWIG_ConvertFunctionPtr(oc, ptr, ty) SWIG_R_ConvertPtr(oc, ptr, ty, 0) +#define SWIG_NewPointerObj(ptr, ty, flags) SWIG_R_NewPointerObj(ptr, ty, flags) +#define SWIG_NewFunctionPtrObj(ptr, ty) SWIG_R_NewPointerObj(ptr, ty, 0) + +/* for raw packed data */ +#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_R_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewPackedObj(ptr, sz, ty) SWIG_R_NewPackedObj(ptr, sz, ty) + +/* for class or struct pointers */ +#define SWIG_ConvertInstance(obj, pptr, ty, flags) SWIG_ConvertPtr(obj, pptr, ty, flags) +#define SWIG_NewInstanceObj(ptr, ty, flags) SWIG_NewPointerObj(ptr, ty, flags) + +/* for C++ member pointers, ie, member methods */ +#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_R_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewMemberObj(ptr, sz, ty) SWIG_R_NewPackedObj(ptr, sz, ty) + + +/* Runtime API */ + +#define SWIG_GetModule(clientdata) SWIG_R_GetModule() +#define SWIG_SetModule(clientdata, pointer) SWIG_R_SetModule(pointer) + +%fragment(SWIG_From_frag(long),"header") { +SWIGINTERNINLINE SEXP +SWIG_From_dec(long)(long value) +{ + return Rf_ScalarInteger((int)value); +} +} + +%fragment(SWIG_AsVal_frag(long),"header") { +SWIGINTERNINLINE int +SWIG_AsVal_dec(long)(SEXP obj, long *val) +{ + if (val) *val = Rf_asInteger(obj); + return SWIG_OK; +} +} + + +%fragment(SWIG_From_frag(long long),"header") { +SWIGINTERNINLINE SEXP +SWIG_From_dec(long long)(long long value) +{ + return Rf_ScalarInteger((int)value); +} +} + +%fragment(SWIG_AsVal_frag(long long),"header") { +SWIGINTERNINLINE int +SWIG_AsVal_dec(long long)(SEXP obj, long long *val) +{ + if (val) *val = Rf_asInteger(obj); + return SWIG_OK; +} +} + +%fragment(SWIG_From_frag(unsigned long),"header") { +SWIGINTERNINLINE SEXP +SWIG_From_dec(unsigned long)(unsigned long value) +{ + return Rf_ScalarInteger((int)value); +} +} + + +%fragment(SWIG_AsVal_frag(unsigned long),"header") { +SWIGINTERNINLINE int +SWIG_AsVal_dec(unsigned long)(SEXP obj, unsigned long *val) +{ + if (val) *val = Rf_asInteger(obj); + return SWIG_OK; +} +} + + +%fragment(SWIG_From_frag(unsigned long long),"header") { +SWIGINTERNINLINE SEXP +SWIG_From_dec(unsigned long long)(unsigned long long value) +{ + return Rf_ScalarInteger((int)value); +} +} + + +%fragment(SWIG_AsVal_frag(unsigned long long),"header") { +SWIGINTERNINLINE int +SWIG_AsVal_dec(unsigned long long)(SEXP obj, unsigned long long *val) +{ + if (val) *val = Rf_asInteger(obj); + return SWIG_OK; +} +} + +%fragment(SWIG_From_frag(double),"header") { +SWIGINTERNINLINE SEXP +SWIG_From_dec(double)(double value) +{ + return Rf_ScalarReal(value); +} +} + + +%fragment(SWIG_AsVal_frag(double),"header") { +SWIGINTERNINLINE int +SWIG_AsVal_dec(double)(SEXP obj, double *val) +{ + if (val) *val = Rf_asReal(obj); + return SWIG_OK; +} +} + +%fragment("SWIG_AsCharPtrAndSize", "header") +{ +SWIGINTERN int +SWIG_AsCharPtrAndSize(SEXP obj, char** cptr, size_t* psize, int *alloc) +{ + if (cptr && Rf_isString(obj)) { + const char *cstr = CHAR(STRING_ELT(obj, 0)); + int len = strlen(cstr); + + if (alloc) { + if (*alloc == SWIG_NEWOBJ) { + *cptr = %new_copy_array(cstr, len + 1, char); + *alloc = SWIG_NEWOBJ; + } else { + *cptr = %reinterpret_cast(malloc(len + 1), char *); + *cptr = strcpy(*cptr, cstr); + *alloc = SWIG_OLDOBJ; + } + } else { + *cptr = %reinterpret_cast(malloc(len + 1), char *); + *cptr = strcpy(*cptr, cstr); + } + if (psize) *psize = len + 1; + return SWIG_OK; + } + return SWIG_TypeError; +} +} + +%fragment("SWIG_strdup","header") +{ +SWIGINTERN char * +SWIG_strdup(const char *str) +{ + char *newstr = %reinterpret_cast(malloc(strlen(str) + 1), char *); + return strcpy(newstr, str); +} +} + +# This is modified from the R header files + +%fragment("SWIG_FromCharPtrAndSize","header") +{ +SWIGINTERN SEXP +SWIG_FromCharPtrAndSize(const char* carray, size_t size) +{ + SEXP t, c; + if (!carray) return R_NilValue; + RVERSION26(return Rf_mkCharEnc(carray, size)); + RVERSIONPRE26( + Rf_protect(t = Rf_allocVector(STRSXP, 1)); + c = allocString(size); + strncpy(CHAR(c), carray, size); + SET_STRING_ELT(t, 0, c); + Rf_unprotect(1);) + return t; +} +} + diff --git a/devtools/swigwin-1.3.34/Lib/r/ropers.swg b/devtools/swigwin-1.3.34/Lib/r/ropers.swg new file mode 100644 index 0000000..c02f7b2 --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/ropers.swg @@ -0,0 +1,70 @@ +#ifdef __cplusplus + +// These are auto-supported by the Perl-module +%rename(__plusplus__) *::operator++; +%rename(__minmin__) *::operator--; +%rename(__add__) *::operator+; +%rename(__sub__) *::operator-; +%rename(__neg__) *::operator-(); +%rename(__neg__) *::operator-() const; +%rename(__mul__) *::operator*; +%rename(__div__) *::operator/; +%rename(__eq__) *::operator==; +%rename(__ne__) *::operator!=; +%rename(__mod__) *::operator%; +%rename(__gt__) *::operator>; +%rename(__lt__) *::operator<; +%rename(__not__) *::operator!; + +// These are renamed, but no 'use overload...' is added +%rename(__lshift__) *::operator<<; +%rename(__rshift__) *::operator>>; +%rename(__and__) *::operator&; +%rename(__or__) *::operator|; +%rename(__xor__) *::operator^; +%rename(__invert__) *::operator~; +%rename(__le__) *::operator<=; +%rename(__ge__) *::operator>=; +%rename(__call__) *::operator(); +%rename(__getitem__) *::operator[]; + +%rename(__seteq__) *::operator=; + + +%rename(__land__) operator&&; +%rename(__lor__) operator||; +%rename(__plusplus__) *::operator++; +%rename(__minusminus__) *::operator--; +%rename(__arrowstar__) *::operator->*; +%rename(__index__) *::operator[]; + +%rename(Equal) operator =; +%rename(PlusEqual) operator +=; +%rename(MinusEqual) operator -=; +%rename(MultiplyEqual) operator *=; +%rename(DivideEqual) operator /=; +%rename(PercentEqual) operator %=; +%rename(Plus) operator +; +%rename(Minus) operator -; +%rename(Multiply) operator *; +%rename(Divide) operator /; +%rename(Percent) operator %; +%rename(Not) operator !; +%rename(IndexIntoConst) operator[](unsigned idx) const; +%rename(IndexInto) operator[](unsigned idx); +%rename(Functor) operator (); +%rename(EqualEqual) operator ==; +%rename(NotEqual) operator !=; +%rename(LessThan) operator <; +%rename(LessThanEqual) operator <=; +%rename(GreaterThan) operator >; +%rename(GreaterThanEqual) operator >=; +%rename(And) operator &&; +%rename(Or) operator ||; +%rename(PlusPlusPrefix) operator++(); +%rename(PlusPlusPostfix) operator++(int); +%rename(MinusMinusPrefix) operator--(); +%rename(MinusMinusPostfix) operator--(int); + + +#endif diff --git a/devtools/swigwin-1.3.34/Lib/r/rrun.swg b/devtools/swigwin-1.3.34/Lib/r/rrun.swg new file mode 100644 index 0000000..6159ed6 --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/rrun.swg @@ -0,0 +1,373 @@ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Remove global namespace pollution */ +#if !defined(SWIG_NO_R_NO_REMAP) +# define R_NO_REMAP +#endif +#if !defined(SWIG_NO_STRICT_R_HEADERS) +# define STRICT_R_HEADERS +#endif + +#include <Rdefines.h> +#include <Rversion.h> +#include <stdlib.h> +#include <assert.h> + +#define SWIGR 1 + +#if R_VERSION >= R_Version(2,6,0) +#define VMAXTYPE void * +#define RVERSION26(x) x +#define RVERSIONPRE26(x) +#else +#define VMAXTYPE char * +#define RVERSION26(x) +#define RVERSIONPRE26(x) x +#endif + +/* + This is mainly a way to avoid having lots of local variables that may + conflict with those in the routine. + + Change name to R_SWIG_Callb.... +*/ +typedef struct RCallbackFunctionData { + + SEXP fun; + SEXP userData; + + + SEXP expr; + SEXP retValue; + int errorOccurred; + + SEXP el; /* Temporary pointer used in the construction of the expression to call the R function. */ + + struct RCallbackFunctionData *previous; /* Stack */ + +} RCallbackFunctionData; + +static RCallbackFunctionData *callbackFunctionDataStack; + + +SWIGRUNTIME SEXP +R_SWIG_debug_getCallbackFunctionData() +{ + int n, i; + SEXP ans; + RCallbackFunctionData *p = callbackFunctionDataStack; + + n = 0; + while(p) { + n++; + p = p->previous; + } + + Rf_protect(ans = Rf_allocVector(VECSXP, n)); + for(p = callbackFunctionDataStack, i = 0; i < n; p = p->previous, i++) + SET_VECTOR_ELT(ans, i, p->fun); + + Rf_unprotect(1); + + return(ans); +} + + + +SWIGRUNTIME RCallbackFunctionData * +R_SWIG_pushCallbackFunctionData(SEXP fun, SEXP userData) +{ + RCallbackFunctionData *el; + el = (RCallbackFunctionData *) calloc(1, sizeof(RCallbackFunctionData)); + el->fun = fun; + el->userData = userData; + el->previous = callbackFunctionDataStack; + + callbackFunctionDataStack = el; + + return(el); +} + + +SWIGRUNTIME SEXP +R_SWIG_R_pushCallbackFunctionData(SEXP fun, SEXP userData) +{ + R_SWIG_pushCallbackFunctionData(fun, userData); + return R_NilValue; +} + +SWIGRUNTIME RCallbackFunctionData * +R_SWIG_getCallbackFunctionData() +{ + if(!callbackFunctionDataStack) { + Rf_error("Supposedly impossible error occurred in the SWIG callback mechanism." + " No callback function data set."); + } + + return callbackFunctionDataStack; +} + +SWIGRUNTIME void +R_SWIG_popCallbackFunctionData(int doFree) +{ + RCallbackFunctionData *el = NULL; + if(!callbackFunctionDataStack) + return ; /* Error !!! */ + + el = callbackFunctionDataStack ; + callbackFunctionDataStack = callbackFunctionDataStack->previous; + + if(doFree) + free(el); +} + + +/* + Interface to S function + is(obj, type) + which is to be used to determine if an + external pointer inherits from the right class. + + Ideally, we would like to be able to do this without an explicit call to the is() function. + When the S4 class system uses its own SEXP types, then we will hopefully be able to do this + in the C code. + + Should we make the expression static and preserve it to avoid the overhead of + allocating each time. +*/ +SWIGRUNTIME int +R_SWIG_checkInherits(SEXP obj, SEXP tag, const char *type) +{ + SEXP e, val; + int check_err = 0; + + Rf_protect(e = Rf_allocVector(LANGSXP, 3)); + SETCAR(e, Rf_install("extends")); + + SETCAR(CDR(e), Rf_mkString(CHAR(PRINTNAME(tag)))); + SETCAR(CDR(CDR(e)), Rf_mkString(type)); + + val = R_tryEval(e, R_GlobalEnv, &check_err); + Rf_unprotect(1); + if(check_err) + return(0); + + + return(LOGICAL(val)[0]); +} + + +SWIGRUNTIME void * +R_SWIG_resolveExternalRef(SEXP arg, const char * const type, const char * const argName, Rboolean nullOk) +{ + void *ptr; + SEXP orig = arg; + + if(TYPEOF(arg) != EXTPTRSXP) + arg = GET_SLOT(arg, Rf_mkString("ref")); + + + if(TYPEOF(arg) != EXTPTRSXP) { + Rf_error("argument %s must be an external pointer (from an ExternalReference)", argName); + } + + + ptr = R_ExternalPtrAddr(arg); + + if(ptr == NULL && nullOk == (Rboolean) FALSE) { + Rf_error("the external pointer (of type %s) for argument %s has value NULL", argName, type); + } + + if(type[0] && R_ExternalPtrTag(arg) != Rf_install(type) && strcmp(type, "voidRef") + && !R_SWIG_checkInherits(orig, R_ExternalPtrTag(arg), type)) { + Rf_error("the external pointer for argument %s has tag %s, not the expected value %s", + argName, CHAR(PRINTNAME(R_ExternalPtrTag(arg))), type); + } + + + return(ptr); +} + +SWIGRUNTIME void +R_SWIG_ReferenceFinalizer(SEXP el) +{ + void *ptr = R_SWIG_resolveExternalRef(el, "", "<finalizer>", (Rboolean) 1); + fprintf(stderr, "In R_SWIG_ReferenceFinalizer for %p\n", ptr); + Rf_PrintValue(el); + + if(ptr) { + if(TYPEOF(el) != EXTPTRSXP) + el = GET_SLOT(el, Rf_mkString("ref")); + + if(TYPEOF(el) == EXTPTRSXP) + R_ClearExternalPtr(el); + + free(ptr); + } + + return; +} + +typedef enum {R_SWIG_EXTERNAL, R_SWIG_OWNER } R_SWIG_Owner; + +SWIGRUNTIME SEXP +SWIG_MakePtr(void *ptr, const char *typeName, R_SWIG_Owner owner) +{ + SEXP external, r_obj; + const char *p = typeName; + + if(typeName[0] == '_') + p = typeName + 1; + + Rf_protect(external = R_MakeExternalPtr(ptr, Rf_install(typeName), R_NilValue)); + Rf_protect(r_obj = NEW_OBJECT(MAKE_CLASS((char *) typeName))); + + if(owner) + R_RegisterCFinalizer(external, R_SWIG_ReferenceFinalizer); + + r_obj = SET_SLOT(r_obj, Rf_mkString((char *) "ref"), external); + SET_S4_OBJECT(r_obj); + Rf_unprotect(2); + + return(r_obj); +} + + +SWIGRUNTIME SEXP +R_SWIG_create_SWIG_R_Array(const char *typeName, SEXP ref, int len) +{ + SEXP arr; + +/*XXX remove the char * cast when we can. MAKE_CLASS should be declared appropriately. */ + Rf_protect(arr = NEW_OBJECT(MAKE_CLASS((char *) typeName))); + Rf_protect(arr = R_do_slot_assign(arr, Rf_mkString("ref"), ref)); + Rf_protect(arr = R_do_slot_assign(arr, Rf_mkString("dims"), Rf_ScalarInteger(len))); + + Rf_unprotect(3); + SET_S4_OBJECT(arr); + return arr; +} + +#define ADD_OUTPUT_ARG(result, pos, value, name) r_ans = AddOutputArgToReturn(pos, value, name, OutputValues); + +SWIGRUNTIME SEXP +AddOutputArgToReturn(int pos, SEXP value, const char *name, SEXP output) +{ + SET_VECTOR_ELT(output, pos, value); + + return(output); +} + +/* Create a new pointer object */ +SWIGRUNTIMEINLINE SEXP +SWIG_R_NewPointerObj(void *ptr, swig_type_info *type, int flags) { + SEXP rptr = R_MakeExternalPtr(ptr, + R_MakeExternalPtr(type, R_NilValue, R_NilValue), R_NilValue); + SET_S4_OBJECT(rptr); +// rptr = Rf_setAttrib(rptr, R_ClassSymbol, mkChar(SWIG_TypeName(type))); + return rptr; +} + +/* Convert a pointer value */ +SWIGRUNTIMEINLINE int +SWIG_R_ConvertPtr(SEXP obj, void **ptr, swig_type_info *ty, int flags) { + void *vptr; + if (!obj) return SWIG_ERROR; + if (obj == R_NilValue) { + if (ptr) *ptr = NULL; + return SWIG_OK; + } + + vptr = R_ExternalPtrAddr(obj); + if (ty) { + swig_type_info *to = (swig_type_info*) + R_ExternalPtrAddr(R_ExternalPtrTag(obj)); + if (to == ty) { + if (ptr) *ptr = vptr; + } else { + swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); + int newmemory = 0; + if (ptr) *ptr = SWIG_TypeCast(tc,vptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + } + } else { + if (ptr) *ptr = vptr; + } + return SWIG_OK; +} + +SWIGRUNTIME swig_module_info * +SWIG_GetModule(void *v) { + static void *type_pointer = (void *)0; + return (swig_module_info *) type_pointer; +} + +SWIGRUNTIME void +SWIG_SetModule(void *v, swig_module_info *swig_module) { +} + +typedef struct { + void *pack; + swig_type_info *ty; + size_t size; +} RSwigPacked; + +/* Create a new packed object */ + +SWIGRUNTIMEINLINE SEXP RSwigPacked_New(void *ptr, size_t sz, + swig_type_info *ty) { + SEXP rptr; + RSwigPacked *sobj = + (RSwigPacked*) malloc(sizeof(RSwigPacked)); + if (sobj) { + void *pack = malloc(sz); + if (pack) { + memcpy(pack, ptr, sz); + sobj->pack = pack; + sobj->ty = ty; + sobj->size = sz; + } else { + sobj = 0; + } + } + rptr = R_MakeExternalPtr(sobj, R_NilValue, R_NilValue); + return rptr; +} + +SWIGRUNTIME swig_type_info * +RSwigPacked_UnpackData(SEXP obj, void *ptr, size_t size) +{ + RSwigPacked *sobj = + (RSwigPacked *)R_ExternalPtrAddr(obj); + if (sobj->size != size) return 0; + memcpy(ptr, sobj->pack, size); + return sobj->ty; +} + +SWIGRUNTIMEINLINE SEXP +SWIG_R_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { + return ptr ? RSwigPacked_New((void *) ptr, sz, type) : R_NilValue; +} + +/* Convert a packed value value */ + +SWIGRUNTIME int +SWIG_R_ConvertPacked(SEXP obj, void *ptr, size_t sz, swig_type_info *ty) { + swig_type_info *to = RSwigPacked_UnpackData(obj, ptr, sz); + if (!to) return SWIG_ERROR; + if (ty) { + if (to != ty) { + /* check type cast? */ + swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); + if (!tc) return SWIG_ERROR; + } + } + return SWIG_OK; +} + +#ifdef __cplusplus +} +#endif diff --git a/devtools/swigwin-1.3.34/Lib/r/rstdcommon.swg b/devtools/swigwin-1.3.34/Lib/r/rstdcommon.swg new file mode 100644 index 0000000..2232037 --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/rstdcommon.swg @@ -0,0 +1,216 @@ +%fragment("StdTraits","header",fragment="StdTraitsCommon") +{ +namespace swig { + /* + Traits that provides the from method + */ + + template <class Type> struct traits_from_ptr { + static SWIG_Object from(Type *val, int owner = 0) { + return SWIG_NewPointerObj(val, type_info<Type>(), owner); + } + }; + + template <class Type> struct traits_from { + static SWIG_Object from(const Type& val) { + return traits_from_ptr<Type>::from(new Type(val), 1); + } + }; + + template <class Type> struct traits_from<Type *> { + static SWIG_Object from(Type* val) { + return traits_from_ptr<Type>::from(val, 0); + } + }; + + template <class Type> + inline SWIG_Object from(const Type& val) { + return traits_from<Type>::from(val); + } + + template <class Type> + inline SWIG_Object from_ptr(Type* val, int owner) { + return traits_from_ptr<Type>::from(val, owner); + } + + /* + Traits that provides the asval/as/check method + */ + template <class Type> + struct traits_asptr { + static int asptr(SWIG_Object obj, Type **val) { + Type *p; + int res = (SWIG_ConvertPtr(obj, (void**)&p, type_info<Type>(), 0) == SWIG_OK) ? SWIG_OLDOBJ : 0; + if (SWIG_IsOK(res)) { + if (val) *val = p; + } + return res; + } + }; + + template <class Type> + inline int asptr(SWIG_Object obj, Type **vptr) { + return traits_asptr<Type>::asptr(obj, vptr); + } + + template <class Type> + struct traits_asval { + static int asval(SWIG_Object obj, Type *val) { + if (val) { + Type *p = 0; + int res = traits_asptr<Type>::asptr(obj, &p); + if (!SWIG_IsOK(res)) return res; + if (p) { + typedef typename noconst_traits<Type>::noconst_type noconst_type; + *(const_cast<noconst_type*>(val)) = *p; + if (SWIG_IsNewObj(res)){ + %delete(p); + res = SWIG_DelNewMask(res); + } + return res; + } else { + return SWIG_ERROR; + } + } else { + return traits_asptr<Type>::asptr(obj, (Type **)(0)); + } + } + }; + + template <class Type> struct traits_asval<Type*> { + static int asval(SWIG_Object obj, Type **val) { + if (val) { + typedef typename noconst_traits<Type>::noconst_type noconst_type; + noconst_type *p = 0; + int res = traits_asptr<noconst_type>::asptr(obj, &p); + if (SWIG_IsOK(res)) { + *(const_cast<noconst_type**>(val)) = p; + } + return res; + } else { + return traits_asptr<Type>::asptr(obj, (Type **)(0)); + } + } + }; + + template <class Type> + inline int asval(SWIG_Object obj, Type *val) { + return traits_asval<Type>::asval(obj, val); + } + + template <class Type> + struct traits_as<Type, value_category> { + static Type as(SWIG_Object obj, bool throw_error) { + Type v; + int res = asval(obj, &v); + if (!obj || !SWIG_IsOK(res)) { +// if (!PyErr_Occurred()) { +// %type_error(swig::type_name<Type>()); +// } + if (throw_error) throw std::invalid_argument("bad type"); + } + return v; + } + }; + + template <class Type> + struct traits_as<Type, pointer_category> { + static Type as(SWIG_Object obj, bool throw_error) { + Type *v = 0; + int res = (obj ? traits_asptr<Type>::asptr(obj, &v) : SWIG_ERROR); + if (SWIG_IsOK(res) && v) { + if (SWIG_IsNewObj(res)) { + Type r(*v); + %delete(v); + return r; + } else { + return *v; + } + } else { + // Uninitialized return value, no Type() constructor required. + static Type *v_def = (Type*) malloc(sizeof(Type)); +// if (!PyErr_Occurred()) { +// %type_error(swig::type_name<Type>()); +// } + if (throw_error) throw std::invalid_argument("bad type"); + memset(v_def,0,sizeof(Type)); + return *v_def; + } + } + }; + + template <class Type> + struct traits_as<Type*, pointer_category> { + static Type* as(SWIG_Object obj, bool throw_error) { + Type *v = 0; + int res = (obj ? traits_asptr<Type>::asptr(obj, &v) : SWIG_ERROR); + if (SWIG_IsOK(res)) { + return v; + } else { +// if (!PyErr_Occurred()) { +// %type_error(swig::type_name<Type>()); +// } + if (throw_error) throw std::invalid_argument("bad type"); + return 0; + } + } + }; + + template <class Type> + inline Type as(SWIG_Object obj, bool te = false) { + return traits_as<Type, typename traits<Type>::category>::as(obj, te); + } + + template <class Type> + struct traits_check<Type, value_category> { + static bool check(SWIG_Object obj) { + int res = obj ? asval(obj, (Type *)(0)) : SWIG_ERROR; + return SWIG_IsOK(res) ? true : false; + } + }; + + template <class Type> + struct traits_check<Type, pointer_category> { + static bool check(SWIG_Object obj) { + int res = obj ? asptr(obj, (Type **)(0)) : SWIG_ERROR; + return SWIG_IsOK(res) ? true : false; + } + }; + + template <class Type> + inline bool check(SWIG_Object obj) { + return traits_check<Type, typename traits<Type>::category>::check(obj); + } +} +} + +%define %specialize_std_container(Type,Check,As,From) +%{ +namespace swig { + template <> struct traits_asval<Type > { + typedef Type value_type; + static int asval(SWIG_Object obj, value_type *val) { + if (Check(obj)) { + if (val) *val = As(obj); + return SWIG_OK; + } + return SWIG_ERROR; + } + }; + template <> struct traits_from<Type > { + typedef Type value_type; + static SWIG_Object from(const value_type& val) { + return From(val); + } + }; + + template <> + struct traits_check<Type, value_category> { + static int check(SWIG_Object obj) { + int res = Check(obj); + return obj && res ? res : 0; + } + }; +} +%} +%enddef diff --git a/devtools/swigwin-1.3.34/Lib/r/rtype.swg b/devtools/swigwin-1.3.34/Lib/r/rtype.swg new file mode 100644 index 0000000..6479a0d --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/rtype.swg @@ -0,0 +1,200 @@ + +/* These map the primitive C types to the appropriate R type + for use in class representations. + */ + +%typemap("rtype") int, int *, int & "numeric"; +%apply int {size_t} +%apply int {std::size_t} +%apply int {ptrdiff_t} +%apply int {std::ptrdiff_t} + +%typemap("rtype") long, long * "numeric"; +%typemap("rtype") unsigned long, + unsigned long * "numeric"; +%typemap("rtype") unsigned int, + unsigned int * "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"; +%typemap("rtype") std::string, std::string *, std::string & "character"; +%typemap("rtype") bool, bool * "logical"; +%typemap("rtype") enum SWIGTYPE "character"; +%typemap("rtype") enum SWIGTYPE * "character"; +%typemap("rtype") enum SWIGTYPE & "character"; +%typemap("rtype") SWIGTYPE * "$R_class"; +%typemap("rtype") SWIGTYPE & "$R_class"; +%typemap("rtype") SWIGTYPE "$&R_class"; + + + +/* 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. +*/ + + +%typemap(scoercein) int, int *, int & + %{ $input = as($input, "integer"); %} +%typemap(scoercein) ptrdiff_t, ptrdiff_t *, ptrdiff_t & + %{ $input = as($input, "integer"); %} +%typemap(scoercein) unsigned long, unsigned long *, unsigned long & + %{ $input = as($input, "integer"); %} +%typemap(scoercein) unsigned int, unsigned int *, unsigned int & + %{ $input = as($input, "integer"); %} +%typemap(scoercein) double, double *, double & + %{ $input = as($input, "numeric"); %} +%typemap(scoercein) float, float *, float & + %{ $input = as($input, "numeric"); %} +%typemap(scoercein) char, char *, char & + %{ $input = as($input, "character"); %} +%typemap(scoercein) string, string *, string & + %{ $input = as($input, "character"); %} +%typemap(scoercein) std::string, std::string *, std::string & + %{ $input = as($input, "character"); %} +%typemap(scoercein) enum SWIGTYPE + %{ $input = enumToInteger($input, "$R_class") %} +%typemap(scoercein) enum SWIGTYPE & + %{ $input = enumToInteger($input, "$R_class") %} +%typemap(scoercein) enum SWIGTYPE * + %{ $input = enumToInteger($input, "$R_class") %} + +%typemap(scoercein) SWIGTYPE * + %{ $input = coerceIfNotSubclass($input, "$R_class") %} + +%typemap(scoercein) SWIGTYPE & + %{ $input = coerceIfNotSubclass($input, "$R_class") %} + +%typemap(scoercein) SWIGTYPE + %{ $input = coerceIfNotSubclass($input, "$&R_class") %} + + +%typemap(scoercein) SWIGTYPE[ANY] + %{ + if(is.list($input)) + assert(all(sapply($input, class) == "$R_class")) + %} + + +/* **************************************************************** */ + +%typemap(scoercein) bool, bool *, bool & + "$input = as.logical($input) "; + +%typemap(scoercein) int, + int *, + int &, + int[ANY], + size_t, + std::size_t, + size_t &, + std::size_t & + "$input = as.integer($input) "; + + +%typemap(scoercein) unsigned int, + unsigned long, + double, + float, + long, + long long, + unsigned int[], + unsigned long[], + double[], + float[], + long[], + long long[], + unsigned int[ANY], + unsigned long[ANY], + double[ANY], + float[ANY], + long[ANY], + long long[ANY], + unsigned int *, + unsigned long *, + double*, + float*, + long*, + long long * +%{ $input = as.numeric($input) %} + + +%typemap(scoercein) char *, string, std::string, +string &, std::string & +%{ $input = as($input, "character") %} + +%typemap(scoerceout) enum SWIGTYPE + %{ $result = enumFromInteger($result, "$R_class") %} + +%typemap(scoerceout) enum SWIGTYPE & + %{ $result = enumFromInteger($result, "$R_class") %} + +%typemap(scoerceout) enum SWIGTYPE * + %{ $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" %} + +/* Override the SWIGTYPE * above. */ +%typemap(scoerceout) char, + char *, + char &, + unsigned int, + unsigned int &, + unsigned long, + unsigned long &, + double, + double &, + float, + float &, + long, + long &, + long long, + long long &, + int, + int &, + bool, + bool &, + string, + std::string, + string &, + std::string &, + size_t, + std::size_t, + size_t &, + std::size_t &, + void + %{ %} + + +#if 0 + Just examining the values for a SWIGTYPE. + +%typemap(scoerceout) SWIGTYPE %{ + + name = $1_name + type = $1_type + ltype = $1_ltype + + mangle = $1_mangle + descriptor = $1_descriptor + + pointer type = $*1_type + pointer ltype = $*1_ltype + + pointer descriptor = $*1_descriptor + basetype = $*_basetype + +%} +#endif + + diff --git a/devtools/swigwin-1.3.34/Lib/r/srun.swg b/devtools/swigwin-1.3.34/Lib/r/srun.swg new file mode 100644 index 0000000..71a508d --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/srun.swg @@ -0,0 +1,150 @@ +# srun.swg # +# +# This is the basic code that is needed at run time within R to +# provide and define the relevant classes. It is included +# automatically in the generated code by copying the contents of +# srun.swg into the newly created binding code. + + +# This could be provided as a separate run-time library but this +# approach allows the code to to be included directly into the +# generated bindings and so removes the need to have and install an +# additional library. We may however end up with multiple copies of +# this and some confusion at run-time as to which class to use. This +# is an issue when we use NAMESPACES as we may need to export certain +# classes. + +###################################################################### + +if(length(getClassDef("RSWIGStruct")) == 0) + setClass("RSWIGStruct", representation("VIRTUAL")) + + + +if(length(getClassDef("ExternalReference")) == 0) +# Should be virtual but this means it loses its slots currently +#representation("VIRTUAL") + setClass("ExternalReference", representation( ref = "externalptr")) + + + +if(length(getClassDef("NativeRoutinePointer")) == 0) + setClass("NativeRoutinePointer", + representation(parameterTypes = "character", + returnType = "character", + "VIRTUAL"), + contains = "ExternalReference") + +if(length(getClassDef("CRoutinePointer")) == 0) + setClass("CRoutinePointer", contains = "NativeRoutinePointer") + + +if(length(getClassDef("EnumerationValue")) == 0) + setClass("EnumerationValue", contains = "integer") + + +if(!isGeneric("copyToR")) + setGeneric("copyToR", + function(value, obj = new(gsub("Ref$", "", class(value)))) + standardGeneric("copyToR" + )) + +setGeneric("delete", function(obj) standardGeneric("delete")) + + +SWIG_createNewRef = +function(className, ..., append = TRUE) +{ + f = get(paste("new", className, sep = "_"), mode = "function") + + f(...) +} + +if(!isGeneric("copyToC")) + setGeneric("copyToC", + function(value, obj = RSWIG_createNewRef(class(value))) + standardGeneric("copyToC" + )) + + +# +defineEnumeration = +function(name, .values, where = topenv(parent.frame()), suffix = "Value") +{ + # Mirror the class definitions via the E analogous to .__C__ + defName = paste(".__E__", name, sep = "") + assign(defName, .values, envir = where) + + if(nchar(suffix)) + name = paste(name, suffix, sep = "") + + setClass(name, contains = "EnumerationValue", where = where) +} + +enumToInteger <- function(name,type) +{ + if (is.character(name)) { + ans <- as.integer(get(paste(".__E__", type, sep = ""))[name]) + if (is.na(ans)) {warning("enum not found ", name, " ", type)} + ans + } +} + +enumFromInteger = +function(i,type) +{ + itemlist <- get(paste(".__E__", type, sep="")) + names(itemlist)[match(i, itemlist)] +} + +coerceIfNotSubclass = +function(obj, type) +{ + if(!is(obj, type)) {as(obj, type)} else obj +} + + +setClass("SWIGArray", representation(dims = "integer"), contains = "ExternalReference") + +setMethod("length", "SWIGArray", function(x) x@dims[1]) + + +defineEnumeration("SCopyReferences", + .values = c( "FALSE" = 0, "TRUE" = 1, "DEEP" = 2)) + +assert = +function(condition, message = "") +{ + if(!condition) + stop(message) + + TRUE +} + + +if(FALSE) { +print.SWIGFunction = +function(x, ...) + { + } +} + + +####################################################################### + +R_SWIG_getCallbackFunctionStack = +function() +{ + # No PACKAGE argument as we don't know what the DLL is. + .Call("R_SWIG_debug_getCallbackFunctionData") +} + +R_SWIG_addCallbackFunctionStack = +function(fun, userData = NULL) +{ + # No PACKAGE argument as we don't know what the DLL is. + .Call("R_SWIG_R_pushCallbackFunctionData", fun, userData) +} + + +#######################################################################
\ No newline at end of file diff --git a/devtools/swigwin-1.3.34/Lib/r/std_alloc.i b/devtools/swigwin-1.3.34/Lib/r/std_alloc.i new file mode 100644 index 0000000..87fa8d4 --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/std_alloc.i @@ -0,0 +1 @@ +%include <std/std_alloc.i>
\ No newline at end of file diff --git a/devtools/swigwin-1.3.34/Lib/r/std_common.i b/devtools/swigwin-1.3.34/Lib/r/std_common.i new file mode 100644 index 0000000..fec0efe --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/std_common.i @@ -0,0 +1,2 @@ +%include <rstdcommon.swg> +%include <std/std_common.i> diff --git a/devtools/swigwin-1.3.34/Lib/r/std_container.i b/devtools/swigwin-1.3.34/Lib/r/std_container.i new file mode 100644 index 0000000..076c1c6 --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/std_container.i @@ -0,0 +1,2 @@ +%include <rcontainer.swg> +%include <std/std_container.i> diff --git a/devtools/swigwin-1.3.34/Lib/r/std_deque.i b/devtools/swigwin-1.3.34/Lib/r/std_deque.i new file mode 100644 index 0000000..0c757ab --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/std_deque.i @@ -0,0 +1 @@ +%include<std/std_deque.i>
\ No newline at end of file diff --git a/devtools/swigwin-1.3.34/Lib/r/std_except.i b/devtools/swigwin-1.3.34/Lib/r/std_except.i new file mode 100644 index 0000000..af98428 --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/std_except.i @@ -0,0 +1 @@ +%include <typemaps/std_except.swg> diff --git a/devtools/swigwin-1.3.34/Lib/r/std_pair.i b/devtools/swigwin-1.3.34/Lib/r/std_pair.i new file mode 100644 index 0000000..3ac7957 --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/std_pair.i @@ -0,0 +1 @@ +%include<std/std_pair.i>
\ No newline at end of file diff --git a/devtools/swigwin-1.3.34/Lib/r/std_string.i b/devtools/swigwin-1.3.34/Lib/r/std_string.i new file mode 100644 index 0000000..dc1378a --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/std_string.i @@ -0,0 +1 @@ +%include <typemaps/std_string.swg> diff --git a/devtools/swigwin-1.3.34/Lib/r/std_vector.i b/devtools/swigwin-1.3.34/Lib/r/std_vector.i new file mode 100644 index 0000000..0336482 --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/std_vector.i @@ -0,0 +1,10 @@ +%fragment("StdVectorTraits","header") +%{ +%} + +#define %swig_vector_methods(Type...) %swig_sequence_methods(Type) +#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type); + + + +%include <std/std_vector.i>
\ No newline at end of file diff --git a/devtools/swigwin-1.3.34/Lib/r/stl.i b/devtools/swigwin-1.3.34/Lib/r/stl.i new file mode 100644 index 0000000..9656ee6 --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/stl.i @@ -0,0 +1,8 @@ +/* initial STL definition. extended as needed in each language */ +%include std_common.i +%include std_vector.i +%include std_string.i + + + + diff --git a/devtools/swigwin-1.3.34/Lib/r/typemaps.i b/devtools/swigwin-1.3.34/Lib/r/typemaps.i new file mode 100644 index 0000000..1f9b9c4 --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/r/typemaps.i @@ -0,0 +1 @@ +%include <typemaps/typemaps.swg> |