summaryrefslogtreecommitdiffstats
path: root/Include/sliceobject.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/sliceobject.h')
-rw-r--r--Include/sliceobject.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/Include/sliceobject.h b/Include/sliceobject.h
index 8ab62dd..0405eda 100644
--- a/Include/sliceobject.h
+++ b/Include/sliceobject.h
@@ -38,6 +38,16 @@ PyAPI_FUNC(int) PySlice_GetIndicesEx(PySliceObject *r, Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop,
Py_ssize_t *step, Py_ssize_t *slicelength);
+#define PySlice_GetIndicesEx(slice, length, start, stop, step, slicelen) ( \
+ _PySlice_Unpack((PyObject *)(slice), (start), (stop), (step)) < 0 ? -1 : \
+ ((*slicelen = _PySlice_AdjustIndices((length), (start), (stop), *(step))), \
+ 0))
+PyAPI_FUNC(int) _PySlice_Unpack(PyObject *slice,
+ Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
+PyAPI_FUNC(Py_ssize_t) _PySlice_AdjustIndices(Py_ssize_t length,
+ Py_ssize_t *start, Py_ssize_t *stop,
+ Py_ssize_t step);
+
#ifdef __cplusplus
}
#endif