Home | History | Annotate | Download | only in Objects

Lines Matching defs:en

16     enumobject *en;

25 en = (enumobject *)type->tp_alloc(type, 0);
26 if (en == NULL)
31 Py_DECREF(en);
35 en->en_index = PyInt_AsSsize_t(start);
36 if (en->en_index == -1 && PyErr_Occurred()) {
38 en->en_index = PY_SSIZE_T_MAX;
39 en->en_longindex = start;
41 en->en_longindex = NULL;
45 en->en_index = 0;
46 en->en_longindex = NULL;
48 en->en_sit = PyObject_GetIter(seq);
49 if (en->en_sit == NULL) {
50 Py_DECREF(en);
53 en->en_result = PyTuple_Pack(2, Py_None, Py_None);
54 if (en->en_result == NULL) {
55 Py_DECREF(en);
58 return (PyObject *)en;
62 enum_dealloc(enumobject *en)
64 PyObject_GC_UnTrack(en);
65 Py_XDECREF(en->en_sit);
66 Py_XDECREF(en->en_result);
67 Py_XDECREF(en->en_longindex);
68 Py_TYPE(en)->tp_free(en);
72 enum_traverse(enumobject *en, visitproc visit, void *arg)
74 Py_VISIT(en->en_sit);
75 Py_VISIT(en->en_result);
76 Py_VISIT(en->en_longindex);
81 enum_next_long(enumobject *en, PyObject* next_item)
84 PyObject *result = en->en_result;
88 if (en->en_longindex == NULL) {
89 en->en_longindex = PyInt_FromSsize_t(PY_SSIZE_T_MAX);
90 if (en->en_longindex == NULL)
98 next_index = en->en_longindex;
103 en->en_longindex = stepped_up;
123 enum_next(enumobject *en)
127 PyObject *result = en->en_result;
128 PyObject *it = en->en_sit;
134 if (en->en_index == PY_SSIZE_T_MAX)
135 return enum_next_long(en, next_item);
137 next_index = PyInt_FromSsize_t(en->en_index);
142 en->en_index++;