Skip to content

Commit 5fd1996

Browse files
committed
Expose PyCapsule type and methods
1 parent 8757a30 commit 5fd1996

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/cpython/pointers.jl

+7
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,12 @@ const CAPI_FUNC_SIGS = Dict{Symbol, Pair{Tuple, Type}}(
167167
:PySlice_New => (PyPtr, PyPtr, PyPtr) => PyPtr,
168168
# METHOD
169169
:PyInstanceMethod_New => (PyPtr,) => PyPtr,
170+
# CAPSULE
171+
:PyCapsule_New => (Ptr{Cvoid}, Ptr{Cchar}, Ptr{Cvoid}) => PyPtr,
172+
:PyCapsule_GetName => (PyPtr,) => Ptr{Cchar},
173+
:PyCapsule_SetName => (PyPtr, Ptr{Cchar}) => Cint,
174+
:PyCapsule_GetPointer => (PyPtr, Ptr{Cchar}) => Ptr{Cvoid},
175+
:PyCapsule_SetDestructor => (PyPtr, Ptr{Cvoid}) => Cint,
170176
)
171177

172178
const CAPI_EXCEPTIONS = Set([
@@ -254,6 +260,7 @@ const CAPI_OBJECTS = Set([
254260
:PyUnicode_Type,
255261
:PyTuple_Type,
256262
:PyType_Type,
263+
:PyCapsule_Type,
257264
# OTHERS
258265
:_Py_TrueStruct,
259266
:_Py_FalseStruct,

0 commit comments

Comments
 (0)