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
10f124c9
Kaydet (Commit)
10f124c9
authored
Ara 17, 1996
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Updated to standard Python C coding style, and fixed a few error
checking nits.
üst
3863fb53
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
_xdrmodule.c
Modules/_xdrmodule.c
+17
-11
No files found.
Modules/_xdrmodule.c
Dosyayı görüntüle @
10f124c9
/* This module exports part of the C API to the XDR routines into Python.
* XDR is Sun's eXternal Data Representation, as described in RFC 1014.
This
*
module is used by xdrlib.py to support the float and double data types
* which are too much of a pain to support in Python directly. It is
* XDR is Sun's eXternal Data Representation, as described in RFC 1014.
*
This module is used by xdrlib.py to support the float and double data
*
types
which are too much of a pain to support in Python directly. It is
* not required by xdrlib.py -- when not available, these types aren't
* supported at the Python layer. Note that representations that can be
* implemented solely in Python, are *not* reproduced here.
...
...
@@ -42,8 +42,9 @@ pack_float(self, args)
xdr
.
x_ops
=
NULL
;
xdrmem_create
(
&
xdr
,
addr
.
buffer
,
4
,
XDR_ENCODE
);
if
(
xdr
.
x_ops
==
NULL
)
PyErr_SetString
(
xdr_error
,
"XDR stream initialization failed."
);
if
(
xdr
.
x_ops
==
NULL
)
PyErr_SetString
(
xdr_error
,
"XDR stream initialization failed."
);
else
if
(
xdr_float
(
&
xdr
,
&
value
))
rtn
=
PyString_FromStringAndSize
(
addr
.
buffer
,
4
);
else
...
...
@@ -73,8 +74,9 @@ pack_double(self, args)
xdr
.
x_ops
=
NULL
;
xdrmem_create
(
&
xdr
,
addr
.
buffer
,
8
,
XDR_ENCODE
);
if
(
xdr
.
x_ops
==
NULL
)
PyErr_SetString
(
xdr_error
,
"XDR stream initialization failed."
);
if
(
xdr
.
x_ops
==
NULL
)
PyErr_SetString
(
xdr_error
,
"XDR stream initialization failed."
);
else
if
(
xdr_double
(
&
xdr
,
&
value
))
rtn
=
PyString_FromStringAndSize
(
addr
.
buffer
,
8
);
else
...
...
@@ -108,8 +110,9 @@ unpack_float(self, args)
/* Python guarantees that the string is 4 byte aligned */
xdr
.
x_ops
=
NULL
;
xdrmem_create
(
&
xdr
,
(
caddr_t
)
string
,
4
,
XDR_DECODE
);
if
(
xdr
.
x_ops
==
NULL
)
PyErr_SetString
(
xdr_error
,
"XDR stream initialization failed."
);
if
(
xdr
.
x_ops
==
NULL
)
PyErr_SetString
(
xdr_error
,
"XDR stream initialization failed."
);
else
if
(
xdr_float
(
&
xdr
,
&
value
))
rtn
=
Py_BuildValue
(
"f"
,
value
);
else
...
...
@@ -143,8 +146,9 @@ unpack_double(self, args)
/* Python guarantees that the string is 4 byte aligned */
xdr
.
x_ops
=
NULL
;
xdrmem_create
(
&
xdr
,
(
caddr_t
)
string
,
8
,
XDR_DECODE
);
if
(
xdr
.
x_ops
==
NULL
)
PyErr_SetString
(
xdr_error
,
"XDR stream initialization failed."
);
if
(
xdr
.
x_ops
==
NULL
)
PyErr_SetString
(
xdr_error
,
"XDR stream initialization failed."
);
else
if
(
xdr_double
(
&
xdr
,
&
value
))
rtn
=
Py_BuildValue
(
"d"
,
value
);
else
...
...
@@ -178,4 +182,6 @@ init_xdr()
xdr_error
=
PyString_FromString
(
"_xdr.error"
);
PyDict_SetItemString
(
dict
,
"error"
,
xdr_error
);
if
(
PyErr_Occurred
())
Py_FatalError
(
"can't initialize module _xdr"
);
}
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