You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.2 KiB

16 years ago
  1. /* Named tuple object interface */
  2. #ifndef Py_STRUCTSEQ_H
  3. #define Py_STRUCTSEQ_H
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. typedef struct PyStructSequence_Field {
  8. char *name;
  9. char *doc;
  10. } PyStructSequence_Field;
  11. typedef struct PyStructSequence_Desc {
  12. char *name;
  13. char *doc;
  14. struct PyStructSequence_Field *fields;
  15. int n_in_sequence;
  16. } PyStructSequence_Desc;
  17. extern char* PyStructSequence_UnnamedField;
  18. #ifndef Py_LIMITED_API
  19. PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
  20. PyStructSequence_Desc *desc);
  21. #endif
  22. PyAPI_FUNC(PyTypeObject*) PyStructSequence_NewType(PyStructSequence_Desc *desc);
  23. PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type);
  24. #ifndef Py_LIMITED_API
  25. typedef PyTupleObject PyStructSequence;
  26. /* Macro, *only* to be used to fill in brand new objects */
  27. #define PyStructSequence_SET_ITEM(op, i, v) PyTuple_SET_ITEM(op, i, v)
  28. #define PyStructSequence_GET_ITEM(op, i) PyTuple_GET_ITEM(op, i)
  29. #endif
  30. PyAPI_FUNC(void) PyStructSequence_SetItem(PyObject*, Py_ssize_t, PyObject*);
  31. PyAPI_FUNC(PyObject*) PyStructSequence_GetItem(PyObject*, Py_ssize_t);
  32. #ifdef __cplusplus
  33. }
  34. #endif
  35. #endif /* !Py_STRUCTSEQ_H */