]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.10/Include/descrobject.h
AppPkg/Applications/Python/Python-2.7.10: Initial Checkin part 1/5.
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.10 / Include / descrobject.h
diff --git a/AppPkg/Applications/Python/Python-2.7.10/Include/descrobject.h b/AppPkg/Applications/Python/Python-2.7.10/Include/descrobject.h
new file mode 100644 (file)
index 0000000..5a9c3e1
--- /dev/null
@@ -0,0 +1,94 @@
+/* Descriptors */\r
+#ifndef Py_DESCROBJECT_H\r
+#define Py_DESCROBJECT_H\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+typedef PyObject *(*getter)(PyObject *, void *);\r
+typedef int (*setter)(PyObject *, PyObject *, void *);\r
+\r
+typedef struct PyGetSetDef {\r
+    char *name;\r
+    getter get;\r
+    setter set;\r
+    char *doc;\r
+    void *closure;\r
+} PyGetSetDef;\r
+\r
+typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args,\r
+                                 void *wrapped);\r
+\r
+typedef PyObject *(*wrapperfunc_kwds)(PyObject *self, PyObject *args,\r
+                                      void *wrapped, PyObject *kwds);\r
+\r
+struct wrapperbase {\r
+    char *name;\r
+    int offset;\r
+    void *function;\r
+    wrapperfunc wrapper;\r
+    char *doc;\r
+    int flags;\r
+    PyObject *name_strobj;\r
+};\r
+\r
+/* Flags for above struct */\r
+#define PyWrapperFlag_KEYWORDS 1 /* wrapper function takes keyword args */\r
+\r
+/* Various kinds of descriptor objects */\r
+\r
+#define PyDescr_COMMON \\r
+    PyObject_HEAD \\r
+    PyTypeObject *d_type; \\r
+    PyObject *d_name\r
+\r
+typedef struct {\r
+    PyDescr_COMMON;\r
+} PyDescrObject;\r
+\r
+typedef struct {\r
+    PyDescr_COMMON;\r
+    PyMethodDef *d_method;\r
+} PyMethodDescrObject;\r
+\r
+typedef struct {\r
+    PyDescr_COMMON;\r
+    struct PyMemberDef *d_member;\r
+} PyMemberDescrObject;\r
+\r
+typedef struct {\r
+    PyDescr_COMMON;\r
+    PyGetSetDef *d_getset;\r
+} PyGetSetDescrObject;\r
+\r
+typedef struct {\r
+    PyDescr_COMMON;\r
+    struct wrapperbase *d_base;\r
+    void *d_wrapped; /* This can be any function pointer */\r
+} PyWrapperDescrObject;\r
+\r
+PyAPI_DATA(PyTypeObject) PyWrapperDescr_Type;\r
+PyAPI_DATA(PyTypeObject) PyDictProxy_Type;\r
+PyAPI_DATA(PyTypeObject) PyGetSetDescr_Type;\r
+PyAPI_DATA(PyTypeObject) PyMemberDescr_Type;\r
+\r
+PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *);\r
+PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *);\r
+PyAPI_FUNC(PyObject *) PyDescr_NewMember(PyTypeObject *,\r
+                                               struct PyMemberDef *);\r
+PyAPI_FUNC(PyObject *) PyDescr_NewGetSet(PyTypeObject *,\r
+                                               struct PyGetSetDef *);\r
+PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *,\r
+                                                struct wrapperbase *, void *);\r
+#define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL)\r
+\r
+PyAPI_FUNC(PyObject *) PyDictProxy_New(PyObject *);\r
+PyAPI_FUNC(PyObject *) PyWrapper_New(PyObject *, PyObject *);\r
+\r
+\r
+PyAPI_DATA(PyTypeObject) PyProperty_Type;\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+#endif /* !Py_DESCROBJECT_H */\r
+\r