mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 09:30:44 +00:00
768e812e45
* On windows it's strongly desired to be able to compile straight out of a clean checkout or source download. This means anyone can download the source and investigate something quickly, without having to worry about the hassle of figuring out how the project downloads 3rd party dependencies, fetching them, getting them registered in the right place. * This can't be put in a submodule as git submodules don't get downloaded by default so people new to git will get confusing compilation messages, and someone downloading the source from github directly without cloning via git won't get submodules included. * It does add some extra size to a fresh download/checkout which is unfortunate, but absolutely worth the cost. Shallow checkouts still aren't unfeasibly large, and it's only a one-off cost at clone time.
45 lines
1007 B
C
45 lines
1007 B
C
|
|
/* Parse tree node interface */
|
|
|
|
#ifndef Py_NODE_H
|
|
#define Py_NODE_H
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct _node {
|
|
short n_type;
|
|
char *n_str;
|
|
int n_lineno;
|
|
int n_col_offset;
|
|
int n_nchildren;
|
|
struct _node *n_child;
|
|
} node;
|
|
|
|
PyAPI_FUNC(node *) PyNode_New(int type);
|
|
PyAPI_FUNC(int) PyNode_AddChild(node *n, int type,
|
|
char *str, int lineno, int col_offset);
|
|
PyAPI_FUNC(void) PyNode_Free(node *n);
|
|
#ifndef Py_LIMITED_API
|
|
PyAPI_FUNC(Py_ssize_t) _PyNode_SizeOf(node *n);
|
|
#endif
|
|
|
|
/* Node access functions */
|
|
#define NCH(n) ((n)->n_nchildren)
|
|
|
|
#define CHILD(n, i) (&(n)->n_child[i])
|
|
#define RCHILD(n, i) (CHILD(n, NCH(n) + i))
|
|
#define TYPE(n) ((n)->n_type)
|
|
#define STR(n) ((n)->n_str)
|
|
#define LINENO(n) ((n)->n_lineno)
|
|
|
|
/* Assert that the type of a node is what we expect */
|
|
#define REQ(n, type) assert(TYPE(n) == (type))
|
|
|
|
PyAPI_FUNC(void) PyNode_ListTree(node *);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* !Py_NODE_H */
|