add getGlobalVariable and setGlobalVariable to swig stuff

This commit is contained in:
Anthony Minessale
2011-10-21 08:56:42 -05:00
parent 8fde25ccfa
commit 2faaee0e6e
19 changed files with 641 additions and 50 deletions
@@ -2687,6 +2687,30 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
SWIGINTERNINLINE PyObject *
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
{
if (carray) {
if (size > INT_MAX) {
swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
return pchar_descriptor ?
SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
} else {
return PyString_FromStringAndSize(carray, static_cast< int >(size));
}
} else {
return SWIG_Py_Void();
}
}
SWIGINTERNINLINE PyObject *
SWIG_FromCharPtr(const char *cptr)
{
return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
}
SWIGINTERNINLINE PyObject*
SWIG_From_bool (bool value)
{
@@ -2839,30 +2863,6 @@ SWIG_AsVal_int (PyObject * obj, int *val)
}
SWIGINTERNINLINE PyObject *
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
{
if (carray) {
if (size > INT_MAX) {
swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
return pchar_descriptor ?
SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
} else {
return PyString_FromStringAndSize(carray, static_cast< int >(size));
}
} else {
return SWIG_Py_Void();
}
}
SWIGINTERNINLINE PyObject *
SWIG_FromCharPtr(const char *cptr)
{
return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
}
#define SWIG_From_long PyInt_FromLong
@@ -3011,6 +3011,68 @@ SWIG_AsVal_bool (PyObject *obj, bool *val)
#ifdef __cplusplus
extern "C" {
#endif
SWIGINTERN PyObject *_wrap_setGlobalVariable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
char *arg1 = (char *) 0 ;
char *arg2 = (char *) 0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:setGlobalVariable",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setGlobalVariable" "', argument " "1"" of type '" "char *""'");
}
arg1 = reinterpret_cast< char * >(buf1);
res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "setGlobalVariable" "', argument " "2"" of type '" "char *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
setGlobalVariable(arg1,arg2);
resultobj = SWIG_Py_Void();
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
return resultobj;
fail:
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
return NULL;
}
SWIGINTERN PyObject *_wrap_getGlobalVariable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
char *arg1 = (char *) 0 ;
char *result = 0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
PyObject * obj0 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:getGlobalVariable",&obj0)) SWIG_fail;
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getGlobalVariable" "', argument " "1"" of type '" "char *""'");
}
arg1 = reinterpret_cast< char * >(buf1);
result = (char *)getGlobalVariable(arg1);
resultobj = SWIG_FromCharPtr((const char *)result);
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
free(result);
return resultobj;
fail:
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
return NULL;
}
SWIGINTERN PyObject *_wrap_consoleLog(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
char *arg1 = (char *) 0 ;
@@ -9081,6 +9143,8 @@ SWIGINTERN PyObject *Session_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObje
}
static PyMethodDef SwigMethods[] = {
{ (char *)"setGlobalVariable", _wrap_setGlobalVariable, METH_VARARGS, NULL},
{ (char *)"getGlobalVariable", _wrap_getGlobalVariable, METH_VARARGS, NULL},
{ (char *)"consoleLog", _wrap_consoleLog, METH_VARARGS, NULL},
{ (char *)"consoleCleanLog", _wrap_consoleCleanLog, METH_VARARGS, NULL},
{ (char *)"email", _wrap_email, METH_VARARGS, NULL},