Mercurial > hg > vamp-build-and-test
annotate DEPENDENCIES/mingw32/Python27/include/node.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 |
Chris@87 | 2 /* Parse tree node interface */ |
Chris@87 | 3 |
Chris@87 | 4 #ifndef Py_NODE_H |
Chris@87 | 5 #define Py_NODE_H |
Chris@87 | 6 #ifdef __cplusplus |
Chris@87 | 7 extern "C" { |
Chris@87 | 8 #endif |
Chris@87 | 9 |
Chris@87 | 10 typedef struct _node { |
Chris@87 | 11 short n_type; |
Chris@87 | 12 char *n_str; |
Chris@87 | 13 int n_lineno; |
Chris@87 | 14 int n_col_offset; |
Chris@87 | 15 int n_nchildren; |
Chris@87 | 16 struct _node *n_child; |
Chris@87 | 17 } node; |
Chris@87 | 18 |
Chris@87 | 19 PyAPI_FUNC(node *) PyNode_New(int type); |
Chris@87 | 20 PyAPI_FUNC(int) PyNode_AddChild(node *n, int type, |
Chris@87 | 21 char *str, int lineno, int col_offset); |
Chris@87 | 22 PyAPI_FUNC(void) PyNode_Free(node *n); |
Chris@87 | 23 PyAPI_FUNC(Py_ssize_t) _PyNode_SizeOf(node *n); |
Chris@87 | 24 |
Chris@87 | 25 /* Node access functions */ |
Chris@87 | 26 #define NCH(n) ((n)->n_nchildren) |
Chris@87 | 27 |
Chris@87 | 28 #define CHILD(n, i) (&(n)->n_child[i]) |
Chris@87 | 29 #define RCHILD(n, i) (CHILD(n, NCH(n) + i)) |
Chris@87 | 30 #define TYPE(n) ((n)->n_type) |
Chris@87 | 31 #define STR(n) ((n)->n_str) |
Chris@87 | 32 |
Chris@87 | 33 /* Assert that the type of a node is what we expect */ |
Chris@87 | 34 #define REQ(n, type) assert(TYPE(n) == (type)) |
Chris@87 | 35 |
Chris@87 | 36 PyAPI_FUNC(void) PyNode_ListTree(node *); |
Chris@87 | 37 |
Chris@87 | 38 #ifdef __cplusplus |
Chris@87 | 39 } |
Chris@87 | 40 #endif |
Chris@87 | 41 #endif /* !Py_NODE_H */ |