Mercurial > cpython-lru_cache-weakref
annotate Doc/c-api/objbuffer.rst @ 64166:d0e9febfa00a 3.1
Merged revisions 84172 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r84172 | martin.v.loewis | 2010-08-18 18:12:23 +0200 (Mi, 18 Aug 2010) | 2 lines
Restore GIL in nis_cat in case of error.
........
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Thu, 19 Aug 2010 09:03:03 +0000 |
| parents | d0594e7a45d6 |
| children | dc3833984734 |
| rev | line source |
|---|---|
|
44812
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
1 .. highlightlang:: c |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
2 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
3 .. _abstract-buffer: |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
4 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
5 Buffer Protocol |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
6 =============== |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
7 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
8 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
9 .. cfunction:: int PyObject_AsCharBuffer(PyObject *obj, const char **buffer, Py_ssize_t *buffer_len) |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
10 |
|
45435
42b3b117391d
Merged revisions 60481,60485,60489-60492,60494-60496,60498-60499,60501-60503,60505-60506,60508-60509,60523-60524,60532,60543,60545,60547-60548,60552,60554,60556-60559,60561-60562,60569,60571-60572,60574,60576-60583,60585-60586,60589,60591,60594-60595,60597-60598,60600-60601,60606-60612,60615,60617,60619-60621,60623-60625,60627-60629,60631,60633,60635,60647,60650,60652,60654,60656,60658-60659,60664-60666,60668-60670,60672,60676,60678,60680-60683,60685-60686,60688,60690,60692-60694,60697-60700,60705-60706,60708,60711,60714,60720,60724-60730,60732,60736,60742,60744,60746,60748,60750-60751,60753,60756-60757,60759-60761,60763-60764,60766,60769-60770,60774-60784,60787-60789,60793,60796,60799-60809,60812-60813,60815-60821,60823-60826,60828-60829,60831-60834,60836,60838-60839,60846-60849,60852-60854,60856-60859,60861-60870,60874-60875,60880-60881,60886,60888-60890,60892,60894-60898,60900-60931,60933-60958 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
44812
diff
changeset
|
11 Returns a pointer to a read-only memory location usable as character-based |
|
44812
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
12 input. The *obj* argument must support the single-segment character buffer |
|
53498
1fca1c932696
Merged revisions 71920-71923,71925-71929,71931-71934,71937 via svnmerge from
Jeroen Ruigrok van der Werven <asmodai@in-nomine.org>
parents:
45435
diff
changeset
|
13 interface. On success, returns ``0``, sets *buffer* to the memory location |
|
1fca1c932696
Merged revisions 71920-71923,71925-71929,71931-71934,71937 via svnmerge from
Jeroen Ruigrok van der Werven <asmodai@in-nomine.org>
parents:
45435
diff
changeset
|
14 and *buffer_len* to the buffer length. Returns ``-1`` and sets a |
|
1fca1c932696
Merged revisions 71920-71923,71925-71929,71931-71934,71937 via svnmerge from
Jeroen Ruigrok van der Werven <asmodai@in-nomine.org>
parents:
45435
diff
changeset
|
15 :exc:`TypeError` on error. |
|
1fca1c932696
Merged revisions 71920-71923,71925-71929,71931-71934,71937 via svnmerge from
Jeroen Ruigrok van der Werven <asmodai@in-nomine.org>
parents:
45435
diff
changeset
|
16 |
|
44812
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
17 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
18 .. cfunction:: int PyObject_AsReadBuffer(PyObject *obj, const void **buffer, Py_ssize_t *buffer_len) |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
19 |
|
53498
1fca1c932696
Merged revisions 71920-71923,71925-71929,71931-71934,71937 via svnmerge from
Jeroen Ruigrok van der Werven <asmodai@in-nomine.org>
parents:
45435
diff
changeset
|
20 Returns a pointer to a read-only memory location containing arbitrary data. |
|
1fca1c932696
Merged revisions 71920-71923,71925-71929,71931-71934,71937 via svnmerge from
Jeroen Ruigrok van der Werven <asmodai@in-nomine.org>
parents:
45435
diff
changeset
|
21 The *obj* argument must support the single-segment readable buffer |
|
1fca1c932696
Merged revisions 71920-71923,71925-71929,71931-71934,71937 via svnmerge from
Jeroen Ruigrok van der Werven <asmodai@in-nomine.org>
parents:
45435
diff
changeset
|
22 interface. On success, returns ``0``, sets *buffer* to the memory location |
|
1fca1c932696
Merged revisions 71920-71923,71925-71929,71931-71934,71937 via svnmerge from
Jeroen Ruigrok van der Werven <asmodai@in-nomine.org>
parents:
45435
diff
changeset
|
23 and *buffer_len* to the buffer length. Returns ``-1`` and sets a |
|
1fca1c932696
Merged revisions 71920-71923,71925-71929,71931-71934,71937 via svnmerge from
Jeroen Ruigrok van der Werven <asmodai@in-nomine.org>
parents:
45435
diff
changeset
|
24 :exc:`TypeError` on error. |
|
1fca1c932696
Merged revisions 71920-71923,71925-71929,71931-71934,71937 via svnmerge from
Jeroen Ruigrok van der Werven <asmodai@in-nomine.org>
parents:
45435
diff
changeset
|
25 |
|
44812
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
26 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
27 .. cfunction:: int PyObject_CheckReadBuffer(PyObject *o) |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
28 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
29 Returns ``1`` if *o* supports the single-segment readable buffer interface. |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
30 Otherwise returns ``0``. |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
31 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
32 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
33 .. cfunction:: int PyObject_AsWriteBuffer(PyObject *obj, void **buffer, Py_ssize_t *buffer_len) |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
34 |
|
1e8b9e7c34ce
Split C API docs in Py3k branch.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
35 Returns a pointer to a writable memory location. The *obj* argument must |
|
53498
1fca1c932696
Merged revisions 71920-71923,71925-71929,71931-71934,71937 via svnmerge from
Jeroen Ruigrok van der Werven <asmodai@in-nomine.org>
parents:
45435
diff
changeset
|
36 support the single-segment, character buffer interface. On success, |
|
1fca1c932696
Merged revisions 71920-71923,71925-71929,71931-71934,71937 via svnmerge from
Jeroen Ruigrok van der Werven <asmodai@in-nomine.org>
parents:
45435
diff
changeset
|
37 returns ``0``, sets *buffer* to the memory location and *buffer_len* to the |
|
1fca1c932696
Merged revisions 71920-71923,71925-71929,71931-71934,71937 via svnmerge from
Jeroen Ruigrok van der Werven <asmodai@in-nomine.org>
parents:
45435
diff
changeset
|
38 buffer length. Returns ``-1`` and sets a :exc:`TypeError` on error. |
|
1fca1c932696
Merged revisions 71920-71923,71925-71929,71931-71934,71937 via svnmerge from
Jeroen Ruigrok van der Werven <asmodai@in-nomine.org>
parents:
45435
diff
changeset
|
39 |
