mirror of https://github.com/sipwise/sems.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
89 lines
2.1 KiB
89 lines
2.1 KiB
/*
|
|
* Interface wrapper code.
|
|
*
|
|
* Generated by SIP 4.5.2 (4.5.2) on Wed Mar 28 22:59:14 2007
|
|
*/
|
|
|
|
#include "sipAPIpy_sems_lib.h"
|
|
#include "sippy_sems_libstring.h"
|
|
|
|
|
|
/* Call the mapped type's destructor. */
|
|
extern "C" {static void release_string(void *, int);}
|
|
static void release_string(void *ptr, int)
|
|
{
|
|
delete reinterpret_cast<string *>(ptr);
|
|
}
|
|
|
|
|
|
|
|
extern "C" {static int convertTo_string(PyObject *, void **, int *, PyObject *);}
|
|
static int convertTo_string(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *)
|
|
{
|
|
string **sipCppPtr = reinterpret_cast<string **>(sipCppPtrV);
|
|
|
|
#line 14 "string.sip"
|
|
// Allow a Python string whenever a string is expected.
|
|
if (sipIsErr == NULL)
|
|
return PyString_Check(sipPy);
|
|
if (sipPy == Py_None) {
|
|
*sipCppPtr = NULL;
|
|
return 0;
|
|
}
|
|
if (PyString_Check(sipPy)) {
|
|
*sipCppPtr = new std::string(PyString_AS_STRING(sipPy));
|
|
return 0;
|
|
}
|
|
*sipCppPtr = (std::string *)sipForceConvertTo_string(sipPy,sipIsErr);
|
|
return 1;
|
|
#line 40 "sippy_sems_libstring.cpp"
|
|
}
|
|
|
|
|
|
extern "C" {static void *forceConvertTo_string(PyObject *, int *);}
|
|
static void *forceConvertTo_string(PyObject *valobj,int *iserrp)
|
|
{
|
|
if (*iserrp || valobj == NULL)
|
|
return NULL;
|
|
|
|
if (convertTo_string(valobj,NULL,NULL,NULL))
|
|
{
|
|
void *val;
|
|
|
|
/*
|
|
* Note that we throw away the flag that says if the value
|
|
* has just been created on the heap or not.
|
|
*/
|
|
convertTo_string(valobj,&val,iserrp,NULL);
|
|
|
|
return val;
|
|
}
|
|
|
|
sipBadClass("string");
|
|
|
|
*iserrp = 1;
|
|
|
|
return NULL;
|
|
}
|
|
|
|
|
|
extern "C" {static PyObject *convertFrom_string(void *, PyObject *);}
|
|
static PyObject *convertFrom_string(void *sipCppV,PyObject *)
|
|
{
|
|
string *sipCpp = reinterpret_cast<string *>(sipCppV);
|
|
|
|
#line 9 "string.sip"
|
|
const char *s = sipCpp->c_str();
|
|
return PyString_FromString(s);
|
|
#line 79 "sippy_sems_libstring.cpp"
|
|
}
|
|
|
|
|
|
sipMappedType sipMappedTypeDef_string = {
|
|
"string",
|
|
release_string,
|
|
forceConvertTo_string,
|
|
convertTo_string,
|
|
convertFrom_string
|
|
};
|