| 1 |
/*[clinic input] |
| 2 |
preserve |
| 3 |
[clinic start generated code]*/ |
| 4 |
|
| 5 |
#include "pycore_modsupport.h" // _PyArg_CheckPositional() |
| 6 |
|
| 7 |
static PyObject * |
| 8 |
pysqlite_row_new_impl(PyTypeObject *type, pysqlite_Cursor *cursor, |
| 9 |
PyObject *data); |
| 10 |
|
| 11 |
static PyObject * |
| 12 |
pysqlite_row_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) |
| 13 |
{ |
| 14 |
PyObject *return_value = NULL; |
| 15 |
PyTypeObject *base_tp = clinic_state()->RowType; |
| 16 |
pysqlite_Cursor *cursor; |
| 17 |
PyObject *data; |
| 18 |
|
| 19 |
if ((type == base_tp || type->tp_init == base_tp->tp_init) && |
| 20 |
!_PyArg_NoKeywords("Row", kwargs)) { |
| 21 |
goto exit; |
| 22 |
} |
| 23 |
if (!_PyArg_CheckPositional("Row", PyTuple_GET_SIZE(args), 2, 2)) { |
| 24 |
goto exit; |
| 25 |
} |
| 26 |
if (!PyObject_TypeCheck(PyTuple_GET_ITEM(args, 0), clinic_state()->CursorType)) { |
| 27 |
_PyArg_BadArgument("Row", "argument 1", (clinic_state()->CursorType)->tp_name, PyTuple_GET_ITEM(args, 0)); |
| 28 |
goto exit; |
| 29 |
} |
| 30 |
cursor = (pysqlite_Cursor *)PyTuple_GET_ITEM(args, 0); |
| 31 |
if (!PyTuple_Check(PyTuple_GET_ITEM(args, 1))) { |
| 32 |
_PyArg_BadArgument("Row", "argument 2", "tuple", PyTuple_GET_ITEM(args, 1)); |
| 33 |
goto exit; |
| 34 |
} |
| 35 |
data = PyTuple_GET_ITEM(args, 1); |
| 36 |
return_value = pysqlite_row_new_impl(type, cursor, data); |
| 37 |
|
| 38 |
exit: |
| 39 |
return return_value; |
| 40 |
} |
| 41 |
|
| 42 |
PyDoc_STRVAR(pysqlite_row_keys__doc__, |
| 43 |
"keys($self, /)\n" |
| 44 |
"--\n" |
| 45 |
"\n" |
| 46 |
"Returns the keys of the row."); |
| 47 |
|
| 48 |
#define PYSQLITE_ROW_KEYS_METHODDEF \ |
| 49 |
{"keys", (PyCFunction)pysqlite_row_keys, METH_NOARGS, pysqlite_row_keys__doc__}, |
| 50 |
|
| 51 |
static PyObject * |
| 52 |
pysqlite_row_keys_impl(pysqlite_Row *self); |
| 53 |
|
| 54 |
static PyObject * |
| 55 |
pysqlite_row_keys(PyObject *self, PyObject *Py_UNUSED(ignored)) |
| 56 |
{ |
| 57 |
return pysqlite_row_keys_impl((pysqlite_Row *)self); |
| 58 |
} |
| 59 |
/*[clinic end generated code: output=6c1acbb48f386468 input=a9049054013a1b77]*/ |