@@ -118,6 +118,7 @@ typedef struct {
118
118
#define Py_TYPE (ob ) (((PyObject*)(ob))->ob_type)
119
119
#define Py_SIZE (ob ) (((PyVarObject*)(ob))->ob_size)
120
120
121
+ #ifndef Py_LIMITED_API
121
122
/********************* String Literals ****************************************/
122
123
/* This structure helps managing static strings. The basic usage goes like this:
123
124
Instead of doing
@@ -148,6 +149,8 @@ typedef struct _Py_Identifier {
148
149
#define _Py_static_string (varname , value ) static _Py_Identifier varname = _Py_static_string_init(value)
149
150
#define _Py_IDENTIFIER (varname ) _Py_static_string(PyId_##varname, #varname)
150
151
152
+ #endif /* !Py_LIMITED_API */
153
+
151
154
/*
152
155
Type objects contain a string containing the type name (to help somewhat
153
156
in debugging), the allocation parameters (see PyObject_New() and
@@ -512,8 +515,8 @@ PyAPI_FUNC(PyObject *) _PyType_GetTextSignatureFromInternalDoc(const char *, con
512
515
#endif
513
516
514
517
/* Generic operations on objects */
515
- struct _Py_Identifier ;
516
518
#ifndef Py_LIMITED_API
519
+ struct _Py_Identifier ;
517
520
PyAPI_FUNC (int ) PyObject_Print (PyObject * , FILE * , int );
518
521
PyAPI_FUNC (void ) _Py_BreakPoint (void );
519
522
PyAPI_FUNC (void ) _PyObject_Dump (PyObject * );
@@ -530,11 +533,11 @@ PyAPI_FUNC(int) PyObject_HasAttrString(PyObject *, const char *);
530
533
PyAPI_FUNC (PyObject * ) PyObject_GetAttr (PyObject * , PyObject * );
531
534
PyAPI_FUNC (int ) PyObject_SetAttr (PyObject * , PyObject * , PyObject * );
532
535
PyAPI_FUNC (int ) PyObject_HasAttr (PyObject * , PyObject * );
536
+ #ifndef Py_LIMITED_API
533
537
PyAPI_FUNC (int ) _PyObject_IsAbstract (PyObject * );
534
538
PyAPI_FUNC (PyObject * ) _PyObject_GetAttrId (PyObject * , struct _Py_Identifier * );
535
539
PyAPI_FUNC (int ) _PyObject_SetAttrId (PyObject * , struct _Py_Identifier * , PyObject * );
536
540
PyAPI_FUNC (int ) _PyObject_HasAttrId (PyObject * , struct _Py_Identifier * );
537
- #ifndef Py_LIMITED_API
538
541
PyAPI_FUNC (PyObject * * ) _PyObject_GetDictPtr (PyObject * );
539
542
#endif
540
543
PyAPI_FUNC (PyObject * ) PyObject_SelfIter (PyObject * );
@@ -557,13 +560,15 @@ PyAPI_FUNC(void) PyObject_CallFinalizer(PyObject *);
557
560
PyAPI_FUNC (int ) PyObject_CallFinalizerFromDealloc (PyObject * );
558
561
#endif
559
562
563
+ #ifndef Py_LIMITED_API
560
564
/* Same as PyObject_Generic{Get,Set}Attr, but passing the attributes
561
565
dict as the last parameter. */
562
566
PyAPI_FUNC (PyObject * )
563
567
_PyObject_GenericGetAttrWithDict (PyObject * , PyObject * , PyObject * );
564
568
PyAPI_FUNC (int )
565
569
_PyObject_GenericSetAttrWithDict (PyObject * , PyObject * ,
566
570
PyObject * , PyObject * );
571
+ #endif /* !Py_LIMITED_API */
567
572
568
573
/* Helper to look up a builtin object */
569
574
#ifndef Py_LIMITED_API
@@ -888,8 +893,10 @@ they can have object code that is not dependent on Python compilation flags.
888
893
PyAPI_FUNC (void ) Py_IncRef (PyObject * );
889
894
PyAPI_FUNC (void ) Py_DecRef (PyObject * );
890
895
896
+ #ifndef Py_LIMITED_API
891
897
PyAPI_DATA (PyTypeObject ) _PyNone_Type ;
892
898
PyAPI_DATA (PyTypeObject ) _PyNotImplemented_Type ;
899
+ #endif /* !Py_LIMITED_API */
893
900
894
901
/*
895
902
_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 */
922
929
#define Py_GT 4
923
930
#define Py_GE 5
924
931
932
+ #ifndef Py_LIMITED_API
925
933
/* Maps Py_LT to Py_GT, ..., Py_GE to Py_LE.
926
934
* Defined in object.c.
927
935
*/
928
936
PyAPI_DATA (int ) _Py_SwappedOp [];
937
+ #endif /* !Py_LIMITED_API */
929
938
930
939
931
940
/*
@@ -1022,12 +1031,14 @@ chain of N deallocations is broken into N / PyTrash_UNWIND_LEVEL pieces,
1022
1031
with the call stack never exceeding a depth of PyTrash_UNWIND_LEVEL.
1023
1032
*/
1024
1033
1034
+ #ifndef Py_LIMITED_API
1025
1035
/* This is the old private API, invoked by the macros before 3.2.4.
1026
1036
Kept for binary compatibility of extensions using the stable ABI. */
1027
1037
PyAPI_FUNC (void ) _PyTrash_deposit_object (PyObject * );
1028
1038
PyAPI_FUNC (void ) _PyTrash_destroy_chain (void );
1029
1039
PyAPI_DATA (int ) _PyTrash_delete_nesting ;
1030
1040
PyAPI_DATA (PyObject * ) _PyTrash_delete_later ;
1041
+ #endif /* !Py_LIMITED_API */
1031
1042
1032
1043
/* The new thread-safe private API, invoked by the macros below. */
1033
1044
PyAPI_FUNC (void ) _PyTrash_thread_deposit_object (PyObject * );
0 commit comments