python (3.11.7)

(root)/
include/
python3.11/
weakrefobject.h
       1  /* Weak references objects for Python. */
       2  
       3  #ifndef Py_WEAKREFOBJECT_H
       4  #define Py_WEAKREFOBJECT_H
       5  #ifdef __cplusplus
       6  extern "C" {
       7  #endif
       8  
       9  typedef struct _PyWeakReference PyWeakReference;
      10  
      11  PyAPI_DATA(PyTypeObject) _PyWeakref_RefType;
      12  PyAPI_DATA(PyTypeObject) _PyWeakref_ProxyType;
      13  PyAPI_DATA(PyTypeObject) _PyWeakref_CallableProxyType;
      14  
      15  #define PyWeakref_CheckRef(op) PyObject_TypeCheck(op, &_PyWeakref_RefType)
      16  #define PyWeakref_CheckRefExact(op) \
      17          Py_IS_TYPE(op, &_PyWeakref_RefType)
      18  #define PyWeakref_CheckProxy(op) \
      19          (Py_IS_TYPE(op, &_PyWeakref_ProxyType) || \
      20           Py_IS_TYPE(op, &_PyWeakref_CallableProxyType))
      21  
      22  #define PyWeakref_Check(op) \
      23          (PyWeakref_CheckRef(op) || PyWeakref_CheckProxy(op))
      24  
      25  
      26  PyAPI_FUNC(PyObject *) PyWeakref_NewRef(PyObject *ob,
      27                                          PyObject *callback);
      28  PyAPI_FUNC(PyObject *) PyWeakref_NewProxy(PyObject *ob,
      29                                            PyObject *callback);
      30  PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref);
      31  
      32  
      33  #ifndef Py_LIMITED_API
      34  #  define Py_CPYTHON_WEAKREFOBJECT_H
      35  #  include "cpython/weakrefobject.h"
      36  #  undef Py_CPYTHON_WEAKREFOBJECT_H
      37  #endif
      38  
      39  #ifdef __cplusplus
      40  }
      41  #endif
      42  #endif /* !Py_WEAKREFOBJECT_H */