search for: extent_length

Displaying 4 results from an estimated 4 matches for "extent_length".

2020 Aug 10
2
[PATCH nbdkit] python: Allow extents to return any iterable (which includes lists).
...terable"); Py_DECREF (r); return -1; } - for (i = 0; i < size; ++i) { - PyObject *t, *py_offset, *py_length, *py_type; + size = 0; + while ((t = PyIter_Next (iter)) != NULL) { + PyObject *py_offset, *py_length, *py_type; uint64_t extent_offset, extent_length; uint32_t extent_type; - t = PyList_GetItem (r, i); + size++; + if (!PyTuple_Check (t) || PyTuple_Size (t) != 3) { - nbdkit_error ("extents method did not return a list of 3-tuples"); + nbdkit_error ("extents method did not return an iterable o...
2020 Aug 10
5
[PATCH nbdkit] python: Implement can_extents + extents.
...if (!PyList_Check (r)) { + nbdkit_error ("extents method did not return a list"); + Py_DECREF (r); + return -1; + } + + size = PyList_Size (r); + for (i = 0; i < size; ++i) { + PyObject *t, *py_offset, *py_length, *py_type; + uint64_t extent_offset, extent_length; + uint32_t extent_type; + + t = PyList_GetItem (r, i); + if (!PyTuple_Check (t) || PyTuple_Size (t) != 3) { + nbdkit_error ("extents method did not return a list of 3-tuples"); + Py_DECREF (r); + return -1; + } + py_offset = PyTuple_GetItem (...
2020 Aug 10
0
Re: [PATCH nbdkit] python: Implement can_extents + extents.
...t_error ("extents method did not return a list"); > + Py_DECREF (r); > + return -1; > + } > + > + size = PyList_Size (r); > + for (i = 0; i < size; ++i) { > + PyObject *t, *py_offset, *py_length, *py_type; > + uint64_t extent_offset, extent_length; > + uint32_t extent_type; > + > + t = PyList_GetItem (r, i); > + if (!PyTuple_Check (t) || PyTuple_Size (t) != 3) { > + nbdkit_error ("extents method did not return a list of 3-tuples"); > + Py_DECREF (r); > + return -1; > +...
2020 Aug 10
0
Re: [PATCH nbdkit] python: Implement can_extents + extents.
...t_error ("extents method did not return a list"); > + Py_DECREF (r); > + return -1; > + } > + > + size = PyList_Size (r); > + for (i = 0; i < size; ++i) { > + PyObject *t, *py_offset, *py_length, *py_type; > + uint64_t extent_offset, extent_length; > + uint32_t extent_type; > + > + t = PyList_GetItem (r, i); > + if (!PyTuple_Check (t) || PyTuple_Size (t) != 3) { > + nbdkit_error ("extents method did not return a list of 3-tuples"); > + Py_DECREF (r); > + return -1; > +...