[Python-checkins] CVS: python/dist/src/Modules cStringIO.c,2.26,2.27

Jim Fulton python-dev@python.org
Fri, 6 Oct 2000 12:24:27 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv24871

Modified Files:
	cStringIO.c 
Log Message:
Added a new "base" type, IOobject for which most of the
operations are defined.  This will, hopefully clarify
some of the logic.

Added close test to raise proper error when operations
are performed on closed StringIOs.

Added a position argument to the truncate method.

Added a size argument to readline.

Added PyArg_Parse calls for methods that don't take arguments to
make sure they don't take arguments.


Index: cStringIO.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/cStringIO.c,v
retrieving revision 2.26
retrieving revision 2.27
diff -C2 -r2.26 -r2.27
*** cStringIO.c	2000/09/19 11:06:46	2.26
--- cStringIO.c	2000/10/06 19:24:23	2.27
***************
*** 86,234 ****
  #include "cStringIO.h"
  
! #define UNLESS(E) if(!(E))
  
! /* Declarations for objects of type StringO */
  
  typedef struct {
    PyObject_HEAD
    char *buf;
!   int pos, string_size, buf_size, softspace;
[...992 lines suppressed...]
--- 733,740 ----
  
  static struct PycStringIO_CAPI CAPI = {
!   IO_cread,
!   IO_creadline,
    O_cwrite,
!   IO_cgetval,
    newOobject,
    newIobject,
***************
*** 701,704 ****
  
    /* Maybe make certain warnings go away */
!   if(0) PycString_IMPORT;
  }
--- 771,774 ----
  
    /* Maybe make certain warnings go away */
!   if (0) PycString_IMPORT;
  }