]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.10/Include/asdl.h
AppPkg/Applications/Python/Python-2.7.10: Initial Checkin part 1/5.
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.10 / Include / asdl.h
diff --git a/AppPkg/Applications/Python/Python-2.7.10/Include/asdl.h b/AppPkg/Applications/Python/Python-2.7.10/Include/asdl.h
new file mode 100644 (file)
index 0000000..d72b2f8
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef Py_ASDL_H\r
+#define Py_ASDL_H\r
+\r
+typedef PyObject * identifier;\r
+typedef PyObject * string;\r
+typedef PyObject * object;\r
+\r
+#ifndef __cplusplus\r
+typedef enum {false, true} bool;\r
+#endif\r
+\r
+/* It would be nice if the code generated by asdl_c.py was completely\r
+   independent of Python, but it is a goal the requires too much work\r
+   at this stage.  So, for example, I'll represent identifiers as\r
+   interned Python strings.\r
+*/\r
+\r
+/* XXX A sequence should be typed so that its use can be typechecked. */\r
+\r
+typedef struct {\r
+    int size;\r
+    void *elements[1];\r
+} asdl_seq;\r
+\r
+typedef struct {\r
+    int size;\r
+    int elements[1];\r
+} asdl_int_seq;\r
+\r
+asdl_seq *asdl_seq_new(int size, PyArena *arena);\r
+asdl_int_seq *asdl_int_seq_new(int size, PyArena *arena);\r
+\r
+#define asdl_seq_GET(S, I) (S)->elements[(I)]\r
+#define asdl_seq_LEN(S) ((S) == NULL ? 0 : (S)->size)\r
+#ifdef Py_DEBUG\r
+#define asdl_seq_SET(S, I, V) { \\r
+        int _asdl_i = (I); \\r
+        assert((S) && _asdl_i < (S)->size); \\r
+        (S)->elements[_asdl_i] = (V); \\r
+}\r
+#else\r
+#define asdl_seq_SET(S, I, V) (S)->elements[I] = (V)\r
+#endif\r
+\r
+#endif /* !Py_ASDL_H */\r