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
73baefd7
Kaydet (Commit)
73baefd7
authored
Haz 11, 2008
tarafından
Thomas Heller
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix markup.
Document the new 'offset' parameter for the 'ctypes.byref' function.
üst
e0b9261a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
20 deletions
+30
-20
ctypes.rst
Doc/library/ctypes.rst
+30
-20
No files found.
Doc/library/ctypes.rst
Dosyayı görüntüle @
73baefd7
...
...
@@ -1406,10 +1406,9 @@ GetLastError() and SetLastError() Windows api functions;
to request and change the ctypes private copy of the windows error
code.
.. versionchanged:: 2.6
The `use_errno` and `use_last_error` parameters were added in Python
2.6.
.. versionadded:: 2.6
The ``use_last_error`` and ``use_errno`` optional parameters
were added.
.. data:: RTLD_GLOBAL
:noindex:
...
...
@@ -1572,22 +1571,23 @@ They are instances of a private class:
Assign a Python function or another callable to this attribute. The
callable will be called with three or more arguments:
.. function:: callable(result, func, arguments)
:noindex:
.. function:: callable(result, func, arguments)
:noindex:
``result`` is what the foreign function returns, as specified by the
:attr:`restype` attribute.
``result`` is what the foreign function returns, as specified
by the :attr:`restype` attribute.
``func`` is the foreign function object itself, this allows to reuse the same
callable object to check or post process the results of several functions.
``func`` is the foreign function object itself, this allows
to reuse the same callable object to check or post process
the results of several functions.
``arguments`` is a tuple containing the parameters originally passed to the
function call, this allows to specialize the behavior on the arguments used.
``arguments`` is a tuple containing the parameters originally
passed to the function call, this allows to specialize the
behavior on the arguments used.
The object that this function returns will be returned from the foreign
function call, but it can also check the result value and raise an exception
if the foreign function call failed.
The object that this function returns will be returned from the
foreign function call, but it can also check the result value
and raise an exception
if the foreign function call failed.
.. exception:: ArgumentError()
...
...
@@ -1805,12 +1805,22 @@ Utility functions
ctypes type or instance.
.. function:: byref(obj)
.. function:: byref(obj[, offset])
Returns a light-weight pointer to ``obj``, which must be an
instance of a ctypes type. ``offset`` defaults to zero, it must be
an integer which is added to the internal pointer value.
Returns a light-weight pointer to ``obj``, which must be an instance of a ctypes
type. The returned object can only be used as a foreign function call parameter.
It behaves similar to ``pointer(obj)``, but the construction is a lot faster.
``byref(obj, offset)`` corresponds to this C code::
(((char *)&obj) + offset)
The returned object can only be used as a foreign function call
parameter. It behaves similar to ``pointer(obj)``, but the
construction is a lot faster.
.. versionadded:: 2.6
The ``offset`` optional argument was added.
.. function:: cast(obj, type)
...
...
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