Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2bbe7d56
Commit
2bbe7d56
authored
Sep 11, 2016
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #26900: Excluded underscored names and other private API from limited API.
parent
48bc4418
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
74 additions
and
15 deletions
+74
-15
Doc/whatsnew/3.5.rst
Doc/whatsnew/3.5.rst
+1
-2
Include/abstract.h
Include/abstract.h
+9
-1
Include/ceval.h
Include/ceval.h
+2
-0
Include/descrobject.h
Include/descrobject.h
+2
-0
Include/dictobject.h
Include/dictobject.h
+5
-1
Include/fileutils.h
Include/fileutils.h
+2
-6
Include/import.h
Include/import.h
+2
-0
Include/intrcheck.h
Include/intrcheck.h
+3
-0
Include/longobject.h
Include/longobject.h
+2
-0
Include/modsupport.h
Include/modsupport.h
+4
-0
Include/namespaceobject.h
Include/namespaceobject.h
+2
-0
Include/object.h
Include/object.h
+13
-2
Include/objimpl.h
Include/objimpl.h
+4
-0
Include/pygetopt.h
Include/pygetopt.h
+1
-1
Include/pylifecycle.h
Include/pylifecycle.h
+2
-0
Include/pystate.h
Include/pystate.h
+10
-0
Include/pystrhex.h
Include/pystrhex.h
+2
-0
Include/sysmodule.h
Include/sysmodule.h
+2
-2
Include/traceback.h
Include/traceback.h
+2
-0
Include/unicodeobject.h
Include/unicodeobject.h
+2
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Doc/whatsnew/3.5.rst
View file @
2bbe7d56
...
...
@@ -2176,8 +2176,7 @@ New ``calloc`` functions were added:
* :c:func:`PyMem_RawCalloc`,
* :c:func:`PyMem_Calloc`,
* :c:func:`PyObject_Calloc`,
* :c:func:`_PyObject_GC_Calloc`.
* :c:func:`PyObject_Calloc`.
(Contributed by Victor Stinner in :issue:`21233`.)
...
...
Include/abstract.h
View file @
2bbe7d56
...
...
@@ -7,7 +7,9 @@ extern "C" {
#ifdef PY_SSIZE_T_CLEAN
#define PyObject_CallFunction _PyObject_CallFunction_SizeT
#define PyObject_CallMethod _PyObject_CallMethod_SizeT
#ifndef Py_LIMITED_API
#define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT
#endif
/* !Py_LIMITED_API */
#endif
/* Abstract Object Interface (many thanks to Jim Fulton) */
...
...
@@ -385,6 +387,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
Python expression: o.method(args).
*/
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
PyObject
*
)
_PyObject_CallMethodId
(
PyObject
*
o
,
_Py_Identifier
*
method
,
const
char
*
format
,
...);
...
...
@@ -393,6 +396,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
Like PyObject_CallMethod, but expect a _Py_Identifier* as the
method name.
*/
#endif
/* !Py_LIMITED_API */
PyAPI_FUNC
(
PyObject
*
)
_PyObject_CallFunction_SizeT
(
PyObject
*
callable
,
const
char
*
format
,
...
...
@@ -401,10 +405,12 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
const
char
*
name
,
const
char
*
format
,
...);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
PyObject
*
)
_PyObject_CallMethodId_SizeT
(
PyObject
*
o
,
_Py_Identifier
*
name
,
const
char
*
format
,
...);
#endif
/* !Py_LIMITED_API */
PyAPI_FUNC
(
PyObject
*
)
PyObject_CallFunctionObjArgs
(
PyObject
*
callable
,
...);
...
...
@@ -420,9 +426,11 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
PyAPI_FUNC
(
PyObject
*
)
PyObject_CallMethodObjArgs
(
PyObject
*
o
,
PyObject
*
method
,
...);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
PyObject
*
)
_PyObject_CallMethodIdObjArgs
(
PyObject
*
o
,
struct
_Py_Identifier
*
method
,
...);
#endif
/* !Py_LIMITED_API */
/*
Call the method named m of object o with a variable number of
...
...
@@ -1340,13 +1348,13 @@ PyAPI_FUNC(int) _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
PyAPI_FUNC
(
char
*
const
*
)
_PySequence_BytesToCharpArray
(
PyObject
*
self
);
PyAPI_FUNC
(
void
)
_Py_FreeCharPArray
(
char
*
const
array
[]);
#endif
/* For internal use by buffer API functions */
PyAPI_FUNC
(
void
)
_Py_add_one_to_index_F
(
int
nd
,
Py_ssize_t
*
index
,
const
Py_ssize_t
*
shape
);
PyAPI_FUNC
(
void
)
_Py_add_one_to_index_C
(
int
nd
,
Py_ssize_t
*
index
,
const
Py_ssize_t
*
shape
);
#endif
/* !Py_LIMITED_API */
#ifdef __cplusplus
...
...
Include/ceval.h
View file @
2bbe7d56
...
...
@@ -179,7 +179,9 @@ PyAPI_FUNC(void) PyEval_RestoreThread(PyThreadState *);
PyAPI_FUNC
(
int
)
PyEval_ThreadsInitialized
(
void
);
PyAPI_FUNC
(
void
)
PyEval_InitThreads
(
void
);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
void
)
_PyEval_FiniThreads
(
void
);
#endif
/* !Py_LIMITED_API */
PyAPI_FUNC
(
void
)
PyEval_AcquireLock
(
void
);
PyAPI_FUNC
(
void
)
PyEval_ReleaseLock
(
void
);
PyAPI_FUNC
(
void
)
PyEval_AcquireThread
(
PyThreadState
*
tstate
);
...
...
Include/descrobject.h
View file @
2bbe7d56
...
...
@@ -78,7 +78,9 @@ PyAPI_DATA(PyTypeObject) PyMemberDescr_Type;
PyAPI_DATA
(
PyTypeObject
)
PyMethodDescr_Type
;
PyAPI_DATA
(
PyTypeObject
)
PyWrapperDescr_Type
;
PyAPI_DATA
(
PyTypeObject
)
PyDictProxy_Type
;
#ifndef Py_LIMITED_API
PyAPI_DATA
(
PyTypeObject
)
_PyMethodWrapper_Type
;
#endif
/* Py_LIMITED_API */
PyAPI_FUNC
(
PyObject
*
)
PyDescr_NewMethod
(
PyTypeObject
*
,
PyMethodDef
*
);
PyAPI_FUNC
(
PyObject
*
)
PyDescr_NewClassMethod
(
PyTypeObject
*
,
PyMethodDef
*
);
...
...
Include/dictobject.h
View file @
2bbe7d56
...
...
@@ -73,9 +73,9 @@ PyAPI_FUNC(PyObject *) _PyDict_GetItem_KnownHash(PyObject *mp, PyObject *key,
Py_hash_t
hash
);
#endif
PyAPI_FUNC
(
PyObject
*
)
PyDict_GetItemWithError
(
PyObject
*
mp
,
PyObject
*
key
);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
PyObject
*
)
_PyDict_GetItemIdWithError
(
PyObject
*
dp
,
struct
_Py_Identifier
*
key
);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
PyObject
*
)
PyDict_SetDefault
(
PyObject
*
mp
,
PyObject
*
key
,
PyObject
*
defaultobj
);
#endif
...
...
@@ -145,9 +145,13 @@ PyAPI_FUNC(int) PyDict_MergeFromSeq2(PyObject *d,
int
override
);
PyAPI_FUNC
(
PyObject
*
)
PyDict_GetItemString
(
PyObject
*
dp
,
const
char
*
key
);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
PyObject
*
)
_PyDict_GetItemId
(
PyObject
*
dp
,
struct
_Py_Identifier
*
key
);
#endif
/* !Py_LIMITED_API */
PyAPI_FUNC
(
int
)
PyDict_SetItemString
(
PyObject
*
dp
,
const
char
*
key
,
PyObject
*
item
);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
int
)
_PyDict_SetItemId
(
PyObject
*
dp
,
struct
_Py_Identifier
*
key
,
PyObject
*
item
);
#endif
/* !Py_LIMITED_API */
PyAPI_FUNC
(
int
)
PyDict_DelItemString
(
PyObject
*
dp
,
const
char
*
key
);
#ifndef Py_LIMITED_API
...
...
Include/fileutils.h
View file @
2bbe7d56
...
...
@@ -5,8 +5,6 @@
extern
"C"
{
#endif
PyAPI_FUNC
(
PyObject
*
)
_Py_device_encoding
(
int
);
PyAPI_FUNC
(
wchar_t
*
)
Py_DecodeLocale
(
const
char
*
arg
,
size_t
*
size
);
...
...
@@ -17,6 +15,8 @@ PyAPI_FUNC(char*) Py_EncodeLocale(
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
PyObject
*
)
_Py_device_encoding
(
int
);
#ifdef MS_WINDOWS
struct
_Py_stat_struct
{
unsigned
long
st_dev
;
...
...
@@ -46,13 +46,11 @@ PyAPI_FUNC(int) _Py_fstat(
PyAPI_FUNC
(
int
)
_Py_fstat_noraise
(
int
fd
,
struct
_Py_stat_struct
*
status
);
#endif
/* Py_LIMITED_API */
PyAPI_FUNC
(
int
)
_Py_stat
(
PyObject
*
path
,
struct
stat
*
status
);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
int
)
_Py_open
(
const
char
*
pathname
,
int
flags
);
...
...
@@ -60,7 +58,6 @@ PyAPI_FUNC(int) _Py_open(
PyAPI_FUNC
(
int
)
_Py_open_noraise
(
const
char
*
pathname
,
int
flags
);
#endif
PyAPI_FUNC
(
FILE
*
)
_Py_wfopen
(
const
wchar_t
*
path
,
...
...
@@ -107,7 +104,6 @@ PyAPI_FUNC(wchar_t*) _Py_wgetcwd(
wchar_t
*
buf
,
size_t
size
);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
int
)
_Py_get_inheritable
(
int
fd
);
PyAPI_FUNC
(
int
)
_Py_set_inheritable
(
int
fd
,
int
inheritable
,
...
...
Include/import.h
View file @
2bbe7d56
...
...
@@ -7,7 +7,9 @@
extern
"C"
{
#endif
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
void
)
_PyImportZip_Init
(
void
);
#endif
/* !Py_LIMITED_API */
PyMODINIT_FUNC
PyInit_imp
(
void
);
PyAPI_FUNC
(
long
)
PyImport_GetMagicNumber
(
void
);
...
...
Include/intrcheck.h
View file @
2bbe7d56
...
...
@@ -8,12 +8,15 @@ extern "C" {
PyAPI_FUNC
(
int
)
PyOS_InterruptOccurred
(
void
);
PyAPI_FUNC
(
void
)
PyOS_InitInterrupts
(
void
);
PyAPI_FUNC
(
void
)
PyOS_AfterFork
(
void
);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
int
)
_PyOS_IsMainThread
(
void
);
#ifdef MS_WINDOWS
/* windows.h is not included by Python.h so use void* instead of HANDLE */
PyAPI_FUNC
(
void
*
)
_PyOS_SigintEvent
(
void
);
#endif
#endif
/* !Py_LIMITED_API */
#ifdef __cplusplus
}
...
...
Include/longobject.h
View file @
2bbe7d56
...
...
@@ -204,8 +204,10 @@ PyAPI_FUNC(int) _PyLong_FormatAdvancedWriter(
PyAPI_FUNC
(
unsigned
long
)
PyOS_strtoul
(
const
char
*
,
char
**
,
int
);
PyAPI_FUNC
(
long
)
PyOS_strtol
(
const
char
*
,
char
**
,
int
);
#ifndef Py_LIMITED_API
/* For use by the gcd function in mathmodule.c */
PyAPI_FUNC
(
PyObject
*
)
_PyLong_GCD
(
PyObject
*
,
PyObject
*
);
#endif
/* !Py_LIMITED_API */
#ifdef __cplusplus
}
...
...
Include/modsupport.h
View file @
2bbe7d56
...
...
@@ -15,12 +15,16 @@ extern "C" {
#define PyArg_Parse _PyArg_Parse_SizeT
#define PyArg_ParseTuple _PyArg_ParseTuple_SizeT
#define PyArg_ParseTupleAndKeywords _PyArg_ParseTupleAndKeywords_SizeT
#ifndef Py_LIMITED_API
#define PyArg_VaParse _PyArg_VaParse_SizeT
#define PyArg_VaParseTupleAndKeywords _PyArg_VaParseTupleAndKeywords_SizeT
#endif
/* !Py_LIMITED_API */
#define Py_BuildValue _Py_BuildValue_SizeT
#define Py_VaBuildValue _Py_VaBuildValue_SizeT
#else
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
PyObject
*
)
_Py_VaBuildValue_SizeT
(
const
char
*
,
va_list
);
#endif
/* !Py_LIMITED_API */
#endif
/* Due to a glitch in 3.2, the _SizeT versions weren't exported from the DLL. */
...
...
Include/namespaceobject.h
View file @
2bbe7d56
...
...
@@ -7,9 +7,11 @@
extern
"C"
{
#endif
#ifndef Py_LIMITED_API
PyAPI_DATA
(
PyTypeObject
)
_PyNamespace_Type
;
PyAPI_FUNC
(
PyObject
*
)
_PyNamespace_New
(
PyObject
*
kwds
);
#endif
/* !Py_LIMITED_API */
#ifdef __cplusplus
}
...
...
Include/object.h
View file @
2bbe7d56
...
...
@@ -118,6 +118,7 @@ typedef struct {
#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
#define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
#ifndef Py_LIMITED_API
/********************* String Literals ****************************************/
/* This structure helps managing static strings. The basic usage goes like this:
Instead of doing
...
...
@@ -148,6 +149,8 @@ typedef struct _Py_Identifier {
#define _Py_static_string(varname, value) static _Py_Identifier varname = _Py_static_string_init(value)
#define _Py_IDENTIFIER(varname) _Py_static_string(PyId_##varname, #varname)
#endif
/* !Py_LIMITED_API */
/*
Type objects contain a string containing the type name (to help somewhat
in debugging), the allocation parameters (see PyObject_New() and
...
...
@@ -512,8 +515,8 @@ PyAPI_FUNC(PyObject *) _PyType_GetTextSignatureFromInternalDoc(const char *, con
#endif
/* Generic operations on objects */
struct
_Py_Identifier
;
#ifndef Py_LIMITED_API
struct
_Py_Identifier
;
PyAPI_FUNC
(
int
)
PyObject_Print
(
PyObject
*
,
FILE
*
,
int
);
PyAPI_FUNC
(
void
)
_Py_BreakPoint
(
void
);
PyAPI_FUNC
(
void
)
_PyObject_Dump
(
PyObject
*
);
...
...
@@ -530,11 +533,11 @@ PyAPI_FUNC(int) PyObject_HasAttrString(PyObject *, const char *);
PyAPI_FUNC
(
PyObject
*
)
PyObject_GetAttr
(
PyObject
*
,
PyObject
*
);
PyAPI_FUNC
(
int
)
PyObject_SetAttr
(
PyObject
*
,
PyObject
*
,
PyObject
*
);
PyAPI_FUNC
(
int
)
PyObject_HasAttr
(
PyObject
*
,
PyObject
*
);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
int
)
_PyObject_IsAbstract
(
PyObject
*
);
PyAPI_FUNC
(
PyObject
*
)
_PyObject_GetAttrId
(
PyObject
*
,
struct
_Py_Identifier
*
);
PyAPI_FUNC
(
int
)
_PyObject_SetAttrId
(
PyObject
*
,
struct
_Py_Identifier
*
,
PyObject
*
);
PyAPI_FUNC
(
int
)
_PyObject_HasAttrId
(
PyObject
*
,
struct
_Py_Identifier
*
);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
PyObject
**
)
_PyObject_GetDictPtr
(
PyObject
*
);
#endif
PyAPI_FUNC
(
PyObject
*
)
PyObject_SelfIter
(
PyObject
*
);
...
...
@@ -557,6 +560,7 @@ PyAPI_FUNC(void) PyObject_CallFinalizer(PyObject *);
PyAPI_FUNC
(
int
)
PyObject_CallFinalizerFromDealloc
(
PyObject
*
);
#endif
#ifndef Py_LIMITED_API
/* Same as PyObject_Generic{Get,Set}Attr, but passing the attributes
dict as the last parameter. */
PyAPI_FUNC
(
PyObject
*
)
...
...
@@ -564,6 +568,7 @@ _PyObject_GenericGetAttrWithDict(PyObject *, PyObject *, PyObject *);
PyAPI_FUNC
(
int
)
_PyObject_GenericSetAttrWithDict
(
PyObject
*
,
PyObject
*
,
PyObject
*
,
PyObject
*
);
#endif
/* !Py_LIMITED_API */
/* Helper to look up a builtin object */
#ifndef Py_LIMITED_API
...
...
@@ -888,8 +893,10 @@ they can have object code that is not dependent on Python compilation flags.
PyAPI_FUNC
(
void
)
Py_IncRef
(
PyObject
*
);
PyAPI_FUNC
(
void
)
Py_DecRef
(
PyObject
*
);
#ifndef Py_LIMITED_API
PyAPI_DATA
(
PyTypeObject
)
_PyNone_Type
;
PyAPI_DATA
(
PyTypeObject
)
_PyNotImplemented_Type
;
#endif
/* !Py_LIMITED_API */
/*
_Py_NoneStruct is an object of undefined type which can be used in contexts
...
...
@@ -922,10 +929,12 @@ PyAPI_DATA(PyObject) _Py_NotImplementedStruct; /* Don't use this directly */
#define Py_GT 4
#define Py_GE 5
#ifndef Py_LIMITED_API
/* Maps Py_LT to Py_GT, ..., Py_GE to Py_LE.
* Defined in object.c.
*/
PyAPI_DATA
(
int
)
_Py_SwappedOp
[];
#endif
/* !Py_LIMITED_API */
/*
...
...
@@ -1022,12 +1031,14 @@ chain of N deallocations is broken into N / PyTrash_UNWIND_LEVEL pieces,
with the call stack never exceeding a depth of PyTrash_UNWIND_LEVEL.
*/
#ifndef Py_LIMITED_API
/* This is the old private API, invoked by the macros before 3.2.4.
Kept for binary compatibility of extensions using the stable ABI. */
PyAPI_FUNC
(
void
)
_PyTrash_deposit_object
(
PyObject
*
);
PyAPI_FUNC
(
void
)
_PyTrash_destroy_chain
(
void
);
PyAPI_DATA
(
int
)
_PyTrash_delete_nesting
;
PyAPI_DATA
(
PyObject
*
)
_PyTrash_delete_later
;
#endif
/* !Py_LIMITED_API */
/* The new thread-safe private API, invoked by the macros below. */
PyAPI_FUNC
(
void
)
_PyTrash_thread_deposit_object
(
PyObject
*
);
...
...
Include/objimpl.h
View file @
2bbe7d56
...
...
@@ -99,8 +99,10 @@ PyAPI_FUNC(void *) PyObject_Calloc(size_t nelem, size_t elsize);
PyAPI_FUNC
(
void
*
)
PyObject_Realloc
(
void
*
ptr
,
size_t
new_size
);
PyAPI_FUNC
(
void
)
PyObject_Free
(
void
*
ptr
);
#ifndef Py_LIMITED_API
/* This function returns the number of allocated memory blocks, regardless of size */
PyAPI_FUNC
(
Py_ssize_t
)
_Py_GetAllocatedBlocks
(
void
);
#endif
/* !Py_LIMITED_API */
/* Macros */
#ifdef WITH_PYMALLOC
...
...
@@ -323,8 +325,10 @@ extern PyGC_Head *_PyGC_generation0;
(!PyTuple_CheckExact(obj) || _PyObject_GC_IS_TRACKED(obj)))
#endif
/* Py_LIMITED_API */
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
PyObject
*
)
_PyObject_GC_Malloc
(
size_t
size
);
PyAPI_FUNC
(
PyObject
*
)
_PyObject_GC_Calloc
(
size_t
size
);
#endif
/* !Py_LIMITED_API */
PyAPI_FUNC
(
PyObject
*
)
_PyObject_GC_New
(
PyTypeObject
*
);
PyAPI_FUNC
(
PyVarObject
*
)
_PyObject_GC_NewVar
(
PyTypeObject
*
,
Py_ssize_t
);
PyAPI_FUNC
(
void
)
PyObject_GC_Track
(
void
*
);
...
...
Include/pygetopt.h
View file @
2bbe7d56
...
...
@@ -11,9 +11,9 @@ PyAPI_DATA(int) _PyOS_optind;
PyAPI_DATA
(
wchar_t
*
)
_PyOS_optarg
;
PyAPI_FUNC
(
void
)
_PyOS_ResetGetOpt
(
void
);
#endif
PyAPI_FUNC
(
int
)
_PyOS_GetOpt
(
int
argc
,
wchar_t
**
argv
,
wchar_t
*
optstring
);
#endif
/* !Py_LIMITED_API */
#ifdef __cplusplus
}
...
...
Include/pylifecycle.h
View file @
2bbe7d56
...
...
@@ -117,9 +117,11 @@ typedef void (*PyOS_sighandler_t)(int);
PyAPI_FUNC
(
PyOS_sighandler_t
)
PyOS_getsig
(
int
);
PyAPI_FUNC
(
PyOS_sighandler_t
)
PyOS_setsig
(
int
,
PyOS_sighandler_t
);
#ifndef Py_LIMITED_API
/* Random */
PyAPI_FUNC
(
int
)
_PyOS_URandom
(
void
*
buffer
,
Py_ssize_t
size
);
PyAPI_FUNC
(
int
)
_PyOS_URandomNonblock
(
void
*
buffer
,
Py_ssize_t
size
);
#endif
/* !Py_LIMITED_API */
#ifdef __cplusplus
}
...
...
Include/pystate.h
View file @
2bbe7d56
...
...
@@ -157,7 +157,9 @@ typedef struct _ts {
PyAPI_FUNC
(
PyInterpreterState
*
)
PyInterpreterState_New
(
void
);
PyAPI_FUNC
(
void
)
PyInterpreterState_Clear
(
PyInterpreterState
*
);
PyAPI_FUNC
(
void
)
PyInterpreterState_Delete
(
PyInterpreterState
*
);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
int
)
_PyState_AddModule
(
PyObject
*
,
struct
PyModuleDef
*
);
#endif
/* !Py_LIMITED_API */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
/* New in 3.3 */
PyAPI_FUNC
(
int
)
PyState_AddModule
(
PyObject
*
,
struct
PyModuleDef
*
);
...
...
@@ -169,14 +171,20 @@ PyAPI_FUNC(void) _PyState_ClearModules(void);
#endif
PyAPI_FUNC
(
PyThreadState
*
)
PyThreadState_New
(
PyInterpreterState
*
);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
PyThreadState
*
)
_PyThreadState_Prealloc
(
PyInterpreterState
*
);
PyAPI_FUNC
(
void
)
_PyThreadState_Init
(
PyThreadState
*
);
#endif
/* !Py_LIMITED_API */
PyAPI_FUNC
(
void
)
PyThreadState_Clear
(
PyThreadState
*
);
PyAPI_FUNC
(
void
)
PyThreadState_Delete
(
PyThreadState
*
);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
void
)
_PyThreadState_DeleteExcept
(
PyThreadState
*
tstate
);
#endif
/* !Py_LIMITED_API */
#ifdef WITH_THREAD
PyAPI_FUNC
(
void
)
PyThreadState_DeleteCurrent
(
void
);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
void
)
_PyGILState_Reinit
(
void
);
#endif
/* !Py_LIMITED_API */
#endif
/* Return the current thread state. The global interpreter lock must be held.
...
...
@@ -184,9 +192,11 @@ PyAPI_FUNC(void) _PyGILState_Reinit(void);
* the caller needn't check for NULL). */
PyAPI_FUNC
(
PyThreadState
*
)
PyThreadState_Get
(
void
);
#ifndef Py_LIMITED_API
/* Similar to PyThreadState_Get(), but don't issue a fatal error
* if it is NULL. */
PyAPI_FUNC
(
PyThreadState
*
)
_PyThreadState_UncheckedGet
(
void
);
#endif
/* !Py_LIMITED_API */
PyAPI_FUNC
(
PyThreadState
*
)
PyThreadState_Swap
(
PyThreadState
*
);
PyAPI_FUNC
(
PyObject
*
)
PyThreadState_GetDict
(
void
);
...
...
Include/pystrhex.h
View file @
2bbe7d56
...
...
@@ -5,10 +5,12 @@
extern
"C"
{
#endif
#ifndef Py_LIMITED_API
/* Returns a str() containing the hex representation of argbuf. */
PyAPI_FUNC
(
PyObject
*
)
_Py_strhex
(
const
char
*
argbuf
,
const
Py_ssize_t
arglen
);
/* Returns a bytes() containing the ASCII hex representation of argbuf. */
PyAPI_FUNC
(
PyObject
*
)
_Py_strhex_bytes
(
const
char
*
argbuf
,
const
Py_ssize_t
arglen
);
#endif
/* !Py_LIMITED_API */
#ifdef __cplusplus
}
...
...
Include/sysmodule.h
View file @
2bbe7d56
...
...
@@ -8,11 +8,11 @@ extern "C" {
#endif
PyAPI_FUNC
(
PyObject
*
)
PySys_GetObject
(
const
char
*
);
PyAPI_FUNC
(
int
)
PySys_SetObject
(
const
char
*
,
PyObject
*
);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
PyObject
*
)
_PySys_GetObjectId
(
_Py_Identifier
*
key
);
#endif
PyAPI_FUNC
(
int
)
PySys_SetObject
(
const
char
*
,
PyObject
*
);
PyAPI_FUNC
(
int
)
_PySys_SetObjectId
(
_Py_Identifier
*
key
,
PyObject
*
);
#endif
PyAPI_FUNC
(
void
)
PySys_SetArgv
(
int
,
wchar_t
**
);
PyAPI_FUNC
(
void
)
PySys_SetArgvEx
(
int
,
wchar_t
**
,
int
);
...
...
Include/traceback.h
View file @
2bbe7d56
...
...
@@ -31,6 +31,7 @@ PyAPI_FUNC(void) _PyTraceback_Add(const char *, const char *, int);
PyAPI_DATA
(
PyTypeObject
)
PyTraceBack_Type
;
#define PyTraceBack_Check(v) (Py_TYPE(v) == &PyTraceBack_Type)
#ifndef Py_LIMITED_API
/* Write the Python traceback into the file 'fd'. For example:
Traceback (most recent call first):
...
...
@@ -79,6 +80,7 @@ PyAPI_FUNC(const char*) _Py_DumpTracebackThreads(
int
fd
,
PyInterpreterState
*
interp
,
PyThreadState
*
current_tstate
);
#endif
/* !Py_LIMITED_API */
#ifndef Py_LIMITED_API
...
...
Include/unicodeobject.h
View file @
2bbe7d56
...
...
@@ -2257,6 +2257,7 @@ PyAPI_FUNC(int) _PyUnicode_CheckConsistency(
int
check_content
);
#endif
#ifndef Py_LIMITED_API
/* Return an interned Unicode object for an Identifier; may fail if there is no memory.*/
PyAPI_FUNC
(
PyObject
*
)
_PyUnicode_FromId
(
_Py_Identifier
*
);
/* Clear all static strings. */
...
...
@@ -2265,6 +2266,7 @@ PyAPI_FUNC(void) _PyUnicode_ClearStaticStrings(void);
/* Fast equality check when the inputs are known to be exact unicode types
and where the hash values are equal (i.e. a very probable match) */
PyAPI_FUNC
(
int
)
_PyUnicode_EQ
(
PyObject
*
,
PyObject
*
);
#endif
/* !Py_LIMITED_API */
#ifdef __cplusplus
}
...
...
Misc/NEWS
View file @
2bbe7d56
...
...
@@ -369,6 +369,8 @@ IDLE
C
API
-----
-
Issue
#
26900
:
Excluded
underscored
names
and
other
private
API
from
limited
API
.
-
Issue
#
26027
:
Add
support
for
path
-
like
objects
in
PyUnicode_FSConverter
()
&
PyUnicode_FSDecoder
().
...
...
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