[Python-checkins] CVS: python/dist/src/Doc/api abstract.tex,1.4,1.5

Jeremy Hylton jhylton@users.sourceforge.net
Fri, 09 Nov 2001 13:59:15 -0800


Update of /cvsroot/python/python/dist/src/Doc/api
In directory usw-pr-cvs1:/tmp/cvs-serv11461

Modified Files:
	abstract.tex 
Log Message:
Add PyObject_CheckReadBuffer(), which returns true if its argument
supports the single-segment readable buffer interface.

Add documentation for this and other PyObject_XXXBuffer() calls.


Index: abstract.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/api/abstract.tex,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** abstract.tex	2001/10/28 02:37:10	1.4
--- abstract.tex	2001/11/09 21:59:12	1.5
***************
*** 868,870 ****
--- 868,909 ----
      /* continue doing useful work */
  }
+ 
+ \section{Buffer Protocol \label{buffer}}
+ 
+ \begin{cfuncdesc}{int}{PyObject_AsCharBuffer}{PyObject *obj,
+ 					      const char **buffer,
+ 					      int *buffer_len}
+   Returns a pointer to a read-only memory location useable as character-
+   based input.  The \var{obj} argument must support the single-segment
+   character buffer interface.  On success, returns \code{1}, sets
+   \var{buffer} to the memory location and \var{buffer} to the buffer
+   length.  Returns \code{0} and sets a \exception{TypeError} on error.
+ \end{cfuncdesc}
+ 
+ \begin{cfuncdesc}{int}{PyObject_AsReadBuffer}{PyObject *obj,
+ 					      const char **buffer,
+ 					      int *buffer_len}
+   Returns a pointer to a read-only memory location containing
+   arbitrary data.  The \var{obj} argument must support the
+   single-segment readable buffer interface.  On success, returns
+   \code{1}, sets \var{buffer} to the memory location and \var{buffer}
+   to the buffer length.  Returns \code{0} and sets a
+   \exception{TypeError} on error.
+ \end{cfuncdesc}
+ 
+ \begin{cfuncdesc}{int}{PyObject_CheckReadBuffer}{PyObject *o}
+   Returns \code{1} if \var{o} supports the single-segment readable
+   buffer interface.  Otherwise returns \code{0}.
+ \enc{cfuncdesc}
+ 
+ \begin{cfuncdesc}{int}{PyObject_AsWriteBuffer}{PyObject *obj,
+ 	 				       const char **buffer,
+  					       int *buffer_len}
+   Returns a pointer to a writeable memory location.  The \var{obj}
+   argument must support the single-segment, character buffer
+   interface.  On success, returns \code{1}, sets \var{buffer} to the
+   memory location and \var{buffer} to the buffer length.  Returns
+   \code{0} and sets a \exception{TypeError} on error.
+ \end{cfuncdesc}
+ 
  \end{verbatim}