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
4e9830f7
Kaydet (Commit)
4e9830f7
authored
Mar 25, 2010
tarafından
Larry Hastings
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove extraneous experimental code checked in by accident.
üst
c1f842b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
92 deletions
+0
-92
pycapsule.h
Include/pycapsule.h
+0
-92
No files found.
Include/pycapsule.h
Dosyayı görüntüle @
4e9830f7
...
@@ -50,98 +50,6 @@ PyAPI_FUNC(int) PyCapsule_SetContext(PyObject *capsule, void *context);
...
@@ -50,98 +50,6 @@ PyAPI_FUNC(int) PyCapsule_SetContext(PyObject *capsule, void *context);
PyAPI_FUNC
(
void
*
)
PyCapsule_Import
(
const
char
*
name
,
int
no_block
);
PyAPI_FUNC
(
void
*
)
PyCapsule_Import
(
const
char
*
name
,
int
no_block
);
#define PYTHON_USING_CAPSULE
#define PYCAPSULE_INSTANTIATE_DESTRUCTOR(name, destructor) \
static void pycapsule_destructor_ ## name(PyObject *ptr) \
{ \
void *p = PyCapsule_GetPointer(ptr, name); \
if (p) { \
destructor(p); \
} \
} \
#define PYCAPSULE_NEW(pointer, name) \
(PyCapsule_New(pointer, name, capsule_destructor_ ## name))
#define PYCAPSULE_ISVALID(capsule, name) \
(PyCapsule_IsValid(capsule, name))
#define PYCAPSULE_DEREFERENCE(capsule, name) \
(PyCapsule_GetPointer(capsule, name))
#define PYCAPSULE_SET(capsule, name, value) \
(PyCapsule_IsValid(capsule, name) && PyCapsule_SetPointer(capsule, value))
/* module and attribute should be specified as string constants */
#define PYCAPSULE_IMPORT(module, attribute) \
(PyCapsule_Import(module "." attribute, 0))
/* begin public-domain code */
/*
** This code was written by Larry Hastings,
** and is dedicated to the public domain.
** It's designed to make it easy to switch
** from CObject to Capsule objects without losing
** backwards compatibility with prior versions
** of CPython. You're encouraged to copy this code
** (including this documentation) into your
** Python C extension.
**
** To use:
** * #define a name for the pointer you store in
** the CObject. If you make the CObject available
** as part of your module's API, this name should
** be "modulename.attributename", and it should be
** considered part of your API (so put it in your
** header file).
** * Specify a PYCAPSULE_INSTANTIATE_DESTRUCTOR(), in
** every C file that creates these CObjects. This
** is where you specify your object's destructor.
** * Change all calls to CObject_FromVoidPtr()
** and CObject_FromVoidPointerAndDesc() into
** PYCAPSULE_NEW() calls.
** * Change all calls to PyCObject_AsVoidPtr()
** into PYCAPSULE_DEREFERENCE() calls.
** * Change all calls to PyCObject_SetVoidPtr()
** into PYCAPSULE_SET() calls.
** * Change all calls to PyCObject_Import()
** into PYCAPSULE_IMPORT() calls. Note that
** the two arguments to PYCAPSULE_IMPORT()
** should both be string constants; that is,
** you should call
** PYCAPSULE_IMPORT("modulename", "attributename"),
** not PYCAPSULE_IMPORT(charstar1, charstar2).
*/
#ifndef PYTHON_USING_CAPSULE
#define PYCAPSULE_INSTANTIATE_DESTRUCTOR(name, destructor) \
static void pycapsule_destructor_ ## name(void *ptr) \
{ \
destructor(p); \
} \
#define PYCAPSULE_NEW(pointer, name) \
(PyCObject_FromVoidPtr(pointer, pycapsule_destructor_ ## name))
#define PYCAPSULE_ISVALID(capsule, name) \
(PyCObject_Check(capsule))
#define PYCAPSULE_DEREFERENCE(capsule, name) \
(PyCObject_AsVoidPtr(capsule))
#define PYCAPSULE_SET(capsule, name, value) \
(PyCObject_SetVoidPtr(capsule, value))
/* module and attribute should be specified as string constants */
#define PYCAPSULE_IMPORT(module, attribute) \
(PyCObject_Import(module, attribute))
#endif
/* PYTHON_USING_CAPSULE */
/* end public-domain code */
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
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