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
970a0a20
Kaydet (Commit)
970a0a20
authored
Ock 09, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
api version checking
üst
6da5bfad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
17 deletions
+32
-17
modsupport.h
Include/modsupport.h
+16
-3
modsupport.c
Python/modsupport.c
+16
-14
No files found.
Include/modsupport.h
Dosyayı görüntüle @
970a0a20
...
...
@@ -51,9 +51,22 @@ extern object *mkvalue();
extern
int
vgetargs
PROTO
((
object
*
,
char
*
,
va_list
));
extern
object
*
vmkvalue
PROTO
((
char
*
,
va_list
));
extern
object
*
initmodule
PROTO
((
char
*
,
struct
methodlist
*
));
extern
object
*
initmodule3
PROTO
((
char
*
,
struct
methodlist
*
,
char
*
,
object
*
));
#define PYTHON_API_VERSION 1001
/* The API version is maintained (independently from the Python version)
so we can detect mismatches between the interpreter and dynamically
loaded modules.
Please add a line or two to the top of this log for each API
version change:
9-Jan-1995 GvR Initial version (incompatible with older API)
*/
extern
object
*
initmodule4
PROTO
((
char
*
,
struct
methodlist
*
,
char
*
,
object
*
,
int
));
#define initmodule(name, methods) \
initmodule4(name, methods, (char *)NULL, (object *)NULL, \
PYTHON_API_VERSION)
/* The following are obsolete -- use getargs directly! */
#define getnoarg(v) getargs(v, "")
...
...
Python/modsupport.c
Dosyayı görüntüle @
970a0a20
...
...
@@ -33,20 +33,32 @@ typedef extended va_double;
typedef
double
va_double
;
#endif
/* initmodule3() has two additional parameters:
- doc is the documentation string;
- passthrough is passed as self to functions defined in the module.
/* initmodule4() parameters:
- name is the module name
- methods is the list of top-level functions
- doc is the documentation string
- passthrough is passed as self to functions defined in the module
- api_version is the value of PYTHON_API_VERSION at the time the
module was compiled
*/
static
char
api_version_warning
[]
=
"WARNING: Python C API version mismatch for module %s:
\n
\
This Python has API version %d, module %s has version %s.
\n
"
;
object
*
initmodule
3
(
name
,
methods
,
doc
,
passthrough
)
initmodule
4
(
name
,
methods
,
doc
,
passthrough
,
module_api_version
)
char
*
name
;
struct
methodlist
*
methods
;
char
*
doc
;
object
*
passthrough
;
int
module_api_version
;
{
object
*
m
,
*
d
,
*
v
;
struct
methodlist
*
ml
;
if
(
module_api_version
!=
PYTHON_API_VERSION
)
fprintf
(
stderr
,
api_version_warning
,
name
,
PYTHON_API_VERSION
,
name
,
module_api_version
);
if
((
m
=
add_module
(
name
))
==
NULL
)
{
fprintf
(
stderr
,
"initializing module: %s
\n
"
,
name
);
fatal
(
"can't create a module"
);
...
...
@@ -69,16 +81,6 @@ initmodule3(name, methods, doc, passthrough)
return
m
;
}
/* The standard initmodule() passes NULL for 'self' */
object
*
initmodule
(
name
,
methods
)
char
*
name
;
struct
methodlist
*
methods
;
{
return
initmodule3
(
name
,
methods
,
(
char
*
)
NULL
,
(
object
*
)
NULL
);
}
/* Helper for mkvalue() to scan the length of a format */
...
...
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