Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | #ifndef Py_STRUCTSEQ_H |
2 | #define Py_STRUCTSEQ_H | |
3 | #ifdef __cplusplus | |
4 | extern "C" { | |
5 | #endif | |
6 | ||
7 | typedef struct PyStructSequence_Field { | |
8 | char *name; | |
9 | char *doc; | |
10 | } PyStructSequence_Field; | |
11 | ||
12 | typedef struct PyStructSequence_Desc { | |
13 | char *name; | |
14 | char *doc; | |
15 | struct PyStructSequence_Field *fields; | |
16 | int n_in_sequence; | |
17 | } PyStructSequence_Desc; | |
18 | ||
19 | extern char* PyStructSequence_UnnamedField; | |
20 | ||
21 | PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type, | |
22 | PyStructSequence_Desc *desc); | |
23 | ||
24 | PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type); | |
25 | ||
26 | typedef struct { | |
27 | PyObject_VAR_HEAD | |
28 | PyObject *ob_item[1]; | |
29 | } PyStructSequence; | |
30 | ||
31 | /* Macro, *only* to be used to fill in brand new objects */ | |
32 | #define PyStructSequence_SET_ITEM(op, i, v) \ | |
33 | (((PyStructSequence *)(op))->ob_item[i] = v) | |
34 | ||
35 | #ifdef __cplusplus | |
36 | } | |
37 | #endif | |
38 | #endif /* !Py_STRUCTSEQ_H */ |