| 182 | }; |
| 183 | |
| 184 | PyObject * |
| 185 | Signature_richcompare(PyObject *a, PyObject *b, int op) |
| 186 | { |
| 187 | int eq; |
| 188 | Signature *sa, *sb; |
| 189 | |
| 190 | /* We only support comparing to another signature */ |
| 191 | if (!PyObject_TypeCheck(b, &SignatureType)) { |
| 192 | Py_INCREF(Py_NotImplemented); |
| 193 | return Py_NotImplemented; |
| 194 | } |
| 195 | |
| 196 | sa = (Signature *)a; |
| 197 | sb = (Signature *)b; |
| 198 | |
| 199 | eq = ( |
| 200 | strcmp(sa->signature->name, sb->signature->name) == 0 && |
| 201 | strcmp(sa->signature->email, sb->signature->email) == 0 && |
| 202 | sa->signature->when.time == sb->signature->when.time && |
| 203 | sa->signature->when.offset == sb->signature->when.offset && |
| 204 | sa->signature->when.sign == sb->signature->when.sign && |
| 205 | strcmp(value_or_default(sa->encoding, "utf-8"), |
| 206 | value_or_default(sb->encoding, "utf-8")) == 0); |
| 207 | |
| 208 | switch (op) { |
| 209 | case Py_EQ: |
| 210 | if (eq) { |
| 211 | Py_RETURN_TRUE; |
| 212 | } else { |
| 213 | Py_RETURN_FALSE; |
| 214 | } |
| 215 | case Py_NE: |
| 216 | if (eq) { |
| 217 | Py_RETURN_FALSE; |
| 218 | } else { |
| 219 | Py_RETURN_TRUE; |
| 220 | } |
| 221 | default: |
| 222 | Py_INCREF(Py_NotImplemented); |
| 223 | return Py_NotImplemented; |
| 224 | } |
| 225 | |
| 226 | } |
| 227 | |
| 228 | static PyObject * |
| 229 | Signature__str__(Signature *self) |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…