Another merge with master.
Updated Doxygen error numbers yet again, as Python errors got added in the meanwhile, pushing the Doxygen ones further off. And re-merged PEP8/whitespace-related conflicts in autodoc_runme.py once again (if anybody is looking for a motivating example about why significant whitespace is bad, here is a great use case).
This commit is contained in:
commit
302955a152
448 changed files with 8836 additions and 5079 deletions
|
|
@ -203,7 +203,7 @@ SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
|
|||
%typemap(directorin) int "$input = $1;"
|
||||
%typemap(directorin) unsigned int "$input = $1;"
|
||||
%typemap(directorin) long "$input = $1;"
|
||||
%typemap(directorin) unsigned long "$input = $1;"
|
||||
%typemap(directorin) unsigned long "$input = (unsigned long)$1;"
|
||||
%typemap(directorin) long long "$input = $1;"
|
||||
%typemap(directorin) unsigned long long "$input = $1;"
|
||||
%typemap(directorin) float "$input = $1;"
|
||||
|
|
|
|||
15
Lib/director_common.swg
Normal file
15
Lib/director_common.swg
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/* -----------------------------------------------------------------------------
|
||||
* director_common.swg
|
||||
*
|
||||
* This file contains support for director classes which is common between
|
||||
* languages.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the
|
||||
'Swig' namespace. This could be useful for multi-modules projects.
|
||||
*/
|
||||
#ifdef SWIG_DIRECTOR_STATIC
|
||||
/* Force anonymous (static) namespace */
|
||||
#define Swig
|
||||
#endif
|
||||
|
|
@ -533,7 +533,7 @@
|
|||
%typemap(directorin) enum SWIGTYPE & (intgo e)
|
||||
%{
|
||||
e = (intgo)$1;
|
||||
$input = &e;
|
||||
$input = ($1_ltype)&e;
|
||||
%}
|
||||
|
||||
%typemap(godirectorin) enum SWIGTYPE & ""
|
||||
|
|
|
|||
|
|
@ -19,21 +19,45 @@ static void Swig_free(void* p) {
|
|||
|
||||
%}
|
||||
|
||||
#if SWIGGO_CGO
|
||||
%insert(cgo_comment_typedefs) %{
|
||||
#include <stdint.h>
|
||||
%}
|
||||
#endif
|
||||
|
||||
#if SWIGGO_INTGO_SIZE == 32
|
||||
%insert(runtime) %{
|
||||
typedef int intgo;
|
||||
typedef unsigned int uintgo;
|
||||
%}
|
||||
#if SWIGGO_CGO
|
||||
%insert(cgo_comment_typedefs) %{
|
||||
typedef int intgo;
|
||||
typedef unsigned int uintgo;
|
||||
%}
|
||||
#endif
|
||||
#elif SWIGGO_INTGO_SIZE == 64
|
||||
%insert(runtime) %{
|
||||
typedef long long intgo;
|
||||
typedef unsigned long long uintgo;
|
||||
%}
|
||||
#if SWIGGO_CGO
|
||||
%insert(cgo_comment_typedefs) %{
|
||||
typedef long long intgo;
|
||||
typedef unsigned long long uintgo;
|
||||
%}
|
||||
#endif
|
||||
#else
|
||||
%insert(runtime) %{
|
||||
typedef ptrdiff_t intgo;
|
||||
typedef size_t uintgo;
|
||||
%}
|
||||
#if SWIGGO_CGO
|
||||
%insert(cgo_comment_typedefs) %{
|
||||
typedef ptrdiff_t intgo;
|
||||
typedef size_t uintgo;
|
||||
%}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
%insert(runtime) %{
|
||||
|
|
@ -43,6 +67,17 @@ typedef struct { void* array; intgo len; intgo cap; } _goslice_;
|
|||
|
||||
%}
|
||||
|
||||
#ifdef SWIGGO_CGO
|
||||
|
||||
%insert(cgo_comment_typedefs) %{
|
||||
|
||||
typedef struct { char *p; intgo n; } _gostring_;
|
||||
typedef struct { void* array; intgo len; intgo cap; } _goslice_;
|
||||
|
||||
%}
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef SWIGGO_GCCGO
|
||||
/* Boilerplate for C/C++ code when using 6g/8g. This code is compiled
|
||||
with gcc. */
|
||||
|
|
@ -78,6 +113,22 @@ static char *_swig_topofstack() {
|
|||
}
|
||||
}
|
||||
|
||||
static void _swig_gopanic(const char *p) {
|
||||
struct {
|
||||
const char *p;
|
||||
} a;
|
||||
a.p = p;
|
||||
crosscall2(_cgo_panic, &a, (int) sizeof a);
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
#if !SWIGGO_CGO
|
||||
|
||||
/* This is here for backward compatibility, but it will not work
|
||||
with Go 1.5 or later. Do not use it in new code. */
|
||||
%insert(runtime) %{
|
||||
|
||||
static void *_swig_goallocate(size_t len) {
|
||||
struct {
|
||||
size_t len;
|
||||
|
|
@ -88,16 +139,12 @@ static void *_swig_goallocate(size_t len) {
|
|||
return a.ret;
|
||||
}
|
||||
|
||||
static void _swig_gopanic(const char *p) {
|
||||
struct {
|
||||
const char *p;
|
||||
} a;
|
||||
a.p = p;
|
||||
crosscall2(_cgo_panic, &a, (int) sizeof a);
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
#endif
|
||||
|
||||
#if !SWIGGO_CGO
|
||||
|
||||
/* Boilerplate for C code when using 6g/8g. This code is compiled
|
||||
with 6c/8c. */
|
||||
%insert(gc_header) %{
|
||||
|
|
@ -111,6 +158,8 @@ void *·_cgo_runtime_cgocall = &cgocall;
|
|||
|
||||
%}
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
/* Boilerplate for C/C++ code when using gccgo. */
|
||||
|
|
@ -122,6 +171,17 @@ extern "C" {
|
|||
#endif
|
||||
extern void *_cgo_allocate(size_t);
|
||||
extern void _cgo_panic(const char *);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#define _swig_goallocate _cgo_allocate
|
||||
#define _swig_gopanic _cgo_panic
|
||||
%}
|
||||
|
||||
#if !SWIGGO_CGO
|
||||
|
||||
%insert(runtime) %{
|
||||
|
||||
/* Implementations of SwigCgocall and friends for different versions
|
||||
of gccgo. The Go code will call these functions using C names with
|
||||
|
|
@ -130,6 +190,10 @@ extern void _cgo_panic(const char *);
|
|||
version. We assume that the version of gcc used to compile this
|
||||
file is the same as the version of gccgo. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SWIG_GCC_VERSION \
|
||||
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
|
||||
|
||||
|
|
@ -184,15 +248,18 @@ void SwigCgocallBackDone() {
|
|||
}
|
||||
#endif
|
||||
|
||||
#define _swig_goallocate _cgo_allocate
|
||||
#define _swig_gopanic _cgo_panic
|
||||
|
||||
%}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if !SWIGGO_CGO
|
||||
|
||||
%insert(runtime) %{
|
||||
|
||||
/* This is here for backward compatibility, but it will not work
|
||||
with Go 1.5 or later. Do not use it in new code. */
|
||||
static _gostring_ _swig_makegostring(const char *p, size_t l) {
|
||||
_gostring_ ret;
|
||||
ret.p = (char*)_swig_goallocate(l + 1);
|
||||
|
|
@ -201,6 +268,12 @@ static _gostring_ _swig_makegostring(const char *p, size_t l) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
#endif
|
||||
|
||||
%insert(runtime) %{
|
||||
|
||||
#define SWIG_contract_assert(expr, msg) \
|
||||
if (!(expr)) { _swig_gopanic(msg); } else
|
||||
%}
|
||||
|
|
@ -209,9 +282,11 @@ static _gostring_ _swig_makegostring(const char *p, size_t l) {
|
|||
|
||||
%go_import("unsafe", _ "runtime/cgo")
|
||||
|
||||
#if !SWIGGO_CGO
|
||||
%insert(go_header) %{
|
||||
var _cgo_runtime_cgocall func(unsafe.Pointer, uintptr)
|
||||
%}
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
|
|
@ -317,3 +392,58 @@ static void swig_acquire_pointer(Swig_memory** pmem, Type* ptr) {
|
|||
(*pmem)->swig_acquire_pointer(ptr);
|
||||
}
|
||||
%}
|
||||
|
||||
/* For directors we need C++ to track a Go pointer. Since we can't
|
||||
pass a Go pointer into C++, we use a map to track the pointers on
|
||||
the Go side. */
|
||||
|
||||
%go_import("sync")
|
||||
|
||||
%insert(go_header) %{
|
||||
type _ sync.Mutex
|
||||
%}
|
||||
|
||||
%insert(go_director) %{
|
||||
|
||||
var swigDirectorTrack struct {
|
||||
sync.Mutex
|
||||
m map[int]interface{}
|
||||
c int
|
||||
}
|
||||
|
||||
func swigDirectorAdd(v interface{}) int {
|
||||
swigDirectorTrack.Lock()
|
||||
defer swigDirectorTrack.Unlock()
|
||||
if swigDirectorTrack.m == nil {
|
||||
swigDirectorTrack.m = make(map[int]interface{})
|
||||
}
|
||||
swigDirectorTrack.c++
|
||||
ret := swigDirectorTrack.c
|
||||
swigDirectorTrack.m[ret] = v
|
||||
return ret
|
||||
}
|
||||
|
||||
func swigDirectorLookup(c int) interface{} {
|
||||
swigDirectorTrack.Lock()
|
||||
defer swigDirectorTrack.Unlock()
|
||||
ret := swigDirectorTrack.m[c]
|
||||
if ret == nil {
|
||||
panic("C++ director pointer not found (possible use-after-free)")
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func swigDirectorDelete(c int) {
|
||||
swigDirectorTrack.Lock()
|
||||
defer swigDirectorTrack.Unlock()
|
||||
if swigDirectorTrack.m[c] == nil {
|
||||
if c > swigDirectorTrack.c {
|
||||
panic("C++ director pointer invalid (possible memory corruption")
|
||||
} else {
|
||||
panic("C++ director pointer not found (possible use-after-free)")
|
||||
}
|
||||
}
|
||||
delete(swigDirectorTrack.m, c)
|
||||
}
|
||||
|
||||
%}
|
||||
|
|
|
|||
|
|
@ -209,6 +209,20 @@ namespace Swig {
|
|||
}
|
||||
};
|
||||
|
||||
// Zero initialized bool array
|
||||
template<size_t N> class BoolArray {
|
||||
bool array_[N];
|
||||
public:
|
||||
BoolArray() {
|
||||
memset(array_, 0, sizeof(array_));
|
||||
}
|
||||
bool& operator[](size_t n) {
|
||||
return array_[n];
|
||||
}
|
||||
bool operator[](size_t n) const {
|
||||
return array_[n];
|
||||
}
|
||||
};
|
||||
|
||||
// Utility classes and functions for exception handling.
|
||||
|
||||
|
|
@ -355,7 +369,7 @@ namespace Swig {
|
|||
static char *copystr(const char *srcmsg) {
|
||||
char *target = 0;
|
||||
if (srcmsg) {
|
||||
int msglen = strlen(srcmsg) + 1;
|
||||
size_t msglen = strlen(srcmsg) + 1;
|
||||
target = new char[msglen];
|
||||
strncpy(target, srcmsg, msglen);
|
||||
}
|
||||
|
|
@ -367,7 +381,7 @@ namespace Swig {
|
|||
};
|
||||
|
||||
// Helper method to determine if a Java throwable matches a particular Java class type
|
||||
bool ExceptionMatches(JNIEnv *jenv, jthrowable throwable, const char *classname) {
|
||||
SWIGINTERN bool ExceptionMatches(JNIEnv *jenv, jthrowable throwable, const char *classname) {
|
||||
bool matches = false;
|
||||
|
||||
if (throwable && jenv && classname) {
|
||||
|
|
|
|||
|
|
@ -1341,12 +1341,14 @@ SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE)
|
|||
if ($input) JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0);
|
||||
}
|
||||
%typemap(directorin, descriptor="[B") (char *STRING, size_t LENGTH) {
|
||||
jbyteArray jb = (jenv)->NewByteArray($2);
|
||||
(jenv)->SetByteArrayRegion(jb, 0, $2, (jbyte *)$1);
|
||||
jbyteArray jb = (jenv)->NewByteArray((jsize)$2);
|
||||
(jenv)->SetByteArrayRegion(jb, 0, (jsize)$2, (jbyte *)$1);
|
||||
$input = jb;
|
||||
}
|
||||
%typemap(directorargout) (char *STRING, size_t LENGTH)
|
||||
%{(jenv)->GetByteArrayRegion($input, 0, $2, (jbyte *)$1); %}
|
||||
%{(jenv)->GetByteArrayRegion($input, 0, (jsize)$2, (jbyte *)$1);
|
||||
(jenv)->DeleteLocalRef($input);%}
|
||||
%typemap(javadirectorin, descriptor="[B") (char *STRING, size_t LENGTH) "$jniinput"
|
||||
%apply (char *STRING, size_t LENGTH) { (char *STRING, int LENGTH) }
|
||||
|
||||
/* java keywords */
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
%typemap(out) char **STRING_ARRAY {
|
||||
if ($1) {
|
||||
int i;
|
||||
int len=0;
|
||||
jsize len=0;
|
||||
jstring temp_string;
|
||||
const jclass clazz = JCALL1(FindClass, jenv, "java/lang/String");
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ typedef v8::PropertyCallbackInfo<v8::Value> SwigV8PropertyCallbackInfo;
|
|||
#define SWIG_fail goto fail
|
||||
#define SWIGV8_OVERLOAD false
|
||||
|
||||
static void SWIG_V8_Raise(const char *msg) {
|
||||
SWIGINTERN void SWIG_V8_Raise(const char *msg) {
|
||||
SWIGV8_THROW_EXCEPTION(v8::Exception::Error(SWIGV8_STRING_NEW(msg)));
|
||||
}
|
||||
|
||||
|
|
@ -126,7 +126,7 @@ public:
|
|||
}
|
||||
};
|
||||
// this is used in usually
|
||||
static V8ErrorHandler SWIGV8_ErrorHandler;
|
||||
SWIGRUNTIME V8ErrorHandler SWIGV8_ErrorHandler;
|
||||
|
||||
// instances of this are used in overloaded functions
|
||||
class OverloadErrorHandler: public V8ErrorHandler {
|
||||
|
|
@ -198,9 +198,9 @@ public:
|
|||
#endif
|
||||
};
|
||||
|
||||
static v8::Persistent<v8::FunctionTemplate> SWIGV8_SWIGTYPE_Proxy_class_templ;
|
||||
SWIGRUNTIME v8::Persistent<v8::FunctionTemplate> SWIGV8_SWIGTYPE_Proxy_class_templ;
|
||||
|
||||
static int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
|
||||
SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
|
||||
SWIGV8_HANDLESCOPE();
|
||||
|
||||
if(objRef->InternalFieldCount() < 1) return SWIG_ERROR;
|
||||
|
|
@ -234,22 +234,22 @@ static int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr,
|
|||
|
||||
|
||||
#if (SWIG_V8_VERSION < 0x031710)
|
||||
static void SWIGV8_Proxy_DefaultDtor(v8::Persistent< v8::Value > object, void *parameter) {
|
||||
SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(v8::Persistent< v8::Value > object, void *parameter) {
|
||||
SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter);
|
||||
#elif (SWIG_V8_VERSION < 0x031900)
|
||||
static void SWIGV8_Proxy_DefaultDtor(v8::Isolate *, v8::Persistent< v8::Value > object, void *parameter) {
|
||||
SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(v8::Isolate *, v8::Persistent< v8::Value > object, void *parameter) {
|
||||
SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter);
|
||||
#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION)
|
||||
static void SWIGV8_Proxy_DefaultDtor(v8::Isolate *, v8::Persistent< v8::Object > *object, SWIGV8_Proxy *proxy) {
|
||||
SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(v8::Isolate *, v8::Persistent< v8::Object > *object, SWIGV8_Proxy *proxy) {
|
||||
#else
|
||||
static void SWIGV8_Proxy_DefaultDtor(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) {
|
||||
SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) {
|
||||
SWIGV8_Proxy *proxy = data.GetParameter();
|
||||
#endif
|
||||
|
||||
delete proxy;
|
||||
}
|
||||
|
||||
static int SWIG_V8_GetInstancePtr(v8::Handle<v8::Value> valRef, void **ptr) {
|
||||
SWIGRUNTIME int SWIG_V8_GetInstancePtr(v8::Handle<v8::Value> valRef, void **ptr) {
|
||||
if(!valRef->IsObject()) {
|
||||
return SWIG_TypeError;
|
||||
}
|
||||
|
|
@ -273,7 +273,7 @@ static int SWIG_V8_GetInstancePtr(v8::Handle<v8::Value> valRef, void **ptr) {
|
|||
return SWIG_OK;
|
||||
}
|
||||
|
||||
static void SWIGV8_SetPrivateData(v8::Handle<v8::Object> obj, void *ptr, swig_type_info *info, int flags) {
|
||||
SWIGRUNTIME void SWIGV8_SetPrivateData(v8::Handle<v8::Object> obj, void *ptr, swig_type_info *info, int flags) {
|
||||
SWIGV8_Proxy *cdata = new SWIGV8_Proxy();
|
||||
cdata->swigCObject = ptr;
|
||||
cdata->swigCMemOwn = (flags & SWIG_POINTER_OWN) ? 1 : 0;
|
||||
|
|
@ -330,7 +330,7 @@ static void SWIGV8_SetPrivateData(v8::Handle<v8::Object> obj, void *ptr, swig_ty
|
|||
|
||||
}
|
||||
|
||||
static int SWIG_V8_ConvertPtr(v8::Handle<v8::Value> valRef, void **ptr, swig_type_info *info, int flags) {
|
||||
SWIGRUNTIME int SWIG_V8_ConvertPtr(v8::Handle<v8::Value> valRef, void **ptr, swig_type_info *info, int flags) {
|
||||
SWIGV8_HANDLESCOPE();
|
||||
|
||||
/* special case: JavaScript null => C NULL pointer */
|
||||
|
|
@ -345,7 +345,7 @@ static int SWIG_V8_ConvertPtr(v8::Handle<v8::Value> valRef, void **ptr, swig_typ
|
|||
return SWIG_V8_ConvertInstancePtr(objRef, ptr, info, flags);
|
||||
}
|
||||
|
||||
static v8::Handle<v8::Value> SWIG_V8_NewPointerObj(void *ptr, swig_type_info *info, int flags) {
|
||||
SWIGRUNTIME v8::Handle<v8::Value> SWIG_V8_NewPointerObj(void *ptr, swig_type_info *info, int flags) {
|
||||
SWIGV8_HANDLESCOPE_ESC();
|
||||
|
||||
v8::Handle<v8::FunctionTemplate> class_templ;
|
||||
|
|
@ -393,7 +393,7 @@ static v8::Handle<v8::Value> SWIG_V8_NewPointerObj(void *ptr, swig_type_info *in
|
|||
|
||||
#define SWIG_GetInstancePtr(obj, ptr) SWIG_V8_GetInstancePtr(obj, ptr)
|
||||
|
||||
static SwigV8ReturnValue _SWIGV8_wrap_equals(const SwigV8Arguments &args) {
|
||||
SWIGRUNTIME SwigV8ReturnValue _SWIGV8_wrap_equals(const SwigV8Arguments &args) {
|
||||
SWIGV8_HANDLESCOPE();
|
||||
|
||||
v8::Handle<v8::Value> jsresult;
|
||||
|
|
@ -423,7 +423,7 @@ fail:
|
|||
SWIGV8_RETURN(SWIGV8_UNDEFINED());
|
||||
}
|
||||
|
||||
static SwigV8ReturnValue _wrap_getCPtr(const SwigV8Arguments &args) {
|
||||
SWIGRUNTIME SwigV8ReturnValue _wrap_getCPtr(const SwigV8Arguments &args) {
|
||||
SWIGV8_HANDLESCOPE();
|
||||
|
||||
v8::Handle<v8::Value> jsresult;
|
||||
|
|
@ -512,15 +512,15 @@ int SWIGV8_ConvertPacked(v8::Handle<v8::Value> valRef, void *ptr, size_t sz, swi
|
|||
}
|
||||
|
||||
#if (SWIG_V8_VERSION < 0x031710)
|
||||
static void _wrap_SwigV8PackedData_delete(v8::Persistent< v8::Value > object, void *parameter) {
|
||||
SWIGRUNTIME void _wrap_SwigV8PackedData_delete(v8::Persistent< v8::Value > object, void *parameter) {
|
||||
SwigV8PackedData *cdata = static_cast<SwigV8PackedData *>(parameter);
|
||||
#elif (SWIG_V8_VERSION < 0x031900)
|
||||
static void _wrap_SwigV8PackedData_delete(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) {
|
||||
SWIGRUNTIME void _wrap_SwigV8PackedData_delete(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) {
|
||||
SwigV8PackedData *cdata = static_cast<SwigV8PackedData *>(parameter);
|
||||
#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION)
|
||||
static void _wrap_SwigV8PackedData_delete(v8::Isolate *isolate, v8::Persistent<v8::Object> *object, SwigV8PackedData *cdata) {
|
||||
SWIGRUNTIME void _wrap_SwigV8PackedData_delete(v8::Isolate *isolate, v8::Persistent<v8::Object> *object, SwigV8PackedData *cdata) {
|
||||
#else
|
||||
static void _wrap_SwigV8PackedData_delete(const v8::WeakCallbackData<v8::Object, SwigV8PackedData> &data) {
|
||||
SWIGRUNTIME void _wrap_SwigV8PackedData_delete(const v8::WeakCallbackData<v8::Object, SwigV8PackedData> &data) {
|
||||
v8::Local<v8::Object> object = data.GetValue();
|
||||
SwigV8PackedData *cdata = data.GetParameter();
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ use %include <std_except.i> instead
|
|||
|
||||
// char is changed to a string
|
||||
%typemap(throws) char
|
||||
%{lua_pushfstring(L,"%c",$1);SWIG_fail;%}
|
||||
%{lua_pushlstring(L,&$1,1);SWIG_fail;%}
|
||||
|
||||
/*
|
||||
Throwing object is a serious problem:
|
||||
|
|
|
|||
|
|
@ -1831,7 +1831,7 @@ SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]) {
|
|||
switch(constants[i].type) {
|
||||
case SWIG_LUA_INT:
|
||||
lua_pushstring(L,constants[i].name);
|
||||
lua_pushnumber(L,(lua_Number)constants[i].lvalue);
|
||||
lua_pushinteger(L,(lua_Number)constants[i].lvalue);
|
||||
lua_rawset(L,-3);
|
||||
break;
|
||||
case SWIG_LUA_FLOAT:
|
||||
|
|
@ -1841,7 +1841,10 @@ SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]) {
|
|||
break;
|
||||
case SWIG_LUA_CHAR:
|
||||
lua_pushstring(L,constants[i].name);
|
||||
lua_pushfstring(L,"%c",(char)constants[i].lvalue);
|
||||
{
|
||||
char c = constants[i].lvalue;
|
||||
lua_pushlstring(L,&c,1);
|
||||
}
|
||||
lua_rawset(L,-3);
|
||||
break;
|
||||
case SWIG_LUA_STRING:
|
||||
|
|
|
|||
|
|
@ -122,14 +122,14 @@ SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) {
|
|||
%{$1 = (lua_tostring(L, $input))[0];%}
|
||||
|
||||
%typemap(out) char
|
||||
%{ lua_pushfstring(L,"%c",$1); SWIG_arg++;%}
|
||||
%{ lua_pushlstring(L, &$1, 1); SWIG_arg++;%}
|
||||
|
||||
// by const ref
|
||||
%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char& (char temp)
|
||||
%{temp = (lua_tostring(L, $input))[0]; $1=&temp;%}
|
||||
|
||||
%typemap(out) const char&
|
||||
%{ lua_pushfstring(L,"%c",*$1); SWIG_arg++;%}
|
||||
%{ lua_pushlstring(L, $1, 1); SWIG_arg++;%}
|
||||
|
||||
// pointers and references
|
||||
// under SWIG rules, it is ok, to have a pass in a lua nil,
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ namespace Swig {
|
|||
mutable bool swig_disown_flag;
|
||||
|
||||
public:
|
||||
/* wrap a ocaml object, optionally taking ownership */
|
||||
/* wrap a ocaml object. */
|
||||
Director(CAML_VALUE self) : swig_self(self), swig_disown_flag(false) {
|
||||
register_global_root(&swig_self);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ CAMLextern int64 Int64_val(caml_value_t v);
|
|||
SWIGSTATIC CAML_VALUE caml_array_new( int n );
|
||||
SWIGSTATIC void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item );
|
||||
SWIGSTATIC CAML_VALUE caml_array_nth( CAML_VALUE arr, int n );
|
||||
SWIGSTATIC int caml_array_length( CAML_VALUE arr );
|
||||
SWIGSTATIC int caml_array_len( CAML_VALUE arr );
|
||||
|
||||
SWIGSTATIC CAML_VALUE caml_val_char( char c );
|
||||
SWIGSTATIC CAML_VALUE caml_val_uchar( unsigned char c );
|
||||
|
|
@ -165,5 +165,3 @@ CAMLextern int64 Int64_val(caml_value_t v);
|
|||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* mzschemedec.swg ends here */
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* -----------------------------------------------------------------------------
|
||||
* director.swg
|
||||
*
|
||||
* This file contains support for director classes so that D proxy
|
||||
* This file contains support for director classes so that Octave proxy
|
||||
* methods can be called from C++.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
%{
|
||||
#include <climits>
|
||||
#include <iostream>
|
||||
%}
|
||||
|
||||
|
|
|
|||
|
|
@ -868,6 +868,17 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
|
|||
}
|
||||
|
||||
#if defined (HAVE_HDF5)
|
||||
# if SWIG_OCTAVE_PREREQ(4,0,0)
|
||||
virtual bool
|
||||
save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats) {
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool
|
||||
load_hdf5 (octave_hdf5_id loc_id, const char *name, bool have_h5giterate_bug) {
|
||||
return true;
|
||||
}
|
||||
# else
|
||||
virtual bool
|
||||
save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) {
|
||||
return true;
|
||||
|
|
@ -877,6 +888,7 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
|
|||
load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) {
|
||||
return true;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
virtual octave_value convert_to_str(bool pad = false, bool force = false, char type = '"') const {
|
||||
|
|
@ -969,7 +981,11 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
|
|||
return octave_value();
|
||||
}
|
||||
|
||||
#if SWIG_OCTAVE_PREREQ(4,0,0)
|
||||
void print(std::ostream &os, bool pr_as_read_syntax = false) {
|
||||
#else
|
||||
void print(std::ostream &os, bool pr_as_read_syntax = false) const {
|
||||
#endif
|
||||
if (is_string()) {
|
||||
os << string_value();
|
||||
return;
|
||||
|
|
@ -1089,6 +1105,15 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
|
|||
{ return ptr->load_binary(is, swap, fmt); }
|
||||
|
||||
#if defined (HAVE_HDF5)
|
||||
# if SWIG_OCTAVE_PREREQ(4,0,0)
|
||||
virtual bool
|
||||
save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats)
|
||||
{ return ptr->save_hdf5(loc_id, name, save_as_floats); }
|
||||
|
||||
virtual bool
|
||||
load_hdf5 (octave_hdf5_id loc_id, const char *name, bool have_h5giterate_bug)
|
||||
{ return ptr->load_hdf5(loc_id, name, have_h5giterate_bug); }
|
||||
# else
|
||||
virtual bool
|
||||
save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats)
|
||||
{ return ptr->save_hdf5(loc_id, name, save_as_floats); }
|
||||
|
|
@ -1096,6 +1121,7 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
|
|||
virtual bool
|
||||
load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug)
|
||||
{ return ptr->load_hdf5(loc_id, name, have_h5giterate_bug); }
|
||||
# endif
|
||||
#endif
|
||||
|
||||
virtual octave_value convert_to_str(bool pad = false, bool force = false, char type = '"') const
|
||||
|
|
@ -1104,14 +1130,22 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
|
|||
virtual octave_value convert_to_str_internal(bool pad, bool force, char type) const
|
||||
{ return ptr->convert_to_str_internal(pad, force, type); }
|
||||
|
||||
#if SWIG_OCTAVE_PREREQ(4,0,0)
|
||||
void print(std::ostream &os, bool pr_as_read_syntax = false)
|
||||
#else
|
||||
void print(std::ostream &os, bool pr_as_read_syntax = false) const
|
||||
#endif
|
||||
{ return ptr->print(os, pr_as_read_syntax); }
|
||||
|
||||
private:
|
||||
#if !SWIG_OCTAVE_PREREQ(4,0,0)
|
||||
DECLARE_OCTAVE_ALLOCATOR;
|
||||
#endif
|
||||
DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA;
|
||||
};
|
||||
#if !SWIG_OCTAVE_PREREQ(4,0,0)
|
||||
DEFINE_OCTAVE_ALLOCATOR(octave_swig_ref);
|
||||
#endif
|
||||
DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(octave_swig_ref, "swig_ref", "swig_ref");
|
||||
|
||||
class octave_swig_packed:public octave_base_value {
|
||||
|
|
@ -1143,7 +1177,11 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
|
|||
return true;
|
||||
}
|
||||
|
||||
#if SWIG_OCTAVE_PREREQ(4,0,0)
|
||||
void print(std::ostream &os, bool pr_as_read_syntax = false) {
|
||||
#else
|
||||
void print(std::ostream &os, bool pr_as_read_syntax = false) const {
|
||||
#endif
|
||||
indent(os);
|
||||
os << "swig packed type: name = " << (type ? type->name : std::string()) << ", len = " << buf.size(); newline(os);
|
||||
}
|
||||
|
|
@ -1167,6 +1205,17 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
|
|||
}
|
||||
|
||||
#if defined (HAVE_HDF5)
|
||||
# if SWIG_OCTAVE_PREREQ(4,0,0)
|
||||
virtual bool
|
||||
save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats) {
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool
|
||||
load_hdf5 (octave_hdf5_id loc_id, const char *name, bool have_h5giterate_bug) {
|
||||
return true;
|
||||
}
|
||||
# else
|
||||
virtual bool
|
||||
save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) {
|
||||
return true;
|
||||
|
|
@ -1176,13 +1225,18 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
|
|||
load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) {
|
||||
return true;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
private:
|
||||
#if !SWIG_OCTAVE_PREREQ(4,0,0)
|
||||
DECLARE_OCTAVE_ALLOCATOR;
|
||||
#endif
|
||||
DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA;
|
||||
};
|
||||
#if !SWIG_OCTAVE_PREREQ(4,0,0)
|
||||
DEFINE_OCTAVE_ALLOCATOR(octave_swig_packed);
|
||||
#endif
|
||||
DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(octave_swig_packed, "swig_packed", "swig_packed");
|
||||
|
||||
SWIGRUNTIME octave_value_list octave_set_immutable(const octave_value_list &args, int nargout) {
|
||||
|
|
|
|||
|
|
@ -227,13 +227,12 @@ namespace Swig {
|
|||
}
|
||||
|
||||
public:
|
||||
/* wrap a Perl object, optionally taking ownership */
|
||||
/* wrap a Perl object. */
|
||||
Director(SV *pkg) : swig_disown_flag(false) {
|
||||
STRLEN len;
|
||||
char *str = SvPV(pkg, len);
|
||||
swig_class = std::string(str, len);
|
||||
swig_self = newRV_inc((SV *)newHV());
|
||||
swig_incref();
|
||||
}
|
||||
|
||||
/* discard our reference at destruction */
|
||||
|
|
|
|||
|
|
@ -103,6 +103,9 @@
|
|||
#ifdef stat
|
||||
#undef stat
|
||||
#endif
|
||||
#ifdef seed
|
||||
#undef seed
|
||||
#endif
|
||||
|
||||
#ifdef bool
|
||||
/* Leave if macro is from C99 stdbool.h */
|
||||
|
|
|
|||
|
|
@ -15,15 +15,6 @@
|
|||
#include <exception>
|
||||
#include <map>
|
||||
|
||||
/*
|
||||
Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the
|
||||
'Swig' namespace. This could be useful for multi-modules projects.
|
||||
*/
|
||||
#ifdef SWIG_DIRECTOR_STATIC
|
||||
/* Force anonymous (static) namespace */
|
||||
#define Swig
|
||||
#endif
|
||||
|
||||
namespace Swig {
|
||||
|
||||
/* memory handler */
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ SWIGINTERN void \
|
|||
wrapper##_closure(PyObject *a) { \
|
||||
SwigPyObject *sobj; \
|
||||
sobj = (SwigPyObject *)a; \
|
||||
Py_XDECREF(sobj->dict); \
|
||||
if (sobj->own) { \
|
||||
PyObject *o = wrapper(a, NULL); \
|
||||
Py_XDECREF(o); \
|
||||
|
|
|
|||
|
|
@ -40,16 +40,6 @@
|
|||
#endif
|
||||
|
||||
|
||||
/*
|
||||
Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the
|
||||
'Swig' namespace. This could be useful for multi-modules projects.
|
||||
*/
|
||||
#ifdef SWIG_DIRECTOR_STATIC
|
||||
/* Force anonymous (static) namespace */
|
||||
#define Swig
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
Use -DSWIG_DIRECTOR_NORTTI if you prefer to avoid the use of the
|
||||
native C++ RTTI and dynamic_cast<>. But be aware that directors
|
||||
|
|
@ -338,9 +328,8 @@ namespace Swig {
|
|||
}
|
||||
|
||||
public:
|
||||
/* wrap a python object, optionally taking ownership */
|
||||
/* wrap a python object. */
|
||||
Director(PyObject *self) : swig_self(self), swig_disown_flag(false) {
|
||||
swig_incref();
|
||||
}
|
||||
|
||||
/* discard our reference at destruction */
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
%define %pythonabc(Type, Abc)
|
||||
%feature("python:abc", #Abc) Type;
|
||||
%enddef
|
||||
%pythoncode {import collections};
|
||||
%pythoncode %{import collections%}
|
||||
%pythonabc(std::vector, collections.MutableSequence);
|
||||
%pythonabc(std::list, collections.MutableSequence);
|
||||
%pythonabc(std::map, collections.MutableMapping);
|
||||
|
|
|
|||
|
|
@ -710,8 +710,8 @@ namespace swig
|
|||
#if defined(SWIGPYTHON_BUILTIN)
|
||||
%feature("python:slot", "tp_iter", functype="getiterfunc") iterator;
|
||||
#else
|
||||
%pythoncode {def __iter__(self):
|
||||
return self.iterator()}
|
||||
%pythoncode %{def __iter__(self):
|
||||
return self.iterator()%}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -275,7 +275,9 @@ SWIG_Python_FixMethods(PyMethodDef *methods,
|
|||
size_t i;
|
||||
for (i = 0; methods[i].ml_name; ++i) {
|
||||
const char *c = methods[i].ml_doc;
|
||||
if (c && (c = strstr(c, "swig_ptr: "))) {
|
||||
if (!c) continue;
|
||||
c = strstr(c, "swig_ptr: ");
|
||||
if (c) {
|
||||
int j;
|
||||
swig_const_info *ci = 0;
|
||||
const char *name = c + 10;
|
||||
|
|
|
|||
|
|
@ -344,8 +344,8 @@ namespace swig
|
|||
%feature("python:slot", "tp_iternext", functype="iternextfunc") SwigPyIterator::__next__;
|
||||
#else
|
||||
%extend SwigPyIterator {
|
||||
%pythoncode {def __iter__(self):
|
||||
return self}
|
||||
%pythoncode %{def __iter__(self):
|
||||
return self%}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -381,6 +381,23 @@ typedef struct {
|
|||
#endif
|
||||
} SwigPyObject;
|
||||
|
||||
|
||||
#ifdef SWIGPYTHON_BUILTIN
|
||||
|
||||
SWIGRUNTIME PyObject *
|
||||
SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
|
||||
{
|
||||
SwigPyObject *sobj = (SwigPyObject *)v;
|
||||
|
||||
if (!sobj->dict)
|
||||
sobj->dict = PyDict_New();
|
||||
|
||||
Py_INCREF(sobj->dict);
|
||||
return sobj->dict;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
SWIGRUNTIME PyObject *
|
||||
SwigPyObject_long(SwigPyObject *v)
|
||||
{
|
||||
|
|
@ -651,7 +668,7 @@ swigobject_methods[] = {
|
|||
static PyMethodDef
|
||||
swigobject_methods[] = {
|
||||
{(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"},
|
||||
{(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"},
|
||||
{(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"acquires ownership of the pointer"},
|
||||
{(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
|
||||
{(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"},
|
||||
{(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"},
|
||||
|
|
@ -1420,18 +1437,21 @@ SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int f
|
|||
newobj = (SwigPyObject *) newobj->next;
|
||||
newobj->next = next_self;
|
||||
newobj = (SwigPyObject *)next_self;
|
||||
#ifdef SWIGPYTHON_BUILTIN
|
||||
newobj->dict = 0;
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
newobj = PyObject_New(SwigPyObject, clientdata->pytype);
|
||||
#ifdef SWIGPYTHON_BUILTIN
|
||||
newobj->dict = 0;
|
||||
#endif
|
||||
}
|
||||
if (newobj) {
|
||||
newobj->ptr = ptr;
|
||||
newobj->ty = type;
|
||||
newobj->own = own;
|
||||
newobj->next = 0;
|
||||
#ifdef SWIGPYTHON_BUILTIN
|
||||
newobj->dict = 0;
|
||||
#endif
|
||||
return (PyObject*) newobj;
|
||||
}
|
||||
return SWIG_Py_Void();
|
||||
|
|
|
|||
|
|
@ -176,14 +176,14 @@
|
|||
|
||||
#else
|
||||
%extend {
|
||||
%pythoncode {def __iter__(self):
|
||||
return self.key_iterator()}
|
||||
%pythoncode {def iterkeys(self):
|
||||
return self.key_iterator()}
|
||||
%pythoncode {def itervalues(self):
|
||||
return self.value_iterator()}
|
||||
%pythoncode {def iteritems(self):
|
||||
return self.iterator()}
|
||||
%pythoncode %{def __iter__(self):
|
||||
return self.key_iterator()%}
|
||||
%pythoncode %{def iterkeys(self):
|
||||
return self.key_iterator()%}
|
||||
%pythoncode %{def itervalues(self):
|
||||
return self.value_iterator()%}
|
||||
%pythoncode %{def iteritems(self):
|
||||
return self.iterator()%}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ SwigPython_std_pair_setitem (PyObject *a, Py_ssize_t b, PyObject *c)
|
|||
%define %swig_pair_methods(pair...)
|
||||
#if !defined(SWIGPYTHON_BUILTIN)
|
||||
%extend {
|
||||
%pythoncode {def __len__(self):
|
||||
%pythoncode %{def __len__(self):
|
||||
return 2
|
||||
def __repr__(self):
|
||||
return str((self.first, self.second))
|
||||
|
|
@ -189,7 +189,7 @@ def __setitem__(self, index, val):
|
|||
if not (index % 2):
|
||||
self.first = val
|
||||
else:
|
||||
self.second = val}
|
||||
self.second = val%}
|
||||
}
|
||||
#endif
|
||||
%enddef
|
||||
|
|
|
|||
|
|
@ -231,14 +231,14 @@
|
|||
return swig::make_output_value_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
|
||||
}
|
||||
|
||||
%pythoncode {def __iter__(self):
|
||||
return self.key_iterator()}
|
||||
%pythoncode {def iterkeys(self):
|
||||
return self.key_iterator()}
|
||||
%pythoncode {def itervalues(self):
|
||||
return self.value_iterator()}
|
||||
%pythoncode {def iteritems(self):
|
||||
return self.iterator()}
|
||||
%pythoncode %{def __iter__(self):
|
||||
return self.key_iterator()%}
|
||||
%pythoncode %{def iterkeys(self):
|
||||
return self.key_iterator()%}
|
||||
%pythoncode %{def itervalues(self):
|
||||
return self.value_iterator()%}
|
||||
%pythoncode %{def iteritems(self):
|
||||
return self.iterator()%}
|
||||
}
|
||||
%enddef
|
||||
|
||||
|
|
|
|||
|
|
@ -264,8 +264,8 @@ x
|
|||
setAs('ExternalReference', 'character',
|
||||
function(from) {if (!is.null(from$"__str__")) from$"__str__"()})
|
||||
|
||||
setMethod('print', 'ExternalReference',
|
||||
function(x) {print(as(x, "character"))})
|
||||
suppressWarnings(setMethod('print', 'ExternalReference',
|
||||
function(x) {print(as(x, "character"))}))
|
||||
%}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
*/
|
||||
|
||||
#define RKW(x) %keywordwarn("'" `x` "' is a R keyword, renaming to '_" `x`"'", rename="_%s") `x`
|
||||
#define RSWIGKW(x) %keywordwarn("'" `x` "' is a SWIG R reserved parameter name, renaming to '_" `x`"'", rename="_%s") `x`
|
||||
|
||||
/*
|
||||
Warnings for R reserved words taken from
|
||||
|
|
@ -29,4 +30,7 @@ RKW(NA_real_);
|
|||
RKW(NA_complex_);
|
||||
RKW(NA_character_);
|
||||
|
||||
RSWIGKW(self);
|
||||
|
||||
#undef RKW
|
||||
#undef RSWIGKW
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ function(className, ..., append = TRUE)
|
|||
|
||||
if(!isGeneric("copyToC"))
|
||||
setGeneric("copyToC",
|
||||
function(value, obj = RSWIG_createNewRef(class(value)))
|
||||
function(value, obj = SWIG_createNewRef(class(value)))
|
||||
standardGeneric("copyToC"
|
||||
))
|
||||
|
||||
|
|
@ -147,4 +147,4 @@ function(fun, userData = NULL)
|
|||
}
|
||||
|
||||
|
||||
#######################################################################
|
||||
#######################################################################
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ namespace Swig {
|
|||
mutable bool swig_disown_flag;
|
||||
|
||||
public:
|
||||
/* wrap a Ruby object, optionally taking ownership */
|
||||
/* wrap a Ruby object. */
|
||||
Director(VALUE self) : swig_self(self), swig_disown_flag(false) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,12 +14,9 @@
|
|||
SWIGINTERN int
|
||||
SWIG_SciString_AsChar(void *pvApiCtx, int iVar, char *pcValue, char *fname) {
|
||||
SciErr sciErr;
|
||||
int iType = 0;
|
||||
int iRows = 0;
|
||||
int iCols = 0;
|
||||
int *piAddrVar = NULL;
|
||||
char *pstStrings = NULL;
|
||||
int piLength = 0;
|
||||
char *pstValue = NULL;
|
||||
int iRet;
|
||||
|
||||
sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar);
|
||||
if (sciErr.iErr) {
|
||||
|
|
@ -27,30 +24,22 @@ SWIG_SciString_AsChar(void *pvApiCtx, int iVar, char *pcValue, char *fname) {
|
|||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
sciErr = getVarType(pvApiCtx, piAddrVar, &iType);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
if (isStringType(pvApiCtx, piAddrVar) == 0)
|
||||
{
|
||||
Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A single string expected.\n"), fname, iVar);
|
||||
return SWIG_TypeError;
|
||||
}
|
||||
if (iType != sci_strings) {
|
||||
Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A string expected.\n"), fname, iVar);
|
||||
|
||||
iRet = getAllocatedSingleString(pvApiCtx, piAddrVar, &pstValue);
|
||||
if (iRet) {
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
pstStrings = (char *)malloc(sizeof(char));
|
||||
sciErr = getMatrixOfString(pvApiCtx, piAddrVar, &iRows, &iCols, &piLength, (char **)&pstStrings);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
if (pcValue != NULL) {
|
||||
*pcValue = pstValue[0];
|
||||
}
|
||||
if (iRows * iCols != 1) {
|
||||
Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A string expected.\n"), fname, iVar);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
*pcValue = pstStrings[0];
|
||||
|
||||
free(pstStrings);
|
||||
|
||||
freeAllocatedSingleString(pstValue);
|
||||
return SWIG_OK;
|
||||
}
|
||||
}
|
||||
|
|
@ -103,8 +92,7 @@ SWIG_SciString_AsCharPtr(void *pvApiCtx, int iVar, char *pcValue, int iLength, c
|
|||
strncpy(pcValue, pcTmpValue, iLength);
|
||||
}
|
||||
|
||||
free(pcTmpValue);
|
||||
|
||||
freeAllocatedSingleString(pcTmpValue);
|
||||
return SWIG_OK;
|
||||
}
|
||||
}
|
||||
|
|
@ -117,8 +105,10 @@ SWIGINTERN int
|
|||
SWIG_SciString_AsCharPtrAndSize(void *pvApiCtx, int iVar, char **pcValue, size_t *piLength, int *alloc, char *fname) {
|
||||
SciErr sciErr;
|
||||
int *piAddrVar = NULL;
|
||||
int iRet;
|
||||
char *pstStrings = NULL;
|
||||
char *pstString = NULL;
|
||||
int iRows = 0;
|
||||
int iCols = 0;
|
||||
int iLen = 0;
|
||||
|
||||
sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar);
|
||||
if (sciErr.iErr) {
|
||||
|
|
@ -126,14 +116,31 @@ SWIG_SciString_AsCharPtrAndSize(void *pvApiCtx, int iVar, char **pcValue, size_t
|
|||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
iRet = getAllocatedSingleString(pvApiCtx, piAddrVar, &pstStrings);
|
||||
if (iRet) {
|
||||
return SWIG_ERROR;
|
||||
if (isScalar(pvApiCtx, piAddrVar) == 0 || isStringType(pvApiCtx, piAddrVar) == 0)
|
||||
{
|
||||
Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A single string expected.\n"), fname, iVar);
|
||||
return SWIG_TypeError;
|
||||
}
|
||||
|
||||
sciErr = getMatrixOfString(pvApiCtx, piAddrVar, &iRows, &iCols, &iLen, NULL);
|
||||
if (sciErr.iErr)
|
||||
{
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
pstString = %new_array(iLen + 1, char);
|
||||
|
||||
sciErr = getMatrixOfString(pvApiCtx, piAddrVar, &iRows, &iCols, &iLen, &pstString);
|
||||
if (sciErr.iErr)
|
||||
{
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
// TODO: return SWIG_ERROR if pcValue NULL (now returning SWIG_ERROR fails some typechecks)
|
||||
if (pcValue) {
|
||||
*pcValue = pstStrings;
|
||||
*pcValue = pstString;
|
||||
}
|
||||
|
||||
if (alloc != NULL) {
|
||||
|
|
@ -141,7 +148,7 @@ SWIG_SciString_AsCharPtrAndSize(void *pvApiCtx, int iVar, char **pcValue, size_t
|
|||
}
|
||||
|
||||
if (piLength != NULL) {
|
||||
*piLength = strlen(*pcValue);
|
||||
*piLength = strlen(pstString);
|
||||
}
|
||||
|
||||
return SWIG_OK;
|
||||
|
|
|
|||
|
|
@ -66,11 +66,13 @@ static void SWIG_Scilab_SetApiContext(void *apiCtx) {
|
|||
|
||||
#if SWIG_SCILAB_VERSION >= 540
|
||||
#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument)
|
||||
#define SWIG_CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) CheckInputArgumentAtLeast(pvApiCtx, minInputArgument)
|
||||
#define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument)
|
||||
#define SWIG_NbInputArgument(pvApiCtx) nbInputArgument(pvApiCtx)
|
||||
#define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) AssignOutputVariable(pvApiCtx, outputArgumentPos) = argumentPos
|
||||
#else
|
||||
#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckRhs(minInputArgument, maxInputArgument)
|
||||
#define SWIG_CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) CheckRhs(minInputArgument, 256)
|
||||
#define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckLhs(minOutputArgument, maxOutputArgument)
|
||||
#define SWIG_NbInputArgument(pvApiCtx) Rhs
|
||||
#define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) LhsVar(outputArgumentPos) = argumentPos
|
||||
|
|
@ -148,7 +150,8 @@ SWIGRUNTIME int
|
|||
SWIG_Scilab_ConvertPacked(void *pvApiCtx, int iVar, void *ptr, int sz, swig_type_info *ty, char *fname) {
|
||||
swig_cast_info *tc;
|
||||
int *piAddrVar = NULL;
|
||||
char *pstStrings = NULL;
|
||||
char *pstString = NULL;
|
||||
char *pstStringPtr = NULL;
|
||||
SciErr sciErr;
|
||||
|
||||
sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar);
|
||||
|
|
@ -157,27 +160,33 @@ SWIG_Scilab_ConvertPacked(void *pvApiCtx, int iVar, void *ptr, int sz, swig_type
|
|||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
if (getAllocatedSingleString(pvApiCtx, piAddrVar, &pstStrings)) {
|
||||
if (getAllocatedSingleString(pvApiCtx, piAddrVar, &pstString)) {
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
/* Pointer values must start with leading underscore */
|
||||
if (*pstStrings != '_') {
|
||||
if (*pstString != '_') {
|
||||
freeAllocatedSingleString(pstString);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
pstStrings++;
|
||||
pstStrings = (char*)SWIG_UnpackData(pstStrings, ptr, sz);
|
||||
pstStringPtr = pstString;
|
||||
pstStringPtr++;
|
||||
pstStringPtr = (char*)SWIG_UnpackData(pstStringPtr, ptr, sz);
|
||||
|
||||
if (ty) {
|
||||
if (!pstStrings) {
|
||||
if (!pstStringPtr) {
|
||||
freeAllocatedSingleString(pstString);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
tc = SWIG_TypeCheck(pstStrings, ty);
|
||||
tc = SWIG_TypeCheck(pstStringPtr, ty);
|
||||
if (!tc) {
|
||||
freeAllocatedSingleString(pstString);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
freeAllocatedSingleString(pstString);
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -110,3 +110,12 @@
|
|||
#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
|
||||
# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
|
||||
#endif
|
||||
|
||||
/* Intel's compiler complains if a variable which was never initialised is
|
||||
* cast to void, which is a common idiom which we use to indicate that we
|
||||
* are aware a variable isn't used. So we just silence that warning.
|
||||
* See: https://github.com/swig/swig/issues/192 for more discussion.
|
||||
*/
|
||||
#ifdef __INTEL_COMPILER
|
||||
# pragma warning disable 592
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue