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
55b69e79
Kaydet (Commit)
55b69e79
authored
Tem 02, 2008
tarafından
Amaury Forgeot d'Arc
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Oops, forgot that there are modules outside the win32 world.
üst
ba4105c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
0 deletions
+47
-0
methodobject.h
Include/methodobject.h
+10
-0
methodobject.c
Objects/methodobject.c
+37
-0
No files found.
Include/methodobject.h
Dosyayı görüntüle @
55b69e79
...
...
@@ -43,6 +43,8 @@ struct PyMethodDef {
};
typedef
struct
PyMethodDef
PyMethodDef
;
PyAPI_FUNC
(
PyObject
*
)
Py_FindMethod
(
PyMethodDef
[],
PyObject
*
,
const
char
*
);
#define PyCFunction_New(ML, SELF) PyCFunction_NewEx((ML), (SELF), NULL)
PyAPI_FUNC
(
PyObject
*
)
PyCFunction_NewEx
(
PyMethodDef
*
,
PyObject
*
,
PyObject
*
);
...
...
@@ -68,6 +70,14 @@ PyAPI_FUNC(PyObject *) PyCFunction_NewEx(PyMethodDef *, PyObject *,
#define METH_COEXIST 0x0040
typedef
struct
PyMethodChain
{
PyMethodDef
*
methods
;
/* Methods of this type */
struct
PyMethodChain
*
link
;
/* NULL or base type */
}
PyMethodChain
;
PyAPI_FUNC
(
PyObject
*
)
Py_FindMethodInChain
(
PyMethodChain
*
,
PyObject
*
,
const
char
*
);
typedef
struct
{
PyObject_HEAD
PyMethodDef
*
m_ml
;
/* Description of the C function to call */
...
...
Objects/methodobject.c
Dosyayı görüntüle @
55b69e79
...
...
@@ -280,6 +280,43 @@ PyTypeObject PyCFunction_Type = {
0
,
/* tp_dict */
};
/* Find a method in a method chain */
PyObject
*
Py_FindMethodInChain
(
PyMethodChain
*
chain
,
PyObject
*
self
,
const
char
*
name
)
{
if
(
name
[
0
]
==
'_'
&&
name
[
1
]
==
'_'
)
{
if
(
strcmp
(
name
,
"__doc__"
)
==
0
)
{
const
char
*
doc
=
self
->
ob_type
->
tp_doc
;
if
(
doc
!=
NULL
)
return
PyUnicode_FromString
(
doc
);
}
}
while
(
chain
!=
NULL
)
{
PyMethodDef
*
ml
=
chain
->
methods
;
for
(;
ml
->
ml_name
!=
NULL
;
ml
++
)
{
if
(
name
[
0
]
==
ml
->
ml_name
[
0
]
&&
strcmp
(
name
+
1
,
ml
->
ml_name
+
1
)
==
0
)
/* XXX */
return
PyCFunction_New
(
ml
,
self
);
}
chain
=
chain
->
link
;
}
PyErr_SetString
(
PyExc_AttributeError
,
name
);
return
NULL
;
}
/* Find a method in a single method list */
PyObject
*
Py_FindMethod
(
PyMethodDef
*
methods
,
PyObject
*
self
,
const
char
*
name
)
{
PyMethodChain
chain
;
chain
.
methods
=
methods
;
chain
.
link
=
NULL
;
return
Py_FindMethodInChain
(
&
chain
,
self
,
name
);
}
/* Clear out the free list */
int
...
...
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