diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-05-30 13:01:18 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-05-30 13:01:18 +0200 |
commit | a9922d62e60142f1cb9889626e82e8cc7126be1a (patch) | |
tree | 6d2281fef42af5d2e2351d8eb8166445478930c4 /src/if_python.c | |
parent | a5b725c3f67f1c98d99fec71a3cbaad502a02291 (diff) | |
download | vim-git-a9922d62e60142f1cb9889626e82e8cc7126be1a.tar.gz |
updated for version 7.3.1061v7.3.1061
Problem: Python: Dictionary is not standard.
Solution: Python patch 20: Add standard methods and fields. (ZyX)
Diffstat (limited to 'src/if_python.c')
-rw-r--r-- | src/if_python.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/if_python.c b/src/if_python.c index 16874e855..188e1a2c7 100644 --- a/src/if_python.c +++ b/src/if_python.c @@ -103,6 +103,7 @@ struct PyMethodDef { Py_ssize_t a; }; # define PyIntIntObjArgProc intintobjargproc # define Py_ssize_t_fmt "i" #endif +#define Py_bytes_fmt "s" /* Parser flags */ #define single_input 256 @@ -187,6 +188,7 @@ struct PyMethodDef { Py_ssize_t a; }; # define PySequence_Check dll_PySequence_Check # define PySequence_Size dll_PySequence_Size # define PySequence_GetItem dll_PySequence_GetItem +# define PySequence_Fast dll_PySequence_Fast # define PyTuple_Size dll_PyTuple_Size # define PyTuple_GetItem dll_PyTuple_GetItem # define PyTuple_Type (*dll_PyTuple_Type) @@ -207,6 +209,7 @@ struct PyMethodDef { Py_ssize_t a; }; # define PyRun_SimpleString dll_PyRun_SimpleString # define PyRun_String dll_PyRun_String # define PyObject_GetAttrString dll_PyObject_GetAttrString +# define PyObject_HasAttrString dll_PyObject_HasAttrString # define PyObject_SetAttrString dll_PyObject_SetAttrString # define PyObject_CallFunctionObjArgs dll_PyObject_CallFunctionObjArgs # define PyString_AsString dll_PyString_AsString @@ -227,6 +230,7 @@ struct PyMethodDef { Py_ssize_t a; }; # define PySys_SetArgv dll_PySys_SetArgv # define PyType_Type (*dll_PyType_Type) # define PyType_Ready (*dll_PyType_Ready) +# define PyType_GenericAlloc dll_PyType_GenericAlloc # define Py_BuildValue dll_Py_BuildValue # define Py_FindMethod dll_Py_FindMethod # define Py_InitModule4 dll_Py_InitModule4 @@ -318,6 +322,7 @@ static PyTypeObject* dll_PyList_Type; static int (*dll_PySequence_Check)(PyObject *); static PyInt(*dll_PySequence_Size)(PyObject *); static PyObject*(*dll_PySequence_GetItem)(PyObject *, PyInt); +static PyObject*(*dll_PySequence_Fast)(PyObject *, const char *); static PyInt(*dll_PyTuple_Size)(PyObject *); static PyObject*(*dll_PyTuple_GetItem)(PyObject *, PyInt); static PyTypeObject* dll_PyTuple_Type; @@ -336,6 +341,7 @@ static PyObject*(*dll_PyModule_GetDict)(PyObject *); static int(*dll_PyRun_SimpleString)(char *); static PyObject *(*dll_PyRun_String)(char *, int, PyObject *, PyObject *); static PyObject* (*dll_PyObject_GetAttrString)(PyObject *, const char *); +static int (*dll_PyObject_HasAttrString)(PyObject *, const char *); static PyObject* (*dll_PyObject_SetAttrString)(PyObject *, const char *, PyObject *); static PyObject* (*dll_PyObject_CallFunctionObjArgs)(PyObject *, ...); static char*(*dll_PyString_AsString)(PyObject *); @@ -354,6 +360,7 @@ static int(*dll_PySys_SetObject)(char *, PyObject *); static int(*dll_PySys_SetArgv)(int, char **); static PyTypeObject* dll_PyType_Type; static int (*dll_PyType_Ready)(PyTypeObject *type); +static PyObject* (*dll_PyType_GenericAlloc)(PyTypeObject *type, PyInt nitems); static PyObject*(*dll_Py_BuildValue)(char *, ...); static PyObject*(*dll_Py_FindMethod)(struct PyMethodDef[], PyObject *, char *); static PyObject*(*dll_Py_InitModule4)(char *, struct PyMethodDef *, char *, PyObject *, int); @@ -475,9 +482,10 @@ static struct {"PyList_SetItem", (PYTHON_PROC*)&dll_PyList_SetItem}, {"PyList_Size", (PYTHON_PROC*)&dll_PyList_Size}, {"PyList_Type", (PYTHON_PROC*)&dll_PyList_Type}, - {"PySequence_GetItem", (PYTHON_PROC*)&dll_PySequence_GetItem}, {"PySequence_Size", (PYTHON_PROC*)&dll_PySequence_Size}, {"PySequence_Check", (PYTHON_PROC*)&dll_PySequence_Check}, + {"PySequence_GetItem", (PYTHON_PROC*)&dll_PySequence_GetItem}, + {"PySequence_Fast", (PYTHON_PROC*)&dll_PySequence_Fast}, {"PyTuple_GetItem", (PYTHON_PROC*)&dll_PyTuple_GetItem}, {"PyTuple_Size", (PYTHON_PROC*)&dll_PyTuple_Size}, {"PyTuple_Type", (PYTHON_PROC*)&dll_PyTuple_Type}, @@ -496,6 +504,7 @@ static struct {"PyRun_SimpleString", (PYTHON_PROC*)&dll_PyRun_SimpleString}, {"PyRun_String", (PYTHON_PROC*)&dll_PyRun_String}, {"PyObject_GetAttrString", (PYTHON_PROC*)&dll_PyObject_GetAttrString}, + {"PyObject_HasAttrString", (PYTHON_PROC*)&dll_PyObject_HasAttrString}, {"PyObject_SetAttrString", (PYTHON_PROC*)&dll_PyObject_SetAttrString}, {"PyObject_CallFunctionObjArgs", (PYTHON_PROC*)&dll_PyObject_CallFunctionObjArgs}, {"PyString_AsString", (PYTHON_PROC*)&dll_PyString_AsString}, @@ -514,6 +523,7 @@ static struct {"PySys_SetArgv", (PYTHON_PROC*)&dll_PySys_SetArgv}, {"PyType_Type", (PYTHON_PROC*)&dll_PyType_Type}, {"PyType_Ready", (PYTHON_PROC*)&dll_PyType_Ready}, + {"PyType_GenericAlloc", (PYTHON_PROC*)&dll_PyType_GenericAlloc}, {"Py_FindMethod", (PYTHON_PROC*)&dll_Py_FindMethod}, {"Py_SetPythonHome", (PYTHON_PROC*)&dll_Py_SetPythonHome}, {"Py_Initialize", (PYTHON_PROC*)&dll_Py_Initialize}, @@ -1116,10 +1126,8 @@ static PySequenceMethods BufferAsSeq = { (PyIntObjArgProc) BufferAssItem, /* sq_ass_item, x[i]=v */ (PyIntIntObjArgProc) BufferAssSlice, /* sq_ass_slice, x[i:j]=v */ (objobjproc) 0, -#if PY_MAJOR_VERSION >= 2 (binaryfunc) 0, 0, -#endif }; /* Buffer object - Implementation |