Lines Matching refs:ro
275 reversedobject *ro; in reversed_new_impl() local
305 ro = (reversedobject *)type->tp_alloc(type, 0); in reversed_new_impl()
306 if (ro == NULL) in reversed_new_impl()
309 ro->index = n-1; in reversed_new_impl()
311 ro->seq = seq; in reversed_new_impl()
312 return (PyObject *)ro; in reversed_new_impl()
316 reversed_dealloc(reversedobject *ro) in reversed_dealloc() argument
318 PyObject_GC_UnTrack(ro); in reversed_dealloc()
319 Py_XDECREF(ro->seq); in reversed_dealloc()
320 Py_TYPE(ro)->tp_free(ro); in reversed_dealloc()
324 reversed_traverse(reversedobject *ro, visitproc visit, void *arg) in reversed_traverse() argument
326 Py_VISIT(ro->seq); in reversed_traverse()
331 reversed_next(reversedobject *ro) in reversed_next() argument
334 Py_ssize_t index = ro->index; in reversed_next()
337 item = PySequence_GetItem(ro->seq, index); in reversed_next()
339 ro->index--; in reversed_next()
346 ro->index = -1; in reversed_next()
347 Py_CLEAR(ro->seq); in reversed_next()
352 reversed_len(reversedobject *ro) in reversed_len() argument
356 if (ro->seq == NULL) in reversed_len()
358 seqsize = PySequence_Size(ro->seq); in reversed_len()
361 position = ro->index + 1; in reversed_len()
368 reversed_reduce(reversedobject *ro) in reversed_reduce() argument
370 if (ro->seq) in reversed_reduce()
371 return Py_BuildValue("O(O)n", Py_TYPE(ro), ro->seq, ro->index); in reversed_reduce()
373 return Py_BuildValue("O(())", Py_TYPE(ro)); in reversed_reduce()
377 reversed_setstate(reversedobject *ro, PyObject *state) in reversed_setstate() argument
382 if (ro->seq != 0) { in reversed_setstate()
383 Py_ssize_t n = PySequence_Size(ro->seq); in reversed_setstate()
390 ro->index = index; in reversed_setstate()