New SWIG runtime files
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25895 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -55,17 +55,6 @@ static void wxPyCoreAPI_IMPORT() {
|
|||||||
#define SWIG_Python_InstallConstants(a,b) (wxPyCoreAPIPtr->p_SWIG_Python_InstallConstants(a,b))
|
#define SWIG_Python_InstallConstants(a,b) (wxPyCoreAPIPtr->p_SWIG_Python_InstallConstants(a,b))
|
||||||
#define SWIG_Python_MustGetPtr(a,b,c,d) (wxPyCoreAPIPtr->p_SWIG_Python_MustGetPtr(a,b,c,d))
|
#define SWIG_Python_MustGetPtr(a,b,c,d) (wxPyCoreAPIPtr->p_SWIG_Python_MustGetPtr(a,b,c,d))
|
||||||
|
|
||||||
#define SWIG_PyObj_AsCharPtr(a,b) (wxPyCoreAPIPtr->p_SWIG_PyObj_AsCharPtr(a,b))
|
|
||||||
#define SWIG_PyObj_FromCharPtr(a) (wxPyCoreAPIPtr->p_SWIG_PyObj_FromCharPtr(a))
|
|
||||||
#define SWIG_PyObj_AsUnsignedLong(a) (wxPyCoreAPIPtr->p_SWIG_PyObj_AsUnsignedLong(a))
|
|
||||||
#define SWIG_PyObj_AsLongInRange(a,b,c,d) (wxPyCoreAPIPtr->p_SWIG_PyObj_AsLongInRange(a,b,c,d))
|
|
||||||
#define SWIG_PyObj_AsUnsignedLongInRange(a,b,c) (wxPyCoreAPIPtr->p_SWIG_PyObj_AsUnsignedLongInRange(a,b,c))
|
|
||||||
#define SWIG_PyObj_AsNewCharPtr(a,b) (wxPyCoreAPIPtr->p_SWIG_PyObj_AsNewCharPtr(a,b))
|
|
||||||
#define SWIG_PyObj_AsCharPtrAndSize(a,b,c,d) (wxPyCoreAPIPtr->p_SWIG_PyObj_AsCharPtrAndSize(a,b,c,d))
|
|
||||||
#define SWIG_PyObj_AsCharArray(a,b,c,d) (wxPyCoreAPIPtr->p_SWIG_PyObj_AsCharArray(a,b,c,d))
|
|
||||||
#define SWIG_PyObj_FromCharArray(a,b) (wxPyCoreAPIPtr->p_SWIG_PyObj_FromCharArray(a,b))
|
|
||||||
#define SWIG_PyObj_AsFloatConv(a,b) (wxPyCoreAPIPtr->p_SWIG_PyObj_AsFloatConv(a,b))
|
|
||||||
|
|
||||||
#define wxPyCheckSwigType(a) (wxPyCoreAPIPtr->p_wxPyCheckSwigType(a))
|
#define wxPyCheckSwigType(a) (wxPyCoreAPIPtr->p_wxPyCheckSwigType(a))
|
||||||
#define wxPyConstructObject(a,b,c) (wxPyCoreAPIPtr->p_wxPyConstructObject(a,b,c))
|
#define wxPyConstructObject(a,b,c) (wxPyCoreAPIPtr->p_wxPyConstructObject(a,b,c))
|
||||||
#define wxPyConvertSwigPtr(a,b,c) (wxPyCoreAPIPtr->p_wxPyConvertSwigPtr(a,b,c))
|
#define wxPyConvertSwigPtr(a,b,c) (wxPyCoreAPIPtr->p_wxPyConvertSwigPtr(a,b,c))
|
||||||
|
@@ -337,23 +337,6 @@ typedef PyObject* (*p_SWIG_Python_NewPackedObj_t)(void *, int sz, swig_typ
|
|||||||
typedef void (*p_SWIG_Python_InstallConstants_t)(PyObject *d, swig_const_info constants[]);
|
typedef void (*p_SWIG_Python_InstallConstants_t)(PyObject *d, swig_const_info constants[]);
|
||||||
typedef void* (*p_SWIG_Python_MustGetPtr_t)(PyObject *, swig_type_info *, int, int);
|
typedef void* (*p_SWIG_Python_MustGetPtr_t)(PyObject *, swig_type_info *, int, int);
|
||||||
|
|
||||||
typedef char* (*p_SWIG_PyObj_AsCharPtr_t)(PyObject *obj, swig_type_info* pchar_info);
|
|
||||||
typedef PyObject * (*p_SWIG_PyObj_FromCharPtr_t)(const char* cptr);
|
|
||||||
typedef unsigned long (*p_SWIG_PyObj_AsUnsignedLong_t)(PyObject * obj);
|
|
||||||
typedef long (*p_SWIG_PyObj_AsLongInRange_t)(PyObject * obj, const char* type,
|
|
||||||
long min_value, long max_value);
|
|
||||||
typedef unsigned long (*p_SWIG_PyObj_AsUnsignedLongInRange_t)(PyObject *obj, const char* type,
|
|
||||||
unsigned long max_value);
|
|
||||||
typedef char * (*p_SWIG_PyObj_AsNewCharPtr_t)(PyObject *obj, swig_type_info* pchar_info);
|
|
||||||
typedef void (*p_SWIG_PyObj_AsCharPtrAndSize_t)(PyObject *obj, swig_type_info* pchar_info,
|
|
||||||
char** cptr, size_t* size);
|
|
||||||
typedef void (*p_SWIG_PyObj_AsCharArray_t)(PyObject *obj, swig_type_info* pchar_info,
|
|
||||||
char* carray, size_t size);
|
|
||||||
typedef PyObject * (*p_SWIG_PyObj_FromCharArray_t)(const char* carray, size_t size);
|
|
||||||
typedef float (*p_SWIG_PyObj_AsFloatConv_t)(PyObject *obj, py_objasdbl_conv pyconv);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct wxPyCoreAPI {
|
struct wxPyCoreAPI {
|
||||||
|
|
||||||
@@ -375,17 +358,6 @@ struct wxPyCoreAPI {
|
|||||||
p_SWIG_Python_InstallConstants_t p_SWIG_Python_InstallConstants;
|
p_SWIG_Python_InstallConstants_t p_SWIG_Python_InstallConstants;
|
||||||
p_SWIG_Python_MustGetPtr_t p_SWIG_Python_MustGetPtr;
|
p_SWIG_Python_MustGetPtr_t p_SWIG_Python_MustGetPtr;
|
||||||
|
|
||||||
p_SWIG_PyObj_AsCharPtr_t p_SWIG_PyObj_AsCharPtr;
|
|
||||||
p_SWIG_PyObj_FromCharPtr_t p_SWIG_PyObj_FromCharPtr;
|
|
||||||
p_SWIG_PyObj_AsUnsignedLong_t p_SWIG_PyObj_AsUnsignedLong;
|
|
||||||
p_SWIG_PyObj_AsLongInRange_t p_SWIG_PyObj_AsLongInRange;
|
|
||||||
p_SWIG_PyObj_AsUnsignedLongInRange_t p_SWIG_PyObj_AsUnsignedLongInRange;
|
|
||||||
p_SWIG_PyObj_AsNewCharPtr_t p_SWIG_PyObj_AsNewCharPtr;
|
|
||||||
p_SWIG_PyObj_AsCharPtrAndSize_t p_SWIG_PyObj_AsCharPtrAndSize;
|
|
||||||
p_SWIG_PyObj_AsCharArray_t p_SWIG_PyObj_AsCharArray;
|
|
||||||
p_SWIG_PyObj_FromCharArray_t p_SWIG_PyObj_FromCharArray;
|
|
||||||
p_SWIG_PyObj_AsFloatConv_t p_SWIG_PyObj_AsFloatConv;
|
|
||||||
|
|
||||||
bool (*p_wxPyCheckSwigType)(const wxChar* className);
|
bool (*p_wxPyCheckSwigType)(const wxChar* className);
|
||||||
PyObject* (*p_wxPyConstructObject)(void* ptr, const wxChar* className, int setThisOwn);
|
PyObject* (*p_wxPyConstructObject)(void* ptr, const wxChar* className, int setThisOwn);
|
||||||
bool (*p_wxPyConvertSwigPtr)(PyObject* obj, void **ptr, const wxChar* className);
|
bool (*p_wxPyConvertSwigPtr)(PyObject* obj, void **ptr, const wxChar* className);
|
||||||
|
@@ -150,17 +150,6 @@ static wxPyCoreAPI API = {
|
|||||||
(p_SWIG_Python_InstallConstants_t)SWIG_Python_InstallConstants,
|
(p_SWIG_Python_InstallConstants_t)SWIG_Python_InstallConstants,
|
||||||
(p_SWIG_Python_MustGetPtr_t)SWIG_Python_MustGetPtr,
|
(p_SWIG_Python_MustGetPtr_t)SWIG_Python_MustGetPtr,
|
||||||
|
|
||||||
(p_SWIG_PyObj_AsCharPtr_t)SWIG_PyObj_AsCharPtr,
|
|
||||||
(p_SWIG_PyObj_FromCharPtr_t)SWIG_PyObj_FromCharPtr,
|
|
||||||
(p_SWIG_PyObj_AsUnsignedLong_t)SWIG_PyObj_AsUnsignedLong,
|
|
||||||
(p_SWIG_PyObj_AsLongInRange_t)SWIG_PyObj_AsLongInRange,
|
|
||||||
(p_SWIG_PyObj_AsUnsignedLongInRange_t)SWIG_PyObj_AsUnsignedLongInRange,
|
|
||||||
(p_SWIG_PyObj_AsNewCharPtr_t)SWIG_PyObj_AsNewCharPtr,
|
|
||||||
(p_SWIG_PyObj_AsCharPtrAndSize_t)SWIG_PyObj_AsCharPtrAndSize,
|
|
||||||
(p_SWIG_PyObj_AsCharArray_t)SWIG_PyObj_AsCharArray,
|
|
||||||
(p_SWIG_PyObj_FromCharArray_t)SWIG_PyObj_FromCharArray,
|
|
||||||
(p_SWIG_PyObj_AsFloatConv_t)SWIG_PyObj_AsFloatConv,
|
|
||||||
|
|
||||||
wxPyCheckSwigType,
|
wxPyCheckSwigType,
|
||||||
wxPyConstructObject,
|
wxPyConstructObject,
|
||||||
wxPyConvertSwigPtr,
|
wxPyConvertSwigPtr,
|
||||||
|
@@ -71,4 +71,3 @@ SWIGIMPORT(char *) SWIG_UnpackData(char *, void *, int);
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -203,12 +203,49 @@ SWIG_TypeName(const swig_type_info *ty) {
|
|||||||
return ty->name;
|
return ty->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Compare two type names skipping the space characters, therefore
|
||||||
|
"char*" == "char *" and "Class<int>" == "Class<int >", etc.
|
||||||
|
|
||||||
|
Return 0 when the two name types are equivalent, as in
|
||||||
|
strncmp, but skipping ' '.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
SWIG_TypeNameComp(const char *f1, const char *l1,
|
||||||
|
const char *f2, const char *l2) {
|
||||||
|
for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
|
||||||
|
while ((*f1 == ' ') && (f1 != l1)) ++f1;
|
||||||
|
while ((*f2 == ' ') && (f2 != l2)) ++f2;
|
||||||
|
if (*f1 != *f2) return *f1 - *f2;
|
||||||
|
}
|
||||||
|
return (l1 - f1) - (l2 - f2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Check type equivalence in a name list like <name1>|<name2>|...
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
SWIG_TypeEquiv(const char *nb, const char *tb) {
|
||||||
|
int equiv = 0;
|
||||||
|
const char* te = tb + strlen(tb);
|
||||||
|
const char* ne = nb;
|
||||||
|
while (!equiv && *ne) {
|
||||||
|
for (nb = ne; *ne; ++ne) {
|
||||||
|
if (*ne == '|') break;
|
||||||
|
}
|
||||||
|
equiv = SWIG_TypeNameComp(nb, ne, tb, te) == 0;
|
||||||
|
if (*ne) ++ne;
|
||||||
|
}
|
||||||
|
return equiv;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Search for a swig_type_info structure */
|
/* Search for a swig_type_info structure */
|
||||||
SWIGRUNTIME(swig_type_info *)
|
SWIGRUNTIME(swig_type_info *)
|
||||||
SWIG_TypeQuery(const char *name) {
|
SWIG_TypeQuery(const char *name) {
|
||||||
swig_type_info *ty = swig_type_list;
|
swig_type_info *ty = swig_type_list;
|
||||||
while (ty) {
|
while (ty) {
|
||||||
if (ty->str && (strcmp(name,ty->str) == 0)) return ty;
|
if (ty->str && (SWIG_TypeEquiv(ty->str,name))) return ty;
|
||||||
if (ty->name && (strcmp(name,ty->name) == 0)) return ty;
|
if (ty->name && (strcmp(name,ty->name) == 0)) return ty;
|
||||||
ty = ty->prev;
|
ty = ty->prev;
|
||||||
}
|
}
|
||||||
@@ -279,7 +316,6 @@ SWIG_UnpackData(char *c, void *ptr, int sz) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* python.swg
|
* python.swg
|
||||||
*
|
*
|
||||||
@@ -353,27 +389,6 @@ SWIGIMPORT(int) SWIG_Python_ConvertPacked(PyObject *, void *, int
|
|||||||
SWIGIMPORT(PyObject *) SWIG_Python_NewPackedObj(void *, int sz, swig_type_info *);
|
SWIGIMPORT(PyObject *) SWIG_Python_NewPackedObj(void *, int sz, swig_type_info *);
|
||||||
SWIGIMPORT(void) SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]);
|
SWIGIMPORT(void) SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]);
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
|
||||||
* the needed conversions between C++ and python
|
|
||||||
* ----------------------------------------------------------------------------- */
|
|
||||||
/* basic types */
|
|
||||||
/*
|
|
||||||
utilities
|
|
||||||
*/
|
|
||||||
SWIGIMPORT(char* ) SWIG_PyObj_AsCharPtr(PyObject *obj, swig_type_info* pchar_info);
|
|
||||||
SWIGIMPORT(PyObject *) SWIG_PyObj_FromCharPtr(const char* cptr);
|
|
||||||
SWIGIMPORT(unsigned long) SWIG_PyObj_AsUnsignedLong(PyObject * obj);
|
|
||||||
SWIGIMPORT(long) SWIG_PyObj_AsLongInRange(PyObject * obj, const char* type,
|
|
||||||
long min_value, long max_value);
|
|
||||||
SWIGIMPORT(unsigned long) SWIG_PyObj_AsUnsignedLongInRange(PyObject *obj, const char* type,
|
|
||||||
unsigned long max_value);
|
|
||||||
SWIGIMPORT(char *) SWIG_PyObj_AsNewCharPtr(PyObject *obj, swig_type_info* pchar_info);
|
|
||||||
SWIGIMPORT(void) SWIG_PyObj_AsCharPtrAndSize(PyObject *obj, swig_type_info* pchar_info,
|
|
||||||
char** cptr, size_t* size);
|
|
||||||
SWIGIMPORT(void) SWIG_PyObj_AsCharArray(PyObject *obj, swig_type_info* pchar_info,
|
|
||||||
char* carray, size_t size);
|
|
||||||
SWIGIMPORT(PyObject *) SWIG_PyObj_FromCharArray(const char* carray, size_t size);
|
|
||||||
SWIGIMPORT(float) SWIG_PyObj_AsFloatConv(PyObject *obj, py_objasdbl_conv pyconv);
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@@ -441,19 +456,51 @@ swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
|
|||||||
|
|
||||||
statichere PyTypeObject varlinktype = {
|
statichere PyTypeObject varlinktype = {
|
||||||
PyObject_HEAD_INIT(0)
|
PyObject_HEAD_INIT(0)
|
||||||
0,
|
0, /* Number of items in variable part (ob_size) */
|
||||||
(char *)"swigvarlink", /* Type name */
|
(char *)"swigvarlink", /* Type name (tp_name) */
|
||||||
sizeof(swig_varlinkobject), /* Basic size */
|
sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */
|
||||||
0, /* Itemsize */
|
0, /* Itemsize (tp_itemsize) */
|
||||||
0, /* Deallocator */
|
0, /* Deallocator (tp_dealloc) */
|
||||||
(printfunc) swig_varlink_print, /* Print */
|
(printfunc) swig_varlink_print, /* Print (tp_print) */
|
||||||
(getattrfunc) swig_varlink_getattr, /* get attr */
|
(getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
|
||||||
(setattrfunc) swig_varlink_setattr, /* Set attr */
|
(setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
|
||||||
0, /* tp_compare */
|
0, /* tp_compare */
|
||||||
(reprfunc) swig_varlink_repr, /* tp_repr */
|
(reprfunc) swig_varlink_repr, /* tp_repr */
|
||||||
0, /* tp_as_number */
|
0, /* tp_as_number */
|
||||||
0, /* tp_as_mapping*/
|
0, /* tp_as_sequence */
|
||||||
|
0, /* tp_as_mapping */
|
||||||
0, /* tp_hash */
|
0, /* tp_hash */
|
||||||
|
0, /* tp_call */
|
||||||
|
0, /* tp_str */
|
||||||
|
0, /* tp_getattro */
|
||||||
|
0, /* tp_setattro */
|
||||||
|
0, /* tp_as_buffer */
|
||||||
|
0, /* tp_flags */
|
||||||
|
0, /* tp_doc */
|
||||||
|
0, /* tp_traverse */
|
||||||
|
0, /* tp_clear */
|
||||||
|
0, /* tp_richcompare */
|
||||||
|
0, /* tp_weaklistoffset */
|
||||||
|
0, /* tp_iter */
|
||||||
|
0, /* tp_iternext */
|
||||||
|
0, /* tp_methods */
|
||||||
|
0, /* tp_members */
|
||||||
|
0, /* tp_getset */
|
||||||
|
0, /* tp_base */
|
||||||
|
0, /* tp_dict */
|
||||||
|
0, /* tp_descr_get */
|
||||||
|
0, /* tp_descr_set */
|
||||||
|
0, /* tp_dictoffset */
|
||||||
|
0, /* tp_init */
|
||||||
|
0, /* tp_alloc */
|
||||||
|
0, /* tp_new */
|
||||||
|
0, /* tp_free */
|
||||||
|
0, /* tp_is_gc */
|
||||||
|
0, /* tp_bases */
|
||||||
|
0, /* tp_mro */
|
||||||
|
0, /* tp_cache */
|
||||||
|
0, /* tp_subclasses */
|
||||||
|
0, /* tp_weaklist */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Create a variable linking object for use later */
|
/* Create a variable linking object for use later */
|
||||||
@@ -564,10 +611,10 @@ cobject:
|
|||||||
type_error:
|
type_error:
|
||||||
if (flags & SWIG_POINTER_EXCEPTION) {
|
if (flags & SWIG_POINTER_EXCEPTION) {
|
||||||
if (ty && c) {
|
if (ty && c) {
|
||||||
char *temp = (char *) malloc(64+strlen(ty->name)+strlen(c));
|
PyObject *err =
|
||||||
sprintf(temp,"Type error. Got %s, expected %s", c, ty->name);
|
PyString_FromFormat("Type error. Got %s, expected %s",c,ty->name);
|
||||||
PyErr_SetString(PyExc_TypeError, temp);
|
PyErr_SetObject(PyExc_TypeError, err);
|
||||||
free((char *) temp);
|
Py_DECREF(err);
|
||||||
} else {
|
} else {
|
||||||
PyErr_SetString(PyExc_TypeError,"Expected a pointer");
|
PyErr_SetString(PyExc_TypeError,"Expected a pointer");
|
||||||
}
|
}
|
||||||
@@ -605,10 +652,10 @@ type_error:
|
|||||||
|
|
||||||
if (flags) {
|
if (flags) {
|
||||||
if (ty && c) {
|
if (ty && c) {
|
||||||
char *temp = (char *) malloc(64+strlen(ty->name)+strlen(c));
|
PyObject *err =
|
||||||
sprintf(temp,"Type error. Got %s, expected %s", c, ty->name);
|
PyString_FromFormat("Type error. Got %s, expected %s",c,ty->name);
|
||||||
PyErr_SetString(PyExc_TypeError, temp);
|
PyErr_SetObject(PyExc_TypeError, err);
|
||||||
free((char *) temp);
|
Py_DECREF(err);
|
||||||
} else {
|
} else {
|
||||||
PyErr_SetString(PyExc_TypeError,"Expected a pointer");
|
PyErr_SetString(PyExc_TypeError,"Expected a pointer");
|
||||||
}
|
}
|
||||||
@@ -666,196 +713,6 @@ SWIG_Python_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
|
|||||||
return PyString_FromString(result);
|
return PyString_FromString(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
|
||||||
* the needed conversions between C++ and python
|
|
||||||
* ----------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
#include <limits.h>
|
|
||||||
#include <float.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
SWIGRUNTIME(unsigned long)
|
|
||||||
SWIG_PyObj_AsUnsignedLong(PyObject * obj)
|
|
||||||
{
|
|
||||||
if (PyLong_Check(obj)) {
|
|
||||||
return PyLong_AsUnsignedLong(obj);
|
|
||||||
} else {
|
|
||||||
long i = PyInt_AsLong(obj);
|
|
||||||
if ( !PyErr_Occurred() && (i < 0)) {
|
|
||||||
PyErr_SetString(PyExc_TypeError, "negative value for unsigned type");
|
|
||||||
}
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SWIGRUNTIME(long)
|
|
||||||
SWIG_PyObj_AsLongInRange(PyObject * obj, const char* type,
|
|
||||||
long min_value, long max_value)
|
|
||||||
{
|
|
||||||
long value = PyInt_Check(obj) ? PyInt_AsLong(obj) : (long)PyLong_AsLongLong(obj);
|
|
||||||
if (!PyErr_Occurred()) {
|
|
||||||
if (value < min_value) {
|
|
||||||
PyObject *err =
|
|
||||||
PyString_FromFormat("value %ld is less than '%s' minimum %ld",
|
|
||||||
value, type, min_value);
|
|
||||||
|
|
||||||
PyErr_SetObject(PyExc_OverflowError, err);
|
|
||||||
Py_XDECREF(err);
|
|
||||||
} else if (value > max_value) {
|
|
||||||
PyObject *err =
|
|
||||||
PyString_FromFormat("value %ld is greater than '%s' maximum %ld",
|
|
||||||
value, type, max_value);
|
|
||||||
PyErr_SetObject(PyExc_OverflowError, err);
|
|
||||||
Py_XDECREF(err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
SWIGRUNTIME(unsigned long)
|
|
||||||
SWIG_PyObj_AsUnsignedLongInRange(PyObject *obj, const char* type,
|
|
||||||
unsigned long max_value)
|
|
||||||
{
|
|
||||||
unsigned long value = SWIG_PyObj_AsUnsignedLong(obj);
|
|
||||||
if (!PyErr_Occurred()) {
|
|
||||||
if (value > max_value) {
|
|
||||||
PyObject *err =
|
|
||||||
PyString_FromFormat("value %ld is greater than '%s' minimum %ld",
|
|
||||||
value, type, max_value);
|
|
||||||
PyErr_SetObject(PyExc_OverflowError, err);
|
|
||||||
Py_XDECREF(err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
SWIGRUNTIME(float)
|
|
||||||
SWIG_PyObj_AsFloatConv(PyObject *obj, py_objasdbl_conv pyconv)
|
|
||||||
{
|
|
||||||
double value = pyconv(obj);
|
|
||||||
if (!PyErr_Occurred()) {
|
|
||||||
if (value < FLT_MIN) {
|
|
||||||
PyObject *err =
|
|
||||||
PyString_FromFormat("value %g is less than float minimum %g",
|
|
||||||
value, FLT_MIN);
|
|
||||||
PyErr_SetObject(PyExc_OverflowError, err);
|
|
||||||
Py_XDECREF(err);
|
|
||||||
} else if (value > FLT_MAX) {
|
|
||||||
PyObject *err =
|
|
||||||
PyString_FromFormat("value %g is greater than float maximum %g",
|
|
||||||
value, FLT_MAX);
|
|
||||||
PyErr_SetObject(PyExc_OverflowError, err);
|
|
||||||
Py_XDECREF(err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return (float) value;
|
|
||||||
}
|
|
||||||
|
|
||||||
SWIGRUNTIME(void)
|
|
||||||
SWIG_PyObj_AsCharPtrAndSize(PyObject *obj, swig_type_info* pchar_info,
|
|
||||||
char** cptr, size_t* size)
|
|
||||||
{
|
|
||||||
int psize;
|
|
||||||
if ((!pchar_info) || SWIG_ConvertPtr(obj,(void **)cptr, pchar_info, 0) == -1) {
|
|
||||||
if (pchar_info && PyErr_Occurred()) PyErr_Clear();
|
|
||||||
PyString_AsStringAndSize(obj, cptr, &psize);
|
|
||||||
*size = (size_t) psize;
|
|
||||||
} else {
|
|
||||||
/* don't like strlen, but ... */
|
|
||||||
*size = (*cptr) ? (strlen(*cptr) + 1) : 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SWIGRUNTIME(char*)
|
|
||||||
SWIG_PyObj_AsNewCharPtr(PyObject *obj, swig_type_info* pchar_info)
|
|
||||||
{
|
|
||||||
char *res = 0;
|
|
||||||
char* cptr; size_t csize;
|
|
||||||
SWIG_PyObj_AsCharPtrAndSize(obj, pchar_info, &cptr, &csize);
|
|
||||||
if (!PyErr_Occurred() && cptr) {
|
|
||||||
/* we add the '0' terminator if needed */
|
|
||||||
size_t size = (csize && !(cptr[csize - 1])) ? csize : csize + 1;
|
|
||||||
if (size) {
|
|
||||||
#ifdef __cplusplus
|
|
||||||
res = new char[size];
|
|
||||||
#else
|
|
||||||
res = malloc(size);
|
|
||||||
#endif
|
|
||||||
if (csize) memcpy(res, cptr, csize);
|
|
||||||
if (csize < size) res[csize] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
SWIGRUNTIME(PyObject *)
|
|
||||||
SWIG_PyObj_FromCharArray(const char* carray, size_t size)
|
|
||||||
{
|
|
||||||
if (size > INT_MAX) {
|
|
||||||
PyObject *err =
|
|
||||||
PyString_FromFormat("a char array of size %d is not allowed in python",
|
|
||||||
size);
|
|
||||||
PyErr_SetObject(PyExc_TypeError, err);
|
|
||||||
Py_XDECREF(err);
|
|
||||||
Py_INCREF(Py_None);
|
|
||||||
return Py_None;
|
|
||||||
} else {
|
|
||||||
int psize = (int) size;
|
|
||||||
return PyString_FromStringAndSize(carray, psize);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SWIGRUNTIME(void)
|
|
||||||
SWIG_PyObj_AsCharArray(PyObject *obj, swig_type_info* pchar_info,
|
|
||||||
char* carray, size_t size)
|
|
||||||
{
|
|
||||||
char* cptr; size_t csize;
|
|
||||||
SWIG_PyObj_AsCharPtrAndSize(obj, pchar_info, &cptr, &csize);
|
|
||||||
if (!PyErr_Occurred()) {
|
|
||||||
/* in C (but not in C++) you can do:
|
|
||||||
|
|
||||||
char x[5] = "hello";
|
|
||||||
|
|
||||||
ie, assing the array using an extra '0' char. Here,
|
|
||||||
we assume the C behavior...
|
|
||||||
*/
|
|
||||||
if ((csize == size + 1) && !(cptr[csize-1])) --csize;
|
|
||||||
if (csize > size) {
|
|
||||||
PyObject *err =
|
|
||||||
PyString_FromFormat("a char array of maximum size %d is expected",
|
|
||||||
size);
|
|
||||||
PyErr_SetObject(PyExc_TypeError, err);
|
|
||||||
Py_XDECREF(err);
|
|
||||||
} else {
|
|
||||||
if (csize) memcpy(carray, cptr, csize);
|
|
||||||
if (csize < size) memset(carray + csize, 0, size - csize);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SWIGRUNTIME(PyObject *)
|
|
||||||
SWIG_PyObj_FromCharPtr(const char* cptr)
|
|
||||||
{
|
|
||||||
if (cptr) {
|
|
||||||
return PyString_FromString(cptr);
|
|
||||||
} else {
|
|
||||||
Py_INCREF(Py_None);
|
|
||||||
return Py_None;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SWIGRUNTIME(char* )
|
|
||||||
SWIG_PyObj_AsCharPtr(PyObject *obj, swig_type_info* pchar_info)
|
|
||||||
{
|
|
||||||
char* ptr;
|
|
||||||
if (SWIG_ConvertPtr(obj,(void **)&ptr, pchar_info, 0) == -1) {
|
|
||||||
if (PyErr_Occurred()) PyErr_Clear();
|
|
||||||
ptr = PyString_AsString(obj);
|
|
||||||
}
|
|
||||||
return ptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Install Constants */
|
/* Install Constants */
|
||||||
SWIGRUNTIME(void)
|
SWIGRUNTIME(void)
|
||||||
SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
|
SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
|
||||||
@@ -870,7 +727,12 @@ SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
|
|||||||
obj = PyFloat_FromDouble(constants[i].dvalue);
|
obj = PyFloat_FromDouble(constants[i].dvalue);
|
||||||
break;
|
break;
|
||||||
case SWIG_PY_STRING:
|
case SWIG_PY_STRING:
|
||||||
obj = SWIG_PyObj_FromCharPtr((char *) constants[i].pvalue);
|
if (constants[i].pvalue) {
|
||||||
|
obj = PyString_FromString((char *) constants[i].pvalue);
|
||||||
|
} else {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
obj = Py_None;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case SWIG_PY_POINTER:
|
case SWIG_PY_POINTER:
|
||||||
obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
|
obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
|
||||||
@@ -900,7 +762,6 @@ SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* -------- TYPES TABLE (BEGIN) -------- */
|
/* -------- TYPES TABLE (BEGIN) -------- */
|
||||||
|
|
||||||
#define SWIGTYPE_p_char swig_types[0]
|
#define SWIGTYPE_p_char swig_types[0]
|
||||||
@@ -916,42 +777,47 @@ static swig_type_info *swig_types[2];
|
|||||||
|
|
||||||
#define SWIG_name "_swigrun"
|
#define SWIG_name "_swigrun"
|
||||||
|
|
||||||
#include <limits.h>
|
/* Auxiliar swig macros */
|
||||||
#include <float.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#ifndef SWIGSTATIC
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#define SWIGSTATIC(a) static inline a
|
#define SWIGSTATICINLINE(a) static inline a
|
||||||
#else
|
|
||||||
#define SWIGSTATIC(a) static a
|
#define SWIGSTATIC(a) static a
|
||||||
#endif
|
#define swig_new_array(type, size) (new type[(size)])
|
||||||
#endif
|
#define swig_delete_array(cptr) delete[] cptr
|
||||||
|
#define swig_const_cast(type,a) const_cast<type>(a)
|
||||||
|
#define swig_static_cast(type,a) static_cast<type>(a)
|
||||||
|
#define swig_reinterpret_cast(type,a) reinterpret_cast<type>(a)
|
||||||
|
|
||||||
#ifndef numeric_cast
|
|
||||||
#ifdef __cplusplus
|
|
||||||
#ifdef HAVE_NUMERIC_CAST
|
#ifdef HAVE_NUMERIC_CAST
|
||||||
#define numeric_cast(type,a) numeric_cast<type>(a)
|
#define swig_numeric_cast(type,a) numeric_cast<type>(a)
|
||||||
#else
|
#else
|
||||||
#define numeric_cast(type,a) static_cast<type>(a)
|
#define swig_numeric_cast(type,a) static_cast<type>(a)
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define numeric_cast(type,a) (type)(a)
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#else /* C case */
|
||||||
|
|
||||||
|
#define SWIGSTATICINLINE(a) static a
|
||||||
|
#define SWIGSTATIC(a) static a
|
||||||
|
#define swig_new_array(type, size) ((type*) malloc((size)*sizeof(type)))
|
||||||
|
#define swig_delete_array(cptr) free((char*)cptr)
|
||||||
|
#define swig_const_cast(type,a) (type)(a)
|
||||||
|
#define swig_static_cast(type,a) (type)(a)
|
||||||
|
#define swig_reinterpret_cast(type,a) (type)(a)
|
||||||
|
#define swig_numeric_cast(type,a) (type)(a)
|
||||||
|
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
|
||||||
#define SWIG_PyObj_FromSignedChar PyInt_FromLong
|
#define SWIG_FromSignedChar PyInt_FromLong
|
||||||
#define SWIG_PyObj_FromUnsignedChar PyInt_FromLong
|
#define SWIG_FromUnsignedChar PyInt_FromLong
|
||||||
#define SWIG_PyObj_FromShort PyInt_FromLong
|
#define SWIG_FromShort PyInt_FromLong
|
||||||
#define SWIG_PyObj_FromUnsignedShort PyInt_FromLong
|
#define SWIG_FromUnsignedShort PyInt_FromLong
|
||||||
#define SWIG_PyObj_FromInt PyInt_FromLong
|
#define SWIG_FromInt PyInt_FromLong
|
||||||
#define SWIG_PyObj_FromLong PyInt_FromLong
|
#define SWIG_FromLong PyInt_FromLong
|
||||||
#define SWIG_PyObj_FromFloat PyFloat_FromDouble
|
#define SWIG_FromFloat PyFloat_FromDouble
|
||||||
#define SWIG_PyObj_FromDouble PyFloat_FromDouble
|
#define SWIG_FromDouble PyFloat_FromDouble
|
||||||
#define SWIG_PyObj_FromFloat PyFloat_FromDouble
|
#define SWIG_FromFloat PyFloat_FromDouble
|
||||||
#define SWIG_PyObj_FromDouble PyFloat_FromDouble
|
#define SWIG_FromDouble PyFloat_FromDouble
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@@ -963,7 +829,7 @@ static PyMethodDef SwigMethods[] = {
|
|||||||
|
|
||||||
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
|
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
|
||||||
|
|
||||||
static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0},{"_p_char"},{0}};
|
static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0, 0, 0, 0},{"_p_char", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
|
||||||
|
|
||||||
static swig_type_info *swig_types_initial[] = {
|
static swig_type_info *swig_types_initial[] = {
|
||||||
_swigt__p_char,
|
_swigt__p_char,
|
||||||
|
@@ -69,28 +69,6 @@ SWIGIMPORT(int) SWIG_Python_ConvertPacked(PyObject *, void *, int
|
|||||||
SWIGIMPORT(PyObject *) SWIG_Python_NewPackedObj(void *, int sz, swig_type_info *);
|
SWIGIMPORT(PyObject *) SWIG_Python_NewPackedObj(void *, int sz, swig_type_info *);
|
||||||
SWIGIMPORT(void) SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]);
|
SWIGIMPORT(void) SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]);
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
|
||||||
* the needed conversions between C++ and python
|
|
||||||
* ----------------------------------------------------------------------------- */
|
|
||||||
/* basic types */
|
|
||||||
/*
|
|
||||||
utilities
|
|
||||||
*/
|
|
||||||
SWIGIMPORT(char* ) SWIG_PyObj_AsCharPtr(PyObject *obj, swig_type_info* pchar_info);
|
|
||||||
SWIGIMPORT(PyObject *) SWIG_PyObj_FromCharPtr(const char* cptr);
|
|
||||||
SWIGIMPORT(unsigned long) SWIG_PyObj_AsUnsignedLong(PyObject * obj);
|
|
||||||
SWIGIMPORT(long) SWIG_PyObj_AsLongInRange(PyObject * obj, const char* type,
|
|
||||||
long min_value, long max_value);
|
|
||||||
SWIGIMPORT(unsigned long) SWIG_PyObj_AsUnsignedLongInRange(PyObject *obj, const char* type,
|
|
||||||
unsigned long max_value);
|
|
||||||
SWIGIMPORT(char *) SWIG_PyObj_AsNewCharPtr(PyObject *obj, swig_type_info* pchar_info);
|
|
||||||
SWIGIMPORT(void) SWIG_PyObj_AsCharPtrAndSize(PyObject *obj, swig_type_info* pchar_info,
|
|
||||||
char** cptr, size_t* size);
|
|
||||||
SWIGIMPORT(void) SWIG_PyObj_AsCharArray(PyObject *obj, swig_type_info* pchar_info,
|
|
||||||
char* carray, size_t size);
|
|
||||||
SWIGIMPORT(PyObject *) SWIG_PyObj_FromCharArray(const char* carray, size_t size);
|
|
||||||
SWIGIMPORT(float) SWIG_PyObj_AsFloatConv(PyObject *obj, py_objasdbl_conv pyconv);
|
|
||||||
|
|
||||||
|
|
||||||
/* Contract support */
|
/* Contract support */
|
||||||
|
|
||||||
@@ -99,4 +77,3 @@ SWIGIMPORT(float) SWIG_PyObj_AsFloatConv(PyObject *obj, py_objasdbl_co
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user