gh-98410: move getbufferproc and releasebufferproc to buffer.h (#31158)

This adds them to the Limited API.
This commit is contained in:
David Hewitt 2022-10-31 14:01:32 +00:00 committed by GitHub
parent a41de32942
commit e98923c0be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 4 deletions

View File

@ -865,6 +865,7 @@ type,descrsetfunc,3.2,,
type,destructor,3.2,, type,destructor,3.2,,
type,getattrfunc,3.2,, type,getattrfunc,3.2,,
type,getattrofunc,3.2,, type,getattrofunc,3.2,,
type,getbufferproc,3.12,,
type,getiterfunc,3.2,, type,getiterfunc,3.2,,
type,getter,3.2,, type,getter,3.2,,
type,hashfunc,3.2,, type,hashfunc,3.2,,
@ -875,6 +876,7 @@ type,lenfunc,3.2,,
type,newfunc,3.2,, type,newfunc,3.2,,
type,objobjargproc,3.2,, type,objobjargproc,3.2,,
type,objobjproc,3.2,, type,objobjproc,3.2,,
type,releasebufferproc,3.12,,
type,reprfunc,3.2,, type,reprfunc,3.2,,
type,richcmpfunc,3.2,, type,richcmpfunc,3.2,,
type,setattrfunc,3.2,, type,setattrfunc,3.2,,

View File

@ -51,10 +51,6 @@ typedef struct _Py_Identifier {
#endif /* NEEDS_PY_IDENTIFIER */ #endif /* NEEDS_PY_IDENTIFIER */
typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
typedef struct { typedef struct {
/* Number implementations must check *both* /* Number implementations must check *both*
arguments for proper type and implement the necessary conversions arguments for proper type and implement the necessary conversions

View File

@ -32,6 +32,9 @@ typedef struct {
void *internal; void *internal;
} Py_buffer; } Py_buffer;
typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
/* Return 1 if the getbuffer function is available, otherwise return 0. */ /* Return 1 if the getbuffer function is available, otherwise return 0. */
PyAPI_FUNC(int) PyObject_CheckBuffer(PyObject *obj); PyAPI_FUNC(int) PyObject_CheckBuffer(PyObject *obj);

View File

@ -0,0 +1 @@
Add ``getbufferproc`` and ``releasebufferproc`` to the stable API.

View File

@ -2299,3 +2299,7 @@
added = '3.12' added = '3.12'
[macro.PY_VECTORCALL_ARGUMENTS_OFFSET] [macro.PY_VECTORCALL_ARGUMENTS_OFFSET]
added = '3.12' added = '3.12'
[typedef.getbufferproc]
added = '3.12'
[typedef.releasebufferproc]
added = '3.12'