Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
58c5a2a5
Kaydet (Commit)
58c5a2a5
authored
Agu 04, 1999
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Started documentation on buffer objects & types. Very preliminary.
Greg Stein: Please help with this; it's your baby!
üst
4574f231
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
1 deletion
+66
-1
api.tex
Doc/api/api.tex
+66
-1
No files found.
Doc/api/api.tex
Dosyayı görüntüle @
58c5a2a5
...
@@ -1828,6 +1828,60 @@ Macro form of \cfunction{PyString_GetSize()} but without error checking.
...
@@ -1828,6 +1828,60 @@ Macro form of \cfunction{PyString_GetSize()} but without error checking.
\end{cfuncdesc}
\end{cfuncdesc}
\subsection
{
Buffer Objects
\label
{
bufferObjects
}}
XXX need a real description of buffers and buffer ''segments.``
\begin{cvardesc}
{
PyTypeObject
}{
PyBuffer
_
Type
}
The instance of
\ctype
{
PyTypeObject
}
which represents the Python
buffer type.
\end{cvardesc}
\begin{cvardesc}
{
int
}{
Py
_
END
_
OF
_
BUFFER
}
Constant returned by
\cfunction
{
Py
}
\end{cvardesc}
\begin{cfuncdesc}
{
int
}{
PyBuffer
_
Check
}{
PyObject *p
}
Return true if the argument has type
\cdata
{
PyBuffer
_
Type
}
.
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyBuffer
_
FromObject
}{
PyObject *base,
int offset, int size
}
Return a new read-only buffer object.
Raises
\exception
{
TypeError
}
if
\var
{
base
}
doesn't support the
read-only buffer protocol or doesn't provide exactly one buffer
segment. Raises
\exception
{
ValueError
}
if
\var
{
offset
}
is less than
zero.
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyBuffer
_
FromReadWriteObject
}{
PyObject *base,
int offset,
int size
}
Return a new writable buffer object. Parameters and exceptions are
similar to those for
\cfunction
{
PyBuffer
_
FromObject()
}
.
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyBuffer
_
FromMemory
}{
void *ptr, int size
}
Return a new read-only buffer object that reads from a memory buffer.
The caller is responsible for ensuring that the memory buffer, passed
in as
\var
{
ptr
}
, is not deallocated while the returned buffer object
exists. Raises
\exception
{
ValueError
}
if
\var
{
size
}
is less than
zero.
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyBuffer
_
FromReadWriteMemory
}{
void *ptr, int size
}
Return a new writable buffer object that reads from and writes to a
memory buffer. The caller is responsible for ensuring that the memory
buffer, passed in as
\var
{
ptr
}
, is not deallocated while the returned
buffer object exists. Raises
\exception
{
ValueError
}
if
\var
{
size
}
is
less than zero.
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyBuffer
_
New
}{
int size
}
Returns a new writable buffer object that maintains its own memory
buffer of
\var
{
size
}
bytes.
\var
{
size
}
must be zero or positive.
\end{cfuncdesc}
\subsection
{
Tuple Objects
\label
{
tupleObjects
}}
\subsection
{
Tuple Objects
\label
{
tupleObjects
}}
...
@@ -3029,10 +3083,21 @@ PyObject_HEAD, PyObject_HEAD_INIT, PyObject_VAR_HEAD
...
@@ -3029,10 +3083,21 @@ PyObject_HEAD, PyObject_HEAD_INIT, PyObject_VAR_HEAD
Typedefs:
Typedefs:
unaryfunc, binaryfunc, ternaryfunc, inquiry, coercion, intargfunc,
unaryfunc, binaryfunc, ternaryfunc, inquiry, coercion, intargfunc,
intintargfunc, intobjargproc, intintobjargproc, objobjargproc,
intintargfunc, intobjargproc, intintobjargproc, objobjargproc,
getreadbufferproc, get
writebufferproc, getsegcount
proc,
getreadbufferproc, get
segcountproc, getcharbuffer
proc,
destructor, printfunc, getattrfunc, getattrofunc, setattrfunc,
destructor, printfunc, getattrfunc, getattrofunc, setattrfunc,
setattrofunc, cmpfunc, reprfunc, hashfunc
setattrofunc, cmpfunc, reprfunc, hashfunc
\begin{ctypedesc}
{
int (*getwritebufferproc) (PyObject *self, int segment,
void **ptrptr)
}
Return a pointer to a writable memory buffer in
\code
{
*
\var
{
ptrptr
}}
;
the memory buffer must correspond to buffer segment
\var
{
segment
}
.
Must return
\code
{
-1
}
and set an exception on error.
\exception
{
TypeError
}
should be raised if the object only supports
read-only buffers, and
\exception
{
SystemError
}
should be raised when
\var
{
segment
}
specifies a segment that doesn't exist.
% Why doesn't it raise ValueError for this one?
\end{ctypedesc}
PyNumberMethods
PyNumberMethods
PySequenceMethods
PySequenceMethods
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment