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
7271babc
Kaydet (Commit)
7271babc
authored
Ara 17, 1992
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Compatibility hack with Python 0.9.6.
üst
2f5dd888
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
xdr.py
Demo/rpc/xdr.py
+6
-3
No files found.
Demo/rpc/xdr.py
Dosyayı görüntüle @
7271babc
# Implement (a subset of) Sun XDR -- RFC1014.
import
struct
try
:
import
struct
except
ImportError
:
struct
=
None
Long
=
type
(
0L
)
...
...
@@ -23,7 +26,7 @@ class Packer:
self
.
buf
=
self
.
buf
+
\
(
chr
(
int
(
x
>>
24
&
0xff
))
+
chr
(
int
(
x
>>
16
&
0xff
))
+
\
chr
(
int
(
x
>>
8
&
0xff
))
+
chr
(
int
(
x
&
0xff
)))
if
struct
.
pack
(
'l'
,
1
)
==
'
\0\0\0\1
'
:
if
struct
and
struct
.
pack
(
'l'
,
1
)
==
'
\0\0\0\1
'
:
def
pack_uint
(
self
,
x
):
if
type
(
x
)
==
Long
:
x
=
int
((
x
+
0x80000000
L
)
%
0x100000000
L
\
...
...
@@ -92,7 +95,7 @@ class Unpacker:
# as a nonnegative Python int
if
x
<
0x80000000
L
:
x
=
int
(
x
)
return
x
if
struct
.
unpack
(
'l'
,
'
\0\0\0\1
'
)
==
1
:
if
struct
and
struct
.
unpack
(
'l'
,
'
\0\0\0\1
'
)
==
1
:
def
unpack_uint
(
self
):
i
=
self
.
pos
self
.
pos
=
j
=
i
+
4
...
...
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