blob: b08f04e5c3386523038856dc7379f2bba02e48e2 [file] [log] [blame]
Guido van Rossum98bf58f2001-10-18 20:34:25 +00001
2/* Tuple object interface */
3
4#ifndef Py_STRUCTSEQ_H
5#define Py_STRUCTSEQ_H
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10typedef struct PyStructSequence_Field {
11 char *name;
12 char *doc;
13} PyStructSequence_Field;
14
15typedef struct PyStructSequence_Desc {
16 char *name;
17 char *doc;
18 struct PyStructSequence_Field *fields;
19 int n_in_sequence;
20} PyStructSequence_Desc;
21
22extern DL_IMPORT(void) PyStructSequence_InitType(PyTypeObject *type,
23 PyStructSequence_Desc *desc);
24
25extern DL_IMPORT(PyObject *) PyStructSequence_New(PyTypeObject* type);
26
27typedef struct {
28 PyObject_VAR_HEAD
29 PyObject *ob_item[1];
30} PyStructSequence;
31
32/* Macro, *only* to be used to fill in brand new objects */
33#define PyStructSequence_SET_ITEM(op, i, v) \
34 (((PyStructSequence *)(op))->ob_item[i] = v)
35
36#ifdef __cplusplus
37}
38#endif
39#endif /* !Py_STRUCTSEQ_H */