|
Karsten Hopp |
eddd07 |
To: vim-dev@vim.org
|
|
Karsten Hopp |
eddd07 |
Subject: Patch 7.1.307
|
|
Karsten Hopp |
eddd07 |
Fcc: outbox
|
|
Karsten Hopp |
eddd07 |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
eddd07 |
Mime-Version: 1.0
|
|
Karsten Hopp |
eddd07 |
Content-Type: text/plain; charset=ISO-8859-1
|
|
Karsten Hopp |
eddd07 |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
eddd07 |
------------
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
Patch 7.1.307
|
|
Karsten Hopp |
eddd07 |
Problem: Many warnings when compiling with Python 2.5.
|
|
Karsten Hopp |
eddd07 |
Solution: Use ssize_t instead of int for some types. (James Vega)
|
|
Karsten Hopp |
eddd07 |
Files: src/if_python.c
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
*** ../vim-7.1.306/src/if_python.c Thu Mar 8 10:20:28 2007
|
|
Karsten Hopp |
eddd07 |
--- src/if_python.c Wed May 7 16:55:44 2008
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 38,43 ****
|
|
Karsten Hopp |
eddd07 |
--- 38,45 ----
|
|
Karsten Hopp |
eddd07 |
# undef HAVE_STDARG_H /* Python's config.h defines it as well. */
|
|
Karsten Hopp |
eddd07 |
#endif
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
+ #define PY_SSIZE_T_CLEAN
|
|
Karsten Hopp |
eddd07 |
+
|
|
Karsten Hopp |
eddd07 |
#include <Python.h>
|
|
Karsten Hopp |
eddd07 |
#if defined(MACOS) && !defined(MACOS_X_UNIX)
|
|
Karsten Hopp |
eddd07 |
# include "macglue.h"
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 55,60 ****
|
|
Karsten Hopp |
eddd07 |
--- 57,78 ----
|
|
Karsten Hopp |
eddd07 |
# define PySequenceMethods int
|
|
Karsten Hopp |
eddd07 |
#endif
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
+ #if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000
|
|
Karsten Hopp |
eddd07 |
+ # define PyInt Py_ssize_t
|
|
Karsten Hopp |
eddd07 |
+ # define PyInquiry lenfunc
|
|
Karsten Hopp |
eddd07 |
+ # define PyIntArgFunc ssizeargfunc
|
|
Karsten Hopp |
eddd07 |
+ # define PyIntIntArgFunc ssizessizeargfunc
|
|
Karsten Hopp |
eddd07 |
+ # define PyIntObjArgProc ssizeobjargproc
|
|
Karsten Hopp |
eddd07 |
+ # define PyIntIntObjArgProc ssizessizeobjargproc
|
|
Karsten Hopp |
eddd07 |
+ #else
|
|
Karsten Hopp |
eddd07 |
+ # define PyInt int
|
|
Karsten Hopp |
eddd07 |
+ # define PyInquiry inquiry
|
|
Karsten Hopp |
eddd07 |
+ # define PyIntArgFunc intargfunc
|
|
Karsten Hopp |
eddd07 |
+ # define PyIntIntArgFunc intintargfunc
|
|
Karsten Hopp |
eddd07 |
+ # define PyIntObjArgProc intobjargproc
|
|
Karsten Hopp |
eddd07 |
+ # define PyIntIntObjArgProc intintobjargproc
|
|
Karsten Hopp |
eddd07 |
+ #endif
|
|
Karsten Hopp |
eddd07 |
+
|
|
Karsten Hopp |
eddd07 |
/* Parser flags */
|
|
Karsten Hopp |
eddd07 |
#define single_input 256
|
|
Karsten Hopp |
eddd07 |
#define file_input 257
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 150,160 ****
|
|
Karsten Hopp |
eddd07 |
static long(*dll_PyInt_AsLong)(PyObject *);
|
|
Karsten Hopp |
eddd07 |
static PyObject*(*dll_PyInt_FromLong)(long);
|
|
Karsten Hopp |
eddd07 |
static PyTypeObject* dll_PyInt_Type;
|
|
Karsten Hopp |
eddd07 |
! static PyObject*(*dll_PyList_GetItem)(PyObject *, int);
|
|
Karsten Hopp |
eddd07 |
static PyObject*(*dll_PyList_Append)(PyObject *, PyObject *);
|
|
Karsten Hopp |
eddd07 |
! static PyObject*(*dll_PyList_New)(int size);
|
|
Karsten Hopp |
eddd07 |
! static int(*dll_PyList_SetItem)(PyObject *, int, PyObject *);
|
|
Karsten Hopp |
eddd07 |
! static int(*dll_PyList_Size)(PyObject *);
|
|
Karsten Hopp |
eddd07 |
static PyTypeObject* dll_PyList_Type;
|
|
Karsten Hopp |
eddd07 |
static PyObject*(*dll_PyImport_ImportModule)(const char *);
|
|
Karsten Hopp |
eddd07 |
static PyObject*(*dll_PyDict_New)(void);
|
|
Karsten Hopp |
eddd07 |
--- 168,178 ----
|
|
Karsten Hopp |
eddd07 |
static long(*dll_PyInt_AsLong)(PyObject *);
|
|
Karsten Hopp |
eddd07 |
static PyObject*(*dll_PyInt_FromLong)(long);
|
|
Karsten Hopp |
eddd07 |
static PyTypeObject* dll_PyInt_Type;
|
|
Karsten Hopp |
eddd07 |
! static PyObject*(*dll_PyList_GetItem)(PyObject *, PyInt);
|
|
Karsten Hopp |
eddd07 |
static PyObject*(*dll_PyList_Append)(PyObject *, PyObject *);
|
|
Karsten Hopp |
eddd07 |
! static PyObject*(*dll_PyList_New)(PyInt size);
|
|
Karsten Hopp |
eddd07 |
! static int(*dll_PyList_SetItem)(PyObject *, PyInt, PyObject *);
|
|
Karsten Hopp |
eddd07 |
! static PyInt(*dll_PyList_Size)(PyObject *);
|
|
Karsten Hopp |
eddd07 |
static PyTypeObject* dll_PyList_Type;
|
|
Karsten Hopp |
eddd07 |
static PyObject*(*dll_PyImport_ImportModule)(const char *);
|
|
Karsten Hopp |
eddd07 |
static PyObject*(*dll_PyDict_New)(void);
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 163,170 ****
|
|
Karsten Hopp |
eddd07 |
static int(*dll_PyRun_SimpleString)(char *);
|
|
Karsten Hopp |
eddd07 |
static char*(*dll_PyString_AsString)(PyObject *);
|
|
Karsten Hopp |
eddd07 |
static PyObject*(*dll_PyString_FromString)(const char *);
|
|
Karsten Hopp |
eddd07 |
! static PyObject*(*dll_PyString_FromStringAndSize)(const char *, int);
|
|
Karsten Hopp |
eddd07 |
! static int(*dll_PyString_Size)(PyObject *);
|
|
Karsten Hopp |
eddd07 |
static PyTypeObject* dll_PyString_Type;
|
|
Karsten Hopp |
eddd07 |
static int(*dll_PySys_SetObject)(char *, PyObject *);
|
|
Karsten Hopp |
eddd07 |
static int(*dll_PySys_SetArgv)(int, char **);
|
|
Karsten Hopp |
eddd07 |
--- 181,188 ----
|
|
Karsten Hopp |
eddd07 |
static int(*dll_PyRun_SimpleString)(char *);
|
|
Karsten Hopp |
eddd07 |
static char*(*dll_PyString_AsString)(PyObject *);
|
|
Karsten Hopp |
eddd07 |
static PyObject*(*dll_PyString_FromString)(const char *);
|
|
Karsten Hopp |
eddd07 |
! static PyObject*(*dll_PyString_FromStringAndSize)(const char *, PyInt);
|
|
Karsten Hopp |
eddd07 |
! static PyInt(*dll_PyString_Size)(PyObject *);
|
|
Karsten Hopp |
eddd07 |
static PyTypeObject* dll_PyString_Type;
|
|
Karsten Hopp |
eddd07 |
static int(*dll_PySys_SetObject)(char *, PyObject *);
|
|
Karsten Hopp |
eddd07 |
static int(*dll_PySys_SetArgv)(int, char **);
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 367,376 ****
|
|
Karsten Hopp |
eddd07 |
* ----------------------------------------------
|
|
Karsten Hopp |
eddd07 |
*/
|
|
Karsten Hopp |
eddd07 |
static PyObject *GetBufferLine(buf_T *, int);
|
|
Karsten Hopp |
eddd07 |
! static PyObject *GetBufferLineList(buf_T *, int, int);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static int SetBufferLine(buf_T *, int, PyObject *, int *);
|
|
Karsten Hopp |
eddd07 |
! static int SetBufferLineList(buf_T *, int, int, PyObject *, int *);
|
|
Karsten Hopp |
eddd07 |
static int InsertBufferLines(buf_T *, int, PyObject *, int *);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyObject *LineToString(const char *);
|
|
Karsten Hopp |
eddd07 |
--- 385,394 ----
|
|
Karsten Hopp |
eddd07 |
* ----------------------------------------------
|
|
Karsten Hopp |
eddd07 |
*/
|
|
Karsten Hopp |
eddd07 |
static PyObject *GetBufferLine(buf_T *, int);
|
|
Karsten Hopp |
eddd07 |
! static PyObject *GetBufferLineList(buf_T *, PyInt, PyInt);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static int SetBufferLine(buf_T *, int, PyObject *, int *);
|
|
Karsten Hopp |
eddd07 |
! static int SetBufferLineList(buf_T *, PyInt, PyInt, PyObject *, int *);
|
|
Karsten Hopp |
eddd07 |
static int InsertBufferLines(buf_T *, int, PyObject *, int *);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyObject *LineToString(const char *);
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 773,780 ****
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
OutputWritelines(PyObject *self, PyObject *args)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
! int n;
|
|
Karsten Hopp |
eddd07 |
! int i;
|
|
Karsten Hopp |
eddd07 |
PyObject *list;
|
|
Karsten Hopp |
eddd07 |
int error = ((OutputObject *)(self))->error;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
--- 791,798 ----
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
OutputWritelines(PyObject *self, PyObject *args)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
! PyInt n;
|
|
Karsten Hopp |
eddd07 |
! PyInt i;
|
|
Karsten Hopp |
eddd07 |
PyObject *list;
|
|
Karsten Hopp |
eddd07 |
int error = ((OutputObject *)(self))->error;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 986,996 ****
|
|
Karsten Hopp |
eddd07 |
static PyObject *BufferGetattr(PyObject *, char *);
|
|
Karsten Hopp |
eddd07 |
static PyObject *BufferRepr(PyObject *);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static int BufferLength(PyObject *);
|
|
Karsten Hopp |
eddd07 |
! static PyObject *BufferItem(PyObject *, int);
|
|
Karsten Hopp |
eddd07 |
! static PyObject *BufferSlice(PyObject *, int, int);
|
|
Karsten Hopp |
eddd07 |
! static int BufferAssItem(PyObject *, int, PyObject *);
|
|
Karsten Hopp |
eddd07 |
! static int BufferAssSlice(PyObject *, int, int, PyObject *);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyObject *BufferAppend(PyObject *, PyObject *);
|
|
Karsten Hopp |
eddd07 |
static PyObject *BufferMark(PyObject *, PyObject *);
|
|
Karsten Hopp |
eddd07 |
--- 1004,1014 ----
|
|
Karsten Hopp |
eddd07 |
static PyObject *BufferGetattr(PyObject *, char *);
|
|
Karsten Hopp |
eddd07 |
static PyObject *BufferRepr(PyObject *);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static PyInt BufferLength(PyObject *);
|
|
Karsten Hopp |
eddd07 |
! static PyObject *BufferItem(PyObject *, PyInt);
|
|
Karsten Hopp |
eddd07 |
! static PyObject *BufferSlice(PyObject *, PyInt, PyInt);
|
|
Karsten Hopp |
eddd07 |
! static PyInt BufferAssItem(PyObject *, PyInt, PyObject *);
|
|
Karsten Hopp |
eddd07 |
! static PyInt BufferAssSlice(PyObject *, PyInt, PyInt, PyObject *);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyObject *BufferAppend(PyObject *, PyObject *);
|
|
Karsten Hopp |
eddd07 |
static PyObject *BufferMark(PyObject *, PyObject *);
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 1017,1027 ****
|
|
Karsten Hopp |
eddd07 |
static PyObject *RangeGetattr(PyObject *, char *);
|
|
Karsten Hopp |
eddd07 |
static PyObject *RangeRepr(PyObject *);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static int RangeLength(PyObject *);
|
|
Karsten Hopp |
eddd07 |
! static PyObject *RangeItem(PyObject *, int);
|
|
Karsten Hopp |
eddd07 |
! static PyObject *RangeSlice(PyObject *, int, int);
|
|
Karsten Hopp |
eddd07 |
! static int RangeAssItem(PyObject *, int, PyObject *);
|
|
Karsten Hopp |
eddd07 |
! static int RangeAssSlice(PyObject *, int, int, PyObject *);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyObject *RangeAppend(PyObject *, PyObject *);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
--- 1035,1045 ----
|
|
Karsten Hopp |
eddd07 |
static PyObject *RangeGetattr(PyObject *, char *);
|
|
Karsten Hopp |
eddd07 |
static PyObject *RangeRepr(PyObject *);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static PyInt RangeLength(PyObject *);
|
|
Karsten Hopp |
eddd07 |
! static PyObject *RangeItem(PyObject *, PyInt);
|
|
Karsten Hopp |
eddd07 |
! static PyObject *RangeSlice(PyObject *, PyInt, PyInt);
|
|
Karsten Hopp |
eddd07 |
! static PyInt RangeAssItem(PyObject *, PyInt, PyObject *);
|
|
Karsten Hopp |
eddd07 |
! static PyInt RangeAssSlice(PyObject *, PyInt, PyInt, PyObject *);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyObject *RangeAppend(PyObject *, PyObject *);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 1029,1043 ****
|
|
Karsten Hopp |
eddd07 |
* -------------------------------------------
|
|
Karsten Hopp |
eddd07 |
*/
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static int WinListLength(PyObject *);
|
|
Karsten Hopp |
eddd07 |
! static PyObject *WinListItem(PyObject *, int);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
/* Buffer list type - Implementation functions
|
|
Karsten Hopp |
eddd07 |
* -------------------------------------------
|
|
Karsten Hopp |
eddd07 |
*/
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static int BufListLength(PyObject *);
|
|
Karsten Hopp |
eddd07 |
! static PyObject *BufListItem(PyObject *, int);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
/* Current objects type - Implementation functions
|
|
Karsten Hopp |
eddd07 |
* -----------------------------------------------
|
|
Karsten Hopp |
eddd07 |
--- 1047,1061 ----
|
|
Karsten Hopp |
eddd07 |
* -------------------------------------------
|
|
Karsten Hopp |
eddd07 |
*/
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static PyInt WinListLength(PyObject *);
|
|
Karsten Hopp |
eddd07 |
! static PyObject *WinListItem(PyObject *, PyInt);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
/* Buffer list type - Implementation functions
|
|
Karsten Hopp |
eddd07 |
* -------------------------------------------
|
|
Karsten Hopp |
eddd07 |
*/
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static PyInt BufListLength(PyObject *);
|
|
Karsten Hopp |
eddd07 |
! static PyObject *BufListItem(PyObject *, PyInt);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
/* Current objects type - Implementation functions
|
|
Karsten Hopp |
eddd07 |
* -----------------------------------------------
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 1130,1135 ****
|
|
Karsten Hopp |
eddd07 |
--- 1148,1163 ----
|
|
Karsten Hopp |
eddd07 |
result = Py_BuildValue("s", buf);
|
|
Karsten Hopp |
eddd07 |
PyDict_SetItemString(lookupDict, ptrBuf, result);
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
+ #ifdef FEAT_FLOAT
|
|
Karsten Hopp |
eddd07 |
+ else if (our_tv->v_type == VAR_FLOAT)
|
|
Karsten Hopp |
eddd07 |
+ {
|
|
Karsten Hopp |
eddd07 |
+ char buf[NUMBUFLEN];
|
|
Karsten Hopp |
eddd07 |
+
|
|
Karsten Hopp |
eddd07 |
+ sprintf(buf, "%f", our_tv->vval.v_float);
|
|
Karsten Hopp |
eddd07 |
+ result = Py_BuildValue("s", buf);
|
|
Karsten Hopp |
eddd07 |
+ PyDict_SetItemString(lookupDict, ptrBuf, result);
|
|
Karsten Hopp |
eddd07 |
+ }
|
|
Karsten Hopp |
eddd07 |
+ #endif
|
|
Karsten Hopp |
eddd07 |
else if (our_tv->v_type == VAR_LIST)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
list_T *list = our_tv->vval.v_list;
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 1245,1251 ****
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
! RBItem(BufferObject *self, int n, int start, int end)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
if (CheckBuffer(self))
|
|
Karsten Hopp |
eddd07 |
return NULL;
|
|
Karsten Hopp |
eddd07 |
--- 1273,1279 ----
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
! RBItem(BufferObject *self, PyInt n, int start, int end)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
if (CheckBuffer(self))
|
|
Karsten Hopp |
eddd07 |
return NULL;
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 1260,1268 ****
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
! RBSlice(BufferObject *self, int lo, int hi, int start, int end)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
! int size;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
if (CheckBuffer(self))
|
|
Karsten Hopp |
eddd07 |
return NULL;
|
|
Karsten Hopp |
eddd07 |
--- 1288,1296 ----
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
! RBSlice(BufferObject *self, PyInt lo, PyInt hi, int start, int end)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
! PyInt size;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
if (CheckBuffer(self))
|
|
Karsten Hopp |
eddd07 |
return NULL;
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 1283,1290 ****
|
|
Karsten Hopp |
eddd07 |
return GetBufferLineList(self->buf, lo+start, hi+start);
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static int
|
|
Karsten Hopp |
eddd07 |
! RBAssItem(BufferObject *self, int n, PyObject *val, int start, int end, int *new_end)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
int len_change;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
--- 1311,1318 ----
|
|
Karsten Hopp |
eddd07 |
return GetBufferLineList(self->buf, lo+start, hi+start);
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static PyInt
|
|
Karsten Hopp |
eddd07 |
! RBAssItem(BufferObject *self, PyInt n, PyObject *val, int start, int end, int *new_end)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
int len_change;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 1306,1313 ****
|
|
Karsten Hopp |
eddd07 |
return 0;
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static int
|
|
Karsten Hopp |
eddd07 |
! RBAssSlice(BufferObject *self, int lo, int hi, PyObject *val, int start, int end, int *new_end)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
int size;
|
|
Karsten Hopp |
eddd07 |
int len_change;
|
|
Karsten Hopp |
eddd07 |
--- 1334,1341 ----
|
|
Karsten Hopp |
eddd07 |
return 0;
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static PyInt
|
|
Karsten Hopp |
eddd07 |
! RBAssSlice(BufferObject *self, PyInt lo, PyInt hi, PyObject *val, int start, int end, int *new_end)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
int size;
|
|
Karsten Hopp |
eddd07 |
int len_change;
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 1384,1396 ****
|
|
Karsten Hopp |
eddd07 |
};
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PySequenceMethods BufferAsSeq = {
|
|
Karsten Hopp |
eddd07 |
! (inquiry) BufferLength, /* sq_length, len(x) */
|
|
Karsten Hopp |
eddd07 |
(binaryfunc) 0, /* BufferConcat, */ /* sq_concat, x+y */
|
|
Karsten Hopp |
eddd07 |
! (intargfunc) 0, /* BufferRepeat, */ /* sq_repeat, x*n */
|
|
Karsten Hopp |
eddd07 |
! (intargfunc) BufferItem, /* sq_item, x[i] */
|
|
Karsten Hopp |
eddd07 |
! (intintargfunc) BufferSlice, /* sq_slice, x[i:j] */
|
|
Karsten Hopp |
eddd07 |
! (intobjargproc) BufferAssItem, /* sq_ass_item, x[i]=v */
|
|
Karsten Hopp |
eddd07 |
! (intintobjargproc) BufferAssSlice, /* sq_ass_slice, x[i:j]=v */
|
|
Karsten Hopp |
eddd07 |
};
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyTypeObject BufferType = {
|
|
Karsten Hopp |
eddd07 |
--- 1412,1424 ----
|
|
Karsten Hopp |
eddd07 |
};
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PySequenceMethods BufferAsSeq = {
|
|
Karsten Hopp |
eddd07 |
! (PyInquiry) BufferLength, /* sq_length, len(x) */
|
|
Karsten Hopp |
eddd07 |
(binaryfunc) 0, /* BufferConcat, */ /* sq_concat, x+y */
|
|
Karsten Hopp |
eddd07 |
! (PyIntArgFunc) 0, /* BufferRepeat, */ /* sq_repeat, x*n */
|
|
Karsten Hopp |
eddd07 |
! (PyIntArgFunc) BufferItem, /* sq_item, x[i] */
|
|
Karsten Hopp |
eddd07 |
! (PyIntIntArgFunc) BufferSlice, /* sq_slice, x[i:j] */
|
|
Karsten Hopp |
eddd07 |
! (PyIntObjArgProc) BufferAssItem, /* sq_ass_item, x[i]=v */
|
|
Karsten Hopp |
eddd07 |
! (PyIntIntObjArgProc) BufferAssSlice, /* sq_ass_slice, x[i:j]=v */
|
|
Karsten Hopp |
eddd07 |
};
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyTypeObject BufferType = {
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 1516,1522 ****
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
/******************/
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static int
|
|
Karsten Hopp |
eddd07 |
BufferLength(PyObject *self)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
/* HOW DO WE SIGNAL AN ERROR FROM THIS FUNCTION? */
|
|
Karsten Hopp |
eddd07 |
--- 1544,1550 ----
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
/******************/
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static PyInt
|
|
Karsten Hopp |
eddd07 |
BufferLength(PyObject *self)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
/* HOW DO WE SIGNAL AN ERROR FROM THIS FUNCTION? */
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 1527,1555 ****
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
! BufferItem(PyObject *self, int n)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
return RBItem((BufferObject *)(self), n, 1,
|
|
Karsten Hopp |
eddd07 |
(int)((BufferObject *)(self))->buf->b_ml.ml_line_count);
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
! BufferSlice(PyObject *self, int lo, int hi)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
return RBSlice((BufferObject *)(self), lo, hi, 1,
|
|
Karsten Hopp |
eddd07 |
(int)((BufferObject *)(self))->buf->b_ml.ml_line_count);
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static int
|
|
Karsten Hopp |
eddd07 |
! BufferAssItem(PyObject *self, int n, PyObject *val)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
return RBAssItem((BufferObject *)(self), n, val, 1,
|
|
Karsten Hopp |
eddd07 |
(int)((BufferObject *)(self))->buf->b_ml.ml_line_count,
|
|
Karsten Hopp |
eddd07 |
NULL);
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static int
|
|
Karsten Hopp |
eddd07 |
! BufferAssSlice(PyObject *self, int lo, int hi, PyObject *val)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
return RBAssSlice((BufferObject *)(self), lo, hi, val, 1,
|
|
Karsten Hopp |
eddd07 |
(int)((BufferObject *)(self))->buf->b_ml.ml_line_count,
|
|
Karsten Hopp |
eddd07 |
--- 1555,1583 ----
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
! BufferItem(PyObject *self, PyInt n)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
return RBItem((BufferObject *)(self), n, 1,
|
|
Karsten Hopp |
eddd07 |
(int)((BufferObject *)(self))->buf->b_ml.ml_line_count);
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
! BufferSlice(PyObject *self, PyInt lo, PyInt hi)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
return RBSlice((BufferObject *)(self), lo, hi, 1,
|
|
Karsten Hopp |
eddd07 |
(int)((BufferObject *)(self))->buf->b_ml.ml_line_count);
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static PyInt
|
|
Karsten Hopp |
eddd07 |
! BufferAssItem(PyObject *self, PyInt n, PyObject *val)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
return RBAssItem((BufferObject *)(self), n, val, 1,
|
|
Karsten Hopp |
eddd07 |
(int)((BufferObject *)(self))->buf->b_ml.ml_line_count,
|
|
Karsten Hopp |
eddd07 |
NULL);
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static PyInt
|
|
Karsten Hopp |
eddd07 |
! BufferAssSlice(PyObject *self, PyInt lo, PyInt hi, PyObject *val)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
return RBAssSlice((BufferObject *)(self), lo, hi, val, 1,
|
|
Karsten Hopp |
eddd07 |
(int)((BufferObject *)(self))->buf->b_ml.ml_line_count,
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 1627,1639 ****
|
|
Karsten Hopp |
eddd07 |
};
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PySequenceMethods RangeAsSeq = {
|
|
Karsten Hopp |
eddd07 |
! (inquiry) RangeLength, /* sq_length, len(x) */
|
|
Karsten Hopp |
eddd07 |
(binaryfunc) 0, /* RangeConcat, */ /* sq_concat, x+y */
|
|
Karsten Hopp |
eddd07 |
! (intargfunc) 0, /* RangeRepeat, */ /* sq_repeat, x*n */
|
|
Karsten Hopp |
eddd07 |
! (intargfunc) RangeItem, /* sq_item, x[i] */
|
|
Karsten Hopp |
eddd07 |
! (intintargfunc) RangeSlice, /* sq_slice, x[i:j] */
|
|
Karsten Hopp |
eddd07 |
! (intobjargproc) RangeAssItem, /* sq_ass_item, x[i]=v */
|
|
Karsten Hopp |
eddd07 |
! (intintobjargproc) RangeAssSlice, /* sq_ass_slice, x[i:j]=v */
|
|
Karsten Hopp |
eddd07 |
};
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyTypeObject RangeType = {
|
|
Karsten Hopp |
eddd07 |
--- 1655,1667 ----
|
|
Karsten Hopp |
eddd07 |
};
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PySequenceMethods RangeAsSeq = {
|
|
Karsten Hopp |
eddd07 |
! (PyInquiry) RangeLength, /* sq_length, len(x) */
|
|
Karsten Hopp |
eddd07 |
(binaryfunc) 0, /* RangeConcat, */ /* sq_concat, x+y */
|
|
Karsten Hopp |
eddd07 |
! (PyIntArgFunc) 0, /* RangeRepeat, */ /* sq_repeat, x*n */
|
|
Karsten Hopp |
eddd07 |
! (PyIntArgFunc) RangeItem, /* sq_item, x[i] */
|
|
Karsten Hopp |
eddd07 |
! (PyIntIntArgFunc) RangeSlice, /* sq_slice, x[i:j] */
|
|
Karsten Hopp |
eddd07 |
! (PyIntObjArgProc) RangeAssItem, /* sq_ass_item, x[i]=v */
|
|
Karsten Hopp |
eddd07 |
! (PyIntIntObjArgProc) RangeAssSlice, /* sq_ass_slice, x[i:j]=v */
|
|
Karsten Hopp |
eddd07 |
};
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyTypeObject RangeType = {
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 1738,1744 ****
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
/****************/
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static int
|
|
Karsten Hopp |
eddd07 |
RangeLength(PyObject *self)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
/* HOW DO WE SIGNAL AN ERROR FROM THIS FUNCTION? */
|
|
Karsten Hopp |
eddd07 |
--- 1766,1772 ----
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
/****************/
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static PyInt
|
|
Karsten Hopp |
eddd07 |
RangeLength(PyObject *self)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
/* HOW DO WE SIGNAL AN ERROR FROM THIS FUNCTION? */
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 1749,1755 ****
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
! RangeItem(PyObject *self, int n)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
return RBItem(((RangeObject *)(self))->buf, n,
|
|
Karsten Hopp |
eddd07 |
((RangeObject *)(self))->start,
|
|
Karsten Hopp |
eddd07 |
--- 1777,1783 ----
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
! RangeItem(PyObject *self, PyInt n)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
return RBItem(((RangeObject *)(self))->buf, n,
|
|
Karsten Hopp |
eddd07 |
((RangeObject *)(self))->start,
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 1757,1771 ****
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
! RangeSlice(PyObject *self, int lo, int hi)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
return RBSlice(((RangeObject *)(self))->buf, lo, hi,
|
|
Karsten Hopp |
eddd07 |
((RangeObject *)(self))->start,
|
|
Karsten Hopp |
eddd07 |
((RangeObject *)(self))->end);
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static int
|
|
Karsten Hopp |
eddd07 |
! RangeAssItem(PyObject *self, int n, PyObject *val)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
return RBAssItem(((RangeObject *)(self))->buf, n, val,
|
|
Karsten Hopp |
eddd07 |
((RangeObject *)(self))->start,
|
|
Karsten Hopp |
eddd07 |
--- 1785,1799 ----
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
! RangeSlice(PyObject *self, PyInt lo, PyInt hi)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
return RBSlice(((RangeObject *)(self))->buf, lo, hi,
|
|
Karsten Hopp |
eddd07 |
((RangeObject *)(self))->start,
|
|
Karsten Hopp |
eddd07 |
((RangeObject *)(self))->end);
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static PyInt
|
|
Karsten Hopp |
eddd07 |
! RangeAssItem(PyObject *self, PyInt n, PyObject *val)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
return RBAssItem(((RangeObject *)(self))->buf, n, val,
|
|
Karsten Hopp |
eddd07 |
((RangeObject *)(self))->start,
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 1773,1780 ****
|
|
Karsten Hopp |
eddd07 |
&((RangeObject *)(self))->end);
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static int
|
|
Karsten Hopp |
eddd07 |
! RangeAssSlice(PyObject *self, int lo, int hi, PyObject *val)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
return RBAssSlice(((RangeObject *)(self))->buf, lo, hi, val,
|
|
Karsten Hopp |
eddd07 |
((RangeObject *)(self))->start,
|
|
Karsten Hopp |
eddd07 |
--- 1801,1808 ----
|
|
Karsten Hopp |
eddd07 |
&((RangeObject *)(self))->end);
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
! static PyInt
|
|
Karsten Hopp |
eddd07 |
! RangeAssSlice(PyObject *self, PyInt lo, PyInt hi, PyObject *val)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
return RBAssSlice(((RangeObject *)(self))->buf, lo, hi, val,
|
|
Karsten Hopp |
eddd07 |
((RangeObject *)(self))->start,
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 1801,1813 ****
|
|
Karsten Hopp |
eddd07 |
BufListObject;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PySequenceMethods BufListAsSeq = {
|
|
Karsten Hopp |
eddd07 |
! (inquiry) BufListLength, /* sq_length, len(x) */
|
|
Karsten Hopp |
eddd07 |
(binaryfunc) 0, /* sq_concat, x+y */
|
|
Karsten Hopp |
eddd07 |
! (intargfunc) 0, /* sq_repeat, x*n */
|
|
Karsten Hopp |
eddd07 |
! (intargfunc) BufListItem, /* sq_item, x[i] */
|
|
Karsten Hopp |
eddd07 |
! (intintargfunc) 0, /* sq_slice, x[i:j] */
|
|
Karsten Hopp |
eddd07 |
! (intobjargproc) 0, /* sq_ass_item, x[i]=v */
|
|
Karsten Hopp |
eddd07 |
! (intintobjargproc) 0, /* sq_ass_slice, x[i:j]=v */
|
|
Karsten Hopp |
eddd07 |
};
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyTypeObject BufListType = {
|
|
Karsten Hopp |
eddd07 |
--- 1829,1841 ----
|
|
Karsten Hopp |
eddd07 |
BufListObject;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PySequenceMethods BufListAsSeq = {
|
|
Karsten Hopp |
eddd07 |
! (PyInquiry) BufListLength, /* sq_length, len(x) */
|
|
Karsten Hopp |
eddd07 |
(binaryfunc) 0, /* sq_concat, x+y */
|
|
Karsten Hopp |
eddd07 |
! (PyIntArgFunc) 0, /* sq_repeat, x*n */
|
|
Karsten Hopp |
eddd07 |
! (PyIntArgFunc) BufListItem, /* sq_item, x[i] */
|
|
Karsten Hopp |
eddd07 |
! (PyIntIntArgFunc) 0, /* sq_slice, x[i:j] */
|
|
Karsten Hopp |
eddd07 |
! (PyIntObjArgProc) 0, /* sq_ass_item, x[i]=v */
|
|
Karsten Hopp |
eddd07 |
! (PyIntIntObjArgProc) 0, /* sq_ass_slice, x[i:j]=v */
|
|
Karsten Hopp |
eddd07 |
};
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyTypeObject BufListType = {
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 1837,1843 ****
|
|
Karsten Hopp |
eddd07 |
*/
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
/*ARGSUSED*/
|
|
Karsten Hopp |
eddd07 |
! static int
|
|
Karsten Hopp |
eddd07 |
BufListLength(PyObject *self)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
buf_T *b = firstbuf;
|
|
Karsten Hopp |
eddd07 |
--- 1865,1871 ----
|
|
Karsten Hopp |
eddd07 |
*/
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
/*ARGSUSED*/
|
|
Karsten Hopp |
eddd07 |
! static PyInt
|
|
Karsten Hopp |
eddd07 |
BufListLength(PyObject *self)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
buf_T *b = firstbuf;
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 1854,1860 ****
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
/*ARGSUSED*/
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
! BufListItem(PyObject *self, int n)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
buf_T *b;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
--- 1882,1888 ----
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
/*ARGSUSED*/
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
! BufListItem(PyObject *self, PyInt n)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
buf_T *b;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 2119,2131 ****
|
|
Karsten Hopp |
eddd07 |
WinListObject;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PySequenceMethods WinListAsSeq = {
|
|
Karsten Hopp |
eddd07 |
! (inquiry) WinListLength, /* sq_length, len(x) */
|
|
Karsten Hopp |
eddd07 |
(binaryfunc) 0, /* sq_concat, x+y */
|
|
Karsten Hopp |
eddd07 |
! (intargfunc) 0, /* sq_repeat, x*n */
|
|
Karsten Hopp |
eddd07 |
! (intargfunc) WinListItem, /* sq_item, x[i] */
|
|
Karsten Hopp |
eddd07 |
! (intintargfunc) 0, /* sq_slice, x[i:j] */
|
|
Karsten Hopp |
eddd07 |
! (intobjargproc) 0, /* sq_ass_item, x[i]=v */
|
|
Karsten Hopp |
eddd07 |
! (intintobjargproc) 0, /* sq_ass_slice, x[i:j]=v */
|
|
Karsten Hopp |
eddd07 |
};
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyTypeObject WinListType = {
|
|
Karsten Hopp |
eddd07 |
--- 2147,2159 ----
|
|
Karsten Hopp |
eddd07 |
WinListObject;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PySequenceMethods WinListAsSeq = {
|
|
Karsten Hopp |
eddd07 |
! (PyInquiry) WinListLength, /* sq_length, len(x) */
|
|
Karsten Hopp |
eddd07 |
(binaryfunc) 0, /* sq_concat, x+y */
|
|
Karsten Hopp |
eddd07 |
! (PyIntArgFunc) 0, /* sq_repeat, x*n */
|
|
Karsten Hopp |
eddd07 |
! (PyIntArgFunc) WinListItem, /* sq_item, x[i] */
|
|
Karsten Hopp |
eddd07 |
! (PyIntIntArgFunc) 0, /* sq_slice, x[i:j] */
|
|
Karsten Hopp |
eddd07 |
! (PyIntObjArgProc) 0, /* sq_ass_item, x[i]=v */
|
|
Karsten Hopp |
eddd07 |
! (PyIntIntObjArgProc) 0, /* sq_ass_slice, x[i:j]=v */
|
|
Karsten Hopp |
eddd07 |
};
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
static PyTypeObject WinListType = {
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 2154,2160 ****
|
|
Karsten Hopp |
eddd07 |
/* Window list object - Implementation
|
|
Karsten Hopp |
eddd07 |
*/
|
|
Karsten Hopp |
eddd07 |
/*ARGSUSED*/
|
|
Karsten Hopp |
eddd07 |
! static int
|
|
Karsten Hopp |
eddd07 |
WinListLength(PyObject *self)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
win_T *w = firstwin;
|
|
Karsten Hopp |
eddd07 |
--- 2182,2188 ----
|
|
Karsten Hopp |
eddd07 |
/* Window list object - Implementation
|
|
Karsten Hopp |
eddd07 |
*/
|
|
Karsten Hopp |
eddd07 |
/*ARGSUSED*/
|
|
Karsten Hopp |
eddd07 |
! static PyInt
|
|
Karsten Hopp |
eddd07 |
WinListLength(PyObject *self)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
win_T *w = firstwin;
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 2171,2177 ****
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
/*ARGSUSED*/
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
! WinListItem(PyObject *self, int n)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
win_T *w;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
--- 2199,2205 ----
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
/*ARGSUSED*/
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
! WinListItem(PyObject *self, PyInt n)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
win_T *w;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 2351,2360 ****
|
|
Karsten Hopp |
eddd07 |
* including, hi. The list is returned as a Python list of string objects.
|
|
Karsten Hopp |
eddd07 |
*/
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
! GetBufferLineList(buf_T *buf, int lo, int hi)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
! int i;
|
|
Karsten Hopp |
eddd07 |
! int n = hi - lo;
|
|
Karsten Hopp |
eddd07 |
PyObject *list = PyList_New(n);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
if (list == NULL)
|
|
Karsten Hopp |
eddd07 |
--- 2379,2388 ----
|
|
Karsten Hopp |
eddd07 |
* including, hi. The list is returned as a Python list of string objects.
|
|
Karsten Hopp |
eddd07 |
*/
|
|
Karsten Hopp |
eddd07 |
static PyObject *
|
|
Karsten Hopp |
eddd07 |
! GetBufferLineList(buf_T *buf, PyInt lo, PyInt hi)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
! PyInt i;
|
|
Karsten Hopp |
eddd07 |
! PyInt n = hi - lo;
|
|
Karsten Hopp |
eddd07 |
PyObject *list = PyList_New(n);
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
if (list == NULL)
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 2517,2523 ****
|
|
Karsten Hopp |
eddd07 |
* is set to the change in the buffer length.
|
|
Karsten Hopp |
eddd07 |
*/
|
|
Karsten Hopp |
eddd07 |
static int
|
|
Karsten Hopp |
eddd07 |
! SetBufferLineList(buf_T *buf, int lo, int hi, PyObject *list, int *len_change)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
/* First of all, we check the thpe of the supplied Python object.
|
|
Karsten Hopp |
eddd07 |
* There are three cases:
|
|
Karsten Hopp |
eddd07 |
--- 2545,2551 ----
|
|
Karsten Hopp |
eddd07 |
* is set to the change in the buffer length.
|
|
Karsten Hopp |
eddd07 |
*/
|
|
Karsten Hopp |
eddd07 |
static int
|
|
Karsten Hopp |
eddd07 |
! SetBufferLineList(buf_T *buf, PyInt lo, PyInt hi, PyObject *list, int *len_change)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
/* First of all, we check the thpe of the supplied Python object.
|
|
Karsten Hopp |
eddd07 |
* There are three cases:
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 2527,2534 ****
|
|
Karsten Hopp |
eddd07 |
*/
|
|
Karsten Hopp |
eddd07 |
if (list == Py_None || list == NULL)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
! int i;
|
|
Karsten Hopp |
eddd07 |
! int n = hi - lo;
|
|
Karsten Hopp |
eddd07 |
buf_T *savebuf = curbuf;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
PyErr_Clear();
|
|
Karsten Hopp |
eddd07 |
--- 2555,2562 ----
|
|
Karsten Hopp |
eddd07 |
*/
|
|
Karsten Hopp |
eddd07 |
if (list == Py_None || list == NULL)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
! PyInt i;
|
|
Karsten Hopp |
eddd07 |
! PyInt n = hi - lo;
|
|
Karsten Hopp |
eddd07 |
buf_T *savebuf = curbuf;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
PyErr_Clear();
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 2564,2572 ****
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
else if (PyList_Check(list))
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
! int i;
|
|
Karsten Hopp |
eddd07 |
! int new_len = PyList_Size(list);
|
|
Karsten Hopp |
eddd07 |
! int old_len = hi - lo;
|
|
Karsten Hopp |
eddd07 |
int extra = 0; /* lines added to text, can be negative */
|
|
Karsten Hopp |
eddd07 |
char **array;
|
|
Karsten Hopp |
eddd07 |
buf_T *savebuf;
|
|
Karsten Hopp |
eddd07 |
--- 2592,2600 ----
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
else if (PyList_Check(list))
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
! PyInt i;
|
|
Karsten Hopp |
eddd07 |
! PyInt new_len = PyList_Size(list);
|
|
Karsten Hopp |
eddd07 |
! PyInt old_len = hi - lo;
|
|
Karsten Hopp |
eddd07 |
int extra = 0; /* lines added to text, can be negative */
|
|
Karsten Hopp |
eddd07 |
char **array;
|
|
Karsten Hopp |
eddd07 |
buf_T *savebuf;
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 2745,2752 ****
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
else if (PyList_Check(lines))
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
! int i;
|
|
Karsten Hopp |
eddd07 |
! int size = PyList_Size(lines);
|
|
Karsten Hopp |
eddd07 |
char **array;
|
|
Karsten Hopp |
eddd07 |
buf_T *savebuf;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
--- 2773,2780 ----
|
|
Karsten Hopp |
eddd07 |
}
|
|
Karsten Hopp |
eddd07 |
else if (PyList_Check(lines))
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
! PyInt i;
|
|
Karsten Hopp |
eddd07 |
! PyInt size = PyList_Size(lines);
|
|
Karsten Hopp |
eddd07 |
char **array;
|
|
Karsten Hopp |
eddd07 |
buf_T *savebuf;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 2831,2837 ****
|
|
Karsten Hopp |
eddd07 |
LineToString(const char *str)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
PyObject *result;
|
|
Karsten Hopp |
eddd07 |
! int len = strlen(str);
|
|
Karsten Hopp |
eddd07 |
char *p;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
/* Allocate an Python string object, with uninitialised contents. We
|
|
Karsten Hopp |
eddd07 |
--- 2859,2865 ----
|
|
Karsten Hopp |
eddd07 |
LineToString(const char *str)
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
PyObject *result;
|
|
Karsten Hopp |
eddd07 |
! PyInt len = strlen(str);
|
|
Karsten Hopp |
eddd07 |
char *p;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
/* Allocate an Python string object, with uninitialised contents. We
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 2871,2878 ****
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
const char *str;
|
|
Karsten Hopp |
eddd07 |
char *save;
|
|
Karsten Hopp |
eddd07 |
! int len;
|
|
Karsten Hopp |
eddd07 |
! int i;
|
|
Karsten Hopp |
eddd07 |
char *p;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
if (obj == NULL || !PyString_Check(obj))
|
|
Karsten Hopp |
eddd07 |
--- 2899,2906 ----
|
|
Karsten Hopp |
eddd07 |
{
|
|
Karsten Hopp |
eddd07 |
const char *str;
|
|
Karsten Hopp |
eddd07 |
char *save;
|
|
Karsten Hopp |
eddd07 |
! PyInt len;
|
|
Karsten Hopp |
eddd07 |
! PyInt i;
|
|
Karsten Hopp |
eddd07 |
char *p;
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
if (obj == NULL || !PyString_Check(obj))
|
|
Karsten Hopp |
eddd07 |
*** ../vim-7.1.306/src/version.c Wed Jun 4 10:59:18 2008
|
|
Karsten Hopp |
eddd07 |
--- src/version.c Wed Jun 4 13:31:40 2008
|
|
Karsten Hopp |
eddd07 |
***************
|
|
Karsten Hopp |
eddd07 |
*** 668,669 ****
|
|
Karsten Hopp |
eddd07 |
--- 673,676 ----
|
|
Karsten Hopp |
eddd07 |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
eddd07 |
+ /**/
|
|
Karsten Hopp |
eddd07 |
+ 307,
|
|
Karsten Hopp |
eddd07 |
/**/
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
--
|
|
Karsten Hopp |
eddd07 |
For humans, honesty is a matter of degree. Engineers are always honest in
|
|
Karsten Hopp |
eddd07 |
matters of technology and human relationships. That's why it's a good idea
|
|
Karsten Hopp |
eddd07 |
to keep engineers away from customers, romantic interests, and other people
|
|
Karsten Hopp |
eddd07 |
who can't handle the truth.
|
|
Karsten Hopp |
eddd07 |
(Scott Adams - The Dilbert principle)
|
|
Karsten Hopp |
eddd07 |
|
|
Karsten Hopp |
eddd07 |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
eddd07 |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
eddd07 |
\\\ download, build and distribute -- http://www.A-A-P.org ///
|
|
Karsten Hopp |
eddd07 |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|