Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/python3....
File: weakrefobject.h
/* Weak references objects for Python. */
[0] Fix | Delete
[1] Fix | Delete
#ifndef Py_WEAKREFOBJECT_H
[2] Fix | Delete
#define Py_WEAKREFOBJECT_H
[3] Fix | Delete
#ifdef __cplusplus
[4] Fix | Delete
extern "C" {
[5] Fix | Delete
#endif
[6] Fix | Delete
[7] Fix | Delete
[8] Fix | Delete
typedef struct _PyWeakReference PyWeakReference;
[9] Fix | Delete
[10] Fix | Delete
/* PyWeakReference is the base struct for the Python ReferenceType, ProxyType,
[11] Fix | Delete
* and CallableProxyType.
[12] Fix | Delete
*/
[13] Fix | Delete
#ifndef Py_LIMITED_API
[14] Fix | Delete
struct _PyWeakReference {
[15] Fix | Delete
PyObject_HEAD
[16] Fix | Delete
[17] Fix | Delete
/* The object to which this is a weak reference, or Py_None if none.
[18] Fix | Delete
* Note that this is a stealth reference: wr_object's refcount is
[19] Fix | Delete
* not incremented to reflect this pointer.
[20] Fix | Delete
*/
[21] Fix | Delete
PyObject *wr_object;
[22] Fix | Delete
[23] Fix | Delete
/* A callable to invoke when wr_object dies, or NULL if none. */
[24] Fix | Delete
PyObject *wr_callback;
[25] Fix | Delete
[26] Fix | Delete
/* A cache for wr_object's hash code. As usual for hashes, this is -1
[27] Fix | Delete
* if the hash code isn't known yet.
[28] Fix | Delete
*/
[29] Fix | Delete
Py_hash_t hash;
[30] Fix | Delete
[31] Fix | Delete
/* If wr_object is weakly referenced, wr_object has a doubly-linked NULL-
[32] Fix | Delete
* terminated list of weak references to it. These are the list pointers.
[33] Fix | Delete
* If wr_object goes away, wr_object is set to Py_None, and these pointers
[34] Fix | Delete
* have no meaning then.
[35] Fix | Delete
*/
[36] Fix | Delete
PyWeakReference *wr_prev;
[37] Fix | Delete
PyWeakReference *wr_next;
[38] Fix | Delete
};
[39] Fix | Delete
#endif
[40] Fix | Delete
[41] Fix | Delete
PyAPI_DATA(PyTypeObject) _PyWeakref_RefType;
[42] Fix | Delete
PyAPI_DATA(PyTypeObject) _PyWeakref_ProxyType;
[43] Fix | Delete
PyAPI_DATA(PyTypeObject) _PyWeakref_CallableProxyType;
[44] Fix | Delete
[45] Fix | Delete
#define PyWeakref_CheckRef(op) PyObject_TypeCheck(op, &_PyWeakref_RefType)
[46] Fix | Delete
#define PyWeakref_CheckRefExact(op) \
[47] Fix | Delete
(Py_TYPE(op) == &_PyWeakref_RefType)
[48] Fix | Delete
#define PyWeakref_CheckProxy(op) \
[49] Fix | Delete
((Py_TYPE(op) == &_PyWeakref_ProxyType) || \
[50] Fix | Delete
(Py_TYPE(op) == &_PyWeakref_CallableProxyType))
[51] Fix | Delete
[52] Fix | Delete
#define PyWeakref_Check(op) \
[53] Fix | Delete
(PyWeakref_CheckRef(op) || PyWeakref_CheckProxy(op))
[54] Fix | Delete
[55] Fix | Delete
[56] Fix | Delete
PyAPI_FUNC(PyObject *) PyWeakref_NewRef(PyObject *ob,
[57] Fix | Delete
PyObject *callback);
[58] Fix | Delete
PyAPI_FUNC(PyObject *) PyWeakref_NewProxy(PyObject *ob,
[59] Fix | Delete
PyObject *callback);
[60] Fix | Delete
PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref);
[61] Fix | Delete
[62] Fix | Delete
#ifndef Py_LIMITED_API
[63] Fix | Delete
PyAPI_FUNC(Py_ssize_t) _PyWeakref_GetWeakrefCount(PyWeakReference *head);
[64] Fix | Delete
[65] Fix | Delete
PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self);
[66] Fix | Delete
#endif
[67] Fix | Delete
[68] Fix | Delete
/* Explanation for the Py_REFCNT() check: when a weakref's target is part
[69] Fix | Delete
of a long chain of deallocations which triggers the trashcan mechanism,
[70] Fix | Delete
clearing the weakrefs can be delayed long after the target's refcount
[71] Fix | Delete
has dropped to zero. In the meantime, code accessing the weakref will
[72] Fix | Delete
be able to "see" the target object even though it is supposed to be
[73] Fix | Delete
unreachable. See issue #16602. */
[74] Fix | Delete
[75] Fix | Delete
#define PyWeakref_GET_OBJECT(ref) \
[76] Fix | Delete
(Py_REFCNT(((PyWeakReference *)(ref))->wr_object) > 0 \
[77] Fix | Delete
? ((PyWeakReference *)(ref))->wr_object \
[78] Fix | Delete
: Py_None)
[79] Fix | Delete
[80] Fix | Delete
[81] Fix | Delete
#ifdef __cplusplus
[82] Fix | Delete
}
[83] Fix | Delete
#endif
[84] Fix | Delete
#endif /* !Py_WEAKREFOBJECT_H */
[85] Fix | Delete
[86] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function