annotate DEPENDENCIES/mingw32/Python27/include/asdl.h @ 133:4acb5d8d80b6
tip
Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author |
Chris Cannam |
date |
Tue, 30 Jul 2019 12:25:44 +0100 |
parents |
2a2c65a20a8b |
children |
|
rev |
line source |
Chris@87
|
1 #ifndef Py_ASDL_H
|
Chris@87
|
2 #define Py_ASDL_H
|
Chris@87
|
3
|
Chris@87
|
4 typedef PyObject * identifier;
|
Chris@87
|
5 typedef PyObject * string;
|
Chris@87
|
6 typedef PyObject * object;
|
Chris@87
|
7
|
Chris@87
|
8 #ifndef __cplusplus
|
Chris@87
|
9 typedef enum {false, true} bool;
|
Chris@87
|
10 #endif
|
Chris@87
|
11
|
Chris@87
|
12 /* It would be nice if the code generated by asdl_c.py was completely
|
Chris@87
|
13 independent of Python, but it is a goal the requires too much work
|
Chris@87
|
14 at this stage. So, for example, I'll represent identifiers as
|
Chris@87
|
15 interned Python strings.
|
Chris@87
|
16 */
|
Chris@87
|
17
|
Chris@87
|
18 /* XXX A sequence should be typed so that its use can be typechecked. */
|
Chris@87
|
19
|
Chris@87
|
20 typedef struct {
|
Chris@87
|
21 int size;
|
Chris@87
|
22 void *elements[1];
|
Chris@87
|
23 } asdl_seq;
|
Chris@87
|
24
|
Chris@87
|
25 typedef struct {
|
Chris@87
|
26 int size;
|
Chris@87
|
27 int elements[1];
|
Chris@87
|
28 } asdl_int_seq;
|
Chris@87
|
29
|
Chris@87
|
30 asdl_seq *asdl_seq_new(int size, PyArena *arena);
|
Chris@87
|
31 asdl_int_seq *asdl_int_seq_new(int size, PyArena *arena);
|
Chris@87
|
32
|
Chris@87
|
33 #define asdl_seq_GET(S, I) (S)->elements[(I)]
|
Chris@87
|
34 #define asdl_seq_LEN(S) ((S) == NULL ? 0 : (S)->size)
|
Chris@87
|
35 #ifdef Py_DEBUG
|
Chris@87
|
36 #define asdl_seq_SET(S, I, V) { \
|
Chris@87
|
37 int _asdl_i = (I); \
|
Chris@87
|
38 assert((S) && _asdl_i < (S)->size); \
|
Chris@87
|
39 (S)->elements[_asdl_i] = (V); \
|
Chris@87
|
40 }
|
Chris@87
|
41 #else
|
Chris@87
|
42 #define asdl_seq_SET(S, I, V) (S)->elements[I] = (V)
|
Chris@87
|
43 #endif
|
Chris@87
|
44
|
Chris@87
|
45 #endif /* !Py_ASDL_H */
|