blob: d9d69349842b4cd5f43b7788a1b221439765c7cc [file] [log] [blame]
Guido van Rossume15d0de1996-07-30 16:42:30 +00001#ifndef Py_SLICEOBJECT_H
2#define Py_SLICEOBJECT_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
Guido van Rossume449af71996-10-11 16:25:41 +00007/* The unique ellipsis object "..." */
Guido van Rossume15d0de1996-07-30 16:42:30 +00008
Guido van Rossume449af71996-10-11 16:25:41 +00009extern DL_IMPORT(PyObject) _Py_EllipsisObject; /* Don't use this directly */
Guido van Rossume15d0de1996-07-30 16:42:30 +000010
Guido van Rossume449af71996-10-11 16:25:41 +000011#define Py_Ellipsis (&_Py_EllipsisObject)
Guido van Rossume15d0de1996-07-30 16:42:30 +000012
13/* Slice object interface */
14
15/*
16
17A slice object containing start, stop, and step data members (the
18names are from range). After much talk with Guido, it was decided to
19let these be any arbitrary python type.
20*/
21
22typedef struct {
Fred Drake3cf4d2b2000-07-09 00:55:06 +000023 PyObject_HEAD
24 PyObject *start, *stop, *step;
Guido van Rossume15d0de1996-07-30 16:42:30 +000025} PySliceObject;
26
27extern DL_IMPORT(PyTypeObject) PySlice_Type;
28
29#define PySlice_Check(op) ((op)->ob_type == &PySlice_Type)
30
Fred Drake3cf4d2b2000-07-09 00:55:06 +000031DL_IMPORT(PyObject *) PySlice_New(PyObject* start, PyObject* stop,
32 PyObject* step);
33DL_IMPORT(int) PySlice_GetIndices(PySliceObject *r, int length,
34 int *start, int *stop, int *step);
Guido van Rossume15d0de1996-07-30 16:42:30 +000035
36#ifdef __cplusplus
37}
38#endif
39#endif /* !Py_SLICEOBJECT_H */