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
2ab0a109
Kaydet (Commit)
2ab0a109
authored
Mar 28, 2002
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
The new files included by \verbatiminput in newtypes.tex.
üst
81b750d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
134 additions
and
0 deletions
+134
-0
noddy.c
Doc/ext/noddy.c
+58
-0
typestruct.h
Doc/ext/typestruct.h
+76
-0
No files found.
Doc/ext/noddy.c
0 → 100644
Dosyayı görüntüle @
2ab0a109
#include <Python.h>
staticforward
PyTypeObject
noddy_NoddyType
;
typedef
struct
{
PyObject_HEAD
}
noddy_NoddyObject
;
static
PyObject
*
noddy_new_noddy
(
PyObject
*
self
,
PyObject
*
args
)
{
noddy_NoddyObject
*
noddy
;
if
(
!
PyArg_ParseTuple
(
args
,
":new_noddy"
))
return
NULL
;
noddy
=
PyObject_New
(
noddy_NoddyObject
,
&
noddy_NoddyType
);
return
(
PyObject
*
)
noddy
;
}
static
void
noddy_noddy_dealloc
(
PyObject
*
self
)
{
PyObject_Del
(
self
);
}
static
PyTypeObject
noddy_NoddyType
=
{
PyObject_HEAD_INIT
(
NULL
)
0
,
"Noddy"
,
sizeof
(
noddy_NoddyObject
),
0
,
noddy_noddy_dealloc
,
/*tp_dealloc*/
0
,
/*tp_print*/
0
,
/*tp_getattr*/
0
,
/*tp_setattr*/
0
,
/*tp_compare*/
0
,
/*tp_repr*/
0
,
/*tp_as_number*/
0
,
/*tp_as_sequence*/
0
,
/*tp_as_mapping*/
0
,
/*tp_hash */
};
static
PyMethodDef
noddy_methods
[]
=
{
{
"new_noddy"
,
noddy_new_noddy
,
METH_VARARGS
,
"Create a new Noddy object."
},
{
NULL
,
NULL
,
0
,
NULL
}
};
DL_EXPORT
(
void
)
initnoddy
(
void
)
{
noddy_NoddyType
.
ob_type
=
&
PyType_Type
;
Py_InitModule
(
"noddy"
,
noddy_methods
);
}
Doc/ext/typestruct.h
0 → 100644
Dosyayı görüntüle @
2ab0a109
typedef
struct
_typeobject
{
PyObject_VAR_HEAD
char
*
tp_name
;
/* For printing, in format "<module>.<name>" */
int
tp_basicsize
,
tp_itemsize
;
/* For allocation */
/* Methods to implement standard operations */
destructor
tp_dealloc
;
printfunc
tp_print
;
getattrfunc
tp_getattr
;
setattrfunc
tp_setattr
;
cmpfunc
tp_compare
;
reprfunc
tp_repr
;
/* Method suites for standard classes */
PyNumberMethods
*
tp_as_number
;
PySequenceMethods
*
tp_as_sequence
;
PyMappingMethods
*
tp_as_mapping
;
/* More standard operations (here for binary compatibility) */
hashfunc
tp_hash
;
ternaryfunc
tp_call
;
reprfunc
tp_str
;
getattrofunc
tp_getattro
;
setattrofunc
tp_setattro
;
/* Functions to access object as input/output buffer */
PyBufferProcs
*
tp_as_buffer
;
/* Flags to define presence of optional/expanded features */
long
tp_flags
;
char
*
tp_doc
;
/* Documentation string */
/* Assigned meaning in release 2.0 */
/* call function for all accessible objects */
traverseproc
tp_traverse
;
/* delete references to contained objects */
inquiry
tp_clear
;
/* Assigned meaning in release 2.1 */
/* rich comparisons */
richcmpfunc
tp_richcompare
;
/* weak reference enabler */
long
tp_weaklistoffset
;
/* Added in release 2.2 */
/* Iterators */
getiterfunc
tp_iter
;
iternextfunc
tp_iternext
;
/* Attribute descriptor and subclassing stuff */
struct
PyMethodDef
*
tp_methods
;
struct
memberlist
*
tp_members
;
struct
getsetlist
*
tp_getset
;
struct
_typeobject
*
tp_base
;
PyObject
*
tp_dict
;
descrgetfunc
tp_descr_get
;
descrsetfunc
tp_descr_set
;
long
tp_dictoffset
;
initproc
tp_init
;
allocfunc
tp_alloc
;
newfunc
tp_new
;
destructor
tp_free
;
/* Low-level free-memory routine */
inquiry
tp_is_gc
;
/* For PyObject_IS_GC */
PyObject
*
tp_bases
;
PyObject
*
tp_mro
;
/* method resolution order */
PyObject
*
tp_cache
;
PyObject
*
tp_subclasses
;
PyObject
*
tp_weaklist
;
}
PyTypeObject
;
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