PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/Include/sliceobject.h

http://unladen-swallow.googlecode.com/
C++ Header | 44 lines | 26 code | 10 blank | 8 comment | 1 complexity | 2c5ffe5197d92ad604a0cf34aec4fc1c MD5 | raw file
 1#ifndef Py_SLICEOBJECT_H
 2#define Py_SLICEOBJECT_H
 3#ifdef __cplusplus
 4extern "C" {
 5#endif
 6
 7/* The unique ellipsis object "..." */
 8
 9PyAPI_DATA(PyObject) _Py_EllipsisObject; /* Don't use this directly */
10
11#define Py_Ellipsis (&_Py_EllipsisObject)
12
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.  Py_None stands for omitted values.
20*/
21
22typedef struct {
23    PyObject_HEAD
24    PyObject *start, *stop, *step;	/* not NULL */
25} PySliceObject;
26
27PyAPI_DATA(PyTypeObject) PySlice_Type;
28PyAPI_DATA(PyTypeObject) PyEllipsis_Type;
29
30#define PySlice_Check(op) (Py_TYPE(op) == &PySlice_Type)
31
32PyAPI_FUNC(PyObject *) PySlice_New(PyObject* start, PyObject* stop,
33                                  PyObject* step);
34PyAPI_FUNC(PyObject *) _PySlice_FromIndices(Py_ssize_t start, Py_ssize_t stop);
35PyAPI_FUNC(int) PySlice_GetIndices(PySliceObject *r, Py_ssize_t length,
36                                  Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
37PyAPI_FUNC(int) PySlice_GetIndicesEx(PySliceObject *r, Py_ssize_t length,
38				    Py_ssize_t *start, Py_ssize_t *stop, 
39				    Py_ssize_t *step, Py_ssize_t *slicelength);
40
41#ifdef __cplusplus
42}
43#endif
44#endif /* !Py_SLICEOBJECT_H */