Mercurial > vim
comparison src/if_py_both.h @ 4490:dff1542e64f9 v7.3.993
updated for version 7.3.993
Problem: Python: Later patch does things slightly differently.
Solution: Adjusted argument type changes. (ZyX)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 21 May 2013 18:47:21 +0200 |
parents | 89ea7593fc0c |
children | f74611bfb1b7 |
comparison
equal
deleted
inserted
replaced
4489:4a263a7f58aa | 4490:dff1542e64f9 |
---|---|
218 Py_INCREF(Py_None); | 218 Py_INCREF(Py_None); |
219 return Py_None; | 219 return Py_None; |
220 } | 220 } |
221 | 221 |
222 static PyObject * | 222 static PyObject * |
223 OutputFlush(PyObject *self UNUSED) | 223 OutputFlush(PyObject *self UNUSED, PyObject *args UNUSED) |
224 { | 224 { |
225 /* do nothing */ | 225 /* do nothing */ |
226 Py_INCREF(Py_None); | 226 Py_INCREF(Py_None); |
227 return Py_None; | 227 return Py_None; |
228 } | 228 } |
229 | 229 |
230 /***************/ | 230 /***************/ |
231 | 231 |
232 static struct PyMethodDef OutputMethods[] = { | 232 static struct PyMethodDef OutputMethods[] = { |
233 /* name, function, calling, doc */ | 233 /* name, function, calling, doc */ |
234 {"write", (PyCFunction)OutputWrite, METH_VARARGS, ""}, | 234 {"write", (PyCFunction)OutputWrite, 1, ""}, |
235 {"writelines", (PyCFunction)OutputWritelines, METH_VARARGS, ""}, | 235 {"writelines", (PyCFunction)OutputWritelines, 1, ""}, |
236 {"flush", (PyCFunction)OutputFlush, METH_NOARGS, ""}, | 236 {"flush", (PyCFunction)OutputFlush, 1, ""}, |
237 { NULL, NULL, 0, NULL} | 237 { NULL, NULL, 0, NULL} |
238 }; | 238 }; |
239 | 239 |
240 static OutputObject Output = | 240 static OutputObject Output = |
241 { | 241 { |
242 PyObject_HEAD_INIT(&OutputType) | 242 PyObject_HEAD_INIT(&OutputType) |
531 /* | 531 /* |
532 * Vim module - Definitions | 532 * Vim module - Definitions |
533 */ | 533 */ |
534 | 534 |
535 static struct PyMethodDef VimMethods[] = { | 535 static struct PyMethodDef VimMethods[] = { |
536 /* name, function, calling, documentation */ | 536 /* name, function, calling, documentation */ |
537 {"command", VimCommand, METH_VARARGS, "Execute a Vim ex-mode command" }, | 537 {"command", VimCommand, 1, "Execute a Vim ex-mode command" }, |
538 {"eval", VimEval, METH_VARARGS, "Evaluate an expression using Vim evaluator" }, | 538 {"eval", VimEval, 1, "Evaluate an expression using Vim evaluator" }, |
539 {"bindeval", VimEvalPy, METH_VARARGS, "Like eval(), but returns objects attached to vim ones"}, | 539 {"bindeval", VimEvalPy, 1, "Like eval(), but returns objects attached to vim ones"}, |
540 {"strwidth", VimStrwidth, METH_VARARGS, "Screen string width, counts <Tab> as having width 1"}, | 540 {"strwidth", VimStrwidth, 1, "Screen string width, counts <Tab> as having width 1"}, |
541 { NULL, NULL, 0, NULL } | 541 { NULL, NULL, 0, NULL } |
542 }; | 542 }; |
543 | 543 |
544 /* | 544 /* |
545 * Generic iterator object | 545 * Generic iterator object |
546 */ | 546 */ |
866 (binaryfunc) DictionaryItem, | 866 (binaryfunc) DictionaryItem, |
867 (objobjargproc) DictionaryAssItem, | 867 (objobjargproc) DictionaryAssItem, |
868 }; | 868 }; |
869 | 869 |
870 static struct PyMethodDef DictionaryMethods[] = { | 870 static struct PyMethodDef DictionaryMethods[] = { |
871 {"keys", (PyCFunction)DictionaryListKeys, METH_NOARGS, ""}, | 871 {"keys", (PyCFunction)DictionaryListKeys, METH_NOARGS, ""}, |
872 { NULL, NULL, 0, NULL } | 872 { NULL, NULL, 0, NULL } |
873 }; | 873 }; |
874 | 874 |
875 static PyTypeObject ListType; | 875 static PyTypeObject ListType; |
876 static PySequenceMethods ListAsSeq; | 876 static PySequenceMethods ListAsSeq; |
877 static PyMappingMethods ListAsMapping; | 877 static PyMappingMethods ListAsMapping; |
1246 return -1; | 1246 return -1; |
1247 } | 1247 } |
1248 } | 1248 } |
1249 | 1249 |
1250 static struct PyMethodDef ListMethods[] = { | 1250 static struct PyMethodDef ListMethods[] = { |
1251 {"extend", (PyCFunction)ListConcatInPlace, METH_O, ""}, | 1251 {"extend", (PyCFunction)ListConcatInPlace, METH_O, ""}, |
1252 { NULL, NULL, 0, NULL } | 1252 { NULL, NULL, 0, NULL } |
1253 }; | 1253 }; |
1254 | 1254 |
1255 typedef struct | 1255 typedef struct |
1256 { | 1256 { |
1257 PyObject_HEAD | 1257 PyObject_HEAD |
1347 | 1347 |
1348 return result; | 1348 return result; |
1349 } | 1349 } |
1350 | 1350 |
1351 static struct PyMethodDef FunctionMethods[] = { | 1351 static struct PyMethodDef FunctionMethods[] = { |
1352 {"__call__", (PyCFunction)FunctionCall, METH_VARARGS|METH_KEYWORDS, ""}, | 1352 {"__call__", (PyCFunction)FunctionCall, METH_VARARGS|METH_KEYWORDS, ""}, |
1353 { NULL, NULL, 0, NULL} | 1353 { NULL, NULL, 0, NULL } |
1354 }; | 1354 }; |
1355 | 1355 |
1356 /* | 1356 /* |
1357 * Options object | 1357 * Options object |
1358 */ | 1358 */ |
2958 return PyString_FromString(repr); | 2958 return PyString_FromString(repr); |
2959 } | 2959 } |
2960 } | 2960 } |
2961 | 2961 |
2962 static struct PyMethodDef RangeMethods[] = { | 2962 static struct PyMethodDef RangeMethods[] = { |
2963 /* name, function, calling, documentation */ | 2963 /* name, function, calling, documentation */ |
2964 {"append", (PyCFunction)RangeAppend, METH_VARARGS, "Append data to the Vim range" }, | 2964 {"append", (PyCFunction)RangeAppend, 1, "Append data to the Vim range" }, |
2965 { NULL, NULL, 0, NULL } | 2965 { NULL, NULL, 0, NULL } |
2966 }; | 2966 }; |
2967 | 2967 |
2968 static PyTypeObject BufferType; | 2968 static PyTypeObject BufferType; |
2969 static PySequenceMethods BufferAsSeq; | 2969 static PySequenceMethods BufferAsSeq; |
2970 static PyMappingMethods BufferAsMapping; | 2970 static PyMappingMethods BufferAsMapping; |
3144 return PyString_FromString(repr); | 3144 return PyString_FromString(repr); |
3145 } | 3145 } |
3146 } | 3146 } |
3147 | 3147 |
3148 static struct PyMethodDef BufferMethods[] = { | 3148 static struct PyMethodDef BufferMethods[] = { |
3149 /* name, function, calling, documentation */ | 3149 /* name, function, calling, documentation */ |
3150 {"append", (PyCFunction)BufferAppend, METH_VARARGS, "Append data to Vim buffer" }, | 3150 {"append", (PyCFunction)BufferAppend, 1, "Append data to Vim buffer" }, |
3151 {"mark", (PyCFunction)BufferMark, METH_VARARGS, "Return (row,col) representing position of named mark" }, | 3151 {"mark", (PyCFunction)BufferMark, 1, "Return (row,col) representing position of named mark" }, |
3152 {"range", (PyCFunction)BufferRange, METH_VARARGS, "Return a range object which represents the part of the given buffer between line numbers s and e" }, | 3152 {"range", (PyCFunction)BufferRange, 1, "Return a range object which represents the part of the given buffer between line numbers s and e" }, |
3153 #if PY_VERSION_HEX >= 0x03000000 | 3153 #if PY_VERSION_HEX >= 0x03000000 |
3154 {"__dir__", (PyCFunction)BufferDir, METH_NOARGS, "List buffer attributes" }, | 3154 {"__dir__", (PyCFunction)BufferDir, 4, "List its attributes" }, |
3155 #endif | 3155 #endif |
3156 { NULL, NULL, 0, NULL } | 3156 { NULL, NULL, 0, NULL } |
3157 }; | 3157 }; |
3158 | 3158 |
3159 /* | 3159 /* |
3160 * Buffer list object - Implementation | 3160 * Buffer list object - Implementation |
3161 */ | 3161 */ |