| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,8 +15,8 @@ PyAPI_DATA(PyTypeObject) PyBool_Type; | |||
| 15 | 15 | Don't forget to apply Py_INCREF() when returning either!!! */ | |
| 16 | 16 | ||
| 17 | 17 | /* Don't use these directly */ | |
| 18 | - PyAPI_DATA(struct _longobject) _Py_FalseStruct; | ||
| 19 | - PyAPI_DATA(struct _longobject) _Py_TrueStruct; | ||
| 18 | + PyAPI_DATA(PyLongObject) _Py_FalseStruct; | ||
| 19 | + PyAPI_DATA(PyLongObject) _Py_TrueStruct; | ||
| 20 | 20 | ||
| 21 | 21 | /* Use these macros */ | |
| 22 | 22 | #define Py_False ((PyObject *) &_Py_FalseStruct) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -133,7 +133,7 @@ PyAPI_FUNC(PyObject *) _PyObject_CallMethodId_SizeT(PyObject *obj, | |||
| 133 | 133 | ||
| 134 | 134 | PyAPI_FUNC(PyObject *) _PyObject_CallMethodIdObjArgs( | |
| 135 | 135 | PyObject *obj, | |
| 136 | - struct _Py_Identifier *name, | ||
| 136 | + _Py_Identifier *name, | ||
| 137 | 137 | ...); | |
| 138 | 138 | ||
| 139 | 139 | static inline PyObject * | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,7 +43,7 @@ typedef struct { | |||
| 43 | 43 | ||
| 44 | 44 | typedef struct { | |
| 45 | 45 | PyDescr_COMMON; | |
| 46 | - struct PyMemberDef *d_member; | ||
| 46 | + PyMemberDef *d_member; | ||
| 47 | 47 | } PyMemberDescrObject; | |
| 48 | 48 | ||
| 49 | 49 | typedef struct { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,7 +32,7 @@ PyAPI_FUNC(PyObject *) _PyDict_GetItem_KnownHash(PyObject *mp, PyObject *key, | |||
| 32 | 32 | Py_hash_t hash); | |
| 33 | 33 | PyAPI_FUNC(PyObject *) _PyDict_GetItemWithError(PyObject *dp, PyObject *key); | |
| 34 | 34 | PyAPI_FUNC(PyObject *) _PyDict_GetItemIdWithError(PyObject *dp, | |
| 35 | - struct _Py_Identifier *key); | ||
| 35 | + _Py_Identifier *key); | ||
| 36 | 36 | PyAPI_FUNC(PyObject *) _PyDict_GetItemStringWithError(PyObject *, const char *); | |
| 37 | 37 | PyAPI_FUNC(PyObject *) PyDict_SetDefault( | |
| 38 | 38 | PyObject *mp, PyObject *key, PyObject *defaultobj); | |
@@ -49,7 +49,7 @@ PyAPI_FUNC(int) _PyDict_Next( | |||
| 49 | 49 | /* Get the number of items of a dictionary. */ | |
| 50 | 50 | #define PyDict_GET_SIZE(mp) (assert(PyDict_Check(mp)),((PyDictObject *)mp)->ma_used) | |
| 51 | 51 | PyAPI_FUNC(int) _PyDict_Contains_KnownHash(PyObject *, PyObject *, Py_hash_t); | |
| 52 | - PyAPI_FUNC(int) _PyDict_ContainsId(PyObject *, struct _Py_Identifier *); | ||
| 52 | + PyAPI_FUNC(int) _PyDict_ContainsId(PyObject *, _Py_Identifier *); | ||
| 53 | 53 | PyAPI_FUNC(PyObject *) _PyDict_NewPresized(Py_ssize_t minused); | |
| 54 | 54 | PyAPI_FUNC(void) _PyDict_MaybeUntrack(PyObject *mp); | |
| 55 | 55 | PyAPI_FUNC(int) _PyDict_HasOnlyStringKeys(PyObject *mp); | |
@@ -66,9 +66,9 @@ PyObject *_PyDict_FromKeys(PyObject *, PyObject *, PyObject *); | |||
| 66 | 66 | argument is raised. | |
| 67 | 67 | */ | |
| 68 | 68 | PyAPI_FUNC(int) _PyDict_MergeEx(PyObject *mp, PyObject *other, int override); | |
| 69 | - PyAPI_FUNC(int) _PyDict_SetItemId(PyObject *dp, struct _Py_Identifier *key, PyObject *item); | ||
| 69 | + PyAPI_FUNC(int) _PyDict_SetItemId(PyObject *dp, _Py_Identifier *key, PyObject *item); | ||
| 70 | 70 | ||
| 71 | - PyAPI_FUNC(int) _PyDict_DelItemId(PyObject *mp, struct _Py_Identifier *key); | ||
| 71 | + PyAPI_FUNC(int) _PyDict_DelItemId(PyObject *mp, _Py_Identifier *key); | ||
| 72 | 72 | PyAPI_FUNC(void) _PyDict_DebugMallocStats(FILE *out); | |
| 73 | 73 | ||
| 74 | 74 | int _PyObjectDict_SetItem(PyTypeObject *tp, PyObject **dictptr, PyObject *name, PyObject *value); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,7 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | 7 | struct _frame { | |
| 8 | 8 | PyObject_HEAD | |
| 9 | - struct _frame *f_back; /* previous frame, or NULL */ | ||
| 9 | + PyFrameObject *f_back; /* previous frame, or NULL */ | ||
| 10 | 10 | struct _interpreter_frame *f_frame; /* points to the frame data */ | |
| 11 | 11 | PyObject *f_trace; /* Trace function */ | |
| 12 | 12 | int f_lineno; /* Current line number. Only valid if non-zero */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,7 +6,7 @@ PyMODINIT_FUNC PyInit__imp(void); | |||
| 6 | 6 | ||
| 7 | 7 | PyAPI_FUNC(int) _PyImport_IsInitialized(PyInterpreterState *); | |
| 8 | 8 | ||
| 9 | - PyAPI_FUNC(PyObject *) _PyImport_GetModuleId(struct _Py_Identifier *name); | ||
| 9 | + PyAPI_FUNC(PyObject *) _PyImport_GetModuleId(_Py_Identifier *name); | ||
| 10 | 10 | PyAPI_FUNC(int) _PyImport_SetModule(PyObject *name, PyObject *module); | |
| 11 | 11 | PyAPI_FUNC(int) _PyImport_SetModuleString(const char *name, PyObject* module); | |
| 12 | 12 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -201,11 +201,11 @@ struct _typeobject { | |||
| 201 | 201 | iternextfunc tp_iternext; | |
| 202 | 202 | ||
| 203 | 203 | /* Attribute descriptor and subclassing stuff */ | |
| 204 | - struct PyMethodDef *tp_methods; | ||
| 205 | - struct PyMemberDef *tp_members; | ||
| 206 | - struct PyGetSetDef *tp_getset; | ||
| 204 | + PyMethodDef *tp_methods; | ||
| 205 | + PyMemberDef *tp_members; | ||
| 206 | + PyGetSetDef *tp_getset; | ||
| 207 | 207 | // Strong reference on a heap type, borrowed reference on a static type | |
| 208 | - struct _typeobject *tp_base; | ||
| 208 | + PyTypeObject *tp_base; | ||
| 209 | 209 | PyObject *tp_dict; | |
| 210 | 210 | descrgetfunc tp_descr_get; | |
| 211 | 211 | descrsetfunc tp_descr_set; | |
@@ -262,16 +262,16 @@ PyAPI_FUNC(PyObject *) _PyObject_LookupSpecialId(PyObject *, _Py_Identifier *); | |||
| 262 | 262 | PyAPI_FUNC(PyTypeObject *) _PyType_CalculateMetaclass(PyTypeObject *, PyObject *); | |
| 263 | 263 | PyAPI_FUNC(PyObject *) _PyType_GetDocFromInternalDoc(const char *, const char *); | |
| 264 | 264 | PyAPI_FUNC(PyObject *) _PyType_GetTextSignatureFromInternalDoc(const char *, const char *); | |
| 265 | - PyAPI_FUNC(PyObject *) PyType_GetModuleByDef(PyTypeObject *, struct PyModuleDef *); | ||
| 265 | + PyAPI_FUNC(PyObject *) PyType_GetModuleByDef(PyTypeObject *, PyModuleDef *); | ||
| 266 | 266 | ||
| 267 | 267 | PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int); | |
| 268 | 268 | PyAPI_FUNC(void) _Py_BreakPoint(void); | |
| 269 | 269 | PyAPI_FUNC(void) _PyObject_Dump(PyObject *); | |
| 270 | 270 | PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *); | |
| 271 | 271 | ||
| 272 | 272 | PyAPI_FUNC(int) _PyObject_IsAbstract(PyObject *); | |
| 273 | - PyAPI_FUNC(PyObject *) _PyObject_GetAttrId(PyObject *, struct _Py_Identifier *); | ||
| 274 | - PyAPI_FUNC(int) _PyObject_SetAttrId(PyObject *, struct _Py_Identifier *, PyObject *); | ||
| 273 | + PyAPI_FUNC(PyObject *) _PyObject_GetAttrId(PyObject *, _Py_Identifier *); | ||
| 274 | + PyAPI_FUNC(int) _PyObject_SetAttrId(PyObject *, _Py_Identifier *, PyObject *); | ||
| 275 | 275 | /* Replacements of PyObject_GetAttr() and _PyObject_GetAttrId() which | |
| 276 | 276 | don't raise AttributeError. | |
| 277 | 277 | ||
@@ -282,7 +282,7 @@ PyAPI_FUNC(int) _PyObject_SetAttrId(PyObject *, struct _Py_Identifier *, PyObjec | |||
| 282 | 282 | is raised. | |
| 283 | 283 | */ | |
| 284 | 284 | PyAPI_FUNC(int) _PyObject_LookupAttr(PyObject *, PyObject *, PyObject **); | |
| 285 | - PyAPI_FUNC(int) _PyObject_LookupAttrId(PyObject *, struct _Py_Identifier *, PyObject **); | ||
| 285 | + PyAPI_FUNC(int) _PyObject_LookupAttrId(PyObject *, _Py_Identifier *, PyObject **); | ||
| 286 | 286 | ||
| 287 | 287 | PyAPI_FUNC(int) _PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); | |
| 288 | 288 | ||
@@ -461,8 +461,8 @@ passed as second argument to Py_TRASHCAN_BEGIN(). | |||
| 461 | 461 | */ | |
| 462 | 462 | ||
| 463 | 463 | /* Python 3.9 private API, invoked by the macros below. */ | |
| 464 | - PyAPI_FUNC(int) _PyTrash_begin(struct _ts *tstate, PyObject *op); | ||
| 465 | - PyAPI_FUNC(void) _PyTrash_end(struct _ts *tstate); | ||
| 464 | + PyAPI_FUNC(int) _PyTrash_begin(PyThreadState *tstate, PyObject *op); | ||
| 465 | + PyAPI_FUNC(void) _PyTrash_end(PyThreadState *tstate); | ||
| 466 | 466 | /* Python 3.10 private API, invoked by the Py_TRASHCAN_BEGIN(). */ | |
| 467 | 467 | PyAPI_FUNC(int) _PyTrash_cond(PyObject *op, destructor dealloc); | |
| 468 | 468 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -79,12 +79,11 @@ typedef struct _stack_chunk { | |||
| 79 | 79 | PyObject * data[1]; /* Variable sized */ | |
| 80 | 80 | } _PyStackChunk; | |
| 81 | 81 | ||
| 82 | - // The PyThreadState typedef is in Include/pystate.h. | ||
| 83 | 82 | struct _ts { | |
| 84 | 83 | /* See Python/ceval.c for comments explaining most fields */ | |
| 85 | 84 | ||
| 86 | - struct _ts *prev; | ||
| 87 | - struct _ts *next; | ||
| 85 | + PyThreadState *prev; | ||
| 86 | + PyThreadState *next; | ||
| 88 | 87 | PyInterpreterState *interp; | |
| 89 | 88 | ||
| 90 | 89 | /* Has been initialized to a safe state. | |
@@ -308,12 +307,12 @@ PyAPI_FUNC(const PyConfig*) _Py_GetConfig(void); | |||
| 308 | 307 | ||
| 309 | 308 | /* cross-interpreter data */ | |
| 310 | 309 | ||
| 311 | - struct _xid; | ||
| 312 | - | ||
| 313 | 310 | // _PyCrossInterpreterData is similar to Py_buffer as an effectively | |
| 314 | 311 | // opaque struct that holds data outside the object machinery. This | |
| 315 | 312 | // is necessary to pass safely between interpreters in the same process. | |
| 316 | - typedef struct _xid { | ||
| 313 | + typedef struct _xid _PyCrossInterpreterData; | ||
| 314 | + | ||
| 315 | + struct _xid { | ||
| 317 | 316 | // data is the cross-interpreter-safe derivation of a Python object | |
| 318 | 317 | // (see _PyObject_GetCrossInterpreterData). It will be NULL if the | |
| 319 | 318 | // new_object func (below) encodes the data. | |
@@ -339,7 +338,7 @@ typedef struct _xid { | |||
| 339 | 338 | // interpreter given the data. The resulting object (a new | |
| 340 | 339 | // reference) will be equivalent to the original object. This field | |
| 341 | 340 | // is required. | |
| 342 | - PyObject *(*new_object)(struct _xid *); | ||
| 341 | + PyObject *(*new_object)(_PyCrossInterpreterData *); | ||
| 343 | 342 | // free is called when the data is released. If it is NULL then | |
| 344 | 343 | // nothing will be done to free the data. For some types this is | |
| 345 | 344 | // okay (e.g. bytes) and for those types this field should be set | |
@@ -350,7 +349,7 @@ typedef struct _xid { | |||
| 350 | 349 | // to PyMem_RawFree (the default if not explicitly set to NULL). | |
| 351 | 350 | // The call will happen with the original interpreter activated. | |
| 352 | 351 | void (*free)(void *); | |
| 353 | - } _PyCrossInterpreterData; | ||
| 352 | + }; | ||
| 354 | 353 | ||
| 355 | 354 | PyAPI_FUNC(int) _PyObject_GetCrossInterpreterData(PyObject *, _PyCrossInterpreterData *); | |
| 356 | 355 | PyAPI_FUNC(PyObject *) _PyCrossInterpreterData_NewObject(_PyCrossInterpreterData *); | |
@@ -360,7 +359,7 @@ PyAPI_FUNC(int) _PyObject_CheckCrossInterpreterData(PyObject *); | |||
| 360 | 359 | ||
| 361 | 360 | /* cross-interpreter data registry */ | |
| 362 | 361 | ||
| 363 | - typedef int (*crossinterpdatafunc)(PyObject *, struct _xid *); | ||
| 362 | + typedef int (*crossinterpdatafunc)(PyObject *, _PyCrossInterpreterData *); | ||
| 364 | 363 | ||
| 365 | 364 | PyAPI_FUNC(int) _PyCrossInterpreterData_RegisterClass(PyTypeObject *, crossinterpdatafunc); | |
| 366 | 365 | PyAPI_FUNC(crossinterpdatafunc) _PyCrossInterpreterData_Lookup(PyObject *); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,13 +2,15 @@ | |||
| 2 | 2 | # error "this header file must not be included directly" | |
| 3 | 3 | #endif | |
| 4 | 4 | ||
| 5 | - typedef struct _traceback { | ||
| 5 | + typedef struct _traceback PyTracebackObject; | ||
| 6 | + | ||
| 7 | + struct _traceback { | ||
| 6 | 8 | PyObject_HEAD | |
| 7 | - struct _traceback *tb_next; | ||
| 9 | + PyTracebackObject *tb_next; | ||
| 8 | 10 | PyFrameObject *tb_frame; | |
| 9 | 11 | int tb_lasti; | |
| 10 | 12 | int tb_lineno; | |
| 11 | - } PyTracebackObject; | ||
| 13 | + }; | ||
| 12 | 14 | ||
| 13 | 15 | PyAPI_FUNC(int) _Py_DisplaySourceLine(PyObject *, PyObject *, int, int, int *, PyObject **); | |
| 14 | 16 | PyAPI_FUNC(void) _PyTraceback_Add(const char *, const char *, int); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,15 +23,11 @@ PyAPI_DATA(PyTypeObject) PyMethodDescr_Type; | |||
| 23 | 23 | PyAPI_DATA(PyTypeObject) PyWrapperDescr_Type; | |
| 24 | 24 | PyAPI_DATA(PyTypeObject) PyDictProxy_Type; | |
| 25 | 25 | PyAPI_DATA(PyTypeObject) PyProperty_Type; | |
| 26 | - // Forward declaration for following prototype | ||
| 27 | - struct PyMemberDef; | ||
| 28 | 26 | ||
| 29 | 27 | PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *); | |
| 30 | 28 | PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *); | |
| 31 | - PyAPI_FUNC(PyObject *) PyDescr_NewMember(PyTypeObject *, | ||
| 32 | - struct PyMemberDef *); | ||
| 33 | - PyAPI_FUNC(PyObject *) PyDescr_NewGetSet(PyTypeObject *, | ||
| 34 | - struct PyGetSetDef *); | ||
| 29 | + PyAPI_FUNC(PyObject *) PyDescr_NewMember(PyTypeObject *, PyMemberDef *); | ||
| 30 | + PyAPI_FUNC(PyObject *) PyDescr_NewGetSet(PyTypeObject *, PyGetSetDef *); | ||
| 35 | 31 | ||
| 36 | 32 | PyAPI_FUNC(PyObject *) PyDictProxy_New(PyObject *); | |
| 37 | 33 | PyAPI_FUNC(PyObject *) PyWrapper_New(PyObject *, PyObject *); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments