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
6ac06b39
Kaydet (Commit)
6ac06b39
authored
Eyl 21, 1998
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch by Greg Stein to document the 'P' flag.
üst
10a79855
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
libstruct.tex
Doc/lib/libstruct.tex
+17
-0
No files found.
Doc/lib/libstruct.tex
Dosyayı görüntüle @
6ac06b39
...
@@ -57,6 +57,7 @@ and Python values should be obvious given their types:
...
@@ -57,6 +57,7 @@ and Python values should be obvious given their types:
\lineiii
{
d
}{
double
}{
float
}
\lineiii
{
d
}{
double
}{
float
}
\lineiii
{
s
}{
char[]
}{
string
}
\lineiii
{
s
}{
char[]
}{
string
}
\lineiii
{
p
}{
char[]
}{
string
}
\lineiii
{
p
}{
char[]
}{
string
}
\lineiii
{
P
}{
void *
}{
integer
}
\end{tableiii}
\end{tableiii}
A format character may be preceded by an integral repeat count; e.g.
\
A format character may be preceded by an integral repeat count; e.g.
\
...
@@ -85,6 +86,15 @@ that exactly enough bytes are used to satisfy the count.
...
@@ -85,6 +86,15 @@ that exactly enough bytes are used to satisfy the count.
For the
\character
{
I
}
and
\character
{
L
}
format characters, the return
For the
\character
{
I
}
and
\character
{
L
}
format characters, the return
value is a Python long integer.
value is a Python long integer.
For the
\character
{
P
}
format character, the return value is a Python
integer or long integer, depending on the size needed to hold a
pointer when it has been cast to an integer type. A NULL pointer will
always be returned as the Python integer 0. When packing pointer-sized
values, Python integer or long integer objects may be used. For
example, the Alpha and Merced processors use 64-bit pointer values,
meaning a Python long integer will be used to hold the pointer; other
platforms use 32-bit pointers and will use a Python integer.
By default, C numbers are represented in the machine's native format
By default, C numbers are represented in the machine's native format
and byte order, and properly aligned by skipping pad bytes if
and byte order, and properly aligned by skipping pad bytes if
necessary (according to the rules used by the C compiler).
necessary (according to the rules used by the C compiler).
...
@@ -126,6 +136,13 @@ There is no way to indicate non-native byte order (i.e. force
...
@@ -126,6 +136,13 @@ There is no way to indicate non-native byte order (i.e. force
byte-swapping); use the appropriate choice of
\character
{
<
}
or
byte-swapping); use the appropriate choice of
\character
{
<
}
or
\character
{
>
}
.
\character
{
>
}
.
The
\character
{
P
}
format character is only available for the native
byte ordering (selected as the default or with the
\character
{
@
}
byte
order character). The byte order character
\character
{
=
}
chooses to
use little- or big-endian ordering based on the host system. The
struct module does not interpret this as native ordering, so the
\character
{
P
}
format is not available.
Examples (all using native byte order, size and alignment, on a
Examples (all using native byte order, size and alignment, on a
big-endian machine):
big-endian machine):
...
...
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