Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: third_party/cython/src/Cython/Includes/cpython/oldbuffer.pxd

Issue 385073004: Adding cython v0.20.2 in third-party. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reference cython dev list thread. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 # Legacy Python 2 buffer interface.
2 #
3 # These functions are no longer available in Python 3, use the new
4 # buffer interface instead.
5
6 cdef extern from "Python.h":
7 cdef enum _:
8 Py_END_OF_BUFFER
9 # This constant may be passed as the size parameter to
10 # PyBuffer_FromObject() or PyBuffer_FromReadWriteObject(). It
11 # indicates that the new PyBufferObject should refer to base object
12 # from the specified offset to the end of its exported
13 # buffer. Using this enables the caller to avoid querying the base
14 # object for its length.
15
16 bint PyBuffer_Check(object p)
17 # Return true if the argument has type PyBuffer_Type.
18
19 object PyBuffer_FromObject(object base, Py_ssize_t offset, Py_ssize_t size)
20 # Return value: New reference.
21 #
22 # Return a new read-only buffer object. This raises TypeError if
23 # base doesn't support the read-only buffer protocol or doesn't
24 # provide exactly one buffer segment, or it raises ValueError if
25 # offset is less than zero. The buffer will hold a reference to the
26 # base object, and the buffer's contents will refer to the base
27 # object's buffer interface, starting as position offset and
28 # extending for size bytes. If size is Py_END_OF_BUFFER, then the
29 # new buffer's contents extend to the length of the base object's
30 # exported buffer data.
31
32 object PyBuffer_FromReadWriteObject(object base, Py_ssize_t offset, Py_ssize _t size)
33 # Return value: New reference.
34 #
35 # Return a new writable buffer object. Parameters and exceptions
36 # are similar to those for PyBuffer_FromObject(). If the base
37 # object does not export the writeable buffer protocol, then
38 # TypeError is raised.
39
40 object PyBuffer_FromMemory(void *ptr, Py_ssize_t size)
41 # Return value: New reference.
42 #
43 # Return a new read-only buffer object that reads from a specified
44 # location in memory, with a specified size. The caller is
45 # responsible for ensuring that the memory buffer, passed in as
46 # ptr, is not deallocated while the returned buffer object
47 # exists. Raises ValueError if size is less than zero. Note that
48 # Py_END_OF_BUFFER may not be passed for the size parameter;
49 # ValueError will be raised in that case.
50
51 object PyBuffer_FromReadWriteMemory(void *ptr, Py_ssize_t size)
52 # Return value: New reference.
53 #
54 # Similar to PyBuffer_FromMemory(), but the returned buffer is
55 # writable.
56
57 object PyBuffer_New(Py_ssize_t size)
58 # Return value: New reference.
59 #
60 # Return a new writable buffer object that maintains its own memory
61 # buffer of size bytes. ValueError is returned if size is not zero
62 # or positive. Note that the memory buffer (as returned by
63 # PyObject_AsWriteBuffer()) is not specifically aligned.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698