[Python-checkins] CVS: python/dist/src/Include abstract.h,2.16,2.17

Guido van Rossum guido@cnri.reston.va.us
Fri, 10 Mar 2000 17:35:09 -0500 (EST)


Update of /projects/cvsroot/python/dist/src/Include
In directory eric:/home/guido/hp/mal/py-patched/Include

Modified Files:
	abstract.h 
Log Message:
Marc-Andre Lemburg: added declarations for PyObject_AsCharBuffer,
PyObject_AsReadBuffer, PyObject_AsWriteBuffer.


Index: abstract.h
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Include/abstract.h,v
retrieving revision 2.16
retrieving revision 2.17
diff -C2 -r2.16 -r2.17
*** abstract.h	1999/03/17 18:44:38	2.16
--- abstract.h	2000/03/10 22:35:06	2.17
***************
*** 437,440 ****
--- 437,486 ----
         */
  
+      DL_IMPORT(int) PyObject_AsCharBuffer(PyObject *obj,
+ 					  const char **buffer,
+ 					  int *buffer_len);
+ 
+        /* 
+ 	  Takes an arbitrary object which must support the (character,
+ 	  single segment) buffer interface and returns a pointer to a
+ 	  read-only memory location useable as character based input
+ 	  for subsequent processing.
+ 
+ 	  0 is returned on success.  buffer and buffer_len are only
+ 	  set in case no error occurrs. Otherwise, -1 is returned and
+ 	  an exception set.
+ 
+        */
+ 
+      DL_IMPORT(int) PyObject_AsReadBuffer(PyObject *obj,
+ 					  const void **buffer,
+ 					  int *buffer_len);
+ 
+        /* 
+ 	  Same as PyObject_AsCharBuffer() except that this API expects
+ 	  (readable, single segment) buffer interface and returns a
+ 	  pointer to a read-only memory location which can contain
+ 	  arbitrary data.
+ 
+ 	  0 is returned on success.  buffer and buffer_len are only
+ 	  set in case no error occurrs.  Otherwise, -1 is returned and
+ 	  an exception set.
+ 
+        */
+ 
+      DL_IMPORT(int) PyObject_AsWriteBuffer(PyObject *obj,
+ 					   void **buffer,
+ 					   int *buffer_len);
+ 
+        /* 
+ 	  Takes an arbitrary object which must support the (writeable,
+ 	  single segment) buffer interface and returns a pointer to a
+ 	  writeable memory location in buffer of size buffer_len.
+ 
+ 	  0 is returned on success.  buffer and buffer_len are only
+ 	  set in case no error occurrs. Otherwise, -1 is returned and
+ 	  an exception set.
+ 
+        */
  
  /*  Number Protocol:*/