Add try-catch to all exposed functions
This commit is contained in:
parent
d77c3a61e1
commit
f17d4f7d62
2 changed files with 183 additions and 5 deletions
116
llvm/wrap.h
116
llvm/wrap.h
|
|
@ -59,7 +59,23 @@
|
|||
|
||||
#include "llvm_c_extra.h"
|
||||
|
||||
#include <new>
|
||||
|
||||
#define _CHECK_PYCAP(X) if( !(X) ) return NULL;
|
||||
#define _TRY \
|
||||
try {
|
||||
|
||||
#define _CATCH_ALL \
|
||||
} catch (const std::bad_alloc&) { \
|
||||
return PyErr_NoMemory(); \
|
||||
} catch (const std::exception& e) { \
|
||||
PyErr_SetString(PyExc_RuntimeError, e.what()); \
|
||||
return NULL; \
|
||||
} catch (...) { \
|
||||
PyErr_SetString(PyExc_RuntimeError, \
|
||||
"Unknown exception"); \
|
||||
return NULL; \
|
||||
}
|
||||
|
||||
/*===----------------------------------------------------------------------===*/
|
||||
/* Typedefs */
|
||||
|
|
@ -176,10 +192,12 @@ LLTYPE make_array_from_list(PyObject *list, int n)
|
|||
static PyObject * \
|
||||
_w ## func(PyObject * self, PyObject * args) \
|
||||
{ \
|
||||
_TRY \
|
||||
if (!PyArg_ParseTuple(args, "")) \
|
||||
return NULL; \
|
||||
func(); \
|
||||
Py_RETURN_NONE; \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -190,12 +208,14 @@ _w ## func(PyObject * self, PyObject * args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
intype1 arg1; \
|
||||
\
|
||||
if (!(arg1 = get_object_arg<intype1>(args))) \
|
||||
return NULL; \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -206,12 +226,14 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
int arg1; \
|
||||
\
|
||||
if (!PyArg_ParseTuple(args, "i", &arg1)) \
|
||||
return NULL; \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -222,6 +244,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2; \
|
||||
\
|
||||
if (!PyArg_ParseTuple(args, "OO", &obj1, &obj2)) \
|
||||
|
|
@ -234,6 +257,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
\
|
||||
if ( !arg1 || !arg2 ) return NULL; \
|
||||
return ctor_ ## outtype ( func (arg1, arg2)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -244,6 +268,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2; \
|
||||
\
|
||||
if (!PyArg_ParseTuple(args, "OO", &obj1, &obj2)) \
|
||||
|
|
@ -256,6 +281,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
\
|
||||
func (arg1, arg2); \
|
||||
Py_RETURN_NONE; \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -266,6 +292,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1; \
|
||||
size_t arg2; \
|
||||
\
|
||||
|
|
@ -276,6 +303,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
_CHECK_PYCAP(arg1); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -286,6 +314,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2, *obj3; \
|
||||
\
|
||||
if (!PyArg_ParseTuple(args, "OOO", &obj1, &obj2, &obj3)) \
|
||||
|
|
@ -299,6 +328,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
_CHECK_PYCAP(arg3); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -309,6 +339,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2, *obj3; \
|
||||
\
|
||||
if (!PyArg_ParseTuple(args, "OOO", &obj1, &obj2, &obj3)) \
|
||||
|
|
@ -323,6 +354,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
\
|
||||
func (arg1, arg2, arg3); \
|
||||
Py_RETURN_NONE; \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -333,6 +365,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
size_t arg1; \
|
||||
PyObject *obj2, *obj3; \
|
||||
\
|
||||
|
|
@ -345,6 +378,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
_CHECK_PYCAP(arg3); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -355,6 +389,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
intype1 arg1; \
|
||||
PyObject *obj2, *obj3; \
|
||||
\
|
||||
|
|
@ -367,6 +402,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
_CHECK_PYCAP(arg3); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -377,12 +413,14 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
const char *arg1; \
|
||||
\
|
||||
if (!PyArg_ParseTuple(args, "s", &arg1)) \
|
||||
return NULL; \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -393,10 +431,12 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
if (!PyArg_ParseTuple(args, "")) \
|
||||
return NULL; \
|
||||
\
|
||||
return ctor_ ## outtype ( func ()); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -408,9 +448,11 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
if (!PyArg_ParseTuple(args, "")) \
|
||||
return NULL; \
|
||||
return PyUnicode_FromString(func()); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -422,12 +464,14 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
intype1 arg1; \
|
||||
\
|
||||
if (!(arg1 = get_object_arg<intype1>(args))) \
|
||||
return NULL; \
|
||||
\
|
||||
return PyUnicode_FromString( func (arg1)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -438,6 +482,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
intype1 arg1; \
|
||||
\
|
||||
if (!(arg1 = get_object_arg<intype1>(args))) \
|
||||
|
|
@ -445,6 +490,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
\
|
||||
func (arg1); \
|
||||
Py_RETURN_NONE; \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -455,6 +501,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1; \
|
||||
const char *arg2; \
|
||||
\
|
||||
|
|
@ -466,6 +513,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
\
|
||||
func (arg1, arg2); \
|
||||
Py_RETURN_NONE; \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -476,6 +524,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1; \
|
||||
const char *arg2; \
|
||||
\
|
||||
|
|
@ -486,6 +535,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
_CHECK_PYCAP(arg1); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -496,6 +546,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1; \
|
||||
int arg2; \
|
||||
\
|
||||
|
|
@ -507,6 +558,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
\
|
||||
func (arg1, arg2); \
|
||||
Py_RETURN_NONE; \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -517,6 +569,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
intype2 arg2; \
|
||||
PyObject *obj1; \
|
||||
\
|
||||
|
|
@ -528,6 +581,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
\
|
||||
func (arg1, arg2); \
|
||||
Py_RETURN_NONE; \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -538,6 +592,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2; \
|
||||
const char *arg3; \
|
||||
\
|
||||
|
|
@ -550,6 +605,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
_CHECK_PYCAP(arg2); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -560,6 +616,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2; \
|
||||
int arg3; \
|
||||
\
|
||||
|
|
@ -572,6 +629,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
_CHECK_PYCAP(arg2); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3)) ; \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -582,6 +640,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2; \
|
||||
unsigned long long arg3; \
|
||||
\
|
||||
|
|
@ -594,6 +653,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
_CHECK_PYCAP(arg2); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3)) ; \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -604,6 +664,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1; \
|
||||
int arg2, arg3; \
|
||||
\
|
||||
|
|
@ -615,6 +676,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
\
|
||||
func (arg1, arg2, arg3); \
|
||||
Py_RETURN_NONE; \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -625,6 +687,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1; \
|
||||
int arg2; \
|
||||
intype3 arg3; \
|
||||
|
|
@ -636,6 +699,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
\
|
||||
func (arg1, arg2, arg3); \
|
||||
Py_RETURN_NONE; \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -646,6 +710,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj3; \
|
||||
const char *arg2; \
|
||||
\
|
||||
|
|
@ -658,6 +723,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
_CHECK_PYCAP(arg3); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -668,6 +734,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj3; \
|
||||
const char *arg2; \
|
||||
\
|
||||
|
|
@ -682,6 +749,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
func(arg1, arg2, arg3); \
|
||||
\
|
||||
Py_RETURN_NONE; \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -693,6 +761,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2; \
|
||||
int arg3; \
|
||||
const char *arg4; \
|
||||
|
|
@ -706,6 +775,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
_CHECK_PYCAP(arg2); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4)) ; \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -716,6 +786,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2, *obj3; \
|
||||
int arg4; \
|
||||
const char *arg5; \
|
||||
|
|
@ -732,6 +803,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
_CHECK_PYCAP(arg3); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4, arg5)) ; \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -742,6 +814,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2, *obj3; \
|
||||
const char *arg4; \
|
||||
\
|
||||
|
|
@ -756,6 +829,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
_CHECK_PYCAP(arg3); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -766,6 +840,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2; \
|
||||
const char *arg3; \
|
||||
int arg4; \
|
||||
|
|
@ -779,6 +854,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
_CHECK_PYCAP(arg2); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -791,6 +867,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2; \
|
||||
int arg3; \
|
||||
const char *arg4; \
|
||||
|
|
@ -805,6 +882,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
_CHECK_PYCAP(arg2); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4, arg5)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -815,6 +893,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1; \
|
||||
const char *arg2; \
|
||||
int arg3; \
|
||||
|
|
@ -825,7 +904,8 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
const intype1 arg1 = pycap_get< intype1 > (obj1); \
|
||||
_CHECK_PYCAP(arg1); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3)); \
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -837,6 +917,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2, *obj3; \
|
||||
const char *arg4; \
|
||||
int arg5; \
|
||||
|
|
@ -852,6 +933,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
_CHECK_PYCAP(arg3); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4, arg5)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -865,6 +947,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2, *obj3; \
|
||||
int arg4; \
|
||||
const char *arg5; \
|
||||
|
|
@ -881,6 +964,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
_CHECK_PYCAP(arg3); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4, arg5, arg6)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -891,6 +975,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2, *obj3, *obj4; \
|
||||
const char *arg5; \
|
||||
int arg6; \
|
||||
|
|
@ -908,6 +993,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
_CHECK_PYCAP(arg4); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4, arg5, arg6)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -919,6 +1005,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj3, *obj4; \
|
||||
const char *arg2; \
|
||||
const char *arg5; \
|
||||
|
|
@ -935,6 +1022,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
_CHECK_PYCAP(arg4); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4, arg5, arg6)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -945,6 +1033,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2, *obj3; \
|
||||
int arg4; \
|
||||
\
|
||||
|
|
@ -959,6 +1048,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
_CHECK_PYCAP(arg3); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -969,6 +1059,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2, *obj3, *obj4; \
|
||||
\
|
||||
if (!PyArg_ParseTuple(args, "OOOO", &obj1, &obj2, &obj3, &obj4)) \
|
||||
|
|
@ -983,6 +1074,7 @@ _w ## func (PyObject *self, PyObject *args)
|
|||
const intype4 arg4 = pycap_get< intype4 > (obj4); \
|
||||
_CHECK_PYCAP(arg4); \
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -993,6 +1085,7 @@ _w ## func (PyObject *self, PyObject *args)
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2, *obj3, *obj4; \
|
||||
const char *arg5; \
|
||||
\
|
||||
|
|
@ -1009,6 +1102,7 @@ _w ## func (PyObject *self, PyObject *args)
|
|||
_CHECK_PYCAP(arg4); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4, arg5)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1019,6 +1113,7 @@ _w ## func (PyObject *self, PyObject *args)
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj3, *obj4; \
|
||||
intype2 arg2 ; \
|
||||
const char *arg5; \
|
||||
|
|
@ -1034,6 +1129,7 @@ _w ## func (PyObject *self, PyObject *args)
|
|||
_CHECK_PYCAP(arg4); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4, arg5)); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1045,6 +1141,7 @@ _w ## func (PyObject *self, PyObject *args)
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2; \
|
||||
\
|
||||
if (!PyArg_ParseTuple(args, "OO", &obj1, &obj2)) \
|
||||
|
|
@ -1059,6 +1156,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
outtype ret = func (arg1, arg2v, arg2n); \
|
||||
delete [] arg2v ; \
|
||||
return ctor_ ## outtype (ret); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1070,6 +1168,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1; \
|
||||
int arg2; \
|
||||
\
|
||||
|
|
@ -1084,6 +1183,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
outtype ret = func (arg1v, arg1n, arg2); \
|
||||
delete [] arg1v; \
|
||||
return ctor_ ## outtype (ret); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1095,6 +1195,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1; \
|
||||
\
|
||||
if (!PyArg_ParseTuple(args, "O", &obj1)) \
|
||||
|
|
@ -1108,6 +1209,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
outtype ret = func (arg1v, arg1n); \
|
||||
delete [] arg1v; \
|
||||
return ctor_ ## outtype (ret); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1119,6 +1221,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2; \
|
||||
int arg3; \
|
||||
\
|
||||
|
|
@ -1135,6 +1238,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
outtype ret = func (arg1, arg2v, arg2n, arg3); \
|
||||
delete [] arg2v ; \
|
||||
return ctor_ ## outtype (ret); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1147,6 +1251,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2; \
|
||||
int arg3; \
|
||||
\
|
||||
|
|
@ -1163,6 +1268,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
func (arg1, arg2v, arg2n, arg3); \
|
||||
delete [] arg2v ; \
|
||||
Py_RETURN_NONE; \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1174,6 +1280,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj3; \
|
||||
int arg2; \
|
||||
\
|
||||
|
|
@ -1190,6 +1297,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
outtype ret = func (arg1, arg2, arg3v, arg3n); \
|
||||
delete [] arg3v ; \
|
||||
return ctor_ ## outtype (ret); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1201,6 +1309,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2, *obj3; \
|
||||
\
|
||||
if (!PyArg_ParseTuple(args, "OOO", &obj1, &obj2, &obj3)) \
|
||||
|
|
@ -1218,6 +1327,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
outtype ret = func (arg1, arg2, arg3v, arg3n); \
|
||||
delete [] arg3v ; \
|
||||
return ctor_ ## outtype (ret); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1229,6 +1339,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
PyObject *obj1, *obj2, *obj3; \
|
||||
const char *arg4; \
|
||||
\
|
||||
|
|
@ -1247,6 +1358,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
outtype ret = func (arg1, arg2, arg3v, arg3n, arg4); \
|
||||
delete [] arg3v ; \
|
||||
return ctor_ ## outtype (ret); \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1259,6 +1371,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
_TRY \
|
||||
intype1 arg1; \
|
||||
\
|
||||
if (!(arg1 = get_object_arg<intype1>(args))) \
|
||||
|
|
@ -1268,6 +1381,7 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
PyObject *ret = PyUnicode_FromString(val); \
|
||||
LLVMDisposeMessage(const_cast<char*>(val)); \
|
||||
return ret; \
|
||||
_CATCH_ALL \
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue