Karsten Hopp ae61a4
To: vim_dev@googlegroups.com
Karsten Hopp ae61a4
Subject: Patch 7.3.992
Karsten Hopp ae61a4
Fcc: outbox
Karsten Hopp ae61a4
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp ae61a4
Mime-Version: 1.0
Karsten Hopp ae61a4
Content-Type: text/plain; charset=UTF-8
Karsten Hopp ae61a4
Content-Transfer-Encoding: 8bit
Karsten Hopp ae61a4
------------
Karsten Hopp ae61a4
Karsten Hopp ae61a4
Patch 7.3.992
Karsten Hopp ae61a4
Problem:    Python: Too many type casts.
Karsten Hopp ae61a4
Solution:   Change argument types. (ZyX)
Karsten Hopp ae61a4
Files:	    src/if_py_both.h, src/if_python3.c, src/if_python.c
Karsten Hopp ae61a4
Karsten Hopp ae61a4
Karsten Hopp ae61a4
*** ../vim-7.3.991/src/if_py_both.h	2013-05-21 18:19:33.000000000 +0200
Karsten Hopp ae61a4
--- src/if_py_both.h	2013-05-21 18:22:03.000000000 +0200
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 76,82 ****
Karsten Hopp ae61a4
  } OutputObject;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! OutputSetattr(PyObject *self, char *name, PyObject *val)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      if (val == NULL)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
--- 76,82 ----
Karsten Hopp ae61a4
  } OutputObject;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! OutputSetattr(OutputObject *self, char *name, PyObject *val)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      if (val == NULL)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 93,99 ****
Karsten Hopp ae61a4
  	    return -1;
Karsten Hopp ae61a4
  	}
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
! 	((OutputObject *)(self))->softspace = PyInt_AsLong(val);
Karsten Hopp ae61a4
  	return 0;
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
--- 93,99 ----
Karsten Hopp ae61a4
  	    return -1;
Karsten Hopp ae61a4
  	}
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
! 	self->softspace = PyInt_AsLong(val);
Karsten Hopp ae61a4
  	return 0;
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 152,162 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! OutputWrite(PyObject *self, PyObject *args)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      Py_ssize_t len = 0;
Karsten Hopp ae61a4
      char *str = NULL;
Karsten Hopp ae61a4
!     int error = ((OutputObject *)(self))->error;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
Karsten Hopp ae61a4
  	return NULL;
Karsten Hopp ae61a4
--- 152,162 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! OutputWrite(OutputObject *self, PyObject *args)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      Py_ssize_t len = 0;
Karsten Hopp ae61a4
      char *str = NULL;
Karsten Hopp ae61a4
!     int error = self->error;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
Karsten Hopp ae61a4
  	return NULL;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 173,184 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! OutputWritelines(PyObject *self, PyObject *args)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      PyInt n;
Karsten Hopp ae61a4
      PyInt i;
Karsten Hopp ae61a4
      PyObject *list;
Karsten Hopp ae61a4
!     int error = ((OutputObject *)(self))->error;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (!PyArg_ParseTuple(args, "O", &list))
Karsten Hopp ae61a4
  	return NULL;
Karsten Hopp ae61a4
--- 173,184 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! OutputWritelines(OutputObject *self, PyObject *args)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      PyInt n;
Karsten Hopp ae61a4
      PyInt i;
Karsten Hopp ae61a4
      PyObject *list;
Karsten Hopp ae61a4
!     int error = self->error;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (!PyArg_ParseTuple(args, "O", &list))
Karsten Hopp ae61a4
  	return NULL;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 220,226 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! OutputFlush(PyObject *self UNUSED, PyObject *args UNUSED)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      /* do nothing */
Karsten Hopp ae61a4
      Py_INCREF(Py_None);
Karsten Hopp ae61a4
--- 220,226 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! OutputFlush(PyObject *self UNUSED)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      /* do nothing */
Karsten Hopp ae61a4
      Py_INCREF(Py_None);
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 230,240 ****
Karsten Hopp ae61a4
  /***************/
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static struct PyMethodDef OutputMethods[] = {
Karsten Hopp ae61a4
!     /* name,	    function,		calling,    documentation */
Karsten Hopp ae61a4
!     {"write",	    OutputWrite,	1,	    ""},
Karsten Hopp ae61a4
!     {"writelines",  OutputWritelines,	1,	    ""},
Karsten Hopp ae61a4
!     {"flush",	    OutputFlush,	1,	    ""},
Karsten Hopp ae61a4
!     { NULL,	    NULL,		0,	    NULL}
Karsten Hopp ae61a4
  };
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static OutputObject Output =
Karsten Hopp ae61a4
--- 230,240 ----
Karsten Hopp ae61a4
  /***************/
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static struct PyMethodDef OutputMethods[] = {
Karsten Hopp ae61a4
!     /* name,	    function,				calling,	doc */
Karsten Hopp ae61a4
!     {"write",	    (PyCFunction)OutputWrite,		METH_VARARGS,	""},
Karsten Hopp ae61a4
!     {"writelines",  (PyCFunction)OutputWritelines,	METH_VARARGS,	""},
Karsten Hopp ae61a4
!     {"flush",	    (PyCFunction)OutputFlush,		METH_NOARGS,	""},
Karsten Hopp ae61a4
!     { NULL,	    NULL,				0,		NULL}
Karsten Hopp ae61a4
  };
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static OutputObject Output =
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 533,544 ****
Karsten Hopp ae61a4
   */
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static struct PyMethodDef VimMethods[] = {
Karsten Hopp ae61a4
!     /* name,	     function,		calling,    documentation */
Karsten Hopp ae61a4
!     {"command",	     VimCommand,	1,	    "Execute a Vim ex-mode command" },
Karsten Hopp ae61a4
!     {"eval",	     VimEval,		1,	    "Evaluate an expression using Vim evaluator" },
Karsten Hopp ae61a4
!     {"bindeval",     VimEvalPy,		1,	    "Like eval(), but returns objects attached to vim ones"},
Karsten Hopp ae61a4
!     {"strwidth",     VimStrwidth,	1,	    "Screen string width, counts <Tab> as having width 1"},
Karsten Hopp ae61a4
!     { NULL,	     NULL,		0,	    NULL }
Karsten Hopp ae61a4
  };
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  /*
Karsten Hopp ae61a4
--- 533,544 ----
Karsten Hopp ae61a4
   */
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static struct PyMethodDef VimMethods[] = {
Karsten Hopp ae61a4
!     /* name,	     function,		calling,	documentation */
Karsten Hopp ae61a4
!     {"command",	     VimCommand,	METH_VARARGS,	"Execute a Vim ex-mode command" },
Karsten Hopp ae61a4
!     {"eval",	     VimEval,		METH_VARARGS,	"Evaluate an expression using Vim evaluator" },
Karsten Hopp ae61a4
!     {"bindeval",     VimEvalPy,		METH_VARARGS,	"Like eval(), but returns objects attached to vim ones"},
Karsten Hopp ae61a4
!     {"strwidth",     VimStrwidth,	METH_VARARGS,	"Screen string width, counts <Tab> as having width 1"},
Karsten Hopp ae61a4
!     { NULL,	     NULL,		0,		NULL }
Karsten Hopp ae61a4
  };
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  /*
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 583,604 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! IterDestructor(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     IterObject *this = (IterObject *)(self);
Karsten Hopp ae61a4
! 
Karsten Hopp ae61a4
!     this->destruct(this->cur);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DESTRUCTOR_FINISH(self);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! IterTraverse(PyObject *self, visitproc visit, void *arg)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     IterObject *this = (IterObject *)(self);
Karsten Hopp ae61a4
! 
Karsten Hopp ae61a4
!     if (this->traverse != NULL)
Karsten Hopp ae61a4
! 	return this->traverse(this->cur, visit, arg);
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
  	return 0;
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
--- 583,600 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! IterDestructor(IterObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     self->destruct(self->cur);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DESTRUCTOR_FINISH(self);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! IterTraverse(IterObject *self, visitproc visit, void *arg)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     if (self->traverse != NULL)
Karsten Hopp ae61a4
! 	return self->traverse(self->cur, visit, arg);
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
  	return 0;
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 609,630 ****
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! IterClear(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     IterObject *this = (IterObject *)(self);
Karsten Hopp ae61a4
! 
Karsten Hopp ae61a4
!     if (this->clear != NULL)
Karsten Hopp ae61a4
! 	return this->clear(&this->cur);
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
  	return 0;
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! IterNext(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     IterObject *this = (IterObject *)(self);
Karsten Hopp ae61a4
! 
Karsten Hopp ae61a4
!     return this->next(&this->cur);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
--- 605,622 ----
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! IterClear(IterObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     if (self->clear != NULL)
Karsten Hopp ae61a4
! 	return self->clear(&self->cur);
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
  	return 0;
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! IterNext(IterObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     return self->next(&self->cur);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 711,731 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! DictionaryDestructor(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     DictionaryObject	*this = ((DictionaryObject *) (self));
Karsten Hopp ae61a4
! 
Karsten Hopp ae61a4
!     pyll_remove(&this->ref, &lastdict);
Karsten Hopp ae61a4
!     dict_unref(this->dict);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DESTRUCTOR_FINISH(self);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! DictionarySetattr(PyObject *self, char *name, PyObject *val)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
-     DictionaryObject *this = (DictionaryObject *)(self);
Karsten Hopp ae61a4
- 
Karsten Hopp ae61a4
      if (val == NULL)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	PyErr_SetString(PyExc_AttributeError, _("Cannot delete DictionaryObject attributes"));
Karsten Hopp ae61a4
--- 703,719 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! DictionaryDestructor(DictionaryObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     pyll_remove(&self->ref, &lastdict);
Karsten Hopp ae61a4
!     dict_unref(self->dict);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DESTRUCTOR_FINISH(self);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! DictionarySetattr(DictionaryObject *self, char *name, PyObject *val)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      if (val == NULL)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	PyErr_SetString(PyExc_AttributeError, _("Cannot delete DictionaryObject attributes"));
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 734,740 ****
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (strcmp(name, "locked") == 0)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	if (this->dict->dv_lock == VAR_FIXED)
Karsten Hopp ae61a4
  	{
Karsten Hopp ae61a4
  	    PyErr_SetString(PyExc_TypeError, _("Cannot modify fixed dictionary"));
Karsten Hopp ae61a4
  	    return -1;
Karsten Hopp ae61a4
--- 722,728 ----
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (strcmp(name, "locked") == 0)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	if (self->dict->dv_lock == VAR_FIXED)
Karsten Hopp ae61a4
  	{
Karsten Hopp ae61a4
  	    PyErr_SetString(PyExc_TypeError, _("Cannot modify fixed dictionary"));
Karsten Hopp ae61a4
  	    return -1;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 745,753 ****
Karsten Hopp ae61a4
  	    if (istrue == -1)
Karsten Hopp ae61a4
  		return -1;
Karsten Hopp ae61a4
  	    else if (istrue)
Karsten Hopp ae61a4
! 		this->dict->dv_lock = VAR_LOCKED;
Karsten Hopp ae61a4
  	    else
Karsten Hopp ae61a4
! 		this->dict->dv_lock = 0;
Karsten Hopp ae61a4
  	}
Karsten Hopp ae61a4
  	return 0;
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
--- 733,741 ----
Karsten Hopp ae61a4
  	    if (istrue == -1)
Karsten Hopp ae61a4
  		return -1;
Karsten Hopp ae61a4
  	    else if (istrue)
Karsten Hopp ae61a4
! 		self->dict->dv_lock = VAR_LOCKED;
Karsten Hopp ae61a4
  	    else
Karsten Hopp ae61a4
! 		self->dict->dv_lock = 0;
Karsten Hopp ae61a4
  	}
Karsten Hopp ae61a4
  	return 0;
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 759,771 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyInt
Karsten Hopp ae61a4
! DictionaryLength(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     return ((PyInt) ((((DictionaryObject *)(self))->dict->dv_hashtab.ht_used)));
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! DictionaryItem(PyObject *self, PyObject *keyObject)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      char_u	*key;
Karsten Hopp ae61a4
      dictitem_T	*di;
Karsten Hopp ae61a4
--- 747,759 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyInt
Karsten Hopp ae61a4
! DictionaryLength(DictionaryObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     return ((PyInt) (self->dict->dv_hashtab.ht_used));
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! DictionaryItem(DictionaryObject *self, PyObject *keyObject)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      char_u	*key;
Karsten Hopp ae61a4
      dictitem_T	*di;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 773,779 ****
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DICTKEY_GET_NOTEMPTY(NULL)
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     di = dict_find(((DictionaryObject *) (self))->dict, key, -1);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DICTKEY_UNREF
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
--- 761,767 ----
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DICTKEY_GET_NOTEMPTY(NULL)
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     di = dict_find(self->dict, key, -1);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DICTKEY_UNREF
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 787,797 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyInt
Karsten Hopp ae61a4
! DictionaryAssItem(PyObject *self, PyObject *keyObject, PyObject *valObject)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      char_u	*key;
Karsten Hopp ae61a4
      typval_T	tv;
Karsten Hopp ae61a4
!     dict_T	*d = ((DictionaryObject *)(self))->dict;
Karsten Hopp ae61a4
      dictitem_T	*di;
Karsten Hopp ae61a4
      DICTKEY_DECL
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
--- 775,785 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyInt
Karsten Hopp ae61a4
! DictionaryAssItem(DictionaryObject *self, PyObject *keyObject, PyObject *valObject)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      char_u	*key;
Karsten Hopp ae61a4
      typval_T	tv;
Karsten Hopp ae61a4
!     dict_T	*d = self->dict;
Karsten Hopp ae61a4
      dictitem_T	*di;
Karsten Hopp ae61a4
      DICTKEY_DECL
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 852,860 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! DictionaryListKeys(PyObject *self UNUSED)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     dict_T	*dict = ((DictionaryObject *)(self))->dict;
Karsten Hopp ae61a4
      long_u	todo = dict->dv_hashtab.ht_used;
Karsten Hopp ae61a4
      Py_ssize_t	i = 0;
Karsten Hopp ae61a4
      PyObject	*r;
Karsten Hopp ae61a4
--- 840,848 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! DictionaryListKeys(DictionaryObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     dict_T	*dict = self->dict;
Karsten Hopp ae61a4
      long_u	todo = dict->dv_hashtab.ht_used;
Karsten Hopp ae61a4
      Py_ssize_t	i = 0;
Karsten Hopp ae61a4
      PyObject	*r;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 880,887 ****
Karsten Hopp ae61a4
  };
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static struct PyMethodDef DictionaryMethods[] = {
Karsten Hopp ae61a4
!     {"keys", (PyCFunction)DictionaryListKeys, METH_NOARGS, ""},
Karsten Hopp ae61a4
!     { NULL,	    NULL,		0,	    NULL }
Karsten Hopp ae61a4
  };
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static PyTypeObject ListType;
Karsten Hopp ae61a4
--- 868,875 ----
Karsten Hopp ae61a4
  };
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static struct PyMethodDef DictionaryMethods[] = {
Karsten Hopp ae61a4
!     {"keys",	(PyCFunction)DictionaryListKeys,	METH_NOARGS,	""},
Karsten Hopp ae61a4
!     { NULL,	NULL,					0,		NULL }
Karsten Hopp ae61a4
  };
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static PyTypeObject ListType;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 912,923 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! ListDestructor(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     ListObject *this = (ListObject *)(self);
Karsten Hopp ae61a4
! 
Karsten Hopp ae61a4
!     pyll_remove(&this->ref, &lastlist);
Karsten Hopp ae61a4
!     list_unref(this->list);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DESTRUCTOR_FINISH(self);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
--- 900,909 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! ListDestructor(ListObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     pyll_remove(&self->ref, &lastlist);
Karsten Hopp ae61a4
!     list_unref(self->list);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DESTRUCTOR_FINISH(self);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 952,973 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyInt
Karsten Hopp ae61a4
! ListLength(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     return ((PyInt) (((ListObject *) (self))->list->lv_len));
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! ListItem(PyObject *self, Py_ssize_t index)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      listitem_T	*li;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (index>=ListLength(self))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	PyErr_SetString(PyExc_IndexError, _("list index out of range"));
Karsten Hopp ae61a4
  	return NULL;
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
!     li = list_find(((ListObject *) (self))->list, (long) index);
Karsten Hopp ae61a4
      if (li == NULL)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	PyErr_SetVim(_("internal error: failed to get vim list item"));
Karsten Hopp ae61a4
--- 938,959 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyInt
Karsten Hopp ae61a4
! ListLength(ListObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     return ((PyInt) (self->list->lv_len));
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! ListItem(ListObject *self, Py_ssize_t index)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      listitem_T	*li;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (index >= ListLength(self))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	PyErr_SetString(PyExc_IndexError, _("list index out of range"));
Karsten Hopp ae61a4
  	return NULL;
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
!     li = list_find(self->list, (long) index);
Karsten Hopp ae61a4
      if (li == NULL)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	PyErr_SetVim(_("internal error: failed to get vim list item"));
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 991,997 ****
Karsten Hopp ae61a4
  	last = size;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! ListSlice(PyObject *self, Py_ssize_t first, Py_ssize_t last)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      PyInt	i;
Karsten Hopp ae61a4
      PyInt	size = ListLength(self);
Karsten Hopp ae61a4
--- 977,983 ----
Karsten Hopp ae61a4
  	last = size;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! ListSlice(ListObject *self, Py_ssize_t first, Py_ssize_t last)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      PyInt	i;
Karsten Hopp ae61a4
      PyInt	size = ListLength(self);
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1058,1067 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! ListIter(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      listiterinfo_T	*lii;
Karsten Hopp ae61a4
!     list_T	*l = ((ListObject *) (self))->list;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (!(lii = PyMem_New(listiterinfo_T, 1)))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
--- 1044,1053 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! ListIter(ListObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      listiterinfo_T	*lii;
Karsten Hopp ae61a4
!     list_T	*l = self->list;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (!(lii = PyMem_New(listiterinfo_T, 1)))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1079,1088 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! ListAssItem(PyObject *self, Py_ssize_t index, PyObject *obj)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      typval_T	tv;
Karsten Hopp ae61a4
!     list_T	*l = ((ListObject *) (self))->list;
Karsten Hopp ae61a4
      listitem_T	*li;
Karsten Hopp ae61a4
      Py_ssize_t	length = ListLength(self);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
--- 1065,1074 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! ListAssItem(ListObject *self, Py_ssize_t index, PyObject *obj)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      typval_T	tv;
Karsten Hopp ae61a4
!     list_T	*l = self->list;
Karsten Hopp ae61a4
      listitem_T	*li;
Karsten Hopp ae61a4
      Py_ssize_t	length = ListLength(self);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1127,1133 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! ListAssSlice(PyObject *self, Py_ssize_t first, Py_ssize_t last, PyObject *obj)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      PyInt	size = ListLength(self);
Karsten Hopp ae61a4
      Py_ssize_t	i;
Karsten Hopp ae61a4
--- 1113,1119 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! ListAssSlice(ListObject *self, Py_ssize_t first, Py_ssize_t last, PyObject *obj)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      PyInt	size = ListLength(self);
Karsten Hopp ae61a4
      Py_ssize_t	i;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1136,1142 ****
Karsten Hopp ae61a4
      listitem_T	*li;
Karsten Hopp ae61a4
      listitem_T	*next;
Karsten Hopp ae61a4
      typval_T	v;
Karsten Hopp ae61a4
!     list_T	*l = ((ListObject *) (self))->list;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (l->lv_lock)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
--- 1122,1128 ----
Karsten Hopp ae61a4
      listitem_T	*li;
Karsten Hopp ae61a4
      listitem_T	*next;
Karsten Hopp ae61a4
      typval_T	v;
Karsten Hopp ae61a4
!     list_T	*l = self->list;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (l->lv_lock)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1196,1204 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! ListConcatInPlace(PyObject *self, PyObject *obj)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     list_T	*l = ((ListObject *) (self))->list;
Karsten Hopp ae61a4
      PyObject	*lookup_dict;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (l->lv_lock)
Karsten Hopp ae61a4
--- 1182,1190 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! ListConcatInPlace(ListObject *self, PyObject *obj)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     list_T	*l = self->list;
Karsten Hopp ae61a4
      PyObject	*lookup_dict;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (l->lv_lock)
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1222,1235 ****
Karsten Hopp ae61a4
      Py_DECREF(lookup_dict);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      Py_INCREF(self);
Karsten Hopp ae61a4
!     return self;
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! ListSetattr(PyObject *self, char *name, PyObject *val)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
-     ListObject *this = (ListObject *)(self);
Karsten Hopp ae61a4
- 
Karsten Hopp ae61a4
      if (val == NULL)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	PyErr_SetString(PyExc_AttributeError,
Karsten Hopp ae61a4
--- 1208,1219 ----
Karsten Hopp ae61a4
      Py_DECREF(lookup_dict);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      Py_INCREF(self);
Karsten Hopp ae61a4
!     return (PyObject *)(self);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! ListSetattr(ListObject *self, char *name, PyObject *val)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      if (val == NULL)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	PyErr_SetString(PyExc_AttributeError,
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1239,1245 ****
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (strcmp(name, "locked") == 0)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	if (this->list->lv_lock == VAR_FIXED)
Karsten Hopp ae61a4
  	{
Karsten Hopp ae61a4
  	    PyErr_SetString(PyExc_TypeError, _("cannot modify fixed list"));
Karsten Hopp ae61a4
  	    return -1;
Karsten Hopp ae61a4
--- 1223,1229 ----
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (strcmp(name, "locked") == 0)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	if (self->list->lv_lock == VAR_FIXED)
Karsten Hopp ae61a4
  	{
Karsten Hopp ae61a4
  	    PyErr_SetString(PyExc_TypeError, _("cannot modify fixed list"));
Karsten Hopp ae61a4
  	    return -1;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1250,1258 ****
Karsten Hopp ae61a4
  	    if (istrue == -1)
Karsten Hopp ae61a4
  		return -1;
Karsten Hopp ae61a4
  	    else if (istrue)
Karsten Hopp ae61a4
! 		this->list->lv_lock = VAR_LOCKED;
Karsten Hopp ae61a4
  	    else
Karsten Hopp ae61a4
! 		this->list->lv_lock = 0;
Karsten Hopp ae61a4
  	}
Karsten Hopp ae61a4
  	return 0;
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
--- 1234,1242 ----
Karsten Hopp ae61a4
  	    if (istrue == -1)
Karsten Hopp ae61a4
  		return -1;
Karsten Hopp ae61a4
  	    else if (istrue)
Karsten Hopp ae61a4
! 		self->list->lv_lock = VAR_LOCKED;
Karsten Hopp ae61a4
  	    else
Karsten Hopp ae61a4
! 		self->list->lv_lock = 0;
Karsten Hopp ae61a4
  	}
Karsten Hopp ae61a4
  	return 0;
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1264,1271 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static struct PyMethodDef ListMethods[] = {
Karsten Hopp ae61a4
!     {"extend", (PyCFunction)ListConcatInPlace, METH_O, ""},
Karsten Hopp ae61a4
!     { NULL,	    NULL,		0,	    NULL }
Karsten Hopp ae61a4
  };
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  typedef struct
Karsten Hopp ae61a4
--- 1248,1255 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static struct PyMethodDef ListMethods[] = {
Karsten Hopp ae61a4
!     {"extend",	(PyCFunction)ListConcatInPlace,	METH_O,	""},
Karsten Hopp ae61a4
!     { NULL,	NULL,				0,	NULL }
Karsten Hopp ae61a4
  };
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  typedef struct
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1296,1316 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! FunctionDestructor(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     FunctionObject	*this = (FunctionObject *) (self);
Karsten Hopp ae61a4
! 
Karsten Hopp ae61a4
!     func_unref(this->name);
Karsten Hopp ae61a4
!     PyMem_Free(this->name);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DESTRUCTOR_FINISH(self);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! FunctionCall(PyObject *self, PyObject *argsObject, PyObject *kwargs)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     FunctionObject	*this = (FunctionObject *)(self);
Karsten Hopp ae61a4
!     char_u	*name = this->name;
Karsten Hopp ae61a4
      typval_T	args;
Karsten Hopp ae61a4
      typval_T	selfdicttv;
Karsten Hopp ae61a4
      typval_T	rettv;
Karsten Hopp ae61a4
--- 1280,1297 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! FunctionDestructor(FunctionObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     func_unref(self->name);
Karsten Hopp ae61a4
!     PyMem_Free(self->name);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DESTRUCTOR_FINISH(self);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! FunctionCall(FunctionObject *self, PyObject *argsObject, PyObject *kwargs)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     char_u	*name = self->name;
Karsten Hopp ae61a4
      typval_T	args;
Karsten Hopp ae61a4
      typval_T	selfdicttv;
Karsten Hopp ae61a4
      typval_T	rettv;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1368,1375 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static struct PyMethodDef FunctionMethods[] = {
Karsten Hopp ae61a4
!     {"__call__",    (PyCFunction)FunctionCall, METH_VARARGS|METH_KEYWORDS, ""},
Karsten Hopp ae61a4
!     { NULL,	    NULL,		0,	    NULL }
Karsten Hopp ae61a4
  };
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  /*
Karsten Hopp ae61a4
--- 1349,1356 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static struct PyMethodDef FunctionMethods[] = {
Karsten Hopp ae61a4
!     {"__call__",    (PyCFunction)FunctionCall,	METH_VARARGS|METH_KEYWORDS, ""},
Karsten Hopp ae61a4
!     { NULL,	    NULL,			0,			   NULL}
Karsten Hopp ae61a4
  };
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  /*
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1415,1443 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! OptionsDestructor(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     if (((OptionsObject *)(self))->fromObj)
Karsten Hopp ae61a4
! 	Py_DECREF(((OptionsObject *)(self))->fromObj);
Karsten Hopp ae61a4
      DESTRUCTOR_FINISH(self);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! OptionsTraverse(PyObject *self, visitproc visit, void *arg)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     Py_VISIT(((OptionsObject *)(self))->fromObj);
Karsten Hopp ae61a4
      return 0;
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! OptionsClear(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     Py_CLEAR(((OptionsObject *)(self))->fromObj);
Karsten Hopp ae61a4
      return 0;
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! OptionsItem(OptionsObject *this, PyObject *keyObject)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      char_u	*key;
Karsten Hopp ae61a4
      int		flags;
Karsten Hopp ae61a4
--- 1396,1424 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! OptionsDestructor(OptionsObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     if (self->fromObj)
Karsten Hopp ae61a4
! 	Py_DECREF(self->fromObj);
Karsten Hopp ae61a4
      DESTRUCTOR_FINISH(self);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! OptionsTraverse(OptionsObject *self, visitproc visit, void *arg)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     Py_VISIT(self->fromObj);
Karsten Hopp ae61a4
      return 0;
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! OptionsClear(OptionsObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     Py_CLEAR(self->fromObj);
Karsten Hopp ae61a4
      return 0;
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! OptionsItem(OptionsObject *self, PyObject *keyObject)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      char_u	*key;
Karsten Hopp ae61a4
      int		flags;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1445,1457 ****
Karsten Hopp ae61a4
      char_u	*stringval;
Karsten Hopp ae61a4
      DICTKEY_DECL
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (this->Check(this->from))
Karsten Hopp ae61a4
  	return NULL;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DICTKEY_GET_NOTEMPTY(NULL)
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      flags = get_option_value_strict(key, &numval, &stringval,
Karsten Hopp ae61a4
! 				    this->opt_type, this->from);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DICTKEY_UNREF
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
--- 1426,1438 ----
Karsten Hopp ae61a4
      char_u	*stringval;
Karsten Hopp ae61a4
      DICTKEY_DECL
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (self->Check(self->from))
Karsten Hopp ae61a4
  	return NULL;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DICTKEY_GET_NOTEMPTY(NULL)
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      flags = get_option_value_strict(key, &numval, &stringval,
Karsten Hopp ae61a4
! 				    self->opt_type, self->from);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DICTKEY_UNREF
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1532,1538 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! OptionsAssItem(OptionsObject *this, PyObject *keyObject, PyObject *valObject)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      char_u	*key;
Karsten Hopp ae61a4
      int		flags;
Karsten Hopp ae61a4
--- 1513,1519 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! OptionsAssItem(OptionsObject *self, PyObject *keyObject, PyObject *valObject)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      char_u	*key;
Karsten Hopp ae61a4
      int		flags;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1540,1552 ****
Karsten Hopp ae61a4
      int		r = 0;
Karsten Hopp ae61a4
      DICTKEY_DECL
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (this->Check(this->from))
Karsten Hopp ae61a4
  	return -1;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DICTKEY_GET_NOTEMPTY(-1)
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      flags = get_option_value_strict(key, NULL, NULL,
Karsten Hopp ae61a4
! 				    this->opt_type, this->from);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DICTKEY_UNREF
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
--- 1521,1533 ----
Karsten Hopp ae61a4
      int		r = 0;
Karsten Hopp ae61a4
      DICTKEY_DECL
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (self->Check(self->from))
Karsten Hopp ae61a4
  	return -1;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DICTKEY_GET_NOTEMPTY(-1)
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      flags = get_option_value_strict(key, NULL, NULL,
Karsten Hopp ae61a4
! 				    self->opt_type, self->from);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DICTKEY_UNREF
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1558,1564 ****
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (valObject == NULL)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	if (this->opt_type == SREQ_GLOBAL)
Karsten Hopp ae61a4
  	{
Karsten Hopp ae61a4
  	    PyErr_SetString(PyExc_ValueError,
Karsten Hopp ae61a4
  		    _("unable to unset global option"));
Karsten Hopp ae61a4
--- 1539,1545 ----
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (valObject == NULL)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	if (self->opt_type == SREQ_GLOBAL)
Karsten Hopp ae61a4
  	{
Karsten Hopp ae61a4
  	    PyErr_SetString(PyExc_ValueError,
Karsten Hopp ae61a4
  		    _("unable to unset global option"));
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1572,1583 ****
Karsten Hopp ae61a4
  	}
Karsten Hopp ae61a4
  	else
Karsten Hopp ae61a4
  	{
Karsten Hopp ae61a4
! 	    unset_global_local_option(key, this->from);
Karsten Hopp ae61a4
  	    return 0;
Karsten Hopp ae61a4
  	}
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     opt_flags = (this->opt_type ? OPT_LOCAL : OPT_GLOBAL);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (flags & SOPT_BOOL)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
--- 1553,1564 ----
Karsten Hopp ae61a4
  	}
Karsten Hopp ae61a4
  	else
Karsten Hopp ae61a4
  	{
Karsten Hopp ae61a4
! 	    unset_global_local_option(key, self->from);
Karsten Hopp ae61a4
  	    return 0;
Karsten Hopp ae61a4
  	}
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     opt_flags = (self->opt_type ? OPT_LOCAL : OPT_GLOBAL);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (flags & SOPT_BOOL)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1585,1591 ****
Karsten Hopp ae61a4
  	if (istrue == -1)
Karsten Hopp ae61a4
  	    return -1;
Karsten Hopp ae61a4
  	r = set_option_value_for(key, istrue, NULL,
Karsten Hopp ae61a4
! 				opt_flags, this->opt_type, this->from);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else if (flags & SOPT_NUM)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
--- 1566,1572 ----
Karsten Hopp ae61a4
  	if (istrue == -1)
Karsten Hopp ae61a4
  	    return -1;
Karsten Hopp ae61a4
  	r = set_option_value_for(key, istrue, NULL,
Karsten Hopp ae61a4
! 				opt_flags, self->opt_type, self->from);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else if (flags & SOPT_NUM)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1605,1611 ****
Karsten Hopp ae61a4
  	}
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	r = set_option_value_for(key, val, NULL, opt_flags,
Karsten Hopp ae61a4
! 				this->opt_type, this->from);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
--- 1586,1592 ----
Karsten Hopp ae61a4
  	}
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	r = set_option_value_for(key, val, NULL, opt_flags,
Karsten Hopp ae61a4
! 				self->opt_type, self->from);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1643,1649 ****
Karsten Hopp ae61a4
  	}
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	r = set_option_value_for(key, 0, val, opt_flags,
Karsten Hopp ae61a4
! 				this->opt_type, this->from);
Karsten Hopp ae61a4
  	vim_free(val);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
--- 1624,1630 ----
Karsten Hopp ae61a4
  	}
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	r = set_option_value_for(key, 0, val, opt_flags,
Karsten Hopp ae61a4
! 				self->opt_type, self->from);
Karsten Hopp ae61a4
  	vim_free(val);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1670,1678 ****
Karsten Hopp ae61a4
  static PyTypeObject TabPageType;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! CheckTabPage(TabPageObject *this)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     if (this->tab == INVALID_TABPAGE_VALUE)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	PyErr_SetVim(_("attempt to refer to deleted tab page"));
Karsten Hopp ae61a4
  	return -1;
Karsten Hopp ae61a4
--- 1651,1659 ----
Karsten Hopp ae61a4
  static PyTypeObject TabPageType;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! CheckTabPage(TabPageObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     if (self->tab == INVALID_TABPAGE_VALUE)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	PyErr_SetVim(_("attempt to refer to deleted tab page"));
Karsten Hopp ae61a4
  	return -1;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1704,1754 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! TabPageDestructor(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     TabPageObject *this = (TabPageObject *)(self);
Karsten Hopp ae61a4
! 
Karsten Hopp ae61a4
!     if (this->tab && this->tab != INVALID_TABPAGE_VALUE)
Karsten Hopp ae61a4
! 	TAB_PYTHON_REF(this->tab) = NULL;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DESTRUCTOR_FINISH(self);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! TabPageAttr(TabPageObject *this, char *name)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      if (strcmp(name, "windows") == 0)
Karsten Hopp ae61a4
! 	return WinListNew(this);
Karsten Hopp ae61a4
      else if (strcmp(name, "number") == 0)
Karsten Hopp ae61a4
! 	return PyLong_FromLong((long) get_tab_number(this->tab));
Karsten Hopp ae61a4
      else if (strcmp(name, "vars") == 0)
Karsten Hopp ae61a4
! 	return DictionaryNew(this->tab->tp_vars);
Karsten Hopp ae61a4
      else if (strcmp(name, "window") == 0)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	/* For current tab window.c does not bother to set or update tp_curwin
Karsten Hopp ae61a4
  	 */
Karsten Hopp ae61a4
! 	if (this->tab == curtab)
Karsten Hopp ae61a4
  	    return WindowNew(curwin, curtab);
Karsten Hopp ae61a4
  	else
Karsten Hopp ae61a4
! 	    return WindowNew(this->tab->tp_curwin, this->tab);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      return NULL;
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! TabPageRepr(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      static char repr[100];
Karsten Hopp ae61a4
-     TabPageObject *this = (TabPageObject *)(self);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (this->tab == INVALID_TABPAGE_VALUE)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	vim_snprintf(repr, 100, _("<tabpage object (deleted) at %p>"), (self));
Karsten Hopp ae61a4
  	return PyString_FromString(repr);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	int	t = get_tab_number(this->tab);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	if (t == 0)
Karsten Hopp ae61a4
  	    vim_snprintf(repr, 100, _("<tabpage object (unknown) at %p>"),
Karsten Hopp ae61a4
--- 1685,1732 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! TabPageDestructor(TabPageObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     if (self->tab && self->tab != INVALID_TABPAGE_VALUE)
Karsten Hopp ae61a4
! 	TAB_PYTHON_REF(self->tab) = NULL;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DESTRUCTOR_FINISH(self);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! TabPageAttr(TabPageObject *self, char *name)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      if (strcmp(name, "windows") == 0)
Karsten Hopp ae61a4
! 	return WinListNew(self);
Karsten Hopp ae61a4
      else if (strcmp(name, "number") == 0)
Karsten Hopp ae61a4
! 	return PyLong_FromLong((long) get_tab_number(self->tab));
Karsten Hopp ae61a4
      else if (strcmp(name, "vars") == 0)
Karsten Hopp ae61a4
! 	return DictionaryNew(self->tab->tp_vars);
Karsten Hopp ae61a4
      else if (strcmp(name, "window") == 0)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	/* For current tab window.c does not bother to set or update tp_curwin
Karsten Hopp ae61a4
  	 */
Karsten Hopp ae61a4
! 	if (self->tab == curtab)
Karsten Hopp ae61a4
  	    return WindowNew(curwin, curtab);
Karsten Hopp ae61a4
  	else
Karsten Hopp ae61a4
! 	    return WindowNew(self->tab->tp_curwin, self->tab);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      return NULL;
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! TabPageRepr(TabPageObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      static char repr[100];
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (self->tab == INVALID_TABPAGE_VALUE)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	vim_snprintf(repr, 100, _("<tabpage object (deleted) at %p>"), (self));
Karsten Hopp ae61a4
  	return PyString_FromString(repr);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	int	t = get_tab_number(self->tab);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	if (t == 0)
Karsten Hopp ae61a4
  	    vim_snprintf(repr, 100, _("<tabpage object (unknown) at %p>"),
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1818,1826 ****
Karsten Hopp ae61a4
  static PyTypeObject WindowType;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! CheckWindow(WindowObject *this)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     if (this->win == INVALID_WINDOW_VALUE)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	PyErr_SetVim(_("attempt to refer to deleted window"));
Karsten Hopp ae61a4
  	return -1;
Karsten Hopp ae61a4
--- 1796,1804 ----
Karsten Hopp ae61a4
  static PyTypeObject WindowType;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! CheckWindow(WindowObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     if (self->win == INVALID_WINDOW_VALUE)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	PyErr_SetVim(_("attempt to refer to deleted window"));
Karsten Hopp ae61a4
  	return -1;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1869,1882 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! WindowDestructor(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     WindowObject *this = (WindowObject *)(self);
Karsten Hopp ae61a4
! 
Karsten Hopp ae61a4
!     if (this->win && this->win != INVALID_WINDOW_VALUE)
Karsten Hopp ae61a4
! 	WIN_PYTHON_REF(this->win) = NULL;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     Py_DECREF(((PyObject *)(this->tabObject)));
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DESTRUCTOR_FINISH(self);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
--- 1847,1858 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! WindowDestructor(WindowObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     if (self->win && self->win != INVALID_WINDOW_VALUE)
Karsten Hopp ae61a4
! 	WIN_PYTHON_REF(self->win) = NULL;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     Py_DECREF(((PyObject *)(self->tabObject)));
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DESTRUCTOR_FINISH(self);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1899,1956 ****
Karsten Hopp ae61a4
  	return firstwin;
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! WindowTraverse(PyObject *self, visitproc visit, void *arg)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     Py_VISIT(((PyObject *)(((WindowObject *)(self))->tabObject)));
Karsten Hopp ae61a4
      return 0;
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! WindowClear(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     Py_CLEAR((((WindowObject *)(self))->tabObject));
Karsten Hopp ae61a4
      return 0;
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! WindowAttr(WindowObject *this, char *name)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      if (strcmp(name, "buffer") == 0)
Karsten Hopp ae61a4
! 	return (PyObject *)BufferNew(this->win->w_buffer);
Karsten Hopp ae61a4
      else if (strcmp(name, "cursor") == 0)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	pos_T *pos = &this->win->w_cursor;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	return Py_BuildValue("(ll)", (long)(pos->lnum), (long)(pos->col));
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else if (strcmp(name, "height") == 0)
Karsten Hopp ae61a4
! 	return PyLong_FromLong((long)(this->win->w_height));
Karsten Hopp ae61a4
  #ifdef FEAT_WINDOWS
Karsten Hopp ae61a4
      else if (strcmp(name, "row") == 0)
Karsten Hopp ae61a4
! 	return PyLong_FromLong((long)(this->win->w_winrow));
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  #ifdef FEAT_VERTSPLIT
Karsten Hopp ae61a4
      else if (strcmp(name, "width") == 0)
Karsten Hopp ae61a4
! 	return PyLong_FromLong((long)(W_WIDTH(this->win)));
Karsten Hopp ae61a4
      else if (strcmp(name, "col") == 0)
Karsten Hopp ae61a4
! 	return PyLong_FromLong((long)(W_WINCOL(this->win)));
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
      else if (strcmp(name, "vars") == 0)
Karsten Hopp ae61a4
! 	return DictionaryNew(this->win->w_vars);
Karsten Hopp ae61a4
      else if (strcmp(name, "options") == 0)
Karsten Hopp ae61a4
! 	return OptionsNew(SREQ_WIN, this->win, (checkfun) CheckWindow,
Karsten Hopp ae61a4
! 			(PyObject *) this);
Karsten Hopp ae61a4
      else if (strcmp(name, "number") == 0)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	if (CheckTabPage(this->tabObject))
Karsten Hopp ae61a4
  	    return NULL;
Karsten Hopp ae61a4
  	return PyLong_FromLong((long)
Karsten Hopp ae61a4
! 		get_win_number(this->win, get_firstwin(this->tabObject)));
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else if (strcmp(name, "tabpage") == 0)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	Py_INCREF(this->tabObject);
Karsten Hopp ae61a4
! 	return (PyObject *)(this->tabObject);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else if (strcmp(name,"__members__") == 0)
Karsten Hopp ae61a4
  	return Py_BuildValue("[sssssssss]", "buffer", "cursor", "height",
Karsten Hopp ae61a4
--- 1875,1932 ----
Karsten Hopp ae61a4
  	return firstwin;
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! WindowTraverse(WindowObject *self, visitproc visit, void *arg)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     Py_VISIT(((PyObject *)(self->tabObject)));
Karsten Hopp ae61a4
      return 0;
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! WindowClear(WindowObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     Py_CLEAR(self->tabObject);
Karsten Hopp ae61a4
      return 0;
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! WindowAttr(WindowObject *self, char *name)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      if (strcmp(name, "buffer") == 0)
Karsten Hopp ae61a4
! 	return (PyObject *)BufferNew(self->win->w_buffer);
Karsten Hopp ae61a4
      else if (strcmp(name, "cursor") == 0)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	pos_T *pos = &self->win->w_cursor;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	return Py_BuildValue("(ll)", (long)(pos->lnum), (long)(pos->col));
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else if (strcmp(name, "height") == 0)
Karsten Hopp ae61a4
! 	return PyLong_FromLong((long)(self->win->w_height));
Karsten Hopp ae61a4
  #ifdef FEAT_WINDOWS
Karsten Hopp ae61a4
      else if (strcmp(name, "row") == 0)
Karsten Hopp ae61a4
! 	return PyLong_FromLong((long)(self->win->w_winrow));
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  #ifdef FEAT_VERTSPLIT
Karsten Hopp ae61a4
      else if (strcmp(name, "width") == 0)
Karsten Hopp ae61a4
! 	return PyLong_FromLong((long)(W_WIDTH(self->win)));
Karsten Hopp ae61a4
      else if (strcmp(name, "col") == 0)
Karsten Hopp ae61a4
! 	return PyLong_FromLong((long)(W_WINCOL(self->win)));
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
      else if (strcmp(name, "vars") == 0)
Karsten Hopp ae61a4
! 	return DictionaryNew(self->win->w_vars);
Karsten Hopp ae61a4
      else if (strcmp(name, "options") == 0)
Karsten Hopp ae61a4
! 	return OptionsNew(SREQ_WIN, self->win, (checkfun) CheckWindow,
Karsten Hopp ae61a4
! 			(PyObject *) self);
Karsten Hopp ae61a4
      else if (strcmp(name, "number") == 0)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	if (CheckTabPage(self->tabObject))
Karsten Hopp ae61a4
  	    return NULL;
Karsten Hopp ae61a4
  	return PyLong_FromLong((long)
Karsten Hopp ae61a4
! 		get_win_number(self->win, get_firstwin(self->tabObject)));
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else if (strcmp(name, "tabpage") == 0)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	Py_INCREF(self->tabObject);
Karsten Hopp ae61a4
! 	return (PyObject *)(self->tabObject);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else if (strcmp(name,"__members__") == 0)
Karsten Hopp ae61a4
  	return Py_BuildValue("[sssssssss]", "buffer", "cursor", "height",
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1960,1970 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! WindowSetattr(PyObject *self, char *name, PyObject *val)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     WindowObject *this = (WindowObject *)(self);
Karsten Hopp ae61a4
! 
Karsten Hopp ae61a4
!     if (CheckWindow(this))
Karsten Hopp ae61a4
  	return -1;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (strcmp(name, "buffer") == 0)
Karsten Hopp ae61a4
--- 1936,1944 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! WindowSetattr(WindowObject *self, char *name, PyObject *val)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     if (CheckWindow(self))
Karsten Hopp ae61a4
  	return -1;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (strcmp(name, "buffer") == 0)
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1980,1986 ****
Karsten Hopp ae61a4
  	if (!PyArg_Parse(val, "(ll)", &lnum, &col))
Karsten Hopp ae61a4
  	    return -1;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
! 	if (lnum <= 0 || lnum > this->win->w_buffer->b_ml.ml_line_count)
Karsten Hopp ae61a4
  	{
Karsten Hopp ae61a4
  	    PyErr_SetVim(_("cursor position outside buffer"));
Karsten Hopp ae61a4
  	    return -1;
Karsten Hopp ae61a4
--- 1954,1960 ----
Karsten Hopp ae61a4
  	if (!PyArg_Parse(val, "(ll)", &lnum, &col))
Karsten Hopp ae61a4
  	    return -1;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
! 	if (lnum <= 0 || lnum > self->win->w_buffer->b_ml.ml_line_count)
Karsten Hopp ae61a4
  	{
Karsten Hopp ae61a4
  	    PyErr_SetVim(_("cursor position outside buffer"));
Karsten Hopp ae61a4
  	    return -1;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1990,2002 ****
Karsten Hopp ae61a4
  	if (VimErrorCheck())
Karsten Hopp ae61a4
  	    return -1;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
! 	this->win->w_cursor.lnum = lnum;
Karsten Hopp ae61a4
! 	this->win->w_cursor.col = col;
Karsten Hopp ae61a4
  #ifdef FEAT_VIRTUALEDIT
Karsten Hopp ae61a4
! 	this->win->w_cursor.coladd = 0;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  	/* When column is out of range silently correct it. */
Karsten Hopp ae61a4
! 	check_cursor_col_win(this->win);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	update_screen(VALID);
Karsten Hopp ae61a4
  	return 0;
Karsten Hopp ae61a4
--- 1964,1976 ----
Karsten Hopp ae61a4
  	if (VimErrorCheck())
Karsten Hopp ae61a4
  	    return -1;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
! 	self->win->w_cursor.lnum = lnum;
Karsten Hopp ae61a4
! 	self->win->w_cursor.col = col;
Karsten Hopp ae61a4
  #ifdef FEAT_VIRTUALEDIT
Karsten Hopp ae61a4
! 	self->win->w_cursor.coladd = 0;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  	/* When column is out of range silently correct it. */
Karsten Hopp ae61a4
! 	check_cursor_col_win(self->win);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	update_screen(VALID);
Karsten Hopp ae61a4
  	return 0;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 2013,2019 ****
Karsten Hopp ae61a4
  	need_mouse_correct = TRUE;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  	savewin = curwin;
Karsten Hopp ae61a4
! 	curwin = this->win;
Karsten Hopp ae61a4
  	win_setheight(height);
Karsten Hopp ae61a4
  	curwin = savewin;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
--- 1987,1993 ----
Karsten Hopp ae61a4
  	need_mouse_correct = TRUE;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  	savewin = curwin;
Karsten Hopp ae61a4
! 	curwin = self->win;
Karsten Hopp ae61a4
  	win_setheight(height);
Karsten Hopp ae61a4
  	curwin = savewin;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 2036,2042 ****
Karsten Hopp ae61a4
  	need_mouse_correct = TRUE;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  	savewin = curwin;
Karsten Hopp ae61a4
! 	curwin = this->win;
Karsten Hopp ae61a4
  	win_setwidth(width);
Karsten Hopp ae61a4
  	curwin = savewin;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
--- 2010,2016 ----
Karsten Hopp ae61a4
  	need_mouse_correct = TRUE;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  	savewin = curwin;
Karsten Hopp ae61a4
! 	curwin = self->win;
Karsten Hopp ae61a4
  	win_setwidth(width);
Karsten Hopp ae61a4
  	curwin = savewin;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 2055,2073 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! WindowRepr(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      static char repr[100];
Karsten Hopp ae61a4
-     WindowObject *this = (WindowObject *)(self);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (this->win == INVALID_WINDOW_VALUE)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	vim_snprintf(repr, 100, _("<window object (deleted) at %p>"), (self));
Karsten Hopp ae61a4
  	return PyString_FromString(repr);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	int	w = get_win_number(this->win, firstwin);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	if (w == 0)
Karsten Hopp ae61a4
  	    vim_snprintf(repr, 100, _("<window object (unknown) at %p>"),
Karsten Hopp ae61a4
--- 2029,2046 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! WindowRepr(WindowObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      static char repr[100];
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (self->win == INVALID_WINDOW_VALUE)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	vim_snprintf(repr, 100, _("<window object (deleted) at %p>"), (self));
Karsten Hopp ae61a4
  	return PyString_FromString(repr);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	int	w = get_win_number(self->win, firstwin);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	if (w == 0)
Karsten Hopp ae61a4
  	    vim_snprintf(repr, 100, _("<window object (unknown) at %p>"),
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 2110,2118 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! WinListDestructor(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     TabPageObject	*tabObject = ((WinListObject *)(self))->tabObject;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (tabObject)
Karsten Hopp ae61a4
  	Py_DECREF((PyObject *)(tabObject));
Karsten Hopp ae61a4
--- 2083,2091 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! WinListDestructor(WinListObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     TabPageObject	*tabObject = self->tabObject;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (tabObject)
Karsten Hopp ae61a4
  	Py_DECREF((PyObject *)(tabObject));
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 2121,2132 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyInt
Karsten Hopp ae61a4
! WinListLength(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      win_T	*w;
Karsten Hopp ae61a4
      PyInt	n = 0;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (!(w = get_firstwin(((WinListObject *)(self))->tabObject)))
Karsten Hopp ae61a4
  	return -1;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      while (w != NULL)
Karsten Hopp ae61a4
--- 2094,2105 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyInt
Karsten Hopp ae61a4
! WinListLength(WinListObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      win_T	*w;
Karsten Hopp ae61a4
      PyInt	n = 0;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (!(w = get_firstwin(self->tabObject)))
Karsten Hopp ae61a4
  	return -1;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      while (w != NULL)
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 2139,2155 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! WinListItem(PyObject *self, PyInt n)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
-     WinListObject	*this = ((WinListObject *)(self));
Karsten Hopp ae61a4
      win_T *w;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (!(w = get_firstwin(this->tabObject)))
Karsten Hopp ae61a4
  	return NULL;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      for (; w != NULL; w = W_NEXT(w), --n)
Karsten Hopp ae61a4
  	if (n == 0)
Karsten Hopp ae61a4
! 	    return WindowNew(w, this->tabObject? this->tabObject->tab: curtab);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      PyErr_SetString(PyExc_IndexError, _("no such window"));
Karsten Hopp ae61a4
      return NULL;
Karsten Hopp ae61a4
--- 2112,2127 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! WinListItem(WinListObject *self, PyInt n)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      win_T *w;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (!(w = get_firstwin(self->tabObject)))
Karsten Hopp ae61a4
  	return NULL;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      for (; w != NULL; w = W_NEXT(w), --n)
Karsten Hopp ae61a4
  	if (n == 0)
Karsten Hopp ae61a4
! 	    return WindowNew(w, self->tabObject? self->tabObject->tab: curtab);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      PyErr_SetString(PyExc_IndexError, _("no such window"));
Karsten Hopp ae61a4
      return NULL;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 2721,2729 ****
Karsten Hopp ae61a4
  } BufferObject;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! CheckBuffer(BufferObject *this)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     if (this->buf == INVALID_BUFFER_VALUE)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	PyErr_SetVim(_("attempt to refer to deleted buffer"));
Karsten Hopp ae61a4
  	return -1;
Karsten Hopp ae61a4
--- 2693,2701 ----
Karsten Hopp ae61a4
  } BufferObject;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static int
Karsten Hopp ae61a4
! CheckBuffer(BufferObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     if (self->buf == INVALID_BUFFER_VALUE)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	PyErr_SetVim(_("attempt to refer to deleted buffer"));
Karsten Hopp ae61a4
  	return -1;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 2922,2975 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! RangeDestructor(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     Py_DECREF(((RangeObject *)(self))->buf);
Karsten Hopp ae61a4
      DESTRUCTOR_FINISH(self);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyInt
Karsten Hopp ae61a4
! RangeLength(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      /* HOW DO WE SIGNAL AN ERROR FROM THIS FUNCTION? */
Karsten Hopp ae61a4
!     if (CheckBuffer(((RangeObject *)(self))->buf))
Karsten Hopp ae61a4
  	return -1; /* ??? */
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     return (((RangeObject *)(self))->end - ((RangeObject *)(self))->start + 1);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! RangeItem(PyObject *self, PyInt n)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     return RBItem(((RangeObject *)(self))->buf, n,
Karsten Hopp ae61a4
! 		  ((RangeObject *)(self))->start,
Karsten Hopp ae61a4
! 		  ((RangeObject *)(self))->end);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! RangeSlice(PyObject *self, PyInt lo, PyInt hi)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     return RBSlice(((RangeObject *)(self))->buf, lo, hi,
Karsten Hopp ae61a4
! 		   ((RangeObject *)(self))->start,
Karsten Hopp ae61a4
! 		   ((RangeObject *)(self))->end);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! RangeAppend(PyObject *self, PyObject *args)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     return RBAppend(((RangeObject *)(self))->buf, args,
Karsten Hopp ae61a4
! 		    ((RangeObject *)(self))->start,
Karsten Hopp ae61a4
! 		    ((RangeObject *)(self))->end,
Karsten Hopp ae61a4
! 		    &((RangeObject *)(self))->end);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! RangeRepr(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      static char repr[100];
Karsten Hopp ae61a4
-     RangeObject *this = (RangeObject *)(self);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (this->buf->buf == INVALID_BUFFER_VALUE)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	vim_snprintf(repr, 100, "<range object (for deleted buffer) at %p>",
Karsten Hopp ae61a4
  								      (self));
Karsten Hopp ae61a4
--- 2894,2939 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! RangeDestructor(RangeObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     Py_DECREF(self->buf);
Karsten Hopp ae61a4
      DESTRUCTOR_FINISH(self);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyInt
Karsten Hopp ae61a4
! RangeLength(RangeObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      /* HOW DO WE SIGNAL AN ERROR FROM THIS FUNCTION? */
Karsten Hopp ae61a4
!     if (CheckBuffer(self->buf))
Karsten Hopp ae61a4
  	return -1; /* ??? */
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     return (self->end - self->start + 1);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! RangeItem(RangeObject *self, PyInt n)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     return RBItem(self->buf, n, self->start, self->end);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! RangeSlice(RangeObject *self, PyInt lo, PyInt hi)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     return RBSlice(self->buf, lo, hi, self->start, self->end);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! RangeAppend(RangeObject *self, PyObject *args)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     return RBAppend(self->buf, args, self->start, self->end, &self->end);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! RangeRepr(RangeObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      static char repr[100];
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (self->buf->buf == INVALID_BUFFER_VALUE)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	vim_snprintf(repr, 100, "<range object (for deleted buffer) at %p>",
Karsten Hopp ae61a4
  								      (self));
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 2977,2983 ****
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	char *name = (char *)this->buf->buf->b_fname;
Karsten Hopp ae61a4
  	int len;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	if (name == NULL)
Karsten Hopp ae61a4
--- 2941,2947 ----
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	char *name = (char *)self->buf->buf->b_fname;
Karsten Hopp ae61a4
  	int len;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	if (name == NULL)
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 2989,3004 ****
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	vim_snprintf(repr, 100, "<range %s%s (%d:%d)>",
Karsten Hopp ae61a4
  		len > 45 ? "..." : "", name,
Karsten Hopp ae61a4
! 		this->start, this->end);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	return PyString_FromString(repr);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static struct PyMethodDef RangeMethods[] = {
Karsten Hopp ae61a4
!     /* name,	    function,		calling,    documentation */
Karsten Hopp ae61a4
!     {"append",	    RangeAppend,	1,	    "Append data to the Vim range" },
Karsten Hopp ae61a4
!     { NULL,	    NULL,		0,	    NULL }
Karsten Hopp ae61a4
  };
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static PyTypeObject BufferType;
Karsten Hopp ae61a4
--- 2953,2968 ----
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	vim_snprintf(repr, 100, "<range %s%s (%d:%d)>",
Karsten Hopp ae61a4
  		len > 45 ? "..." : "", name,
Karsten Hopp ae61a4
! 		self->start, self->end);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	return PyString_FromString(repr);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static struct PyMethodDef RangeMethods[] = {
Karsten Hopp ae61a4
!     /* name,	function,			calling,	documentation */
Karsten Hopp ae61a4
!     {"append",	(PyCFunction)RangeAppend,	METH_VARARGS,	"Append data to the Vim range" },
Karsten Hopp ae61a4
!     { NULL,	NULL,				0,		NULL }
Karsten Hopp ae61a4
  };
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static PyTypeObject BufferType;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 3045,3094 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! BufferDestructor(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     BufferObject *this = (BufferObject *)(self);
Karsten Hopp ae61a4
! 
Karsten Hopp ae61a4
!     if (this->buf && this->buf != INVALID_BUFFER_VALUE)
Karsten Hopp ae61a4
! 	BUF_PYTHON_REF(this->buf) = NULL;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DESTRUCTOR_FINISH(self);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyInt
Karsten Hopp ae61a4
! BufferLength(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      /* HOW DO WE SIGNAL AN ERROR FROM THIS FUNCTION? */
Karsten Hopp ae61a4
!     if (CheckBuffer((BufferObject *)(self)))
Karsten Hopp ae61a4
  	return -1; /* ??? */
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     return (PyInt)(((BufferObject *)(self))->buf->b_ml.ml_line_count);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! BufferItem(PyObject *self, PyInt n)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     return RBItem((BufferObject *)(self), n, 1, -1);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! BufferSlice(PyObject *self, PyInt lo, PyInt hi)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     return RBSlice((BufferObject *)(self), lo, hi, 1, -1);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! BufferAttr(BufferObject *this, char *name)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      if (strcmp(name, "name") == 0)
Karsten Hopp ae61a4
! 	return Py_BuildValue("s", this->buf->b_ffname);
Karsten Hopp ae61a4
      else if (strcmp(name, "number") == 0)
Karsten Hopp ae61a4
! 	return Py_BuildValue(Py_ssize_t_fmt, this->buf->b_fnum);
Karsten Hopp ae61a4
      else if (strcmp(name, "vars") == 0)
Karsten Hopp ae61a4
! 	return DictionaryNew(this->buf->b_vars);
Karsten Hopp ae61a4
      else if (strcmp(name, "options") == 0)
Karsten Hopp ae61a4
! 	return OptionsNew(SREQ_BUF, this->buf, (checkfun) CheckBuffer,
Karsten Hopp ae61a4
! 			(PyObject *) this);
Karsten Hopp ae61a4
      else if (strcmp(name,"__members__") == 0)
Karsten Hopp ae61a4
  	return Py_BuildValue("[ssss]", "name", "number", "vars", "options");
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
--- 3009,3056 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static void
Karsten Hopp ae61a4
! BufferDestructor(BufferObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     if (self->buf && self->buf != INVALID_BUFFER_VALUE)
Karsten Hopp ae61a4
! 	BUF_PYTHON_REF(self->buf) = NULL;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      DESTRUCTOR_FINISH(self);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyInt
Karsten Hopp ae61a4
! BufferLength(BufferObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      /* HOW DO WE SIGNAL AN ERROR FROM THIS FUNCTION? */
Karsten Hopp ae61a4
!     if (CheckBuffer(self))
Karsten Hopp ae61a4
  	return -1; /* ??? */
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     return (PyInt)(self->buf->b_ml.ml_line_count);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! BufferItem(BufferObject *self, PyInt n)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     return RBItem(self, n, 1, -1);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! BufferSlice(BufferObject *self, PyInt lo, PyInt hi)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     return RBSlice(self, lo, hi, 1, -1);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! BufferAttr(BufferObject *self, char *name)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      if (strcmp(name, "name") == 0)
Karsten Hopp ae61a4
! 	return Py_BuildValue("s", self->buf->b_ffname);
Karsten Hopp ae61a4
      else if (strcmp(name, "number") == 0)
Karsten Hopp ae61a4
! 	return Py_BuildValue(Py_ssize_t_fmt, self->buf->b_fnum);
Karsten Hopp ae61a4
      else if (strcmp(name, "vars") == 0)
Karsten Hopp ae61a4
! 	return DictionaryNew(self->buf->b_vars);
Karsten Hopp ae61a4
      else if (strcmp(name, "options") == 0)
Karsten Hopp ae61a4
! 	return OptionsNew(SREQ_BUF, self->buf, (checkfun) CheckBuffer,
Karsten Hopp ae61a4
! 			(PyObject *) self);
Karsten Hopp ae61a4
      else if (strcmp(name,"__members__") == 0)
Karsten Hopp ae61a4
  	return Py_BuildValue("[ssss]", "name", "number", "vars", "options");
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 3096,3122 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! BufferAppend(PyObject *self, PyObject *args)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     return RBAppend((BufferObject *)(self), args, 1, -1, NULL);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! BufferMark(PyObject *self, PyObject *args)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      pos_T	*posp;
Karsten Hopp ae61a4
      char	*pmark;
Karsten Hopp ae61a4
      char	mark;
Karsten Hopp ae61a4
      buf_T	*savebuf;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (CheckBuffer((BufferObject *)(self)))
Karsten Hopp ae61a4
  	return NULL;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (!PyArg_ParseTuple(args, "s", &pmark))
Karsten Hopp ae61a4
  	return NULL;
Karsten Hopp ae61a4
      mark = *pmark;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     switch_buffer(&savebuf, ((BufferObject *)(self))->buf);
Karsten Hopp ae61a4
      posp = getmark(mark, FALSE);
Karsten Hopp ae61a4
      restore_buffer(savebuf);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
--- 3058,3084 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! BufferAppend(BufferObject *self, PyObject *args)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     return RBAppend(self, args, 1, -1, NULL);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! BufferMark(BufferObject *self, PyObject *args)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      pos_T	*posp;
Karsten Hopp ae61a4
      char	*pmark;
Karsten Hopp ae61a4
      char	mark;
Karsten Hopp ae61a4
      buf_T	*savebuf;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (CheckBuffer(self))
Karsten Hopp ae61a4
  	return NULL;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (!PyArg_ParseTuple(args, "s", &pmark))
Karsten Hopp ae61a4
  	return NULL;
Karsten Hopp ae61a4
      mark = *pmark;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     switch_buffer(&savebuf, self->buf);
Karsten Hopp ae61a4
      posp = getmark(mark, FALSE);
Karsten Hopp ae61a4
      restore_buffer(savebuf);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 3141,3174 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! BufferRange(PyObject *self, PyObject *args)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      PyInt start;
Karsten Hopp ae61a4
      PyInt end;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (CheckBuffer((BufferObject *)(self)))
Karsten Hopp ae61a4
  	return NULL;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (!PyArg_ParseTuple(args, "nn", &start, &end))
Karsten Hopp ae61a4
  	return NULL;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     return RangeNew(((BufferObject *)(self))->buf, start, end);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! BufferRepr(PyObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      static char repr[100];
Karsten Hopp ae61a4
-     BufferObject *this = (BufferObject *)(self);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (this->buf == INVALID_BUFFER_VALUE)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	vim_snprintf(repr, 100, _("<buffer object (deleted) at %p>"), (self));
Karsten Hopp ae61a4
  	return PyString_FromString(repr);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	char *name = (char *)this->buf->b_fname;
Karsten Hopp ae61a4
  	PyInt len;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	if (name == NULL)
Karsten Hopp ae61a4
--- 3103,3135 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! BufferRange(BufferObject *self, PyObject *args)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      PyInt start;
Karsten Hopp ae61a4
      PyInt end;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (CheckBuffer(self))
Karsten Hopp ae61a4
  	return NULL;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      if (!PyArg_ParseTuple(args, "nn", &start, &end))
Karsten Hopp ae61a4
  	return NULL;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     return RangeNew(self->buf, start, end);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! BufferRepr(BufferObject *self)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      static char repr[100];
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     if (self->buf == INVALID_BUFFER_VALUE)
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	vim_snprintf(repr, 100, _("<buffer object (deleted) at %p>"), (self));
Karsten Hopp ae61a4
  	return PyString_FromString(repr);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	char *name = (char *)self->buf->b_fname;
Karsten Hopp ae61a4
  	PyInt len;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  	if (name == NULL)
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 3185,3198 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static struct PyMethodDef BufferMethods[] = {
Karsten Hopp ae61a4
!     /* name,	    function,		calling,    documentation */
Karsten Hopp ae61a4
!     {"append",	    BufferAppend,	1,	    "Append data to Vim buffer" },
Karsten Hopp ae61a4
!     {"mark",	    BufferMark,		1,	    "Return (row,col) representing position of named mark" },
Karsten Hopp ae61a4
!     {"range",	    BufferRange,	1,	    "Return a range object which represents the part of the given buffer between line numbers s and e" },
Karsten Hopp ae61a4
  #if PY_VERSION_HEX >= 0x03000000
Karsten Hopp ae61a4
!     {"__dir__",	    BufferDir,		4,	    "List its attributes" },
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
!     { NULL,	    NULL,		0,	    NULL }
Karsten Hopp ae61a4
  };
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  /*
Karsten Hopp ae61a4
--- 3146,3159 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static struct PyMethodDef BufferMethods[] = {
Karsten Hopp ae61a4
!     /* name,	    function,			calling,	documentation */
Karsten Hopp ae61a4
!     {"append",	    (PyCFunction)BufferAppend,	METH_VARARGS,	"Append data to Vim buffer" },
Karsten Hopp ae61a4
!     {"mark",	    (PyCFunction)BufferMark,	METH_VARARGS,	"Return (row,col) representing position of named mark" },
Karsten Hopp ae61a4
!     {"range",	    (PyCFunction)BufferRange,	METH_VARARGS,	"Return a range object which represents the part of the given buffer between line numbers s and e" },
Karsten Hopp ae61a4
  #if PY_VERSION_HEX >= 0x03000000
Karsten Hopp ae61a4
!     {"__dir__",	    (PyCFunction)BufferDir,	METH_NOARGS,	"List buffer attributes" },
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
!     { NULL,	    NULL,			0,		NULL }
Karsten Hopp ae61a4
  };
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  /*
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 4021,4034 ****
Karsten Hopp ae61a4
      OutputType.tp_doc = "vim message object";
Karsten Hopp ae61a4
      OutputType.tp_methods = OutputMethods;
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
!     OutputType.tp_getattro = OutputGetattro;
Karsten Hopp ae61a4
!     OutputType.tp_setattro = OutputSetattro;
Karsten Hopp ae61a4
      OutputType.tp_alloc = call_PyType_GenericAlloc;
Karsten Hopp ae61a4
      OutputType.tp_new = call_PyType_GenericNew;
Karsten Hopp ae61a4
      OutputType.tp_free = call_PyObject_Free;
Karsten Hopp ae61a4
  #else
Karsten Hopp ae61a4
!     OutputType.tp_getattr = OutputGetattr;
Karsten Hopp ae61a4
!     OutputType.tp_setattr = OutputSetattr;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&IterType, 0, sizeof(IterType));
Karsten Hopp ae61a4
--- 3982,3995 ----
Karsten Hopp ae61a4
      OutputType.tp_doc = "vim message object";
Karsten Hopp ae61a4
      OutputType.tp_methods = OutputMethods;
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
!     OutputType.tp_getattro = (getattrofunc)OutputGetattro;
Karsten Hopp ae61a4
!     OutputType.tp_setattro = (setattrofunc)OutputSetattro;
Karsten Hopp ae61a4
      OutputType.tp_alloc = call_PyType_GenericAlloc;
Karsten Hopp ae61a4
      OutputType.tp_new = call_PyType_GenericNew;
Karsten Hopp ae61a4
      OutputType.tp_free = call_PyObject_Free;
Karsten Hopp ae61a4
  #else
Karsten Hopp ae61a4
!     OutputType.tp_getattr = (getattrfunc)OutputGetattr;
Karsten Hopp ae61a4
!     OutputType.tp_setattr = (setattrfunc)OutputSetattr;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&IterType, 0, sizeof(IterType));
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 4036,4102 ****
Karsten Hopp ae61a4
      IterType.tp_basicsize = sizeof(IterObject);
Karsten Hopp ae61a4
      IterType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      IterType.tp_doc = "generic iterator object";
Karsten Hopp ae61a4
!     IterType.tp_iter = IterIter;
Karsten Hopp ae61a4
!     IterType.tp_iternext = IterNext;
Karsten Hopp ae61a4
!     IterType.tp_dealloc = IterDestructor;
Karsten Hopp ae61a4
!     IterType.tp_traverse = IterTraverse;
Karsten Hopp ae61a4
!     IterType.tp_clear = IterClear;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&BufferType, 0, sizeof(BufferType));
Karsten Hopp ae61a4
      BufferType.tp_name = "vim.buffer";
Karsten Hopp ae61a4
      BufferType.tp_basicsize = sizeof(BufferType);
Karsten Hopp ae61a4
!     BufferType.tp_dealloc = BufferDestructor;
Karsten Hopp ae61a4
!     BufferType.tp_repr = BufferRepr;
Karsten Hopp ae61a4
      BufferType.tp_as_sequence = &BufferAsSeq;
Karsten Hopp ae61a4
      BufferType.tp_as_mapping = &BufferAsMapping;
Karsten Hopp ae61a4
      BufferType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      BufferType.tp_doc = "vim buffer object";
Karsten Hopp ae61a4
      BufferType.tp_methods = BufferMethods;
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
!     BufferType.tp_getattro = BufferGetattro;
Karsten Hopp ae61a4
      BufferType.tp_alloc = call_PyType_GenericAlloc;
Karsten Hopp ae61a4
      BufferType.tp_new = call_PyType_GenericNew;
Karsten Hopp ae61a4
      BufferType.tp_free = call_PyObject_Free;
Karsten Hopp ae61a4
  #else
Karsten Hopp ae61a4
!     BufferType.tp_getattr = BufferGetattr;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&WindowType, 0, sizeof(WindowType));
Karsten Hopp ae61a4
      WindowType.tp_name = "vim.window";
Karsten Hopp ae61a4
      WindowType.tp_basicsize = sizeof(WindowObject);
Karsten Hopp ae61a4
!     WindowType.tp_dealloc = WindowDestructor;
Karsten Hopp ae61a4
!     WindowType.tp_repr = WindowRepr;
Karsten Hopp ae61a4
      WindowType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      WindowType.tp_doc = "vim Window object";
Karsten Hopp ae61a4
      WindowType.tp_methods = WindowMethods;
Karsten Hopp ae61a4
!     WindowType.tp_traverse = WindowTraverse;
Karsten Hopp ae61a4
!     WindowType.tp_clear = WindowClear;
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
!     WindowType.tp_getattro = WindowGetattro;
Karsten Hopp ae61a4
!     WindowType.tp_setattro = WindowSetattro;
Karsten Hopp ae61a4
      WindowType.tp_alloc = call_PyType_GenericAlloc;
Karsten Hopp ae61a4
      WindowType.tp_new = call_PyType_GenericNew;
Karsten Hopp ae61a4
      WindowType.tp_free = call_PyObject_Free;
Karsten Hopp ae61a4
  #else
Karsten Hopp ae61a4
!     WindowType.tp_getattr = WindowGetattr;
Karsten Hopp ae61a4
!     WindowType.tp_setattr = WindowSetattr;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&TabPageType, 0, sizeof(TabPageType));
Karsten Hopp ae61a4
      TabPageType.tp_name = "vim.tabpage";
Karsten Hopp ae61a4
      TabPageType.tp_basicsize = sizeof(TabPageObject);
Karsten Hopp ae61a4
!     TabPageType.tp_dealloc = TabPageDestructor;
Karsten Hopp ae61a4
!     TabPageType.tp_repr = TabPageRepr;
Karsten Hopp ae61a4
      TabPageType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      TabPageType.tp_doc = "vim tab page object";
Karsten Hopp ae61a4
      TabPageType.tp_methods = TabPageMethods;
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
!     TabPageType.tp_getattro = TabPageGetattro;
Karsten Hopp ae61a4
      TabPageType.tp_alloc = call_PyType_GenericAlloc;
Karsten Hopp ae61a4
      TabPageType.tp_new = call_PyType_GenericNew;
Karsten Hopp ae61a4
      TabPageType.tp_free = call_PyObject_Free;
Karsten Hopp ae61a4
  #else
Karsten Hopp ae61a4
!     TabPageType.tp_getattr = TabPageGetattr;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&BufMapType, 0, sizeof(BufMapType));
Karsten Hopp ae61a4
--- 3997,4063 ----
Karsten Hopp ae61a4
      IterType.tp_basicsize = sizeof(IterObject);
Karsten Hopp ae61a4
      IterType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      IterType.tp_doc = "generic iterator object";
Karsten Hopp ae61a4
!     IterType.tp_iter = (getiterfunc)IterIter;
Karsten Hopp ae61a4
!     IterType.tp_iternext = (iternextfunc)IterNext;
Karsten Hopp ae61a4
!     IterType.tp_dealloc = (destructor)IterDestructor;
Karsten Hopp ae61a4
!     IterType.tp_traverse = (traverseproc)IterTraverse;
Karsten Hopp ae61a4
!     IterType.tp_clear = (inquiry)IterClear;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&BufferType, 0, sizeof(BufferType));
Karsten Hopp ae61a4
      BufferType.tp_name = "vim.buffer";
Karsten Hopp ae61a4
      BufferType.tp_basicsize = sizeof(BufferType);
Karsten Hopp ae61a4
!     BufferType.tp_dealloc = (destructor)BufferDestructor;
Karsten Hopp ae61a4
!     BufferType.tp_repr = (reprfunc)BufferRepr;
Karsten Hopp ae61a4
      BufferType.tp_as_sequence = &BufferAsSeq;
Karsten Hopp ae61a4
      BufferType.tp_as_mapping = &BufferAsMapping;
Karsten Hopp ae61a4
      BufferType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      BufferType.tp_doc = "vim buffer object";
Karsten Hopp ae61a4
      BufferType.tp_methods = BufferMethods;
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
!     BufferType.tp_getattro = (getattrofunc)BufferGetattro;
Karsten Hopp ae61a4
      BufferType.tp_alloc = call_PyType_GenericAlloc;
Karsten Hopp ae61a4
      BufferType.tp_new = call_PyType_GenericNew;
Karsten Hopp ae61a4
      BufferType.tp_free = call_PyObject_Free;
Karsten Hopp ae61a4
  #else
Karsten Hopp ae61a4
!     BufferType.tp_getattr = (getattrfunc)BufferGetattr;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&WindowType, 0, sizeof(WindowType));
Karsten Hopp ae61a4
      WindowType.tp_name = "vim.window";
Karsten Hopp ae61a4
      WindowType.tp_basicsize = sizeof(WindowObject);
Karsten Hopp ae61a4
!     WindowType.tp_dealloc = (destructor)WindowDestructor;
Karsten Hopp ae61a4
!     WindowType.tp_repr = (reprfunc)WindowRepr;
Karsten Hopp ae61a4
      WindowType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      WindowType.tp_doc = "vim Window object";
Karsten Hopp ae61a4
      WindowType.tp_methods = WindowMethods;
Karsten Hopp ae61a4
!     WindowType.tp_traverse = (traverseproc)WindowTraverse;
Karsten Hopp ae61a4
!     WindowType.tp_clear = (inquiry)WindowClear;
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
!     WindowType.tp_getattro = (getattrofunc)WindowGetattro;
Karsten Hopp ae61a4
!     WindowType.tp_setattro = (setattrofunc)WindowSetattro;
Karsten Hopp ae61a4
      WindowType.tp_alloc = call_PyType_GenericAlloc;
Karsten Hopp ae61a4
      WindowType.tp_new = call_PyType_GenericNew;
Karsten Hopp ae61a4
      WindowType.tp_free = call_PyObject_Free;
Karsten Hopp ae61a4
  #else
Karsten Hopp ae61a4
!     WindowType.tp_getattr = (getattrfunc)WindowGetattr;
Karsten Hopp ae61a4
!     WindowType.tp_setattr = (setattrfunc)WindowSetattr;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&TabPageType, 0, sizeof(TabPageType));
Karsten Hopp ae61a4
      TabPageType.tp_name = "vim.tabpage";
Karsten Hopp ae61a4
      TabPageType.tp_basicsize = sizeof(TabPageObject);
Karsten Hopp ae61a4
!     TabPageType.tp_dealloc = (destructor)TabPageDestructor;
Karsten Hopp ae61a4
!     TabPageType.tp_repr = (reprfunc)TabPageRepr;
Karsten Hopp ae61a4
      TabPageType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      TabPageType.tp_doc = "vim tab page object";
Karsten Hopp ae61a4
      TabPageType.tp_methods = TabPageMethods;
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
!     TabPageType.tp_getattro = (getattrofunc)TabPageGetattro;
Karsten Hopp ae61a4
      TabPageType.tp_alloc = call_PyType_GenericAlloc;
Karsten Hopp ae61a4
      TabPageType.tp_new = call_PyType_GenericNew;
Karsten Hopp ae61a4
      TabPageType.tp_free = call_PyObject_Free;
Karsten Hopp ae61a4
  #else
Karsten Hopp ae61a4
!     TabPageType.tp_getattr = (getattrfunc)TabPageGetattr;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&BufMapType, 0, sizeof(BufMapType));
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 4113,4119 ****
Karsten Hopp ae61a4
      WinListType.tp_as_sequence = &WinListAsSeq;
Karsten Hopp ae61a4
      WinListType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      WinListType.tp_doc = "vim window list";
Karsten Hopp ae61a4
!     WinListType.tp_dealloc = WinListDestructor;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&TabListType, 0, sizeof(TabListType));
Karsten Hopp ae61a4
      TabListType.tp_name = "vim.tabpagelist";
Karsten Hopp ae61a4
--- 4074,4080 ----
Karsten Hopp ae61a4
      WinListType.tp_as_sequence = &WinListAsSeq;
Karsten Hopp ae61a4
      WinListType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      WinListType.tp_doc = "vim window list";
Karsten Hopp ae61a4
!     WinListType.tp_dealloc = (destructor)WinListDestructor;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&TabListType, 0, sizeof(TabListType));
Karsten Hopp ae61a4
      TabListType.tp_name = "vim.tabpagelist";
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 4125,4144 ****
Karsten Hopp ae61a4
      vim_memset(&RangeType, 0, sizeof(RangeType));
Karsten Hopp ae61a4
      RangeType.tp_name = "vim.range";
Karsten Hopp ae61a4
      RangeType.tp_basicsize = sizeof(RangeObject);
Karsten Hopp ae61a4
!     RangeType.tp_dealloc = RangeDestructor;
Karsten Hopp ae61a4
!     RangeType.tp_repr = RangeRepr;
Karsten Hopp ae61a4
      RangeType.tp_as_sequence = &RangeAsSeq;
Karsten Hopp ae61a4
      RangeType.tp_as_mapping = &RangeAsMapping;
Karsten Hopp ae61a4
      RangeType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      RangeType.tp_doc = "vim Range object";
Karsten Hopp ae61a4
      RangeType.tp_methods = RangeMethods;
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
!     RangeType.tp_getattro = RangeGetattro;
Karsten Hopp ae61a4
      RangeType.tp_alloc = call_PyType_GenericAlloc;
Karsten Hopp ae61a4
      RangeType.tp_new = call_PyType_GenericNew;
Karsten Hopp ae61a4
      RangeType.tp_free = call_PyObject_Free;
Karsten Hopp ae61a4
  #else
Karsten Hopp ae61a4
!     RangeType.tp_getattr = RangeGetattr;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&CurrentType, 0, sizeof(CurrentType));
Karsten Hopp ae61a4
--- 4086,4105 ----
Karsten Hopp ae61a4
      vim_memset(&RangeType, 0, sizeof(RangeType));
Karsten Hopp ae61a4
      RangeType.tp_name = "vim.range";
Karsten Hopp ae61a4
      RangeType.tp_basicsize = sizeof(RangeObject);
Karsten Hopp ae61a4
!     RangeType.tp_dealloc = (destructor)RangeDestructor;
Karsten Hopp ae61a4
!     RangeType.tp_repr = (reprfunc)RangeRepr;
Karsten Hopp ae61a4
      RangeType.tp_as_sequence = &RangeAsSeq;
Karsten Hopp ae61a4
      RangeType.tp_as_mapping = &RangeAsMapping;
Karsten Hopp ae61a4
      RangeType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      RangeType.tp_doc = "vim Range object";
Karsten Hopp ae61a4
      RangeType.tp_methods = RangeMethods;
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
!     RangeType.tp_getattro = (getattrofunc)RangeGetattro;
Karsten Hopp ae61a4
      RangeType.tp_alloc = call_PyType_GenericAlloc;
Karsten Hopp ae61a4
      RangeType.tp_new = call_PyType_GenericNew;
Karsten Hopp ae61a4
      RangeType.tp_free = call_PyObject_Free;
Karsten Hopp ae61a4
  #else
Karsten Hopp ae61a4
!     RangeType.tp_getattr = (getattrfunc)RangeGetattr;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&CurrentType, 0, sizeof(CurrentType));
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 4147,4205 ****
Karsten Hopp ae61a4
      CurrentType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      CurrentType.tp_doc = "vim current object";
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
!     CurrentType.tp_getattro = CurrentGetattro;
Karsten Hopp ae61a4
!     CurrentType.tp_setattro = CurrentSetattro;
Karsten Hopp ae61a4
  #else
Karsten Hopp ae61a4
!     CurrentType.tp_getattr = CurrentGetattr;
Karsten Hopp ae61a4
!     CurrentType.tp_setattr = CurrentSetattr;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&DictionaryType, 0, sizeof(DictionaryType));
Karsten Hopp ae61a4
      DictionaryType.tp_name = "vim.dictionary";
Karsten Hopp ae61a4
      DictionaryType.tp_basicsize = sizeof(DictionaryObject);
Karsten Hopp ae61a4
!     DictionaryType.tp_dealloc = DictionaryDestructor;
Karsten Hopp ae61a4
      DictionaryType.tp_as_mapping = &DictionaryAsMapping;
Karsten Hopp ae61a4
      DictionaryType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      DictionaryType.tp_doc = "dictionary pushing modifications to vim structure";
Karsten Hopp ae61a4
      DictionaryType.tp_methods = DictionaryMethods;
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
!     DictionaryType.tp_getattro = DictionaryGetattro;
Karsten Hopp ae61a4
!     DictionaryType.tp_setattro = DictionarySetattro;
Karsten Hopp ae61a4
  #else
Karsten Hopp ae61a4
!     DictionaryType.tp_getattr = DictionaryGetattr;
Karsten Hopp ae61a4
!     DictionaryType.tp_setattr = DictionarySetattr;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&ListType, 0, sizeof(ListType));
Karsten Hopp ae61a4
      ListType.tp_name = "vim.list";
Karsten Hopp ae61a4
!     ListType.tp_dealloc = ListDestructor;
Karsten Hopp ae61a4
      ListType.tp_basicsize = sizeof(ListObject);
Karsten Hopp ae61a4
      ListType.tp_as_sequence = &ListAsSeq;
Karsten Hopp ae61a4
      ListType.tp_as_mapping = &ListAsMapping;
Karsten Hopp ae61a4
      ListType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      ListType.tp_doc = "list pushing modifications to vim structure";
Karsten Hopp ae61a4
      ListType.tp_methods = ListMethods;
Karsten Hopp ae61a4
!     ListType.tp_iter = ListIter;
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
!     ListType.tp_getattro = ListGetattro;
Karsten Hopp ae61a4
!     ListType.tp_setattro = ListSetattro;
Karsten Hopp ae61a4
  #else
Karsten Hopp ae61a4
!     ListType.tp_getattr = ListGetattr;
Karsten Hopp ae61a4
!     ListType.tp_setattr = ListSetattr;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&FunctionType, 0, sizeof(FunctionType));
Karsten Hopp ae61a4
      FunctionType.tp_name = "vim.function";
Karsten Hopp ae61a4
      FunctionType.tp_basicsize = sizeof(FunctionObject);
Karsten Hopp ae61a4
!     FunctionType.tp_dealloc = FunctionDestructor;
Karsten Hopp ae61a4
!     FunctionType.tp_call = FunctionCall;
Karsten Hopp ae61a4
      FunctionType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      FunctionType.tp_doc = "object that calls vim function";
Karsten Hopp ae61a4
      FunctionType.tp_methods = FunctionMethods;
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
!     FunctionType.tp_getattro = FunctionGetattro;
Karsten Hopp ae61a4
  #else
Karsten Hopp ae61a4
!     FunctionType.tp_getattr = FunctionGetattr;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&OptionsType, 0, sizeof(OptionsType));
Karsten Hopp ae61a4
--- 4108,4166 ----
Karsten Hopp ae61a4
      CurrentType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      CurrentType.tp_doc = "vim current object";
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
!     CurrentType.tp_getattro = (getattrofunc)CurrentGetattro;
Karsten Hopp ae61a4
!     CurrentType.tp_setattro = (setattrofunc)CurrentSetattro;
Karsten Hopp ae61a4
  #else
Karsten Hopp ae61a4
!     CurrentType.tp_getattr = (getattrfunc)CurrentGetattr;
Karsten Hopp ae61a4
!     CurrentType.tp_setattr = (setattrfunc)CurrentSetattr;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&DictionaryType, 0, sizeof(DictionaryType));
Karsten Hopp ae61a4
      DictionaryType.tp_name = "vim.dictionary";
Karsten Hopp ae61a4
      DictionaryType.tp_basicsize = sizeof(DictionaryObject);
Karsten Hopp ae61a4
!     DictionaryType.tp_dealloc = (destructor)DictionaryDestructor;
Karsten Hopp ae61a4
      DictionaryType.tp_as_mapping = &DictionaryAsMapping;
Karsten Hopp ae61a4
      DictionaryType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      DictionaryType.tp_doc = "dictionary pushing modifications to vim structure";
Karsten Hopp ae61a4
      DictionaryType.tp_methods = DictionaryMethods;
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
!     DictionaryType.tp_getattro = (getattrofunc)DictionaryGetattro;
Karsten Hopp ae61a4
!     DictionaryType.tp_setattro = (setattrofunc)DictionarySetattro;
Karsten Hopp ae61a4
  #else
Karsten Hopp ae61a4
!     DictionaryType.tp_getattr = (getattrfunc)DictionaryGetattr;
Karsten Hopp ae61a4
!     DictionaryType.tp_setattr = (setattrfunc)DictionarySetattr;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&ListType, 0, sizeof(ListType));
Karsten Hopp ae61a4
      ListType.tp_name = "vim.list";
Karsten Hopp ae61a4
!     ListType.tp_dealloc = (destructor)ListDestructor;
Karsten Hopp ae61a4
      ListType.tp_basicsize = sizeof(ListObject);
Karsten Hopp ae61a4
      ListType.tp_as_sequence = &ListAsSeq;
Karsten Hopp ae61a4
      ListType.tp_as_mapping = &ListAsMapping;
Karsten Hopp ae61a4
      ListType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      ListType.tp_doc = "list pushing modifications to vim structure";
Karsten Hopp ae61a4
      ListType.tp_methods = ListMethods;
Karsten Hopp ae61a4
!     ListType.tp_iter = (getiterfunc)ListIter;
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
!     ListType.tp_getattro = (getattrofunc)ListGetattro;
Karsten Hopp ae61a4
!     ListType.tp_setattro = (setattrofunc)ListSetattro;
Karsten Hopp ae61a4
  #else
Karsten Hopp ae61a4
!     ListType.tp_getattr = (getattrfunc)ListGetattr;
Karsten Hopp ae61a4
!     ListType.tp_setattr = (setattrfunc)ListSetattr;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&FunctionType, 0, sizeof(FunctionType));
Karsten Hopp ae61a4
      FunctionType.tp_name = "vim.function";
Karsten Hopp ae61a4
      FunctionType.tp_basicsize = sizeof(FunctionObject);
Karsten Hopp ae61a4
!     FunctionType.tp_dealloc = (destructor)FunctionDestructor;
Karsten Hopp ae61a4
!     FunctionType.tp_call = (ternaryfunc)FunctionCall;
Karsten Hopp ae61a4
      FunctionType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      FunctionType.tp_doc = "object that calls vim function";
Karsten Hopp ae61a4
      FunctionType.tp_methods = FunctionMethods;
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
!     FunctionType.tp_getattro = (getattrofunc)FunctionGetattro;
Karsten Hopp ae61a4
  #else
Karsten Hopp ae61a4
!     FunctionType.tp_getattr = (getattrfunc)FunctionGetattr;
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      vim_memset(&OptionsType, 0, sizeof(OptionsType));
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 4208,4216 ****
Karsten Hopp ae61a4
      OptionsType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      OptionsType.tp_doc = "object for manipulating options";
Karsten Hopp ae61a4
      OptionsType.tp_as_mapping = &OptionsAsMapping;
Karsten Hopp ae61a4
!     OptionsType.tp_dealloc = OptionsDestructor;
Karsten Hopp ae61a4
!     OptionsType.tp_traverse = OptionsTraverse;
Karsten Hopp ae61a4
!     OptionsType.tp_clear = OptionsClear;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
      vim_memset(&vimmodule, 0, sizeof(vimmodule));
Karsten Hopp ae61a4
--- 4169,4177 ----
Karsten Hopp ae61a4
      OptionsType.tp_flags = Py_TPFLAGS_DEFAULT;
Karsten Hopp ae61a4
      OptionsType.tp_doc = "object for manipulating options";
Karsten Hopp ae61a4
      OptionsType.tp_as_mapping = &OptionsAsMapping;
Karsten Hopp ae61a4
!     OptionsType.tp_dealloc = (destructor)OptionsDestructor;
Karsten Hopp ae61a4
!     OptionsType.tp_traverse = (traverseproc)OptionsTraverse;
Karsten Hopp ae61a4
!     OptionsType.tp_clear = (inquiry)OptionsClear;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  #if PY_MAJOR_VERSION >= 3
Karsten Hopp ae61a4
      vim_memset(&vimmodule, 0, sizeof(vimmodule));
Karsten Hopp ae61a4
*** ../vim-7.3.991/src/if_python3.c	2013-05-21 18:19:33.000000000 +0200
Karsten Hopp ae61a4
--- src/if_python3.c	2013-05-21 18:22:03.000000000 +0200
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 68,75 ****
Karsten Hopp ae61a4
  # define PY_SSIZE_T_CLEAN
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
- static void init_structs(void);
Karsten Hopp ae61a4
- 
Karsten Hopp ae61a4
  /* The "surrogateescape" error handler is new in Python 3.1 */
Karsten Hopp ae61a4
  #if PY_VERSION_HEX >= 0x030100f0
Karsten Hopp ae61a4
  # define CODEC_ERROR_HANDLER "surrogateescape"
Karsten Hopp ae61a4
--- 68,73 ----
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 610,617 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  #endif /* DYNAMIC_PYTHON3 */
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
- static PyObject *BufferDir(PyObject *, PyObject *);
Karsten Hopp ae61a4
- 
Karsten Hopp ae61a4
  static int py3initialised = 0;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  #define PYINITIALISED py3initialised
Karsten Hopp ae61a4
--- 608,613 ----
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 670,675 ****
Karsten Hopp ae61a4
--- 666,672 ----
Karsten Hopp ae61a4
      return PyType_GenericAlloc(type,nitems);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
+ static PyObject *BufferDir(PyObject *);
Karsten Hopp ae61a4
  static PyObject *OutputGetattro(PyObject *, PyObject *);
Karsten Hopp ae61a4
  static int OutputSetattro(PyObject *, PyObject *, PyObject *);
Karsten Hopp ae61a4
  static PyObject *BufferGetattro(PyObject *, PyObject *);
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1008,1014 ****
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      GET_ATTR_STRING(name, nameobj);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     return OutputSetattr(self, name, val);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  /***************/
Karsten Hopp ae61a4
--- 1005,1011 ----
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      GET_ATTR_STRING(name, nameobj);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     return OutputSetattr((OutputObject *)(self), name, val);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  /***************/
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1036,1047 ****
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  #define BufferType_Check(obj) ((obj)->ob_base.ob_type == &BufferType)
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
- static Py_ssize_t BufferLength(PyObject *);
Karsten Hopp ae61a4
- static PyObject *BufferItem(PyObject *, Py_ssize_t);
Karsten Hopp ae61a4
  static PyObject* BufferSubscript(PyObject *self, PyObject *idx);
Karsten Hopp ae61a4
  static Py_ssize_t BufferAsSubscript(PyObject *self, PyObject *idx, PyObject *val);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
- 
Karsten Hopp ae61a4
  /* Line range type - Implementation functions
Karsten Hopp ae61a4
   * --------------------------------------
Karsten Hopp ae61a4
   */
Karsten Hopp ae61a4
--- 1033,1041 ----
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1097,1103 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! BufferDir(PyObject *self UNUSED, PyObject *args UNUSED)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      return Py_BuildValue("[sssss]", "name", "number",
Karsten Hopp ae61a4
  						   "append", "mark", "range");
Karsten Hopp ae61a4
--- 1091,1097 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! BufferDir(PyObject *self UNUSED)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      return Py_BuildValue("[sssss]", "name", "number",
Karsten Hopp ae61a4
  						   "append", "mark", "range");
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1111,1117 ****
Karsten Hopp ae61a4
      if (PyLong_Check(idx))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	long _idx = PyLong_AsLong(idx);
Karsten Hopp ae61a4
! 	return BufferItem(self,_idx);
Karsten Hopp ae61a4
      } else if (PySlice_Check(idx))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	Py_ssize_t start, stop, step, slicelen;
Karsten Hopp ae61a4
--- 1105,1111 ----
Karsten Hopp ae61a4
      if (PyLong_Check(idx))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	long _idx = PyLong_AsLong(idx);
Karsten Hopp ae61a4
! 	return BufferItem((BufferObject *)(self), _idx);
Karsten Hopp ae61a4
      } else if (PySlice_Check(idx))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	Py_ssize_t start, stop, step, slicelen;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1126,1132 ****
Karsten Hopp ae61a4
  	{
Karsten Hopp ae61a4
  	    return NULL;
Karsten Hopp ae61a4
  	}
Karsten Hopp ae61a4
! 	return BufferSlice(self, start, stop);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
--- 1120,1126 ----
Karsten Hopp ae61a4
  	{
Karsten Hopp ae61a4
  	    return NULL;
Karsten Hopp ae61a4
  	}
Karsten Hopp ae61a4
! 	return BufferSlice((BufferObject *)(self), start, stop);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1230,1236 ****
Karsten Hopp ae61a4
      if (PyLong_Check(idx))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	long _idx = PyLong_AsLong(idx);
Karsten Hopp ae61a4
! 	return RangeItem(self,_idx);
Karsten Hopp ae61a4
      } else if (PySlice_Check(idx))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	Py_ssize_t start, stop, step, slicelen;
Karsten Hopp ae61a4
--- 1224,1230 ----
Karsten Hopp ae61a4
      if (PyLong_Check(idx))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	long _idx = PyLong_AsLong(idx);
Karsten Hopp ae61a4
! 	return RangeItem((RangeObject *)(self), _idx);
Karsten Hopp ae61a4
      } else if (PySlice_Check(idx))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	Py_ssize_t start, stop, step, slicelen;
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1242,1248 ****
Karsten Hopp ae61a4
  	{
Karsten Hopp ae61a4
  	    return NULL;
Karsten Hopp ae61a4
  	}
Karsten Hopp ae61a4
! 	return RangeSlice(self, start, stop);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
--- 1236,1242 ----
Karsten Hopp ae61a4
  	{
Karsten Hopp ae61a4
  	    return NULL;
Karsten Hopp ae61a4
  	}
Karsten Hopp ae61a4
! 	return RangeSlice((RangeObject *)(self), start, stop);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1323,1329 ****
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      GET_ATTR_STRING(name, nameobj);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     return WindowSetattr(self, name, val);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  /* Tab page list object - Definitions
Karsten Hopp ae61a4
--- 1317,1323 ----
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      GET_ATTR_STRING(name, nameobj);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
!     return WindowSetattr((WindowObject *)(self), name, val);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  /* Tab page list object - Definitions
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1377,1384 ****
Karsten Hopp ae61a4
  /* Dictionary object - Definitions
Karsten Hopp ae61a4
   */
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
- static PyInt DictionaryLength(PyObject *);
Karsten Hopp ae61a4
- 
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
  DictionaryGetattro(PyObject *self, PyObject *nameobj)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
--- 1371,1376 ----
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1398,1412 ****
Karsten Hopp ae61a4
  DictionarySetattro(PyObject *self, PyObject *nameobj, PyObject *val)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      GET_ATTR_STRING(name, nameobj);
Karsten Hopp ae61a4
!     return DictionarySetattr(self, name, val);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  /* List object - Definitions
Karsten Hopp ae61a4
   */
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
- static PyInt ListLength(PyObject *);
Karsten Hopp ae61a4
- static PyObject *ListItem(PyObject *, Py_ssize_t);
Karsten Hopp ae61a4
- 
Karsten Hopp ae61a4
  static PySequenceMethods ListAsSeq = {
Karsten Hopp ae61a4
      (lenfunc)		ListLength,	 /* sq_length,	  len(x)   */
Karsten Hopp ae61a4
      (binaryfunc)	0,		 /* RangeConcat, sq_concat,  x+y   */
Karsten Hopp ae61a4
--- 1390,1401 ----
Karsten Hopp ae61a4
  DictionarySetattro(PyObject *self, PyObject *nameobj, PyObject *val)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      GET_ATTR_STRING(name, nameobj);
Karsten Hopp ae61a4
!     return DictionarySetattr((DictionaryObject *)(self), name, val);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  /* List object - Definitions
Karsten Hopp ae61a4
   */
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  static PySequenceMethods ListAsSeq = {
Karsten Hopp ae61a4
      (lenfunc)		ListLength,	 /* sq_length,	  len(x)   */
Karsten Hopp ae61a4
      (binaryfunc)	0,		 /* RangeConcat, sq_concat,  x+y   */
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1430,1450 ****
Karsten Hopp ae61a4
  };
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! ListSubscript(PyObject *self, PyObject* idxObject)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     if (PyLong_Check(idxObject))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	long idx = PyLong_AsLong(idxObject);
Karsten Hopp ae61a4
! 	return ListItem(self, idx);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
!     else if (PySlice_Check(idxObject))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	Py_ssize_t start, stop, step, slicelen;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
! 	if (PySlice_GetIndicesEx(idxObject, ListLength(self), &start, &stop,
Karsten Hopp ae61a4
! 				 &step, &slicelen) < 0)
Karsten Hopp ae61a4
  	    return NULL;
Karsten Hopp ae61a4
! 	return ListSlice(self, start, stop);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
--- 1419,1439 ----
Karsten Hopp ae61a4
  };
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static PyObject *
Karsten Hopp ae61a4
! ListSubscript(PyObject *self, PyObject* idx)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     if (PyLong_Check(idx))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	long _idx = PyLong_AsLong(idx);
Karsten Hopp ae61a4
! 	return ListItem((ListObject *)(self), _idx);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
!     else if (PySlice_Check(idx))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	Py_ssize_t start, stop, step, slicelen;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
! 	if (PySlice_GetIndicesEx(idx, ListLength((ListObject *)(self)),
Karsten Hopp ae61a4
! 				 &start, &stop, &step, &slicelen) < 0)
Karsten Hopp ae61a4
  	    return NULL;
Karsten Hopp ae61a4
! 	return ListSlice((ListObject *)(self), start, stop);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1454,1474 ****
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static Py_ssize_t
Karsten Hopp ae61a4
! ListAsSubscript(PyObject *self, PyObject *idxObject, PyObject *obj)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     if (PyLong_Check(idxObject))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	long idx = PyLong_AsLong(idxObject);
Karsten Hopp ae61a4
! 	return ListAssItem(self, idx, obj);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
!     else if (PySlice_Check(idxObject))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	Py_ssize_t start, stop, step, slicelen;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
! 	if (PySlice_GetIndicesEx(idxObject, ListLength(self), &start, &stop,
Karsten Hopp ae61a4
! 				 &step, &slicelen) < 0)
Karsten Hopp ae61a4
  	    return -1;
Karsten Hopp ae61a4
! 	return ListAssSlice(self, start, stop, obj);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
--- 1443,1463 ----
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
      static Py_ssize_t
Karsten Hopp ae61a4
! ListAsSubscript(PyObject *self, PyObject *idx, PyObject *obj)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
!     if (PyLong_Check(idx))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
! 	long _idx = PyLong_AsLong(idx);
Karsten Hopp ae61a4
! 	return ListAssItem((ListObject *)(self), _idx, obj);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
!     else if (PySlice_Check(idx))
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
  	Py_ssize_t start, stop, step, slicelen;
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
! 	if (PySlice_GetIndicesEx(idx, ListLength((ListObject *)(self)),
Karsten Hopp ae61a4
! 				 &start, &stop, &step, &slicelen) < 0)
Karsten Hopp ae61a4
  	    return -1;
Karsten Hopp ae61a4
! 	return ListAssSlice((ListObject *)(self), start, stop, obj);
Karsten Hopp ae61a4
      }
Karsten Hopp ae61a4
      else
Karsten Hopp ae61a4
      {
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1492,1498 ****
Karsten Hopp ae61a4
  ListSetattro(PyObject *self, PyObject *nameobj, PyObject *val)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      GET_ATTR_STRING(name, nameobj);
Karsten Hopp ae61a4
!     return ListSetattr(self, name, val);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  /* Function object - Definitions
Karsten Hopp ae61a4
--- 1481,1487 ----
Karsten Hopp ae61a4
  ListSetattro(PyObject *self, PyObject *nameobj, PyObject *val)
Karsten Hopp ae61a4
  {
Karsten Hopp ae61a4
      GET_ATTR_STRING(name, nameobj);
Karsten Hopp ae61a4
!     return ListSetattr((ListObject *)(self), name, val);
Karsten Hopp ae61a4
  }
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  /* Function object - Definitions
Karsten Hopp ae61a4
*** ../vim-7.3.991/src/if_python.c	2013-05-21 18:19:33.000000000 +0200
Karsten Hopp ae61a4
--- src/if_python.c	2013-05-21 18:22:03.000000000 +0200
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 56,63 ****
Karsten Hopp ae61a4
  # define PY_SSIZE_T_CLEAN
Karsten Hopp ae61a4
  #endif
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
- static void init_structs(void);
Karsten Hopp ae61a4
- 
Karsten Hopp ae61a4
  #define PyBytes_FromString PyString_FromString
Karsten Hopp ae61a4
  #define PyBytes_Check PyString_Check
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
--- 56,61 ----
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 659,674 ****
Karsten Hopp ae61a4
   * Internal function prototypes.
Karsten Hopp ae61a4
   */
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
- static void PythonIO_Flush(void);
Karsten Hopp ae61a4
  static int PythonIO_Init(void);
Karsten Hopp ae61a4
  static int PythonMod_Init(void);
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
- /* Utility functions for the vim/python interface
Karsten Hopp ae61a4
-  * ----------------------------------------------
Karsten Hopp ae61a4
-  */
Karsten Hopp ae61a4
- 
Karsten Hopp ae61a4
- static int SetBufferLineList(buf_T *, PyInt, PyInt, PyObject *, PyInt *);
Karsten Hopp ae61a4
- 
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
  /******************************************************
Karsten Hopp ae61a4
   * 1. Python interpreter main program.
Karsten Hopp ae61a4
--- 657,665 ----
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 1017,1025 ****
Karsten Hopp ae61a4
   * 3. Implementation of the Vim module for Python
Karsten Hopp ae61a4
   */
Karsten Hopp ae61a4
  
Karsten Hopp ae61a4
- static PyObject *ConvertToPyObject(typval_T *);
Karsten Hopp ae61a4
- static int ConvertFromPyObject(PyObject *, typval_T *);
Karsten Hopp ae61a4
- 
Karsten Hopp ae61a4
  /* Window type - Implementation functions
Karsten Hopp ae61a4
   * --------------------------------------
Karsten Hopp ae61a4
   */
Karsten Hopp ae61a4
--- 1008,1013 ----
Karsten Hopp ae61a4
*** ../vim-7.3.991/src/version.c	2013-05-21 18:19:33.000000000 +0200
Karsten Hopp ae61a4
--- src/version.c	2013-05-21 18:28:18.000000000 +0200
Karsten Hopp ae61a4
***************
Karsten Hopp ae61a4
*** 730,731 ****
Karsten Hopp ae61a4
--- 730,733 ----
Karsten Hopp ae61a4
  {   /* Add new patch number below this line */
Karsten Hopp ae61a4
+ /**/
Karsten Hopp ae61a4
+     992,
Karsten Hopp ae61a4
  /**/
Karsten Hopp ae61a4
Karsten Hopp ae61a4
-- 
Karsten Hopp ae61a4
We apologise again for the fault in the subtitles.  Those responsible for
Karsten Hopp ae61a4
sacking the people who have just been sacked have been sacked.
Karsten Hopp ae61a4
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
Karsten Hopp ae61a4
Karsten Hopp ae61a4
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp ae61a4
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp ae61a4
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp ae61a4
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///