home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / py2s152.zip / Include / sliceobject.h < prev    next >
C/C++ Source or Header  |  1999-06-27  |  962b  |  40 lines

  1. #ifndef Py_SLICEOBJECT_H
  2. #define Py_SLICEOBJECT_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6.  
  7. /* The unique ellipsis object "..." */
  8.  
  9. extern DL_IMPORT(PyObject) _Py_EllipsisObject; /* Don't use this directly */
  10.  
  11. #define Py_Ellipsis (&_Py_EllipsisObject)
  12.  
  13. /* Slice object interface */
  14.  
  15. /*
  16.  
  17. A slice object containing start, stop, and step data members (the
  18. names are from range).  After much talk with Guido, it was decided to
  19. let these be any arbitrary python type. 
  20. */
  21.  
  22. typedef struct {
  23.     PyObject_HEAD
  24.     PyObject *start, *stop, *step;
  25. } PySliceObject;
  26.  
  27. extern DL_IMPORT(PyTypeObject) PySlice_Type;
  28.  
  29. #define PySlice_Check(op) ((op)->ob_type == &PySlice_Type)
  30.  
  31. DL_IMPORT(PyObject *) PySlice_New Py_PROTO((
  32.     PyObject* start, PyObject* stop, PyObject* step));
  33. DL_IMPORT(int) PySlice_GetIndices Py_PROTO((
  34.     PySliceObject *r, int length, int *start, int *stop, int *step));
  35.  
  36. #ifdef __cplusplus
  37. }
  38. #endif
  39. #endif /* !Py_SLICEOBJECT_H */
  40.