Lines Matching full:en
16 enumobject *en; in enum_new() local
25 en = (enumobject *)type->tp_alloc(type, 0); in enum_new()
26 if (en == NULL) in enum_new()
31 Py_DECREF(en); in enum_new()
35 en->en_index = PyInt_AsSsize_t(start); in enum_new()
36 if (en->en_index == -1 && PyErr_Occurred()) { in enum_new()
38 en->en_index = PY_SSIZE_T_MAX; in enum_new()
39 en->en_longindex = start; in enum_new()
41 en->en_longindex = NULL; in enum_new()
45 en->en_index = 0; in enum_new()
46 en->en_longindex = NULL; in enum_new()
48 en->en_sit = PyObject_GetIter(seq); in enum_new()
49 if (en->en_sit == NULL) { in enum_new()
50 Py_DECREF(en); in enum_new()
53 en->en_result = PyTuple_Pack(2, Py_None, Py_None); in enum_new()
54 if (en->en_result == NULL) { in enum_new()
55 Py_DECREF(en); in enum_new()
58 return (PyObject *)en; in enum_new()
62 enum_dealloc(enumobject *en) in enum_dealloc() argument
64 PyObject_GC_UnTrack(en); in enum_dealloc()
65 Py_XDECREF(en->en_sit); in enum_dealloc()
66 Py_XDECREF(en->en_result); in enum_dealloc()
67 Py_XDECREF(en->en_longindex); in enum_dealloc()
68 Py_TYPE(en)->tp_free(en); in enum_dealloc()
72 enum_traverse(enumobject *en, visitproc visit, void *arg) in enum_traverse() argument
74 Py_VISIT(en->en_sit); in enum_traverse()
75 Py_VISIT(en->en_result); in enum_traverse()
76 Py_VISIT(en->en_longindex); in enum_traverse()
81 enum_next_long(enumobject *en, PyObject* next_item) in enum_next_long() argument
84 PyObject *result = en->en_result; in enum_next_long()
88 if (en->en_longindex == NULL) { in enum_next_long()
89 en->en_longindex = PyInt_FromSsize_t(PY_SSIZE_T_MAX); in enum_next_long()
90 if (en->en_longindex == NULL) { in enum_next_long()
102 next_index = en->en_longindex; in enum_next_long()
109 en->en_longindex = stepped_up; in enum_next_long()
129 enum_next(enumobject *en) in enum_next() argument
133 PyObject *result = en->en_result; in enum_next()
134 PyObject *it = en->en_sit; in enum_next()
140 if (en->en_index == PY_SSIZE_T_MAX) in enum_next()
141 return enum_next_long(en, next_item); in enum_next()
143 next_index = PyInt_FromSsize_t(en->en_index); in enum_next()
148 en->en_index++; in enum_next()