Lines Matching +full:no +full:- +full:eq +full:- +full:null
1 /* row.c - an enhanced tuple for database rows
3 * Copyright (C) 2005-2010 Gerhard Häring <gh@ghaering.de>
7 * This software is provided 'as-is', without any express or implied
8 * warranty. In no event will the authors be held liable for any damages
29 Py_XDECREF(self->data); in pysqlite_row_dealloc()
30 Py_XDECREF(self->description); in pysqlite_row_dealloc()
32 Py_TYPE(self)->tp_free((PyObject*)self); in pysqlite_row_dealloc()
42 assert(type != NULL && type->tp_alloc != NULL); in pysqlite_row_new()
45 return NULL; in pysqlite_row_new()
47 return NULL; in pysqlite_row_new()
51 return NULL; in pysqlite_row_new()
56 return NULL; in pysqlite_row_new()
59 self = (pysqlite_Row *) type->tp_alloc(type, 0); in pysqlite_row_new()
60 if (self == NULL) in pysqlite_row_new()
61 return NULL; in pysqlite_row_new()
64 self->data = data; in pysqlite_row_new()
66 Py_INCREF(cursor->description); in pysqlite_row_new()
67 self->description = cursor->description; in pysqlite_row_new()
74 PyObject* item = PyTuple_GetItem(self->data, idx); in pysqlite_row_item()
82 int eq = PyObject_RichCompareBool(left, right, Py_EQ); in equal_ignore_case() local
83 if (eq) { /* equal or error */ in equal_ignore_case()
84 return eq; in equal_ignore_case()
99 for (; len; len--, p1++, p2++) { in equal_ignore_case()
115 if (_idx == -1 && PyErr_Occurred()) in pysqlite_row_subscript()
116 return NULL; in pysqlite_row_subscript()
118 _idx += PyTuple_GET_SIZE(self->data); in pysqlite_row_subscript()
119 item = PyTuple_GetItem(self->data, _idx); in pysqlite_row_subscript()
123 nitems = PyTuple_Size(self->description); in pysqlite_row_subscript()
127 obj = PyTuple_GET_ITEM(self->description, i); in pysqlite_row_subscript()
129 int eq = equal_ignore_case(idx, obj); in pysqlite_row_subscript() local
130 if (eq < 0) { in pysqlite_row_subscript()
131 return NULL; in pysqlite_row_subscript()
133 if (eq) { in pysqlite_row_subscript()
135 item = PyTuple_GetItem(self->data, i); in pysqlite_row_subscript()
141 PyErr_SetString(PyExc_IndexError, "No item with that key"); in pysqlite_row_subscript()
142 return NULL; in pysqlite_row_subscript()
145 return PyObject_GetItem(self->data, idx); in pysqlite_row_subscript()
149 return NULL; in pysqlite_row_subscript()
156 return PyTuple_GET_SIZE(self->data); in pysqlite_row_length()
166 return NULL; in pysqlite_row_keys()
168 nitems = PyTuple_Size(self->description); in pysqlite_row_keys()
171 if (PyList_Append(list, PyTuple_GET_ITEM(PyTuple_GET_ITEM(self->description, i), 0)) != 0) { in pysqlite_row_keys()
173 return NULL; in pysqlite_row_keys()
182 return PyObject_GetIter(self->data); in pysqlite_iter()
187 return PyObject_Hash(self->description) ^ PyObject_Hash(self->data); in pysqlite_row_hash()
197 int eq = PyObject_RichCompareBool(self->description, other->description, Py_EQ); in pysqlite_row_richcompare() local
198 if (eq < 0) { in pysqlite_row_richcompare()
199 return NULL; in pysqlite_row_richcompare()
201 if (eq) { in pysqlite_row_richcompare()
202 return PyObject_RichCompare(self->data, other->data, opid); in pysqlite_row_richcompare()
226 {NULL, NULL}
231 PyVarObject_HEAD_INIT(NULL, 0)