Skip to content

Instantly share code, notes, and snippets.

@nxmaintainer
Created April 30, 2023 12:36
Show Gist options
  • Save nxmaintainer/794c3f0453fb987b8d9234e42eacaef4 to your computer and use it in GitHub Desktop.
Save nxmaintainer/794c3f0453fb987b8d9234e42eacaef4 to your computer and use it in GitHub Desktop.
cpp -nostdinc -E -P -DPy_BUILD_CORE=1 -D_POSIX_THREADS=1
typedef unsigned char uuid_t[16];
typedef int speed_t;
typedef unsigned long tcflag_t;
typedef unsigned char cc_t;
typedef struct {} DBM;
typedef struct {} datum;
typedef struct {
long fds_bits[1024 / 64];
} fd_set;
typedef int socklen_t;
typedef int mpd_ssize_t;
typedef int mpd_uint_t;
typedef int size_t;
typedef int __builtin_va_list;
typedef int __gnuc_va_list;
typedef int va_list;
typedef int __int8_t;
typedef int __uint8_t;
typedef int __int16_t;
typedef int __uint16_t;
typedef int __int_least16_t;
typedef int __uint_least16_t;
typedef int __int32_t;
typedef int __uint32_t;
typedef int __int64_t;
typedef int __uint64_t;
typedef int __int_least32_t;
typedef int __uint_least32_t;
typedef int __s8;
typedef int __u8;
typedef int __s16;
typedef int __u16;
typedef int __s32;
typedef int __u32;
typedef int __s64;
typedef int __u64;
typedef int _LOCK_T;
typedef int _LOCK_RECURSIVE_T;
typedef int _off_t;
typedef int __dev_t;
typedef int __uid_t;
typedef int __gid_t;
typedef int _off64_t;
typedef int _fpos_t;
typedef int _ssize_t;
typedef int wint_t;
typedef int _mbstate_t;
typedef int _flock_t;
typedef int _iconv_t;
typedef int __ULong;
typedef int __FILE;
typedef int ptrdiff_t;
typedef int wchar_t;
typedef int char16_t;
typedef int char32_t;
typedef int __off_t;
typedef int __pid_t;
typedef int __loff_t;
typedef int u_char;
typedef int u_short;
typedef int u_int;
typedef int u_long;
typedef int ushort;
typedef int uint;
typedef int clock_t;
typedef int time_t;
typedef int daddr_t;
typedef int caddr_t;
typedef int ino_t;
typedef int off_t;
typedef int dev_t;
typedef int uid_t;
typedef int gid_t;
typedef int pid_t;
typedef int key_t;
typedef int ssize_t;
typedef int mode_t;
typedef int nlink_t;
typedef int fd_mask;
typedef int _types_fd_set;
typedef int clockid_t;
typedef int timer_t;
typedef int useconds_t;
typedef int suseconds_t;
typedef int FILE;
typedef int fpos_t;
typedef int cookie_read_function_t;
typedef int cookie_write_function_t;
typedef int cookie_seek_function_t;
typedef int cookie_close_function_t;
typedef int cookie_io_functions_t;
typedef int div_t;
typedef int ldiv_t;
typedef int lldiv_t;
typedef int sigset_t;
typedef int __sigset_t;
typedef int _sig_func_ptr;
typedef int sig_atomic_t;
typedef int __tzrule_type;
typedef int __tzinfo_type;
typedef int mbstate_t;
typedef int sem_t;
typedef int pthread_t;
typedef int pthread_attr_t;
typedef int pthread_mutex_t;
typedef int pthread_mutexattr_t;
typedef int pthread_cond_t;
typedef int pthread_condattr_t;
typedef int pthread_key_t;
typedef int pthread_once_t;
typedef int pthread_rwlock_t;
typedef int pthread_rwlockattr_t;
typedef int pthread_spinlock_t;
typedef int pthread_barrier_t;
typedef int pthread_barrierattr_t;
typedef int jmp_buf;
typedef int rlim_t;
typedef int sa_family_t;
typedef int sigjmp_buf;
typedef int stack_t;
typedef int siginfo_t;
typedef int z_stream;
typedef int int8_t;
typedef int uint8_t;
typedef int int16_t;
typedef int uint16_t;
typedef int int32_t;
typedef int uint32_t;
typedef int int64_t;
typedef int uint64_t;
typedef int int_least8_t;
typedef int uint_least8_t;
typedef int int_least16_t;
typedef int uint_least16_t;
typedef int int_least32_t;
typedef int uint_least32_t;
typedef int int_least64_t;
typedef int uint_least64_t;
typedef int int_fast8_t;
typedef int uint_fast8_t;
typedef int int_fast16_t;
typedef int uint_fast16_t;
typedef int int_fast32_t;
typedef int uint_fast32_t;
typedef int int_fast64_t;
typedef int uint_fast64_t;
typedef int intptr_t;
typedef int uintptr_t;
typedef int intmax_t;
typedef int uintmax_t;
typedef _Bool bool;
typedef void* MirEGLNativeWindowType;
typedef void* MirEGLNativeDisplayType;
typedef struct MirConnection MirConnection;
typedef struct MirSurface MirSurface;
typedef struct MirSurfaceSpec MirSurfaceSpec;
typedef struct MirScreencast MirScreencast;
typedef struct MirPromptSession MirPromptSession;
typedef struct MirBufferStream MirBufferStream;
typedef struct MirPersistentId MirPersistentId;
typedef struct MirBlob MirBlob;
typedef struct MirDisplayConfig MirDisplayConfig;
typedef struct xcb_connection_t xcb_connection_t;
typedef uint32_t xcb_window_t;
typedef uint32_t xcb_visualid_t;
typedef _Bool atomic_bool;
typedef char atomic_char;
typedef signed char atomic_schar;
typedef unsigned char atomic_uchar;
typedef short atomic_short;
typedef unsigned short atomic_ushort;
typedef int atomic_int;
typedef unsigned int atomic_uint;
typedef long atomic_long;
typedef unsigned long atomic_ulong;
typedef long long atomic_llong;
typedef unsigned long long atomic_ullong;
typedef uint_least16_t atomic_char16_t;
typedef uint_least32_t atomic_char32_t;
typedef wchar_t atomic_wchar_t;
typedef int_least8_t atomic_int_least8_t;
typedef uint_least8_t atomic_uint_least8_t;
typedef int_least16_t atomic_int_least16_t;
typedef uint_least16_t atomic_uint_least16_t;
typedef int_least32_t atomic_int_least32_t;
typedef uint_least32_t atomic_uint_least32_t;
typedef int_least64_t atomic_int_least64_t;
typedef uint_least64_t atomic_uint_least64_t;
typedef int_fast8_t atomic_int_fast8_t;
typedef uint_fast8_t atomic_uint_fast8_t;
typedef int_fast16_t atomic_int_fast16_t;
typedef uint_fast16_t atomic_uint_fast16_t;
typedef int_fast32_t atomic_int_fast32_t;
typedef uint_fast32_t atomic_uint_fast32_t;
typedef int_fast64_t atomic_int_fast64_t;
typedef uint_fast64_t atomic_uint_fast64_t;
typedef intptr_t atomic_intptr_t;
typedef uintptr_t atomic_uintptr_t;
typedef size_t atomic_size_t;
typedef ptrdiff_t atomic_ptrdiff_t;
typedef intmax_t atomic_intmax_t;
typedef uintmax_t atomic_uintmax_t;
typedef struct atomic_flag { atomic_bool _Value; } atomic_flag;
typedef enum memory_order {
memory_order_relaxed,
memory_order_consume,
memory_order_acquire,
memory_order_release,
memory_order_acq_rel,
memory_order_seq_cst
} memory_order;
typedef uintptr_t Py_uintptr_t;
typedef intptr_t Py_intptr_t;
typedef ssize_t Py_ssize_t;
typedef Py_ssize_t Py_hash_t;
typedef size_t Py_uhash_t;
typedef Py_ssize_t Py_ssize_clean_t;
void * PyMem_Malloc(size_t size);
void * PyMem_Calloc(size_t nelem, size_t elsize);
void * PyMem_Realloc(void *ptr, size_t new_size);
void PyMem_Free(void *ptr);
void * PyMem_RawMalloc(size_t size);
void * PyMem_RawCalloc(size_t nelem, size_t elsize);
void * PyMem_RawRealloc(void *ptr, size_t new_size);
void PyMem_RawFree(void *ptr);
const char* _PyMem_GetCurrentAllocatorName(void);
char * _PyMem_RawStrdup(const char *str);
char * _PyMem_Strdup(const char *str);
wchar_t* _PyMem_RawWcsdup(const wchar_t *str);
typedef enum {
PYMEM_DOMAIN_RAW,
PYMEM_DOMAIN_MEM,
PYMEM_DOMAIN_OBJ
} PyMemAllocatorDomain;
typedef enum {
PYMEM_ALLOCATOR_NOT_SET = 0,
PYMEM_ALLOCATOR_DEFAULT = 1,
PYMEM_ALLOCATOR_DEBUG = 2,
PYMEM_ALLOCATOR_MALLOC = 3,
PYMEM_ALLOCATOR_MALLOC_DEBUG = 4,
} PyMemAllocatorName;
typedef struct {
void *ctx;
void* (*malloc) (void *ctx, size_t size);
void* (*calloc) (void *ctx, size_t nelem, size_t elsize);
void* (*realloc) (void *ctx, void *ptr, size_t new_size);
void (*free) (void *ctx, void *ptr);
} PyMemAllocatorEx;
void PyMem_GetAllocator(PyMemAllocatorDomain domain,
PyMemAllocatorEx *allocator);
void PyMem_SetAllocator(PyMemAllocatorDomain domain,
PyMemAllocatorEx *allocator);
void PyMem_SetupDebugHooks(void);
typedef struct PyModuleDef PyModuleDef;
typedef struct PyModuleDef_Slot PyModuleDef_Slot;
typedef struct PyMethodDef PyMethodDef;
typedef struct PyGetSetDef PyGetSetDef;
typedef struct PyMemberDef PyMemberDef;
typedef struct _object PyObject;
typedef struct _longobject PyLongObject;
typedef struct _typeobject PyTypeObject;
typedef struct PyCodeObject PyCodeObject;
typedef struct _frame PyFrameObject;
typedef struct _ts PyThreadState;
typedef struct _is PyInterpreterState;
typedef struct {
void *buf;
PyObject *obj;
Py_ssize_t len;
Py_ssize_t itemsize;
int readonly;
int ndim;
char *format;
Py_ssize_t *shape;
Py_ssize_t *strides;
Py_ssize_t *suboffsets;
void *internal;
} Py_buffer;
typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
int PyObject_CheckBuffer(PyObject *obj);
int PyObject_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
void * PyBuffer_GetPointer(const Py_buffer *view, const Py_ssize_t *indices);
Py_ssize_t PyBuffer_SizeFromFormat(const char *format);
int PyBuffer_ToContiguous(void *buf, const Py_buffer *view,
Py_ssize_t len, char order);
int PyBuffer_FromContiguous(const Py_buffer *view, const void *buf,
Py_ssize_t len, char order);
int PyObject_CopyData(PyObject *dest, PyObject *src);
int PyBuffer_IsContiguous(const Py_buffer *view, char fort);
void PyBuffer_FillContiguousStrides(int ndims,
Py_ssize_t *shape,
Py_ssize_t *strides,
int itemsize,
char fort);
int PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf,
Py_ssize_t len, int readonly,
int flags);
void PyBuffer_Release(Py_buffer *view);
struct _object {
Py_ssize_t ob_refcnt;
PyTypeObject *ob_type;
};
typedef struct {
PyObject ob_base;
Py_ssize_t ob_size;
} PyVarObject;
int Py_Is(PyObject *x, PyObject *y);
static inline Py_ssize_t Py_REFCNT(PyObject *ob) {
return ob->ob_refcnt;
}
static inline PyTypeObject* Py_TYPE(PyObject *ob) {
return ob->ob_type;
}
extern PyTypeObject PyLong_Type;
extern PyTypeObject PyBool_Type;
static inline Py_ssize_t Py_SIZE(PyObject *ob) {
assert(ob->ob_type != &PyLong_Type);
assert(ob->ob_type != &PyBool_Type);
PyVarObject *var_ob = ((PyVarObject*)((ob)));
return var_ob->ob_size;
}
static inline int Py_IS_TYPE(PyObject *ob, PyTypeObject *type) {
return Py_TYPE(((PyObject*)((ob)))) == type;
}
static inline void Py_SET_REFCNT(PyObject *ob, Py_ssize_t refcnt) {
ob->ob_refcnt = refcnt;
}
static inline void Py_SET_TYPE(PyObject *ob, PyTypeObject *type) {
ob->ob_type = type;
}
static inline void Py_SET_SIZE(PyVarObject *ob, Py_ssize_t size) {
assert(ob->ob_base.ob_type != &PyLong_Type);
assert(ob->ob_base.ob_type != &PyBool_Type);
ob->ob_size = size;
}
typedef PyObject * (*unaryfunc)(PyObject *);
typedef PyObject * (*binaryfunc)(PyObject *, PyObject *);
typedef PyObject * (*ternaryfunc)(PyObject *, PyObject *, PyObject *);
typedef int (*inquiry)(PyObject *);
typedef Py_ssize_t (*lenfunc)(PyObject *);
typedef PyObject *(*ssizeargfunc)(PyObject *, Py_ssize_t);
typedef PyObject *(*ssizessizeargfunc)(PyObject *, Py_ssize_t, Py_ssize_t);
typedef int(*ssizeobjargproc)(PyObject *, Py_ssize_t, PyObject *);
typedef int(*ssizessizeobjargproc)(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *);
typedef int(*objobjargproc)(PyObject *, PyObject *, PyObject *);
typedef int (*objobjproc)(PyObject *, PyObject *);
typedef int (*visitproc)(PyObject *, void *);
typedef int (*traverseproc)(PyObject *, visitproc, void *);
typedef void (*freefunc)(void *);
typedef void (*destructor)(PyObject *);
typedef PyObject *(*getattrfunc)(PyObject *, char *);
typedef PyObject *(*getattrofunc)(PyObject *, PyObject *);
typedef int (*setattrfunc)(PyObject *, char *, PyObject *);
typedef int (*setattrofunc)(PyObject *, PyObject *, PyObject *);
typedef PyObject *(*reprfunc)(PyObject *);
typedef Py_hash_t (*hashfunc)(PyObject *);
typedef PyObject *(*richcmpfunc) (PyObject *, PyObject *, int);
typedef PyObject *(*getiterfunc) (PyObject *);
typedef PyObject *(*iternextfunc) (PyObject *);
typedef PyObject *(*descrgetfunc) (PyObject *, PyObject *, PyObject *);
typedef int (*descrsetfunc) (PyObject *, PyObject *, PyObject *);
typedef int (*initproc)(PyObject *, PyObject *, PyObject *);
typedef PyObject *(*newfunc)(PyTypeObject *, PyObject *, PyObject *);
typedef PyObject *(*allocfunc)(PyTypeObject *, Py_ssize_t);
typedef PyObject *(*vectorcallfunc)(PyObject *callable, PyObject *const *args,
size_t nargsf, PyObject *kwnames);
typedef struct{
int slot;
void *pfunc;
} PyType_Slot;
typedef struct{
const char* name;
int basicsize;
int itemsize;
unsigned int flags;
PyType_Slot *slots;
} PyType_Spec;
PyObject* PyType_FromSpec(PyType_Spec*);
PyObject* PyType_FromSpecWithBases(PyType_Spec*, PyObject*);
void* PyType_GetSlot(PyTypeObject*, int);
PyObject* PyType_FromModuleAndSpec(PyObject *, PyType_Spec *, PyObject *);
PyObject * PyType_GetModule(PyTypeObject *);
void * PyType_GetModuleState(PyTypeObject *);
PyObject * PyType_GetName(PyTypeObject *);
PyObject * PyType_GetQualName(PyTypeObject *);
PyObject * PyType_FromMetaclass(PyTypeObject*, PyObject*, PyType_Spec*, PyObject*);
int PyType_IsSubtype(PyTypeObject *, PyTypeObject *);
static inline int PyObject_TypeCheck(PyObject *ob, PyTypeObject *type) {
return Py_IS_TYPE(((PyObject*)((ob))), (type)) || PyType_IsSubtype(Py_TYPE(((PyObject*)((ob)))), type);
}
extern PyTypeObject PyType_Type;
extern PyTypeObject PyBaseObject_Type;
extern PyTypeObject PySuper_Type;
unsigned long PyType_GetFlags(PyTypeObject*);
int PyType_Ready(PyTypeObject *);
PyObject * PyType_GenericAlloc(PyTypeObject *, Py_ssize_t);
PyObject * PyType_GenericNew(PyTypeObject *,
PyObject *, PyObject *);
unsigned int PyType_ClearCache(void);
void PyType_Modified(PyTypeObject *);
PyObject * PyObject_Repr(PyObject *);
PyObject * PyObject_Str(PyObject *);
PyObject * PyObject_ASCII(PyObject *);
PyObject * PyObject_Bytes(PyObject *);
PyObject * PyObject_RichCompare(PyObject *, PyObject *, int);
int PyObject_RichCompareBool(PyObject *, PyObject *, int);
PyObject * PyObject_GetAttrString(PyObject *, const char *);
int PyObject_SetAttrString(PyObject *, const char *, PyObject *);
int PyObject_HasAttrString(PyObject *, const char *);
PyObject * PyObject_GetAttr(PyObject *, PyObject *);
int PyObject_SetAttr(PyObject *, PyObject *, PyObject *);
int PyObject_HasAttr(PyObject *, PyObject *);
PyObject * PyObject_SelfIter(PyObject *);
PyObject * PyObject_GenericGetAttr(PyObject *, PyObject *);
int PyObject_GenericSetAttr(PyObject *, PyObject *, PyObject *);
int PyObject_GenericSetDict(PyObject *, PyObject *, void *);
Py_hash_t PyObject_Hash(PyObject *);
Py_hash_t PyObject_HashNotImplemented(PyObject *);
int PyObject_IsTrue(PyObject *);
int PyObject_Not(PyObject *);
int PyCallable_Check(PyObject *);
void PyObject_ClearWeakRefs(PyObject *);
PyObject * PyObject_Dir(PyObject *);
PyObject * _PyObject_GetState(PyObject *);
int Py_ReprEnter(PyObject *);
void Py_ReprLeave(PyObject *);
void _Py_Dealloc(PyObject *);
void Py_IncRef(PyObject *);
void Py_DecRef(PyObject *);
void _Py_IncRef(PyObject *);
void _Py_DecRef(PyObject *);
static inline void Py_INCREF(PyObject *op)
{
((void)0);
op->ob_refcnt++;
}
static inline void Py_DECREF(PyObject *op)
{
((void)0);
if (--op->ob_refcnt == 0) {
_Py_Dealloc(op);
}
}
static inline void Py_XINCREF(PyObject *op)
{
if (op != 0) {
Py_INCREF(((PyObject*)((op))));
}
}
static inline void Py_XDECREF(PyObject *op)
{
if (op != 0) {
Py_DECREF(((PyObject*)((op))));
}
}
PyObject* Py_NewRef(PyObject *obj);
PyObject* Py_XNewRef(PyObject *obj);
static inline PyObject* _Py_NewRef(PyObject *obj)
{
Py_INCREF(((PyObject*)((obj))));
return obj;
}
static inline PyObject* _Py_XNewRef(PyObject *obj)
{
Py_XINCREF(((PyObject*)((obj))));
return obj;
}
extern PyObject _Py_NoneStruct;
int Py_IsNone(PyObject *x);
extern PyObject _Py_NotImplementedStruct;
typedef enum {
PYGEN_RETURN = 0,
PYGEN_ERROR = -1,
PYGEN_NEXT = 1,
} PySendResult;
void _Py_NewReference(PyObject *op);
void _Py_NewReferenceNoTotal(PyObject *op);
typedef struct _Py_Identifier {
const char* string;
Py_ssize_t index;
} _Py_Identifier;
typedef struct {
binaryfunc nb_add;
binaryfunc nb_subtract;
binaryfunc nb_multiply;
binaryfunc nb_remainder;
binaryfunc nb_divmod;
ternaryfunc nb_power;
unaryfunc nb_negative;
unaryfunc nb_positive;
unaryfunc nb_absolute;
inquiry nb_bool;
unaryfunc nb_invert;
binaryfunc nb_lshift;
binaryfunc nb_rshift;
binaryfunc nb_and;
binaryfunc nb_xor;
binaryfunc nb_or;
unaryfunc nb_int;
void *nb_reserved;
unaryfunc nb_float;
binaryfunc nb_inplace_add;
binaryfunc nb_inplace_subtract;
binaryfunc nb_inplace_multiply;
binaryfunc nb_inplace_remainder;
ternaryfunc nb_inplace_power;
binaryfunc nb_inplace_lshift;
binaryfunc nb_inplace_rshift;
binaryfunc nb_inplace_and;
binaryfunc nb_inplace_xor;
binaryfunc nb_inplace_or;
binaryfunc nb_floor_divide;
binaryfunc nb_true_divide;
binaryfunc nb_inplace_floor_divide;
binaryfunc nb_inplace_true_divide;
unaryfunc nb_index;
binaryfunc nb_matrix_multiply;
binaryfunc nb_inplace_matrix_multiply;
} PyNumberMethods;
typedef struct {
lenfunc sq_length;
binaryfunc sq_concat;
ssizeargfunc sq_repeat;
ssizeargfunc sq_item;
void *was_sq_slice;
ssizeobjargproc sq_ass_item;
void *was_sq_ass_slice;
objobjproc sq_contains;
binaryfunc sq_inplace_concat;
ssizeargfunc sq_inplace_repeat;
} PySequenceMethods;
typedef struct {
lenfunc mp_length;
binaryfunc mp_subscript;
objobjargproc mp_ass_subscript;
} PyMappingMethods;
typedef PySendResult (*sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
typedef struct {
unaryfunc am_await;
unaryfunc am_aiter;
unaryfunc am_anext;
sendfunc am_send;
} PyAsyncMethods;
typedef struct {
getbufferproc bf_getbuffer;
releasebufferproc bf_releasebuffer;
} PyBufferProcs;
typedef Py_ssize_t printfunc;
struct _typeobject {
PyVarObject ob_base;
const char *tp_name;
Py_ssize_t tp_basicsize, tp_itemsize;
destructor tp_dealloc;
Py_ssize_t tp_vectorcall_offset;
getattrfunc tp_getattr;
setattrfunc tp_setattr;
PyAsyncMethods *tp_as_async;
reprfunc tp_repr;
PyNumberMethods *tp_as_number;
PySequenceMethods *tp_as_sequence;
PyMappingMethods *tp_as_mapping;
hashfunc tp_hash;
ternaryfunc tp_call;
reprfunc tp_str;
getattrofunc tp_getattro;
setattrofunc tp_setattro;
PyBufferProcs *tp_as_buffer;
unsigned long tp_flags;
const char *tp_doc;
traverseproc tp_traverse;
inquiry tp_clear;
richcmpfunc tp_richcompare;
Py_ssize_t tp_weaklistoffset;
getiterfunc tp_iter;
iternextfunc tp_iternext;
PyMethodDef *tp_methods;
PyMemberDef *tp_members;
PyGetSetDef *tp_getset;
PyTypeObject *tp_base;
PyObject *tp_dict;
descrgetfunc tp_descr_get;
descrsetfunc tp_descr_set;
Py_ssize_t tp_dictoffset;
initproc tp_init;
allocfunc tp_alloc;
newfunc tp_new;
freefunc tp_free;
inquiry tp_is_gc;
PyObject *tp_bases;
PyObject *tp_mro;
PyObject *tp_cache;
void *tp_subclasses;
PyObject *tp_weaklist;
destructor tp_del;
unsigned int tp_version_tag;
destructor tp_finalize;
vectorcallfunc tp_vectorcall;
char tp_watched;
};
struct _specialization_cache {
PyObject *getitem;
uint32_t getitem_version;
};
typedef struct _heaptypeobject {
PyTypeObject ht_type;
PyAsyncMethods as_async;
PyNumberMethods as_number;
PyMappingMethods as_mapping;
PySequenceMethods as_sequence;
PyBufferProcs as_buffer;
PyObject *ht_name, *ht_slots, *ht_qualname;
struct _dictkeysobject *ht_cached_keys;
PyObject *ht_module;
char *_ht_tpname;
struct _specialization_cache _spec_cache;
} PyHeapTypeObject;
const char * _PyType_Name(PyTypeObject *);
PyObject * _PyType_Lookup(PyTypeObject *, PyObject *);
PyObject * _PyType_LookupId(PyTypeObject *, _Py_Identifier *);
PyObject * _PyObject_LookupSpecialId(PyObject *, _Py_Identifier *);
PyTypeObject * _PyType_CalculateMetaclass(PyTypeObject *, PyObject *);
PyObject * _PyType_GetDocFromInternalDoc(const char *, const char *);
PyObject * _PyType_GetTextSignatureFromInternalDoc(const char *, const char *);
PyObject * PyType_GetModuleByDef(PyTypeObject *, PyModuleDef *);
int PyObject_Print(PyObject *, FILE *, int);
void _Py_BreakPoint(void);
void _PyObject_Dump(PyObject *);
int _PyObject_IsFreed(PyObject *);
int _PyObject_IsAbstract(PyObject *);
PyObject * _PyObject_GetAttrId(PyObject *, _Py_Identifier *);
int _PyObject_SetAttrId(PyObject *, _Py_Identifier *, PyObject *);
int _PyObject_LookupAttr(PyObject *, PyObject *, PyObject **);
int _PyObject_LookupAttrId(PyObject *, _Py_Identifier *, PyObject **);
int _PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
PyObject ** _PyObject_GetDictPtr(PyObject *);
PyObject * _PyObject_NextNotImplemented(PyObject *);
void PyObject_CallFinalizer(PyObject *);
int PyObject_CallFinalizerFromDealloc(PyObject *);
PyObject *
_PyObject_GenericGetAttrWithDict(PyObject *, PyObject *, PyObject *, int);
int
_PyObject_GenericSetAttrWithDict(PyObject *, PyObject *,
PyObject *, PyObject *);
PyObject * _PyObject_FunctionStr(PyObject *);
extern PyTypeObject _PyNone_Type;
extern PyTypeObject _PyNotImplemented_Type;
extern int _Py_SwappedOp[];
void
_PyDebugAllocatorStats(FILE *out, const char *block_name, int num_blocks,
size_t sizeof_block);
void
_PyObject_DebugTypeStats(FILE *out);
void _PyObject_AssertFailed(
PyObject *obj,
const char *expr,
const char *msg,
const char *file,
int line,
const char *function);
int _PyObject_CheckConsistency(
PyObject *op,
int check_content);
int _PyTrash_begin(PyThreadState *tstate, PyObject *op);
void _PyTrash_end(PyThreadState *tstate);
int _PyTrash_cond(PyObject *op, destructor dealloc);
typedef int UsingDeprecatedTrashcanMacro;
int _PyObject_VisitManagedDict(PyObject *obj, visitproc visit, void *arg);
void _PyObject_ClearManagedDict(PyObject *obj);
typedef int(*PyType_WatchCallback)(PyTypeObject *);
int PyType_AddWatcher(PyType_WatchCallback callback);
int PyType_ClearWatcher(int watcher_id);
int PyType_Watch(int watcher_id, PyObject *type);
int PyType_Unwatch(int watcher_id, PyObject *type);
static inline int
PyType_HasFeature(PyTypeObject *type, unsigned long feature)
{
unsigned long flags;
flags = type->tp_flags;
return ((flags & feature) != 0);
}
static inline int PyType_Check(PyObject *op) {
return PyType_HasFeature((Py_TYPE(((PyObject*)((op))))), ((1UL << 31)));
}
static inline int PyType_CheckExact(PyObject *op) {
return Py_IS_TYPE(((PyObject*)((op))), (&PyType_Type));
}
void * PyObject_Malloc(size_t size);
void * PyObject_Calloc(size_t nelem, size_t elsize);
void * PyObject_Realloc(void *ptr, size_t new_size);
void PyObject_Free(void *ptr);
PyObject * PyObject_Init(PyObject *, PyTypeObject *);
PyVarObject * PyObject_InitVar(PyVarObject *,
PyTypeObject *, Py_ssize_t);
PyObject * _PyObject_New(PyTypeObject *);
PyVarObject * _PyObject_NewVar(PyTypeObject *, Py_ssize_t);
Py_ssize_t PyGC_Collect(void);
int PyGC_Enable(void);
int PyGC_Disable(void);
int PyGC_IsEnabled(void);
typedef int (*gcvisitobjects_t)(PyObject*, void*);
void PyUnstable_GC_VisitObjects(gcvisitobjects_t callback, void* arg);
PyVarObject * _PyObject_GC_Resize(PyVarObject *, Py_ssize_t);
PyObject * _PyObject_GC_New(PyTypeObject *);
PyVarObject * _PyObject_GC_NewVar(PyTypeObject *, Py_ssize_t);
void PyObject_GC_Track(void *);
void PyObject_GC_UnTrack(void *);
void PyObject_GC_Del(void *);
int PyObject_GC_IsTracked(PyObject *);
int PyObject_GC_IsFinalized(PyObject *);
static inline size_t _PyObject_SIZE(PyTypeObject *type) {
return ((size_t)(type->tp_basicsize));
}
static inline size_t _PyObject_VAR_SIZE(PyTypeObject *type, Py_ssize_t nitems) {
size_t size = ((size_t)(type->tp_basicsize));
size += ((size_t)(nitems)) * ((size_t)(type->tp_itemsize));
return (((size_t)(size) + (size_t)((4) - 1)) & ~(size_t)((4) - 1));
}
typedef struct {
void *ctx;
void* (*alloc) (void *ctx, size_t size);
void (*free) (void *ctx, void *ptr, size_t size);
} PyObjectArenaAllocator;
void PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator);
void PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator);
int PyObject_IS_GC(PyObject *obj);
int PyType_SUPPORTS_WEAKREFS(PyTypeObject *type);
PyObject ** PyObject_GET_WEAKREFS_LISTPTR(PyObject *op);
Py_hash_t _Py_HashDouble(PyObject *, double);
Py_hash_t _Py_HashPointer(const void*);
Py_hash_t _Py_HashPointerRaw(const void*);
Py_hash_t _Py_HashBytes(const void*, Py_ssize_t);
typedef union {
unsigned char uc[24];
struct {
Py_hash_t prefix;
Py_hash_t suffix;
} fnv;
struct {
uint64_t k0;
uint64_t k1;
} siphash;
struct {
unsigned char padding[16];
Py_hash_t suffix;
} djbx33a;
struct {
unsigned char padding[16];
Py_hash_t hashsalt;
} expat;
} _Py_HashSecret_t;
extern _Py_HashSecret_t _Py_HashSecret;
typedef struct {
Py_hash_t (*const hash)(const void *, Py_ssize_t);
const char *name;
const int hash_bits;
const int seed_bits;
} PyHash_FuncDef;
PyHash_FuncDef* PyHash_GetFuncDef(void);
extern int Py_DebugFlag;
extern int Py_VerboseFlag;
extern int Py_QuietFlag;
extern int Py_InteractiveFlag;
extern int Py_InspectFlag;
extern int Py_OptimizeFlag;
extern int Py_NoSiteFlag;
extern int Py_BytesWarningFlag;
extern int Py_FrozenFlag;
extern int Py_IgnoreEnvironmentFlag;
extern int Py_DontWriteBytecodeFlag;
extern int Py_NoUserSiteDirectory;
extern int Py_UnbufferedStdioFlag;
extern int Py_HashRandomizationFlag;
extern int Py_IsolatedFlag;
char* Py_GETENV(const char *name);
extern PyTypeObject PyByteArray_Type;
extern PyTypeObject PyByteArrayIter_Type;
PyObject * PyByteArray_FromObject(PyObject *);
PyObject * PyByteArray_Concat(PyObject *, PyObject *);
PyObject * PyByteArray_FromStringAndSize(const char *, Py_ssize_t);
Py_ssize_t PyByteArray_Size(PyObject *);
char * PyByteArray_AsString(PyObject *);
int PyByteArray_Resize(PyObject *, Py_ssize_t);
typedef struct {
PyVarObject ob_base;
Py_ssize_t ob_alloc;
char *ob_bytes;
char *ob_start;
Py_ssize_t ob_exports;
} PyByteArrayObject;
extern char _PyByteArray_empty_string[];
static inline char* PyByteArray_AS_STRING(PyObject *op)
{
PyByteArrayObject *self = (assert(PyObject_TypeCheck(((PyObject*)(((op)))), (&PyByteArray_Type))), ((PyByteArrayObject*)(op)));
if (Py_SIZE(((PyObject*)((self))))) {
return self->ob_start;
}
return _PyByteArray_empty_string;
}
static inline Py_ssize_t PyByteArray_GET_SIZE(PyObject *op) {
PyByteArrayObject *self = (assert(PyObject_TypeCheck(((PyObject*)(((op)))), (&PyByteArray_Type))), ((PyByteArrayObject*)(op)));
return Py_SIZE(((PyObject*)((self))));
}
extern PyTypeObject PyBytes_Type;
extern PyTypeObject PyBytesIter_Type;
PyObject * PyBytes_FromStringAndSize(const char *, Py_ssize_t);
PyObject * PyBytes_FromString(const char *);
PyObject * PyBytes_FromObject(PyObject *);
PyObject * PyBytes_FromFormatV(const char*, va_list)
;
PyObject * PyBytes_FromFormat(const char*, ...)
;
Py_ssize_t PyBytes_Size(PyObject *);
char * PyBytes_AsString(PyObject *);
PyObject * PyBytes_Repr(PyObject *, int);
void PyBytes_Concat(PyObject **, PyObject *);
void PyBytes_ConcatAndDel(PyObject **, PyObject *);
PyObject * PyBytes_DecodeEscape(const char *, Py_ssize_t,
const char *, Py_ssize_t,
const char *);
int PyBytes_AsStringAndSize(
PyObject *obj,
char **s,
Py_ssize_t *len
);
typedef struct {
PyVarObject ob_base;
Py_hash_t ob_shash;
char ob_sval[1];
} PyBytesObject;
int _PyBytes_Resize(PyObject **, Py_ssize_t);
PyObject* _PyBytes_FormatEx(
const char *format,
Py_ssize_t format_len,
PyObject *args,
int use_bytearray);
PyObject* _PyBytes_FromHex(
PyObject *string,
int use_bytearray);
PyObject * _PyBytes_DecodeEscape(const char *, Py_ssize_t,
const char *, const char **);
static inline char* PyBytes_AS_STRING(PyObject *op)
{
return (assert(PyType_HasFeature((Py_TYPE(((PyObject*)((op))))), ((1UL << 27)))), ((PyBytesObject*)(op)))->ob_sval;
}
static inline Py_ssize_t PyBytes_GET_SIZE(PyObject *op) {
PyBytesObject *self = (assert(PyType_HasFeature((Py_TYPE(((PyObject*)((op))))), ((1UL << 27)))), ((PyBytesObject*)(op)));
return Py_SIZE(((PyObject*)((self))));
}
PyObject * _PyBytes_Join(PyObject *sep, PyObject *x);
typedef struct {
PyObject *buffer;
Py_ssize_t allocated;
Py_ssize_t min_size;
int use_bytearray;
int overallocate;
int use_small_buffer;
char small_buffer[512];
} _PyBytesWriter;
void _PyBytesWriter_Init(_PyBytesWriter *writer);
PyObject * _PyBytesWriter_Finish(_PyBytesWriter *writer,
void *str);
void _PyBytesWriter_Dealloc(_PyBytesWriter *writer);
void* _PyBytesWriter_Alloc(_PyBytesWriter *writer,
Py_ssize_t size);
void* _PyBytesWriter_Prepare(_PyBytesWriter *writer,
void *str,
Py_ssize_t size);
void* _PyBytesWriter_Resize(_PyBytesWriter *writer,
void *str,
Py_ssize_t size);
void* _PyBytesWriter_WriteBytes(_PyBytesWriter *writer,
void *str,
const void *bytes,
Py_ssize_t size);
typedef uint32_t Py_UCS4;
typedef uint16_t Py_UCS2;
typedef uint8_t Py_UCS1;
extern PyTypeObject PyUnicode_Type;
extern PyTypeObject PyUnicodeIter_Type;
PyObject* PyUnicode_FromStringAndSize(
const char *u,
Py_ssize_t size
);
PyObject* PyUnicode_FromString(
const char *u
);
PyObject* PyUnicode_Substring(
PyObject *str,
Py_ssize_t start,
Py_ssize_t end);
Py_UCS4* PyUnicode_AsUCS4(
PyObject *unicode,
Py_UCS4* buffer,
Py_ssize_t buflen,
int copy_null);
Py_UCS4* PyUnicode_AsUCS4Copy(PyObject *unicode);
Py_ssize_t PyUnicode_GetLength(
PyObject *unicode
);
Py_UCS4 PyUnicode_ReadChar(
PyObject *unicode,
Py_ssize_t index
);
int PyUnicode_WriteChar(
PyObject *unicode,
Py_ssize_t index,
Py_UCS4 character
);
int PyUnicode_Resize(
PyObject **unicode,
Py_ssize_t length
);
PyObject* PyUnicode_FromEncodedObject(
PyObject *obj,
const char *encoding,
const char *errors
);
PyObject* PyUnicode_FromObject(
PyObject *obj
);
PyObject * PyUnicode_FromFormatV(
const char *format,
va_list vargs
);
PyObject * PyUnicode_FromFormat(
const char *format,
...
);
void PyUnicode_InternInPlace(PyObject **);
PyObject * PyUnicode_InternFromString(
const char *u
);
PyObject* PyUnicode_FromWideChar(
const wchar_t *w,
Py_ssize_t size
);
Py_ssize_t PyUnicode_AsWideChar(
PyObject *unicode,
wchar_t *w,
Py_ssize_t size
);
wchar_t* PyUnicode_AsWideCharString(
PyObject *unicode,
Py_ssize_t *size
);
PyObject* PyUnicode_FromOrdinal(int ordinal);
const char* PyUnicode_GetDefaultEncoding(void);
PyObject* PyUnicode_Decode(
const char *s,
Py_ssize_t size,
const char *encoding,
const char *errors
);
PyObject* PyUnicode_AsDecodedObject(
PyObject *unicode,
const char *encoding,
const char *errors
);
PyObject* PyUnicode_AsDecodedUnicode(
PyObject *unicode,
const char *encoding,
const char *errors
);
PyObject* PyUnicode_AsEncodedObject(
PyObject *unicode,
const char *encoding,
const char *errors
);
PyObject* PyUnicode_AsEncodedString(
PyObject *unicode,
const char *encoding,
const char *errors
);
PyObject* PyUnicode_AsEncodedUnicode(
PyObject *unicode,
const char *encoding,
const char *errors
);
PyObject* PyUnicode_BuildEncodingMap(
PyObject* string
);
PyObject* PyUnicode_DecodeUTF7(
const char *string,
Py_ssize_t length,
const char *errors
);
PyObject* PyUnicode_DecodeUTF7Stateful(
const char *string,
Py_ssize_t length,
const char *errors,
Py_ssize_t *consumed
);
PyObject* PyUnicode_DecodeUTF8(
const char *string,
Py_ssize_t length,
const char *errors
);
PyObject* PyUnicode_DecodeUTF8Stateful(
const char *string,
Py_ssize_t length,
const char *errors,
Py_ssize_t *consumed
);
PyObject* PyUnicode_AsUTF8String(
PyObject *unicode
);
const char * PyUnicode_AsUTF8AndSize(
PyObject *unicode,
Py_ssize_t *size);
PyObject* PyUnicode_DecodeUTF32(
const char *string,
Py_ssize_t length,
const char *errors,
int *byteorder
);
PyObject* PyUnicode_DecodeUTF32Stateful(
const char *string,
Py_ssize_t length,
const char *errors,
int *byteorder,
Py_ssize_t *consumed
);
PyObject* PyUnicode_AsUTF32String(
PyObject *unicode
);
PyObject* PyUnicode_DecodeUTF16(
const char *string,
Py_ssize_t length,
const char *errors,
int *byteorder
);
PyObject* PyUnicode_DecodeUTF16Stateful(
const char *string,
Py_ssize_t length,
const char *errors,
int *byteorder,
Py_ssize_t *consumed
);
PyObject* PyUnicode_AsUTF16String(
PyObject *unicode
);
PyObject* PyUnicode_DecodeUnicodeEscape(
const char *string,
Py_ssize_t length,
const char *errors
);
PyObject* PyUnicode_AsUnicodeEscapeString(
PyObject *unicode
);
PyObject* PyUnicode_DecodeRawUnicodeEscape(
const char *string,
Py_ssize_t length,
const char *errors
);
PyObject* PyUnicode_AsRawUnicodeEscapeString(
PyObject *unicode
);
PyObject* PyUnicode_DecodeLatin1(
const char *string,
Py_ssize_t length,
const char *errors
);
PyObject* PyUnicode_AsLatin1String(
PyObject *unicode
);
PyObject* PyUnicode_DecodeASCII(
const char *string,
Py_ssize_t length,
const char *errors
);
PyObject* PyUnicode_AsASCIIString(
PyObject *unicode
);
PyObject* PyUnicode_DecodeCharmap(
const char *string,
Py_ssize_t length,
PyObject *mapping,
const char *errors
);
PyObject* PyUnicode_AsCharmapString(
PyObject *unicode,
PyObject *mapping
);
PyObject* PyUnicode_DecodeLocaleAndSize(
const char *str,
Py_ssize_t len,
const char *errors);
PyObject* PyUnicode_DecodeLocale(
const char *str,
const char *errors);
PyObject* PyUnicode_EncodeLocale(
PyObject *unicode,
const char *errors
);
int PyUnicode_FSConverter(PyObject*, void*);
int PyUnicode_FSDecoder(PyObject*, void*);
PyObject* PyUnicode_DecodeFSDefault(
const char *s
);
PyObject* PyUnicode_DecodeFSDefaultAndSize(
const char *s,
Py_ssize_t size
);
PyObject* PyUnicode_EncodeFSDefault(
PyObject *unicode
);
PyObject* PyUnicode_Concat(
PyObject *left,
PyObject *right
);
void PyUnicode_Append(
PyObject **pleft,
PyObject *right
);
void PyUnicode_AppendAndDel(
PyObject **pleft,
PyObject *right
);
PyObject* PyUnicode_Split(
PyObject *s,
PyObject *sep,
Py_ssize_t maxsplit
);
PyObject* PyUnicode_Splitlines(
PyObject *s,
int keepends
);
PyObject* PyUnicode_Partition(
PyObject *s,
PyObject *sep
);
PyObject* PyUnicode_RPartition(
PyObject *s,
PyObject *sep
);
PyObject* PyUnicode_RSplit(
PyObject *s,
PyObject *sep,
Py_ssize_t maxsplit
);
PyObject * PyUnicode_Translate(
PyObject *str,
PyObject *table,
const char *errors
);
PyObject* PyUnicode_Join(
PyObject *separator,
PyObject *seq
);
Py_ssize_t PyUnicode_Tailmatch(
PyObject *str,
PyObject *substr,
Py_ssize_t start,
Py_ssize_t end,
int direction
);
Py_ssize_t PyUnicode_Find(
PyObject *str,
PyObject *substr,
Py_ssize_t start,
Py_ssize_t end,
int direction
);
Py_ssize_t PyUnicode_FindChar(
PyObject *str,
Py_UCS4 ch,
Py_ssize_t start,
Py_ssize_t end,
int direction
);
Py_ssize_t PyUnicode_Count(
PyObject *str,
PyObject *substr,
Py_ssize_t start,
Py_ssize_t end
);
PyObject * PyUnicode_Replace(
PyObject *str,
PyObject *substr,
PyObject *replstr,
Py_ssize_t maxcount
);
int PyUnicode_Compare(
PyObject *left,
PyObject *right
);
int PyUnicode_CompareWithASCIIString(
PyObject *left,
const char *right
);
PyObject * PyUnicode_RichCompare(
PyObject *left,
PyObject *right,
int op
);
PyObject * PyUnicode_Format(
PyObject *format,
PyObject *args
);
int PyUnicode_Contains(
PyObject *container,
PyObject *element
);
int PyUnicode_IsIdentifier(PyObject *s);
typedef wchar_t Py_UNICODE;
static inline int Py_UNICODE_IS_SURROGATE(Py_UCS4 ch) {
return (0xD800 <= ch && ch <= 0xDFFF);
}
static inline int Py_UNICODE_IS_HIGH_SURROGATE(Py_UCS4 ch) {
return (0xD800 <= ch && ch <= 0xDBFF);
}
static inline int Py_UNICODE_IS_LOW_SURROGATE(Py_UCS4 ch) {
return (0xDC00 <= ch && ch <= 0xDFFF);
}
static inline Py_UCS4 Py_UNICODE_JOIN_SURROGATES(Py_UCS4 high, Py_UCS4 low) {
assert(Py_UNICODE_IS_HIGH_SURROGATE(high));
assert(Py_UNICODE_IS_LOW_SURROGATE(low));
return 0x10000 + (((high & 0x03FF) << 10) | (low & 0x03FF));
}
static inline Py_UCS4 Py_UNICODE_HIGH_SURROGATE(Py_UCS4 ch) {
assert(0x10000 <= ch && ch <= 0x10ffff);
return (0xD800 - (0x10000 >> 10) + (ch >> 10));
}
static inline Py_UCS4 Py_UNICODE_LOW_SURROGATE(Py_UCS4 ch) {
assert(0x10000 <= ch && ch <= 0x10ffff);
return (0xDC00 + (ch & 0x3FF));
}
typedef struct {
PyObject ob_base;
Py_ssize_t length;
Py_hash_t hash;
struct {
unsigned int interned:1;
unsigned int kind:3;
unsigned int compact:1;
unsigned int ascii:1;
unsigned int :26;
} state;
} PyASCIIObject;
typedef struct {
PyASCIIObject _base;
Py_ssize_t utf8_length;
char *utf8;
} PyCompactUnicodeObject;
typedef struct {
PyCompactUnicodeObject _base;
union {
void *any;
Py_UCS1 *latin1;
Py_UCS2 *ucs2;
Py_UCS4 *ucs4;
} data;
} PyUnicodeObject;
int _PyUnicode_CheckConsistency(
PyObject *op,
int check_content);
static inline unsigned int PyUnicode_CHECK_INTERNED(PyObject *op) {
return (assert(PyType_HasFeature((Py_TYPE(((PyObject*)((op))))), ((1UL << 28)))), ((PyASCIIObject*)((op))))->state.interned;
}
static inline unsigned int PyUnicode_IS_READY(PyObject* _unused_op ) {
return 1;
}
static inline unsigned int PyUnicode_IS_ASCII(PyObject *op) {
return (assert(PyType_HasFeature((Py_TYPE(((PyObject*)((op))))), ((1UL << 28)))), ((PyASCIIObject*)((op))))->state.ascii;
}
static inline unsigned int PyUnicode_IS_COMPACT(PyObject *op) {
return (assert(PyType_HasFeature((Py_TYPE(((PyObject*)((op))))), ((1UL << 28)))), ((PyASCIIObject*)((op))))->state.compact;
}
static inline int PyUnicode_IS_COMPACT_ASCII(PyObject *op) {
return ((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((op))))), ((1UL << 28)))), ((PyASCIIObject*)((op))))->state.ascii && PyUnicode_IS_COMPACT(((PyObject*)((op)))));
}
enum PyUnicode_Kind {
PyUnicode_1BYTE_KIND = 1,
PyUnicode_2BYTE_KIND = 2,
PyUnicode_4BYTE_KIND = 4
};
static inline void* _PyUnicode_COMPACT_DATA(PyObject *op) {
if (PyUnicode_IS_ASCII(((PyObject*)((op))))) {
return ((void*)(((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((op))))), ((1UL << 28)))), ((PyASCIIObject*)((op)))) + 1)));
}
return ((void*)(((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((op))))), ((1UL << 28)))), ((PyCompactUnicodeObject*)((op)))) + 1)));
}
static inline void* _PyUnicode_NONCOMPACT_DATA(PyObject *op) {
void *data;
assert(!PyUnicode_IS_COMPACT(((PyObject*)((op)))));
data = (assert(PyType_HasFeature((Py_TYPE(((PyObject*)((op))))), ((1UL << 28)))), ((PyUnicodeObject*)((op))))->data.any;
assert(data != 0);
return data;
}
static inline void* PyUnicode_DATA(PyObject *op) {
if (PyUnicode_IS_COMPACT(((PyObject*)((op))))) {
return _PyUnicode_COMPACT_DATA(op);
}
return _PyUnicode_NONCOMPACT_DATA(op);
}
static inline Py_ssize_t PyUnicode_GET_LENGTH(PyObject *op) {
return (assert(PyType_HasFeature((Py_TYPE(((PyObject*)((op))))), ((1UL << 28)))), ((PyASCIIObject*)((op))))->length;
}
static inline void PyUnicode_WRITE(int kind, void *data,
Py_ssize_t index, Py_UCS4 value)
{
assert(index >= 0);
if (kind == PyUnicode_1BYTE_KIND) {
assert(value <= 0xffU);
((Py_UCS1*)(data))[index] = ((Py_UCS1)(value));
}
else if (kind == PyUnicode_2BYTE_KIND) {
assert(value <= 0xffffU);
((Py_UCS2*)(data))[index] = ((Py_UCS2)(value));
}
else {
assert(kind == PyUnicode_4BYTE_KIND);
assert(value <= 0x10ffffU);
((Py_UCS4*)(data))[index] = value;
}
}
static inline Py_UCS4 PyUnicode_READ(int kind,
const void *data, Py_ssize_t index)
{
assert(index >= 0);
if (kind == PyUnicode_1BYTE_KIND) {
return ((const Py_UCS1*)(data))[index];
}
if (kind == PyUnicode_2BYTE_KIND) {
return ((const Py_UCS2*)(data))[index];
}
assert(kind == PyUnicode_4BYTE_KIND);
return ((const Py_UCS4*)(data))[index];
}
static inline Py_UCS4 PyUnicode_READ_CHAR(PyObject *unicode, Py_ssize_t index)
{
int kind;
assert(index >= 0);
assert(index <= PyUnicode_GET_LENGTH(((PyObject*)((unicode)))));
kind = ((void)0, ((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((unicode))))), ((1UL << 28)))), ((PyASCIIObject*)((unicode))))->state.kind));
if (kind == PyUnicode_1BYTE_KIND) {
return ((Py_UCS1*)(PyUnicode_DATA(((PyObject*)((unicode))))))[index];
}
if (kind == PyUnicode_2BYTE_KIND) {
return ((Py_UCS2*)(PyUnicode_DATA(((PyObject*)((unicode))))))[index];
}
assert(kind == PyUnicode_4BYTE_KIND);
return ((Py_UCS4*)(PyUnicode_DATA(((PyObject*)((unicode))))))[index];
}
static inline Py_UCS4 PyUnicode_MAX_CHAR_VALUE(PyObject *op)
{
int kind;
if (PyUnicode_IS_ASCII(((PyObject*)((op))))) {
return 0x7fU;
}
kind = ((void)0, ((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((op))))), ((1UL << 28)))), ((PyASCIIObject*)((op))))->state.kind));
if (kind == PyUnicode_1BYTE_KIND) {
return 0xffU;
}
if (kind == PyUnicode_2BYTE_KIND) {
return 0xffffU;
}
assert(kind == PyUnicode_4BYTE_KIND);
return 0x10ffffU;
}
PyObject* PyUnicode_New(
Py_ssize_t size,
Py_UCS4 maxchar
);
static inline int PyUnicode_READY(PyObject* _unused_op )
{
return 0;
}
PyObject* _PyUnicode_Copy(
PyObject *unicode
);
Py_ssize_t PyUnicode_CopyCharacters(
PyObject *to,
Py_ssize_t to_start,
PyObject *from,
Py_ssize_t from_start,
Py_ssize_t how_many
);
void _PyUnicode_FastCopyCharacters(
PyObject *to,
Py_ssize_t to_start,
PyObject *from,
Py_ssize_t from_start,
Py_ssize_t how_many
);
Py_ssize_t PyUnicode_Fill(
PyObject *unicode,
Py_ssize_t start,
Py_ssize_t length,
Py_UCS4 fill_char
);
void _PyUnicode_FastFill(
PyObject *unicode,
Py_ssize_t start,
Py_ssize_t length,
Py_UCS4 fill_char
);
PyObject* PyUnicode_FromKindAndData(
int kind,
const void *buffer,
Py_ssize_t size);
PyObject* _PyUnicode_FromASCII(
const char *buffer,
Py_ssize_t size);
Py_UCS4 _PyUnicode_FindMaxChar (
PyObject *unicode,
Py_ssize_t start,
Py_ssize_t end);
typedef struct {
PyObject *buffer;
void *data;
int kind;
Py_UCS4 maxchar;
Py_ssize_t size;
Py_ssize_t pos;
Py_ssize_t min_length;
Py_UCS4 min_char;
unsigned char overallocate;
unsigned char readonly;
} _PyUnicodeWriter ;
void
_PyUnicodeWriter_Init(_PyUnicodeWriter *writer);
int
_PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer,
Py_ssize_t length, Py_UCS4 maxchar);
int
_PyUnicodeWriter_PrepareKindInternal(_PyUnicodeWriter *writer,
int kind);
int
_PyUnicodeWriter_WriteChar(_PyUnicodeWriter *writer,
Py_UCS4 ch
);
int
_PyUnicodeWriter_WriteStr(_PyUnicodeWriter *writer,
PyObject *str
);
int
_PyUnicodeWriter_WriteSubstring(_PyUnicodeWriter *writer,
PyObject *str,
Py_ssize_t start,
Py_ssize_t end
);
int
_PyUnicodeWriter_WriteASCIIString(_PyUnicodeWriter *writer,
const char *str,
Py_ssize_t len
);
int
_PyUnicodeWriter_WriteLatin1String(_PyUnicodeWriter *writer,
const char *str,
Py_ssize_t len
);
PyObject *
_PyUnicodeWriter_Finish(_PyUnicodeWriter *writer);
void
_PyUnicodeWriter_Dealloc(_PyUnicodeWriter *writer);
int _PyUnicode_FormatAdvancedWriter(
_PyUnicodeWriter *writer,
PyObject *obj,
PyObject *format_spec,
Py_ssize_t start,
Py_ssize_t end);
const char * PyUnicode_AsUTF8(PyObject *unicode);
PyObject* _PyUnicode_EncodeUTF7(
PyObject *unicode,
int base64SetO,
int base64WhiteSpace,
const char *errors
);
PyObject* _PyUnicode_AsUTF8String(
PyObject *unicode,
const char *errors);
PyObject* _PyUnicode_EncodeUTF32(
PyObject *object,
const char *errors,
int byteorder
);
PyObject* _PyUnicode_EncodeUTF16(
PyObject* unicode,
const char *errors,
int byteorder
);
PyObject* _PyUnicode_DecodeUnicodeEscapeStateful(
const char *string,
Py_ssize_t length,
const char *errors,
Py_ssize_t *consumed
);
PyObject* _PyUnicode_DecodeUnicodeEscapeInternal(
const char *string,
Py_ssize_t length,
const char *errors,
Py_ssize_t *consumed,
const char **first_invalid_escape
);
PyObject* _PyUnicode_DecodeRawUnicodeEscapeStateful(
const char *string,
Py_ssize_t length,
const char *errors,
Py_ssize_t *consumed
);
PyObject* _PyUnicode_AsLatin1String(
PyObject* unicode,
const char* errors);
PyObject* _PyUnicode_AsASCIIString(
PyObject* unicode,
const char* errors);
PyObject* _PyUnicode_EncodeCharmap(
PyObject *unicode,
PyObject *mapping,
const char *errors
);
PyObject* _PyUnicode_TransformDecimalAndSpaceToASCII(
PyObject *unicode
);
PyObject * _PyUnicode_JoinArray(
PyObject *separator,
PyObject *const *items,
Py_ssize_t seqlen
);
int _PyUnicode_EqualToASCIIId(
PyObject *left,
_Py_Identifier *right
);
int _PyUnicode_EqualToASCIIString(
PyObject *left,
const char *right
);
PyObject * _PyUnicode_XStrip(
PyObject *self,
int striptype,
PyObject *sepobj
);
Py_ssize_t _PyUnicode_InsertThousandsGrouping(
_PyUnicodeWriter *writer,
Py_ssize_t n_buffer,
PyObject *digits,
Py_ssize_t d_pos,
Py_ssize_t n_digits,
Py_ssize_t min_width,
const char *grouping,
PyObject *thousands_sep,
Py_UCS4 *maxchar);
int _PyUnicode_IsLowercase(
Py_UCS4 ch
);
int _PyUnicode_IsUppercase(
Py_UCS4 ch
);
int _PyUnicode_IsTitlecase(
Py_UCS4 ch
);
int _PyUnicode_IsXidStart(
Py_UCS4 ch
);
int _PyUnicode_IsXidContinue(
Py_UCS4 ch
);
int _PyUnicode_IsWhitespace(
const Py_UCS4 ch
);
int _PyUnicode_IsLinebreak(
const Py_UCS4 ch
);
Py_UCS4 _PyUnicode_ToLowercase(
Py_UCS4 ch
);
Py_UCS4 _PyUnicode_ToUppercase(
Py_UCS4 ch
);
Py_UCS4 _PyUnicode_ToTitlecase(
Py_UCS4 ch
);
int _PyUnicode_ToLowerFull(
Py_UCS4 ch,
Py_UCS4 *res
);
int _PyUnicode_ToTitleFull(
Py_UCS4 ch,
Py_UCS4 *res
);
int _PyUnicode_ToUpperFull(
Py_UCS4 ch,
Py_UCS4 *res
);
int _PyUnicode_ToFoldedFull(
Py_UCS4 ch,
Py_UCS4 *res
);
int _PyUnicode_IsCaseIgnorable(
Py_UCS4 ch
);
int _PyUnicode_IsCased(
Py_UCS4 ch
);
int _PyUnicode_ToDecimalDigit(
Py_UCS4 ch
);
int _PyUnicode_ToDigit(
Py_UCS4 ch
);
double _PyUnicode_ToNumeric(
Py_UCS4 ch
);
int _PyUnicode_IsDecimalDigit(
Py_UCS4 ch
);
int _PyUnicode_IsDigit(
Py_UCS4 ch
);
int _PyUnicode_IsNumeric(
Py_UCS4 ch
);
int _PyUnicode_IsPrintable(
Py_UCS4 ch
);
int _PyUnicode_IsAlpha(
Py_UCS4 ch
);
extern const unsigned char _Py_ascii_whitespace[];
static inline int Py_UNICODE_ISSPACE(Py_UCS4 ch) {
if (ch < 128) {
return _Py_ascii_whitespace[ch];
}
return _PyUnicode_IsWhitespace(ch);
}
static inline int Py_UNICODE_ISALNUM(Py_UCS4 ch) {
return (_PyUnicode_IsAlpha(ch)
|| _PyUnicode_IsDecimalDigit(ch)
|| _PyUnicode_IsDigit(ch)
|| _PyUnicode_IsNumeric(ch));
}
PyObject* _PyUnicode_FormatLong(PyObject *, int, int, int);
PyObject* _PyUnicode_FromId(_Py_Identifier*);
int _PyUnicode_EQ(PyObject *, PyObject *);
int _PyUnicode_Equal(PyObject *, PyObject *);
int _PyUnicode_WideCharString_Converter(PyObject *, void *);
int _PyUnicode_WideCharString_Opt_Converter(PyObject *, void *);
Py_ssize_t _PyUnicode_ScanIdentifier(PyObject *);
extern PyTypeObject PyLong_Type;
PyObject * PyLong_FromLong(long);
PyObject * PyLong_FromUnsignedLong(unsigned long);
PyObject * PyLong_FromSize_t(size_t);
PyObject * PyLong_FromSsize_t(Py_ssize_t);
PyObject * PyLong_FromDouble(double);
long PyLong_AsLong(PyObject *);
long PyLong_AsLongAndOverflow(PyObject *, int *);
Py_ssize_t PyLong_AsSsize_t(PyObject *);
size_t PyLong_AsSize_t(PyObject *);
unsigned long PyLong_AsUnsignedLong(PyObject *);
unsigned long PyLong_AsUnsignedLongMask(PyObject *);
PyObject * PyLong_GetInfo(void);
double PyLong_AsDouble(PyObject *);
PyObject * PyLong_FromVoidPtr(void *);
void * PyLong_AsVoidPtr(PyObject *);
PyObject * PyLong_FromLongLong(long long);
PyObject * PyLong_FromUnsignedLongLong(unsigned long long);
long long PyLong_AsLongLong(PyObject *);
unsigned long long PyLong_AsUnsignedLongLong(PyObject *);
unsigned long long PyLong_AsUnsignedLongLongMask(PyObject *);
long long PyLong_AsLongLongAndOverflow(PyObject *, int *);
PyObject * PyLong_FromString(const char *, char **, int);
unsigned long PyOS_strtoul(const char *, char **, int);
long PyOS_strtol(const char *, char **, int);
int _PyLong_AsInt(PyObject *);
int _PyLong_UnsignedShort_Converter(PyObject *, void *);
int _PyLong_UnsignedInt_Converter(PyObject *, void *);
int _PyLong_UnsignedLong_Converter(PyObject *, void *);
int _PyLong_UnsignedLongLong_Converter(PyObject *, void *);
int _PyLong_Size_t_Converter(PyObject *, void *);
double _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e);
PyObject * PyLong_FromUnicodeObject(PyObject *u, int base);
PyObject * _PyLong_FromBytes(const char *, Py_ssize_t, int);
int _PyLong_Sign(PyObject *v);
size_t _PyLong_NumBits(PyObject *v);
PyObject * _PyLong_DivmodNear(PyObject *, PyObject *);
PyObject * _PyLong_FromByteArray(
const unsigned char* bytes, size_t n,
int little_endian, int is_signed);
int _PyLong_AsByteArray(PyLongObject* v,
unsigned char* bytes, size_t n,
int little_endian, int is_signed);
PyObject * _PyLong_Format(PyObject *obj, int base);
PyObject * _PyLong_GCD(PyObject *, PyObject *);
PyObject * _PyLong_Rshift(PyObject *, size_t);
PyObject * _PyLong_Lshift(PyObject *, size_t);
typedef uint32_t digit;
typedef int32_t sdigit;
typedef uint64_t twodigits;
typedef int64_t stwodigits;
typedef struct _PyLongValue {
uintptr_t lv_tag;
digit ob_digit[1];
} _PyLongValue;
struct _longobject {
PyObject ob_base;
_PyLongValue long_value;
};
PyLongObject * _PyLong_New(Py_ssize_t);
PyObject * _PyLong_Copy(PyLongObject *src);
PyLongObject *
_PyLong_FromDigits(int negative, Py_ssize_t digit_count, digit *digits);
extern PyTypeObject PyBool_Type;
extern PyLongObject _Py_FalseStruct;
extern PyLongObject _Py_TrueStruct;
int Py_IsTrue(PyObject *x);
int Py_IsFalse(PyObject *x);
PyObject * PyBool_FromLong(long);
extern PyTypeObject PyFloat_Type;
double PyFloat_GetMax(void);
double PyFloat_GetMin(void);
PyObject* PyFloat_GetInfo(void);
PyObject* PyFloat_FromString(PyObject*);
PyObject* PyFloat_FromDouble(double);
double PyFloat_AsDouble(PyObject*);
typedef struct {
PyObject ob_base;
double ob_fval;
} PyFloatObject;
static inline double PyFloat_AS_DOUBLE(PyObject *op) {
return (assert(PyObject_TypeCheck(((PyObject*)((op))), (&PyFloat_Type))), ((PyFloatObject*)(op)))->ob_fval;
}
int PyFloat_Pack2(double x, char *p, int le);
int PyFloat_Pack4(double x, char *p, int le);
int PyFloat_Pack8(double x, char *p, int le);
double PyFloat_Unpack2(const char *p, int le);
double PyFloat_Unpack4(const char *p, int le);
double PyFloat_Unpack8(const char *p, int le);
extern PyTypeObject PyComplex_Type;
PyObject * PyComplex_FromDoubles(double real, double imag);
double PyComplex_RealAsDouble(PyObject *op);
double PyComplex_ImagAsDouble(PyObject *op);
typedef struct {
double real;
double imag;
} Py_complex;
Py_complex _Py_c_sum(Py_complex, Py_complex);
Py_complex _Py_c_diff(Py_complex, Py_complex);
Py_complex _Py_c_neg(Py_complex);
Py_complex _Py_c_prod(Py_complex, Py_complex);
Py_complex _Py_c_quot(Py_complex, Py_complex);
Py_complex _Py_c_pow(Py_complex, Py_complex);
double _Py_c_abs(Py_complex);
typedef struct {
PyObject ob_base;
Py_complex cval;
} PyComplexObject;
PyObject * PyComplex_FromCComplex(Py_complex);
Py_complex PyComplex_AsCComplex(PyObject *op);
extern int _PyComplex_FormatAdvancedWriter(
_PyUnicodeWriter *writer,
PyObject *obj,
PyObject *format_spec,
Py_ssize_t start,
Py_ssize_t end);
extern PyTypeObject PyRange_Type;
extern PyTypeObject PyRangeIter_Type;
extern PyTypeObject PyLongRangeIter_Type;
extern PyTypeObject PyMemoryView_Type;
PyObject * PyMemoryView_FromObject(PyObject *base);
PyObject * PyMemoryView_FromMemory(char *mem, Py_ssize_t size,
int flags);
PyObject * PyMemoryView_FromBuffer(const Py_buffer *info);
PyObject * PyMemoryView_GetContiguous(PyObject *base,
int buffertype,
char order);
extern PyTypeObject _PyManagedBuffer_Type;
typedef struct {
PyObject ob_base;
int flags;
Py_ssize_t exports;
Py_buffer master;
} _PyManagedBufferObject;
typedef struct {
PyVarObject ob_base;
_PyManagedBufferObject *mbuf;
Py_hash_t hash;
int flags;
Py_ssize_t exports;
Py_buffer view;
PyObject *weakreflist;
Py_ssize_t ob_array[1];
} PyMemoryViewObject;
static inline Py_buffer* PyMemoryView_GET_BUFFER(PyObject *op) {
return (&((PyMemoryViewObject*)(op))->view);
}
static inline PyObject* PyMemoryView_GET_BASE(PyObject *op) {
return ((PyMemoryViewObject*)(op))->view.obj;
}
extern PyTypeObject PyTuple_Type;
extern PyTypeObject PyTupleIter_Type;
PyObject * PyTuple_New(Py_ssize_t size);
Py_ssize_t PyTuple_Size(PyObject *);
PyObject * PyTuple_GetItem(PyObject *, Py_ssize_t);
int PyTuple_SetItem(PyObject *, Py_ssize_t, PyObject *);
PyObject * PyTuple_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t);
PyObject * PyTuple_Pack(Py_ssize_t, ...);
typedef struct {
PyVarObject ob_base;
PyObject *ob_item[1];
} PyTupleObject;
int _PyTuple_Resize(PyObject **, Py_ssize_t);
void _PyTuple_MaybeUntrack(PyObject *);
static inline Py_ssize_t PyTuple_GET_SIZE(PyObject *op) {
PyTupleObject *tuple = (assert(PyType_HasFeature((Py_TYPE(((PyObject*)((op))))), ((1UL << 26)))), ((PyTupleObject*)((op))));
return Py_SIZE(((PyObject*)((tuple))));
}
static inline void
PyTuple_SET_ITEM(PyObject *op, Py_ssize_t index, PyObject *value) {
PyTupleObject *tuple = (assert(PyType_HasFeature((Py_TYPE(((PyObject*)((op))))), ((1UL << 26)))), ((PyTupleObject*)((op))));
tuple->ob_item[index] = value;
}
void _PyTuple_DebugMallocStats(FILE *out);
extern PyTypeObject PyList_Type;
extern PyTypeObject PyListIter_Type;
extern PyTypeObject PyListRevIter_Type;
PyObject * PyList_New(Py_ssize_t size);
Py_ssize_t PyList_Size(PyObject *);
PyObject * PyList_GetItem(PyObject *, Py_ssize_t);
int PyList_SetItem(PyObject *, Py_ssize_t, PyObject *);
int PyList_Insert(PyObject *, Py_ssize_t, PyObject *);
int PyList_Append(PyObject *, PyObject *);
PyObject * PyList_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t);
int PyList_SetSlice(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *);
int PyList_Sort(PyObject *);
int PyList_Reverse(PyObject *);
PyObject * PyList_AsTuple(PyObject *);
typedef struct {
PyVarObject ob_base;
PyObject **ob_item;
Py_ssize_t allocated;
} PyListObject;
PyObject * _PyList_Extend(PyListObject *, PyObject *);
void _PyList_DebugMallocStats(FILE *out);
static inline Py_ssize_t PyList_GET_SIZE(PyObject *op) {
PyListObject *list = (assert(PyType_HasFeature((Py_TYPE(((PyObject*)((op))))), ((1UL << 25)))), ((PyListObject*)((op))));
return Py_SIZE(((PyObject*)((list))));
}
static inline void
PyList_SET_ITEM(PyObject *op, Py_ssize_t index, PyObject *value) {
PyListObject *list = (assert(PyType_HasFeature((Py_TYPE(((PyObject*)((op))))), ((1UL << 25)))), ((PyListObject*)((op))));
list->ob_item[index] = value;
}
extern PyTypeObject PyDict_Type;
PyObject * PyDict_New(void);
PyObject * PyDict_GetItem(PyObject *mp, PyObject *key);
PyObject * PyDict_GetItemWithError(PyObject *mp, PyObject *key);
int PyDict_SetItem(PyObject *mp, PyObject *key, PyObject *item);
int PyDict_DelItem(PyObject *mp, PyObject *key);
void PyDict_Clear(PyObject *mp);
int PyDict_Next(
PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value);
PyObject * PyDict_Keys(PyObject *mp);
PyObject * PyDict_Values(PyObject *mp);
PyObject * PyDict_Items(PyObject *mp);
Py_ssize_t PyDict_Size(PyObject *mp);
PyObject * PyDict_Copy(PyObject *mp);
int PyDict_Contains(PyObject *mp, PyObject *key);
int PyDict_Update(PyObject *mp, PyObject *other);
int PyDict_Merge(PyObject *mp,
PyObject *other,
int override);
int PyDict_MergeFromSeq2(PyObject *d,
PyObject *seq2,
int override);
PyObject * PyDict_GetItemString(PyObject *dp, const char *key);
int PyDict_SetItemString(PyObject *dp, const char *key, PyObject *item);
int PyDict_DelItemString(PyObject *dp, const char *key);
PyObject * PyObject_GenericGetDict(PyObject *, void *);
extern PyTypeObject PyDictKeys_Type;
extern PyTypeObject PyDictValues_Type;
extern PyTypeObject PyDictItems_Type;
extern PyTypeObject PyDictIterKey_Type;
extern PyTypeObject PyDictIterValue_Type;
extern PyTypeObject PyDictIterItem_Type;
extern PyTypeObject PyDictRevIterKey_Type;
extern PyTypeObject PyDictRevIterItem_Type;
extern PyTypeObject PyDictRevIterValue_Type;
typedef struct _dictkeysobject PyDictKeysObject;
typedef struct _dictvalues PyDictValues;
typedef struct {
PyObject ob_base;
Py_ssize_t ma_used;
uint64_t ma_version_tag;
PyDictKeysObject *ma_keys;
PyDictValues *ma_values;
} PyDictObject;
PyObject * _PyDict_GetItem_KnownHash(PyObject *mp, PyObject *key,
Py_hash_t hash);
PyObject * _PyDict_GetItemWithError(PyObject *dp, PyObject *key);
PyObject * _PyDict_GetItemIdWithError(PyObject *dp,
_Py_Identifier *key);
PyObject * _PyDict_GetItemStringWithError(PyObject *, const char *);
PyObject * PyDict_SetDefault(
PyObject *mp, PyObject *key, PyObject *defaultobj);
int _PyDict_SetItem_KnownHash(PyObject *mp, PyObject *key,
PyObject *item, Py_hash_t hash);
int _PyDict_DelItem_KnownHash(PyObject *mp, PyObject *key,
Py_hash_t hash);
int _PyDict_DelItemIf(PyObject *mp, PyObject *key,
int (*predicate)(PyObject *value));
int _PyDict_Next(
PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value, Py_hash_t *hash);
static inline Py_ssize_t PyDict_GET_SIZE(PyObject *op) {
PyDictObject *mp;
assert(PyType_HasFeature((Py_TYPE(((PyObject*)((op))))), ((1UL << 29))));
mp = ((PyDictObject*)(op));
return mp->ma_used;
}
int _PyDict_Contains_KnownHash(PyObject *, PyObject *, Py_hash_t);
int _PyDict_ContainsId(PyObject *, _Py_Identifier *);
PyObject * _PyDict_NewPresized(Py_ssize_t minused);
void _PyDict_MaybeUntrack(PyObject *mp);
int _PyDict_HasOnlyStringKeys(PyObject *mp);
Py_ssize_t _PyDict_SizeOf(PyDictObject *);
PyObject * _PyDict_Pop(PyObject *, PyObject *, PyObject *);
int _PyDict_MergeEx(PyObject *mp, PyObject *other, int override);
int _PyDict_SetItemId(PyObject *dp, _Py_Identifier *key, PyObject *item);
int _PyDict_DelItemId(PyObject *mp, _Py_Identifier *key);
void _PyDict_DebugMallocStats(FILE *out);
typedef struct {
PyObject ob_base;
PyDictObject *dv_dict;
} _PyDictViewObject;
PyObject * _PyDictView_New(PyObject *, PyTypeObject *);
PyObject * _PyDictView_Intersect(PyObject* self, PyObject *other);
typedef enum {
PyDict_EVENT_ADDED, PyDict_EVENT_MODIFIED, PyDict_EVENT_DELETED, PyDict_EVENT_CLONED, PyDict_EVENT_CLEARED, PyDict_EVENT_DEALLOCATED,
} PyDict_WatchEvent;
typedef int(*PyDict_WatchCallback)(PyDict_WatchEvent event, PyObject* dict, PyObject* key, PyObject* new_value);
int PyDict_AddWatcher(PyDict_WatchCallback callback);
int PyDict_ClearWatcher(int watcher_id);
int PyDict_Watch(int watcher_id, PyObject* dict);
int PyDict_Unwatch(int watcher_id, PyObject* dict);
typedef struct _odictobject PyODictObject;
extern PyTypeObject PyODict_Type;
extern PyTypeObject PyODictIter_Type;
extern PyTypeObject PyODictKeys_Type;
extern PyTypeObject PyODictItems_Type;
extern PyTypeObject PyODictValues_Type;
PyObject * PyODict_New(void);
int PyODict_SetItem(PyObject *od, PyObject *key, PyObject *item);
int PyODict_DelItem(PyObject *od, PyObject *key);
extern PyTypeObject PyEnum_Type;
extern PyTypeObject PyReversed_Type;
extern PyTypeObject PySet_Type;
extern PyTypeObject PyFrozenSet_Type;
extern PyTypeObject PySetIter_Type;
PyObject * PySet_New(PyObject *);
PyObject * PyFrozenSet_New(PyObject *);
int PySet_Add(PyObject *set, PyObject *key);
int PySet_Clear(PyObject *set);
int PySet_Contains(PyObject *anyset, PyObject *key);
int PySet_Discard(PyObject *set, PyObject *key);
PyObject * PySet_Pop(PyObject *set);
Py_ssize_t PySet_Size(PyObject *anyset);
typedef struct {
PyObject *key;
Py_hash_t hash;
} setentry;
typedef struct {
PyObject ob_base;
Py_ssize_t fill;
Py_ssize_t used;
Py_ssize_t mask;
setentry *table;
Py_hash_t hash;
Py_ssize_t finger;
setentry smalltable[8];
PyObject *weakreflist;
} PySetObject;
static inline Py_ssize_t PySet_GET_SIZE(PyObject *so) {
return (assert((Py_IS_TYPE(((PyObject*)(((so)))), (&PySet_Type)) || Py_IS_TYPE(((PyObject*)(((so)))), (&PyFrozenSet_Type)) || PyType_IsSubtype(Py_TYPE(((PyObject*)((so)))), &PySet_Type) || PyType_IsSubtype(Py_TYPE(((PyObject*)((so)))), &PyFrozenSet_Type))), ((PySetObject*)(so)))->used;
}
extern PyObject * _PySet_Dummy;
int _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, Py_hash_t *hash);
int _PySet_Update(PyObject *set, PyObject *iterable);
extern PyTypeObject PyCFunction_Type;
typedef PyObject *(*PyCFunction)(PyObject *, PyObject *);
typedef PyObject *(*_PyCFunctionFast) (PyObject *, PyObject *const *, Py_ssize_t);
typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *,
PyObject *);
typedef PyObject *(*_PyCFunctionFastWithKeywords) (PyObject *,
PyObject *const *, Py_ssize_t,
PyObject *);
typedef PyObject *(*PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *,
size_t, PyObject *);
PyCFunction PyCFunction_GetFunction(PyObject *);
PyObject * PyCFunction_GetSelf(PyObject *);
int PyCFunction_GetFlags(PyObject *);
PyObject * PyCFunction_Call(PyObject *, PyObject *, PyObject *);
struct PyMethodDef {
const char *ml_name;
PyCFunction ml_meth;
int ml_flags;
const char *ml_doc;
};
PyObject * PyCFunction_New(PyMethodDef *, PyObject *);
PyObject * PyCFunction_NewEx(PyMethodDef *, PyObject *,
PyObject *);
PyObject * PyCMethod_New(PyMethodDef *, PyObject *,
PyObject *, PyTypeObject *);
typedef struct {
PyObject ob_base;
PyMethodDef *m_ml;
PyObject *m_self;
PyObject *m_module;
PyObject *m_weakreflist;
vectorcallfunc vectorcall;
} PyCFunctionObject;
typedef struct {
PyCFunctionObject func;
PyTypeObject *mm_class;
} PyCMethodObject;
extern PyTypeObject PyCMethod_Type;
static inline PyCFunction PyCFunction_GET_FUNCTION(PyObject *func) {
return (assert(PyObject_TypeCheck(((PyObject*)(((func)))), (&PyCFunction_Type))), ((PyCFunctionObject*)((func))))->m_ml->ml_meth;
}
static inline PyObject* PyCFunction_GET_SELF(PyObject *func_obj) {
PyCFunctionObject *func = (assert(PyObject_TypeCheck(((PyObject*)(((func_obj)))), (&PyCFunction_Type))), ((PyCFunctionObject*)((func_obj))));
if (func->m_ml->ml_flags & 0x0020) {
return 0;
}
return func->m_self;
}
static inline int PyCFunction_GET_FLAGS(PyObject *func) {
return (assert(PyObject_TypeCheck(((PyObject*)(((func)))), (&PyCFunction_Type))), ((PyCFunctionObject*)((func))))->m_ml->ml_flags;
}
static inline PyTypeObject* PyCFunction_GET_CLASS(PyObject *func_obj) {
PyCFunctionObject *func = (assert(PyObject_TypeCheck(((PyObject*)(((func_obj)))), (&PyCFunction_Type))), ((PyCFunctionObject*)((func_obj))));
if (func->m_ml->ml_flags & 0x0200) {
return (assert(PyObject_TypeCheck(((PyObject*)(((func)))), (&PyCMethod_Type))), ((PyCMethodObject*)((func))))->mm_class;
}
return 0;
}
extern PyTypeObject PyModule_Type;
PyObject * PyModule_NewObject(
PyObject *name
);
PyObject * PyModule_New(
const char *name
);
PyObject * PyModule_GetDict(PyObject *);
PyObject * PyModule_GetNameObject(PyObject *);
const char * PyModule_GetName(PyObject *);
const char * PyModule_GetFilename(PyObject *);
PyObject * PyModule_GetFilenameObject(PyObject *);
void _PyModule_Clear(PyObject *);
void _PyModule_ClearDict(PyObject *);
int _PyModuleSpec_IsInitializing(PyObject *);
PyModuleDef* PyModule_GetDef(PyObject*);
void* PyModule_GetState(PyObject*);
PyObject * PyModuleDef_Init(PyModuleDef*);
extern PyTypeObject PyModuleDef_Type;
typedef struct PyModuleDef_Base {
PyObject ob_base;
PyObject* (*m_init)(void);
Py_ssize_t m_index;
PyObject* m_copy;
} PyModuleDef_Base;
struct PyModuleDef_Slot {
int slot;
void *value;
};
struct PyModuleDef {
PyModuleDef_Base m_base;
const char* m_name;
const char* m_doc;
Py_ssize_t m_size;
PyMethodDef *m_methods;
PyModuleDef_Slot *m_slots;
traverseproc m_traverse;
inquiry m_clear;
freefunc m_free;
};
extern int _PyModule_IsExtension(PyObject *obj);
typedef struct {
PyObject *fc_globals; PyObject *fc_builtins; PyObject *fc_name; PyObject *fc_qualname; PyObject *fc_code; PyObject *fc_defaults; PyObject *fc_kwdefaults; PyObject *fc_closure;
} PyFrameConstructor;
typedef struct {
PyObject ob_base;
PyObject *func_globals; PyObject *func_builtins; PyObject *func_name; PyObject *func_qualname; PyObject *func_code; PyObject *func_defaults; PyObject *func_kwdefaults; PyObject *func_closure;
PyObject *func_doc;
PyObject *func_dict;
PyObject *func_weakreflist;
PyObject *func_module;
PyObject *func_annotations;
vectorcallfunc vectorcall;
uint32_t func_version;
} PyFunctionObject;
extern PyTypeObject PyFunction_Type;
PyObject * PyFunction_New(PyObject *, PyObject *);
PyObject * PyFunction_NewWithQualName(PyObject *, PyObject *, PyObject *);
PyObject * PyFunction_GetCode(PyObject *);
PyObject * PyFunction_GetGlobals(PyObject *);
PyObject * PyFunction_GetModule(PyObject *);
PyObject * PyFunction_GetDefaults(PyObject *);
int PyFunction_SetDefaults(PyObject *, PyObject *);
void PyFunction_SetVectorcall(PyFunctionObject *, vectorcallfunc);
PyObject * PyFunction_GetKwDefaults(PyObject *);
int PyFunction_SetKwDefaults(PyObject *, PyObject *);
PyObject * PyFunction_GetClosure(PyObject *);
int PyFunction_SetClosure(PyObject *, PyObject *);
PyObject * PyFunction_GetAnnotations(PyObject *);
int PyFunction_SetAnnotations(PyObject *, PyObject *);
PyObject * _PyFunction_Vectorcall(
PyObject *func,
PyObject *const *stack,
size_t nargsf,
PyObject *kwnames);
static inline PyObject* PyFunction_GET_CODE(PyObject *func) {
return (assert(Py_IS_TYPE(((PyObject*)(((func)))), (&PyFunction_Type))), ((PyFunctionObject*)(func)))->func_code;
}
static inline PyObject* PyFunction_GET_GLOBALS(PyObject *func) {
return (assert(Py_IS_TYPE(((PyObject*)(((func)))), (&PyFunction_Type))), ((PyFunctionObject*)(func)))->func_globals;
}
static inline PyObject* PyFunction_GET_MODULE(PyObject *func) {
return (assert(Py_IS_TYPE(((PyObject*)(((func)))), (&PyFunction_Type))), ((PyFunctionObject*)(func)))->func_module;
}
static inline PyObject* PyFunction_GET_DEFAULTS(PyObject *func) {
return (assert(Py_IS_TYPE(((PyObject*)(((func)))), (&PyFunction_Type))), ((PyFunctionObject*)(func)))->func_defaults;
}
static inline PyObject* PyFunction_GET_KW_DEFAULTS(PyObject *func) {
return (assert(Py_IS_TYPE(((PyObject*)(((func)))), (&PyFunction_Type))), ((PyFunctionObject*)(func)))->func_kwdefaults;
}
static inline PyObject* PyFunction_GET_CLOSURE(PyObject *func) {
return (assert(Py_IS_TYPE(((PyObject*)(((func)))), (&PyFunction_Type))), ((PyFunctionObject*)(func)))->func_closure;
}
static inline PyObject* PyFunction_GET_ANNOTATIONS(PyObject *func) {
return (assert(Py_IS_TYPE(((PyObject*)(((func)))), (&PyFunction_Type))), ((PyFunctionObject*)(func)))->func_annotations;
}
extern PyTypeObject PyClassMethod_Type;
extern PyTypeObject PyStaticMethod_Type;
PyObject * PyClassMethod_New(PyObject *);
PyObject * PyStaticMethod_New(PyObject *);
typedef enum {
PyFunction_EVENT_CREATE, PyFunction_EVENT_DESTROY, PyFunction_EVENT_MODIFY_CODE, PyFunction_EVENT_MODIFY_DEFAULTS, PyFunction_EVENT_MODIFY_KWDEFAULTS,
} PyFunction_WatchEvent;
typedef int (*PyFunction_WatchCallback)(
PyFunction_WatchEvent event,
PyFunctionObject *func,
PyObject *new_value);
int PyFunction_AddWatcher(PyFunction_WatchCallback callback);
int PyFunction_ClearWatcher(int watcher_id);
typedef struct {
PyObject ob_base;
PyObject *im_func;
PyObject *im_self;
PyObject *im_weakreflist;
vectorcallfunc vectorcall;
} PyMethodObject;
extern PyTypeObject PyMethod_Type;
PyObject * PyMethod_New(PyObject *, PyObject *);
PyObject * PyMethod_Function(PyObject *);
PyObject * PyMethod_Self(PyObject *);
static inline PyObject* PyMethod_GET_FUNCTION(PyObject *meth) {
return (assert(Py_IS_TYPE(((PyObject*)(((meth)))), (&PyMethod_Type))), ((PyMethodObject*)(meth)))->im_func;
}
static inline PyObject* PyMethod_GET_SELF(PyObject *meth) {
return (assert(Py_IS_TYPE(((PyObject*)(((meth)))), (&PyMethod_Type))), ((PyMethodObject*)(meth)))->im_self;
}
typedef struct {
PyObject ob_base;
PyObject *func;
} PyInstanceMethodObject;
extern PyTypeObject PyInstanceMethod_Type;
PyObject * PyInstanceMethod_New(PyObject *);
PyObject * PyInstanceMethod_Function(PyObject *);
static inline PyObject* PyInstanceMethod_GET_FUNCTION(PyObject *meth) {
return (assert(Py_IS_TYPE(((PyObject*)(((meth)))), (&PyInstanceMethod_Type))), ((PyInstanceMethodObject*)(meth)))->func;
}
PyObject * PyFile_FromFd(int, const char *, const char *, int,
const char *, const char *,
const char *, int);
PyObject * PyFile_GetLine(PyObject *, int);
int PyFile_WriteObject(PyObject *, PyObject *, int);
int PyFile_WriteString(const char *, PyObject *);
int PyObject_AsFileDescriptor(PyObject *);
extern const char * Py_FileSystemDefaultEncoding;
extern const char * Py_FileSystemDefaultEncodeErrors;
extern int Py_HasFileSystemDefaultEncoding;
extern int Py_UTF8Mode;
char * Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *);
char * _Py_UniversalNewlineFgetsWithSize(char *, int, FILE*, PyObject *, size_t*);
PyObject * PyFile_NewStdPrinter(int);
extern PyTypeObject PyStdPrinter_Type;
typedef PyObject * (*Py_OpenCodeHookFunction)(PyObject *, void *);
PyObject * PyFile_OpenCode(const char *utf8path);
PyObject * PyFile_OpenCodeObject(PyObject *path);
int PyFile_SetOpenCodeHook(Py_OpenCodeHookFunction hook, void *userData);
int _PyLong_FileDescriptor_Converter(PyObject *, void *);
extern PyTypeObject PyCapsule_Type;
typedef void (*PyCapsule_Destructor)(PyObject *);
PyObject * PyCapsule_New(
void *pointer,
const char *name,
PyCapsule_Destructor destructor);
void * PyCapsule_GetPointer(PyObject *capsule, const char *name);
PyCapsule_Destructor PyCapsule_GetDestructor(PyObject *capsule);
const char * PyCapsule_GetName(PyObject *capsule);
void * PyCapsule_GetContext(PyObject *capsule);
int PyCapsule_IsValid(PyObject *capsule, const char *name);
int PyCapsule_SetPointer(PyObject *capsule, void *pointer);
int PyCapsule_SetDestructor(PyObject *capsule, PyCapsule_Destructor destructor);
int PyCapsule_SetName(PyObject *capsule, const char *name);
int PyCapsule_SetContext(PyObject *capsule, void *context);
void * PyCapsule_Import(
const char *name,
int no_block);
typedef union {
uint16_t cache;
struct {
uint8_t code;
uint8_t arg;
} op;
} _Py_CODEUNIT;
static inline _Py_CODEUNIT
_py_make_codeunit(uint8_t opcode, uint8_t oparg)
{
_Py_CODEUNIT word;
word.op.code = opcode;
word.op.arg = oparg;
return word;
}
static inline void
_py_set_opcode(_Py_CODEUNIT *word, uint8_t opcode)
{
word->op.code = opcode;
}
typedef struct {
PyObject *_co_code;
PyObject *_co_varnames;
PyObject *_co_cellvars;
PyObject *_co_freevars;
} _PyCoCached;
struct PyCodeObject { PyVarObject ob_base; PyObject *co_consts; PyObject *co_names; PyObject *co_exceptiontable; int co_flags; short _co_linearray_entry_size; int co_argcount; int co_posonlyargcount; int co_kwonlyargcount; int co_stacksize; int co_firstlineno; int co_nlocalsplus; int co_framesize; int co_nlocals; int co_ncellvars; int co_nfreevars; uint32_t co_version; PyObject *co_localsplusnames; PyObject *co_localspluskinds; PyObject *co_filename; PyObject *co_name; PyObject *co_qualname; PyObject *co_linetable; PyObject *co_weakreflist; _PyCoCached *_co_cached; int _co_firsttraceable; char *_co_linearray; void *co_extra; char co_code_adaptive[(1)]; };
extern PyTypeObject PyCode_Type;
static inline Py_ssize_t PyCode_GetNumFree(PyCodeObject *op) {
assert(Py_IS_TYPE(((PyObject*)(((op)))), (&PyCode_Type)));
return op->co_nfreevars;
}
static inline int PyCode_GetFirstFree(PyCodeObject *op) {
assert(Py_IS_TYPE(((PyObject*)(((op)))), (&PyCode_Type)));
return op->co_nlocalsplus - op->co_nfreevars;
}
PyCodeObject * PyUnstable_Code_New(
int, int, int, int, int, PyObject *, PyObject *,
PyObject *, PyObject *, PyObject *, PyObject *,
PyObject *, PyObject *, PyObject *, int, PyObject *,
PyObject *);
PyCodeObject * PyUnstable_Code_NewWithPosOnlyArgs(
int, int, int, int, int, int, PyObject *, PyObject *,
PyObject *, PyObject *, PyObject *, PyObject *,
PyObject *, PyObject *, PyObject *, int, PyObject *,
PyObject *);
static inline PyCodeObject *
PyCode_New(
int a, int b, int c, int d, int e, PyObject *f, PyObject *g,
PyObject *h, PyObject *i, PyObject *j, PyObject *k,
PyObject *l, PyObject *m, PyObject *n, int o, PyObject *p,
PyObject *q)
{
return PyUnstable_Code_New(
a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q);
}
static inline PyCodeObject *
PyCode_NewWithPosOnlyArgs(
int a, int poac, int b, int c, int d, int e, PyObject *f, PyObject *g,
PyObject *h, PyObject *i, PyObject *j, PyObject *k,
PyObject *l, PyObject *m, PyObject *n, int o, PyObject *p,
PyObject *q)
{
return PyUnstable_Code_NewWithPosOnlyArgs(
a, poac, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q);
}
PyCodeObject *
PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno);
int PyCode_Addr2Line(PyCodeObject *, int);
int PyCode_Addr2Location(PyCodeObject *, int, int *, int *, int *, int *);
typedef enum {
PY_CODE_EVENT_CREATE, PY_CODE_EVENT_DESTROY,
} PyCodeEvent;
typedef int (*PyCode_WatchCallback)(
PyCodeEvent event,
PyCodeObject* co);
int PyCode_AddWatcher(PyCode_WatchCallback callback);
int PyCode_ClearWatcher(int watcher_id);
struct _opaque {
int computed_line;
const uint8_t *lo_next;
const uint8_t *limit;
};
typedef struct _line_offsets {
int ar_start;
int ar_end;
int ar_line;
struct _opaque opaque;
} PyCodeAddressRange;
int _PyCode_CheckLineNumber(int lasti, PyCodeAddressRange *bounds);
PyObject* _PyCode_ConstantKey(PyObject *obj);
PyObject* PyCode_Optimize(PyObject *code, PyObject* consts,
PyObject *names, PyObject *lnotab);
int PyUnstable_Code_GetExtra(
PyObject *code, Py_ssize_t index, void **extra);
int PyUnstable_Code_SetExtra(
PyObject *code, Py_ssize_t index, void *extra);
static inline int
_PyCode_GetExtra(PyObject *code, Py_ssize_t index, void **extra)
{
return PyUnstable_Code_GetExtra(code, index, extra);
}
static inline int
_PyCode_SetExtra(PyObject *code, Py_ssize_t index, void *extra)
{
return PyUnstable_Code_SetExtra(code, index, extra);
}
PyObject * PyCode_GetCode(PyCodeObject *code);
PyObject * PyCode_GetVarnames(PyCodeObject *code);
PyObject * PyCode_GetCellvars(PyCodeObject *code);
PyObject * PyCode_GetFreevars(PyCodeObject *code);
typedef enum _PyCodeLocationInfoKind {
PY_CODE_LOCATION_INFO_SHORT0 = 0,
PY_CODE_LOCATION_INFO_ONE_LINE0 = 10,
PY_CODE_LOCATION_INFO_ONE_LINE1 = 11,
PY_CODE_LOCATION_INFO_ONE_LINE2 = 12,
PY_CODE_LOCATION_INFO_NO_COLUMNS = 13,
PY_CODE_LOCATION_INFO_LONG = 14,
PY_CODE_LOCATION_INFO_NONE = 15
} _PyCodeLocationInfoKind;
int PyFrame_GetLineNumber(PyFrameObject *);
PyCodeObject * PyFrame_GetCode(PyFrameObject *frame);
extern PyTypeObject PyFrame_Type;
PyFrameObject * PyFrame_GetBack(PyFrameObject *frame);
PyObject * PyFrame_GetLocals(PyFrameObject *frame);
PyObject * PyFrame_GetGlobals(PyFrameObject *frame);
PyObject * PyFrame_GetBuiltins(PyFrameObject *frame);
PyObject * PyFrame_GetGenerator(PyFrameObject *frame);
int PyFrame_GetLasti(PyFrameObject *frame);
PyObject* PyFrame_GetVar(PyFrameObject *frame, PyObject *name);
PyObject* PyFrame_GetVarString(PyFrameObject *frame, const char *name);
int PyTraceBack_Here(PyFrameObject *);
int PyTraceBack_Print(PyObject *, PyObject *);
extern PyTypeObject PyTraceBack_Type;
typedef struct _traceback PyTracebackObject;
struct _traceback {
PyObject ob_base;
PyTracebackObject *tb_next;
PyFrameObject *tb_frame;
int tb_lasti;
int tb_lineno;
};
int _Py_DisplaySourceLine(PyObject *, PyObject *, int, int, int *, PyObject **);
void _PyTraceback_Add(const char *, const char *, int);
extern PyObject _Py_EllipsisObject;
typedef struct {
PyObject ob_base;
PyObject *start, *stop, *step;
} PySliceObject;
extern PyTypeObject PySlice_Type;
extern PyTypeObject PyEllipsis_Type;
PyObject * PySlice_New(PyObject* start, PyObject* stop,
PyObject* step);
PyObject * _PySlice_FromIndices(Py_ssize_t start, Py_ssize_t stop);
int _PySlice_GetLongIndices(PySliceObject *self, PyObject *length,
PyObject **start_ptr, PyObject **stop_ptr,
PyObject **step_ptr);
int PySlice_GetIndices(PyObject *r, Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
int PySlice_GetIndicesEx(PyObject *r, Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop,
Py_ssize_t *step,
Py_ssize_t *slicelength);
int PySlice_Unpack(PyObject *slice,
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
Py_ssize_t PySlice_AdjustIndices(Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop,
Py_ssize_t step);
typedef struct {
PyObject ob_base;
PyObject *ob_ref;
} PyCellObject;
extern PyTypeObject PyCell_Type;
PyObject * PyCell_New(PyObject *);
PyObject * PyCell_Get(PyObject *);
int PyCell_Set(PyObject *, PyObject *);
static inline PyObject* PyCell_GET(PyObject *op) {
PyCellObject *cell;
assert(Py_IS_TYPE(((PyObject*)(((op)))), (&PyCell_Type)));
cell = ((PyCellObject*)(op));
return cell->ob_ref;
}
static inline void PyCell_SET(PyObject *op, PyObject *value) {
PyCellObject *cell;
assert(Py_IS_TYPE(((PyObject*)(((op)))), (&PyCell_Type)));
cell = ((PyCellObject*)(op));
cell->ob_ref = value;
}
extern PyTypeObject PySeqIter_Type;
extern PyTypeObject PyCallIter_Type;
extern PyTypeObject _PyAnextAwaitable_Type;
PyObject * PySeqIter_New(PyObject *);
PyObject * PyCallIter_New(PyObject *, PyObject *);
typedef struct {
enum {
_PyStatus_TYPE_OK=0,
_PyStatus_TYPE_ERROR=1,
_PyStatus_TYPE_EXIT=2
} _type;
const char *func;
const char *err_msg;
int exitcode;
} PyStatus;
PyStatus PyStatus_Ok(void);
PyStatus PyStatus_Error(const char *err_msg);
PyStatus PyStatus_NoMemory(void);
PyStatus PyStatus_Exit(int exitcode);
int PyStatus_IsError(PyStatus err);
int PyStatus_IsExit(PyStatus err);
int PyStatus_Exception(PyStatus err);
PyObject * _PyErr_SetFromPyStatus(PyStatus status);
typedef struct {
Py_ssize_t length;
wchar_t **items;
} PyWideStringList;
PyStatus PyWideStringList_Append(PyWideStringList *list,
const wchar_t *item);
PyStatus PyWideStringList_Insert(PyWideStringList *list,
Py_ssize_t index,
const wchar_t *item);
typedef struct PyPreConfig {
int _config_init;
int parse_argv;
int isolated;
int use_environment;
int configure_locale;
int coerce_c_locale;
int coerce_c_locale_warn;
int utf8_mode;
int dev_mode;
int allocator;
} PyPreConfig;
void PyPreConfig_InitPythonConfig(PyPreConfig *config);
void PyPreConfig_InitIsolatedConfig(PyPreConfig *config);
typedef struct PyConfig {
int _config_init;
int isolated;
int use_environment;
int dev_mode;
int install_signal_handlers;
int use_hash_seed;
unsigned long hash_seed;
int faulthandler;
int tracemalloc;
int perf_profiling;
int import_time;
int code_debug_ranges;
int show_ref_count;
int dump_refs;
wchar_t *dump_refs_file;
int malloc_stats;
wchar_t *filesystem_encoding;
wchar_t *filesystem_errors;
wchar_t *pycache_prefix;
int parse_argv;
PyWideStringList orig_argv;
PyWideStringList argv;
PyWideStringList xoptions;
PyWideStringList warnoptions;
int site_import;
int bytes_warning;
int warn_default_encoding;
int inspect;
int interactive;
int optimization_level;
int parser_debug;
int write_bytecode;
int verbose;
int quiet;
int user_site_directory;
int configure_c_stdio;
int buffered_stdio;
wchar_t *stdio_encoding;
wchar_t *stdio_errors;
wchar_t *check_hash_pycs_mode;
int use_frozen_modules;
int safe_path;
int int_max_str_digits;
int pathconfig_warnings;
wchar_t *program_name;
wchar_t *pythonpath_env;
wchar_t *home;
wchar_t *platlibdir;
int module_search_paths_set;
PyWideStringList module_search_paths;
wchar_t *stdlib_dir;
wchar_t *executable;
wchar_t *base_executable;
wchar_t *prefix;
wchar_t *base_prefix;
wchar_t *exec_prefix;
wchar_t *base_exec_prefix;
int skip_source_first_line;
wchar_t *run_command;
wchar_t *run_module;
wchar_t *run_filename;
int _install_importlib;
int _init_main;
int _is_python_build;
} PyConfig;
void PyConfig_InitPythonConfig(PyConfig *config);
void PyConfig_InitIsolatedConfig(PyConfig *config);
void PyConfig_Clear(PyConfig *);
PyStatus PyConfig_SetString(
PyConfig *config,
wchar_t **config_str,
const wchar_t *str);
PyStatus PyConfig_SetBytesString(
PyConfig *config,
wchar_t **config_str,
const char *str);
PyStatus PyConfig_Read(PyConfig *config);
PyStatus PyConfig_SetBytesArgv(
PyConfig *config,
Py_ssize_t argc,
char * const *argv);
PyStatus PyConfig_SetArgv(PyConfig *config,
Py_ssize_t argc,
wchar_t * const *argv);
PyStatus PyConfig_SetWideStringList(PyConfig *config,
PyWideStringList *list,
Py_ssize_t length, wchar_t **items);
typedef struct {
int allow_fork;
int allow_exec;
int allow_threads;
int allow_daemon_threads;
int check_multi_interp_extensions;
} _PyInterpreterConfig;
void Py_GetArgcArgv(int *argc, wchar_t ***argv);
PyInterpreterState * PyInterpreterState_New(void);
void PyInterpreterState_Clear(PyInterpreterState *);
void PyInterpreterState_Delete(PyInterpreterState *);
PyInterpreterState * PyInterpreterState_Get(void);
PyObject * PyInterpreterState_GetDict(PyInterpreterState *);
int64_t PyInterpreterState_GetID(PyInterpreterState *);
int PyState_AddModule(PyObject*, PyModuleDef*);
int PyState_RemoveModule(PyModuleDef*);
PyObject* PyState_FindModule(PyModuleDef*);
PyThreadState * PyThreadState_New(PyInterpreterState *);
void PyThreadState_Clear(PyThreadState *);
void PyThreadState_Delete(PyThreadState *);
PyThreadState * PyThreadState_Get(void);
PyThreadState * PyThreadState_Swap(PyThreadState *);
PyObject * PyThreadState_GetDict(void);
int PyThreadState_SetAsyncExc(unsigned long, PyObject *);
PyInterpreterState* PyThreadState_GetInterpreter(PyThreadState *tstate);
PyFrameObject* PyThreadState_GetFrame(PyThreadState *tstate);
uint64_t PyThreadState_GetID(PyThreadState *tstate);
typedef
enum {PyGILState_LOCKED, PyGILState_UNLOCKED}
PyGILState_STATE;
PyGILState_STATE PyGILState_Ensure(void);
void PyGILState_Release(PyGILState_STATE);
PyThreadState * PyGILState_GetThisThreadState(void);
int _PyInterpreterState_HasFeature(PyInterpreterState *interp,
unsigned long feature);
int _PyInterpreterState_RequiresIDRef(PyInterpreterState *);
void _PyInterpreterState_RequireIDRef(PyInterpreterState *, int);
PyObject * _PyInterpreterState_GetMainModule(PyInterpreterState *);
typedef int (*Py_tracefunc)(PyObject *, PyFrameObject *, int, PyObject *);
typedef struct {
PyCodeObject *code;
PyCodeAddressRange bounds;
} PyTraceInfo;
typedef struct _PyCFrame {
uint8_t use_tracing;
struct _PyInterpreterFrame *current_frame;
struct _PyCFrame *previous;
} _PyCFrame;
typedef struct _err_stackitem {
PyObject *exc_value;
struct _err_stackitem *previous_item;
} _PyErr_StackItem;
typedef struct _stack_chunk {
struct _stack_chunk *previous;
size_t size;
size_t top;
PyObject * data[1];
} _PyStackChunk;
struct _py_trashcan {
int delete_nesting;
PyObject *delete_later;
};
struct _ts {
PyThreadState *prev;
PyThreadState *next;
PyInterpreterState *interp;
struct {
unsigned int initialized:1;
unsigned int bound:1;
unsigned int unbound:1;
unsigned int bound_gilstate:1;
unsigned int active:1;
unsigned int finalizing:1;
unsigned int cleared:1;
unsigned int finalized:1;
unsigned int :24;
} _status;
int py_recursion_remaining;
int py_recursion_limit;
int c_recursion_remaining;
int recursion_headroom;
int tracing;
int tracing_what;
_PyCFrame *cframe;
Py_tracefunc c_profilefunc;
Py_tracefunc c_tracefunc;
PyObject *c_profileobj;
PyObject *c_traceobj;
PyObject *current_exception;
_PyErr_StackItem *exc_info;
PyObject *dict;
int gilstate_counter;
PyObject *async_exc;
unsigned long thread_id;
unsigned long native_thread_id;
struct _py_trashcan trash;
void (*on_delete)(void *);
void *on_delete_data;
int coroutine_origin_tracking_depth;
PyObject *async_gen_firstiter;
PyObject *async_gen_finalizer;
PyObject *context;
uint64_t context_ver;
uint64_t id;
PyTraceInfo trace_info;
_PyStackChunk *datastack_chunk;
PyObject **datastack_top;
PyObject **datastack_limit;
_PyErr_StackItem exc_state;
_PyCFrame root_cframe;
};
PyThreadState * _PyThreadState_Prealloc(PyInterpreterState *);
PyThreadState * _PyThreadState_UncheckedGet(void);
PyObject * _PyThreadState_GetDict(PyThreadState *tstate);
void PyThreadState_EnterTracing(PyThreadState *tstate);
void PyThreadState_LeaveTracing(PyThreadState *tstate);
int PyGILState_Check(void);
PyInterpreterState * _PyGILState_GetInterpreterStateUnsafe(void);
PyObject * _PyThread_CurrentFrames(void);
PyObject * _PyThread_CurrentExceptions(void);
PyInterpreterState * PyInterpreterState_Main(void);
PyInterpreterState * PyInterpreterState_Head(void);
PyInterpreterState * PyInterpreterState_Next(PyInterpreterState *);
PyThreadState * PyInterpreterState_ThreadHead(PyInterpreterState *);
PyThreadState * PyThreadState_Next(PyThreadState *);
void PyThreadState_DeleteCurrent(void);
typedef PyObject* (*_PyFrameEvalFunction)(PyThreadState *tstate, struct _PyInterpreterFrame *, int);
_PyFrameEvalFunction _PyInterpreterState_GetEvalFrameFunc(
PyInterpreterState *interp);
void _PyInterpreterState_SetEvalFrameFunc(
PyInterpreterState *interp,
_PyFrameEvalFunction eval_frame);
const PyConfig* _PyInterpreterState_GetConfig(PyInterpreterState *interp);
int _PyInterpreterState_GetConfigCopy(
struct PyConfig *config);
int _PyInterpreterState_SetConfig(
const struct PyConfig *config);
const PyConfig* _Py_GetConfig(void);
typedef struct _xid _PyCrossInterpreterData;
typedef PyObject *(*xid_newobjectfunc)(_PyCrossInterpreterData *);
typedef void (*xid_freefunc)(void *);
struct _xid {
void *data;
PyObject *obj;
int64_t interp;
xid_newobjectfunc new_object;
xid_freefunc free;
};
void _PyCrossInterpreterData_Init(
_PyCrossInterpreterData *data,
PyInterpreterState *interp, void *shared, PyObject *obj,
xid_newobjectfunc new_object);
int _PyCrossInterpreterData_InitWithSize(
_PyCrossInterpreterData *,
PyInterpreterState *interp, const size_t, PyObject *,
xid_newobjectfunc);
void _PyCrossInterpreterData_Clear(
PyInterpreterState *, _PyCrossInterpreterData *);
int _PyObject_GetCrossInterpreterData(PyObject *, _PyCrossInterpreterData *);
PyObject * _PyCrossInterpreterData_NewObject(_PyCrossInterpreterData *);
int _PyCrossInterpreterData_Release(_PyCrossInterpreterData *);
int _PyObject_CheckCrossInterpreterData(PyObject *);
typedef int (*crossinterpdatafunc)(PyThreadState *tstate, PyObject *,
_PyCrossInterpreterData *);
int _PyCrossInterpreterData_RegisterClass(PyTypeObject *, crossinterpdatafunc);
int _PyCrossInterpreterData_UnregisterClass(PyTypeObject *);
crossinterpdatafunc _PyCrossInterpreterData_Lookup(PyObject *);
typedef struct {
PyObject ob_base; PyObject *gi_weakreflist; PyObject *gi_name; PyObject *gi_qualname; _PyErr_StackItem gi_exc_state; PyObject *gi_origin_or_finalizer; char gi_hooks_inited; char gi_closed; char gi_running_async; int8_t gi_frame_state; PyObject *gi_iframe[1];
} PyGenObject;
extern PyTypeObject PyGen_Type;
PyObject * PyGen_New(PyFrameObject *);
PyObject * PyGen_NewWithQualName(PyFrameObject *,
PyObject *name, PyObject *qualname);
int _PyGen_SetStopIterationValue(PyObject *);
int _PyGen_FetchStopIterationValue(PyObject **);
void _PyGen_Finalize(PyObject *self);
PyCodeObject * PyGen_GetCode(PyGenObject *gen);
typedef struct {
PyObject ob_base; PyObject *cr_weakreflist; PyObject *cr_name; PyObject *cr_qualname; _PyErr_StackItem cr_exc_state; PyObject *cr_origin_or_finalizer; char cr_hooks_inited; char cr_closed; char cr_running_async; int8_t cr_frame_state; PyObject *cr_iframe[1];
} PyCoroObject;
extern PyTypeObject PyCoro_Type;
extern PyTypeObject _PyCoroWrapper_Type;
PyObject * PyCoro_New(PyFrameObject *,
PyObject *name, PyObject *qualname);
typedef struct {
PyObject ob_base; PyObject *ag_weakreflist; PyObject *ag_name; PyObject *ag_qualname; _PyErr_StackItem ag_exc_state; PyObject *ag_origin_or_finalizer; char ag_hooks_inited; char ag_closed; char ag_running_async; int8_t ag_frame_state; PyObject *ag_iframe[1];
} PyAsyncGenObject;
extern PyTypeObject PyAsyncGen_Type;
extern PyTypeObject _PyAsyncGenASend_Type;
extern PyTypeObject _PyAsyncGenWrappedValue_Type;
extern PyTypeObject _PyAsyncGenAThrow_Type;
PyObject * PyAsyncGen_New(PyFrameObject *,
PyObject *name, PyObject *qualname);
typedef PyObject *(*getter)(PyObject *, void *);
typedef int (*setter)(PyObject *, PyObject *, void *);
struct PyGetSetDef {
const char *name;
getter get;
setter set;
const char *doc;
void *closure;
};
extern PyTypeObject PyClassMethodDescr_Type;
extern PyTypeObject PyGetSetDescr_Type;
extern PyTypeObject PyMemberDescr_Type;
extern PyTypeObject PyMethodDescr_Type;
extern PyTypeObject PyWrapperDescr_Type;
extern PyTypeObject PyDictProxy_Type;
extern PyTypeObject PyProperty_Type;
PyObject * PyDescr_NewMethod(PyTypeObject *, PyMethodDef *);
PyObject * PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *);
PyObject * PyDescr_NewMember(PyTypeObject *, PyMemberDef *);
PyObject * PyDescr_NewGetSet(PyTypeObject *, PyGetSetDef *);
PyObject * PyDictProxy_New(PyObject *);
PyObject * PyWrapper_New(PyObject *, PyObject *);
struct PyMemberDef {
const char *name;
int type;
Py_ssize_t offset;
int flags;
const char *doc;
};
PyObject * PyMember_GetOne(const char *, PyMemberDef *);
int PyMember_SetOne(char *, PyMemberDef *, PyObject *);
typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args,
void *wrapped);
typedef PyObject *(*wrapperfunc_kwds)(PyObject *self, PyObject *args,
void *wrapped, PyObject *kwds);
struct wrapperbase {
const char *name;
int offset;
void *function;
wrapperfunc wrapper;
const char *doc;
int flags;
PyObject *name_strobj;
};
typedef struct {
PyObject ob_base;
PyTypeObject *d_type;
PyObject *d_name;
PyObject *d_qualname;
} PyDescrObject;
typedef struct {
PyDescrObject d_common;
PyMethodDef *d_method;
vectorcallfunc vectorcall;
} PyMethodDescrObject;
typedef struct {
PyDescrObject d_common;
PyMemberDef *d_member;
} PyMemberDescrObject;
typedef struct {
PyDescrObject d_common;
PyGetSetDef *d_getset;
} PyGetSetDescrObject;
typedef struct {
PyDescrObject d_common;
struct wrapperbase *d_base;
void *d_wrapped;
} PyWrapperDescrObject;
extern PyTypeObject _PyMethodWrapper_Type;
PyObject * PyDescr_NewWrapper(PyTypeObject *,
struct wrapperbase *, void *);
int PyDescr_IsData(PyObject *);
PyObject * Py_GenericAlias(PyObject *, PyObject *);
extern PyTypeObject Py_GenericAliasType;
int PyErr_WarnEx(
PyObject *category,
const char *message,
Py_ssize_t stack_level);
int PyErr_WarnFormat(
PyObject *category,
Py_ssize_t stack_level,
const char *format,
...);
int PyErr_ResourceWarning(
PyObject *source,
Py_ssize_t stack_level,
const char *format,
...);
int PyErr_WarnExplicit(
PyObject *category,
const char *message,
const char *filename,
int lineno,
const char *module,
PyObject *registry);
int PyErr_WarnExplicitObject(
PyObject *category,
PyObject *message,
PyObject *filename,
int lineno,
PyObject *module,
PyObject *registry);
int PyErr_WarnExplicitFormat(
PyObject *category,
const char *filename, int lineno,
const char *module, PyObject *registry,
const char *format, ...);
typedef struct _PyWeakReference PyWeakReference;
extern PyTypeObject _PyWeakref_RefType;
extern PyTypeObject _PyWeakref_ProxyType;
extern PyTypeObject _PyWeakref_CallableProxyType;
PyObject * PyWeakref_NewRef(PyObject *ob,
PyObject *callback);
PyObject * PyWeakref_NewProxy(PyObject *ob,
PyObject *callback);
PyObject * PyWeakref_GetObject(PyObject *ref);
struct _PyWeakReference {
PyObject ob_base;
PyObject *wr_object;
PyObject *wr_callback;
Py_hash_t hash;
PyWeakReference *wr_prev;
PyWeakReference *wr_next;
vectorcallfunc vectorcall;
};
Py_ssize_t _PyWeakref_GetWeakrefCount(PyWeakReference *head);
void _PyWeakref_ClearRef(PyWeakReference *self);
static inline PyObject* PyWeakref_GET_OBJECT(PyObject *ref_obj) {
PyWeakReference *ref;
PyObject *obj;
assert((PyObject_TypeCheck(((PyObject*)(((ref_obj)))), (&_PyWeakref_RefType)) || (Py_IS_TYPE(((PyObject*)(((ref_obj)))), (&_PyWeakref_ProxyType)) || Py_IS_TYPE(((PyObject*)(((ref_obj)))), (&_PyWeakref_CallableProxyType)))));
ref = ((PyWeakReference*)(ref_obj));
obj = ref->wr_object;
if (Py_REFCNT(((PyObject*)((obj)))) > 0) {
return obj;
}
return (&_Py_NoneStruct);
}
typedef struct PyStructSequence_Field {
const char *name;
const char *doc;
} PyStructSequence_Field;
typedef struct PyStructSequence_Desc {
const char *name;
const char *doc;
PyStructSequence_Field *fields;
int n_in_sequence;
} PyStructSequence_Desc;
extern const char * const PyStructSequence_UnnamedField;
void PyStructSequence_InitType(PyTypeObject *type,
PyStructSequence_Desc *desc);
int PyStructSequence_InitType2(PyTypeObject *type,
PyStructSequence_Desc *desc);
PyTypeObject* PyStructSequence_NewType(PyStructSequence_Desc *desc);
PyObject * PyStructSequence_New(PyTypeObject* type);
typedef PyTupleObject PyStructSequence;
void PyStructSequence_SetItem(PyObject*, Py_ssize_t, PyObject*);
PyObject* PyStructSequence_GetItem(PyObject*, Py_ssize_t);
extern PyTypeObject PyPickleBuffer_Type;
PyObject * PyPickleBuffer_FromObject(PyObject *);
const Py_buffer * PyPickleBuffer_GetBuffer(PyObject *);
int PyPickleBuffer_Release(PyObject *);
typedef int64_t _PyTime_t;
typedef enum {
_PyTime_ROUND_FLOOR=0,
_PyTime_ROUND_CEILING=1,
_PyTime_ROUND_HALF_EVEN=2,
_PyTime_ROUND_UP=3,
_PyTime_ROUND_TIMEOUT = _PyTime_ROUND_UP
} _PyTime_round_t;
PyObject * _PyLong_FromTime_t(
time_t sec);
time_t _PyLong_AsTime_t(
PyObject *obj);
int _PyTime_ObjectToTime_t(
PyObject *obj,
time_t *sec,
_PyTime_round_t);
int _PyTime_ObjectToTimeval(
PyObject *obj,
time_t *sec,
long *usec,
_PyTime_round_t);
int _PyTime_ObjectToTimespec(
PyObject *obj,
time_t *sec,
long *nsec,
_PyTime_round_t);
_PyTime_t _PyTime_FromSeconds(int seconds);
_PyTime_t _PyTime_FromNanoseconds(_PyTime_t ns);
_PyTime_t _PyTime_FromMicrosecondsClamp(_PyTime_t us);
int _PyTime_FromNanosecondsObject(_PyTime_t *t,
PyObject *obj);
int _PyTime_FromSecondsObject(_PyTime_t *t,
PyObject *obj,
_PyTime_round_t round);
int _PyTime_FromMillisecondsObject(_PyTime_t *t,
PyObject *obj,
_PyTime_round_t round);
double _PyTime_AsSecondsDouble(_PyTime_t t);
_PyTime_t _PyTime_AsMilliseconds(_PyTime_t t,
_PyTime_round_t round);
_PyTime_t _PyTime_AsMicroseconds(_PyTime_t t,
_PyTime_round_t round);
_PyTime_t _PyTime_AsNanoseconds(_PyTime_t t);
PyObject * _PyTime_AsNanosecondsObject(_PyTime_t t);
int _PyTime_FromTimeval(_PyTime_t *tp, struct timeval *tv);
int _PyTime_AsTimeval(_PyTime_t t,
struct timeval *tv,
_PyTime_round_t round);
void _PyTime_AsTimeval_clamp(_PyTime_t t,
struct timeval *tv,
_PyTime_round_t round);
int _PyTime_AsTimevalTime_t(
_PyTime_t t,
time_t *secs,
int *us,
_PyTime_round_t round);
int _PyTime_FromTimespec(_PyTime_t *tp, struct timespec *ts);
int _PyTime_AsTimespec(_PyTime_t t, struct timespec *ts);
void _PyTime_AsTimespec_clamp(_PyTime_t t, struct timespec *ts);
_PyTime_t _PyTime_Add(_PyTime_t t1, _PyTime_t t2);
_PyTime_t _PyTime_MulDiv(_PyTime_t ticks,
_PyTime_t mul,
_PyTime_t div);
typedef struct {
const char *implementation;
int monotonic;
int adjustable;
double resolution;
} _Py_clock_info_t;
_PyTime_t _PyTime_GetSystemClock(void);
int _PyTime_GetSystemClockWithInfo(
_PyTime_t *t,
_Py_clock_info_t *info);
_PyTime_t _PyTime_GetMonotonicClock(void);
int _PyTime_GetMonotonicClockWithInfo(
_PyTime_t *t,
_Py_clock_info_t *info);
int _PyTime_localtime(time_t t, struct tm *tm);
int _PyTime_gmtime(time_t t, struct tm *tm);
_PyTime_t _PyTime_GetPerfCounter(void);
int _PyTime_GetPerfCounterWithInfo(
_PyTime_t *t,
_Py_clock_info_t *info);
_PyTime_t _PyDeadline_Init(_PyTime_t timeout);
_PyTime_t _PyDeadline_Get(_PyTime_t deadline);
int PyCodec_Register(
PyObject *search_function
);
int PyCodec_Unregister(
PyObject *search_function
);
PyObject * _PyCodec_Lookup(
const char *encoding
);
int _PyCodec_Forget(
const char *encoding
);
int PyCodec_KnownEncoding(
const char *encoding
);
PyObject * PyCodec_Encode(
PyObject *object,
const char *encoding,
const char *errors
);
PyObject * PyCodec_Decode(
PyObject *object,
const char *encoding,
const char *errors
);
PyObject * _PyCodec_LookupTextEncoding(
const char *encoding,
const char *alternate_command
);
PyObject * _PyCodec_EncodeText(
PyObject *object,
const char *encoding,
const char *errors
);
PyObject * _PyCodec_DecodeText(
PyObject *object,
const char *encoding,
const char *errors
);
PyObject * _PyCodecInfo_GetIncrementalDecoder(
PyObject *codec_info,
const char *errors
);
PyObject * _PyCodecInfo_GetIncrementalEncoder(
PyObject *codec_info,
const char *errors
);
PyObject * PyCodec_Encoder(
const char *encoding
);
PyObject * PyCodec_Decoder(
const char *encoding
);
PyObject * PyCodec_IncrementalEncoder(
const char *encoding,
const char *errors
);
PyObject * PyCodec_IncrementalDecoder(
const char *encoding,
const char *errors
);
PyObject * PyCodec_StreamReader(
const char *encoding,
PyObject *stream,
const char *errors
);
PyObject * PyCodec_StreamWriter(
const char *encoding,
PyObject *stream,
const char *errors
);
int PyCodec_RegisterError(const char *name, PyObject *error);
PyObject * PyCodec_LookupError(const char *name);
PyObject * PyCodec_StrictErrors(PyObject *exc);
PyObject * PyCodec_IgnoreErrors(PyObject *exc);
PyObject * PyCodec_ReplaceErrors(PyObject *exc);
PyObject * PyCodec_XMLCharRefReplaceErrors(PyObject *exc);
PyObject * PyCodec_BackslashReplaceErrors(PyObject *exc);
PyObject * PyCodec_NameReplaceErrors(PyObject *exc);
extern const char * Py_hexdigits;
void PyErr_SetNone(PyObject *);
void PyErr_SetObject(PyObject *, PyObject *);
void PyErr_SetString(
PyObject *exception,
const char *string
);
PyObject * PyErr_Occurred(void);
void PyErr_Clear(void);
void PyErr_Fetch(PyObject **, PyObject **, PyObject **);
void PyErr_Restore(PyObject *, PyObject *, PyObject *);
PyObject * PyErr_GetRaisedException(void);
void PyErr_SetRaisedException(PyObject *);
PyObject* PyErr_GetHandledException(void);
void PyErr_SetHandledException(PyObject *);
void PyErr_GetExcInfo(PyObject **, PyObject **, PyObject **);
void PyErr_SetExcInfo(PyObject *, PyObject *, PyObject *);
void Py_FatalError(const char *message);
int PyErr_GivenExceptionMatches(PyObject *, PyObject *);
int PyErr_ExceptionMatches(PyObject *);
void PyErr_NormalizeException(PyObject**, PyObject**, PyObject**);
int PyException_SetTraceback(PyObject *, PyObject *);
PyObject * PyException_GetTraceback(PyObject *);
PyObject * PyException_GetCause(PyObject *);
void PyException_SetCause(PyObject *, PyObject *);
PyObject * PyException_GetContext(PyObject *);
void PyException_SetContext(PyObject *, PyObject *);
PyObject * PyException_GetArgs(PyObject *);
void PyException_SetArgs(PyObject *, PyObject *);
const char * PyExceptionClass_Name(PyObject *);
extern PyObject * PyExc_BaseException;
extern PyObject * PyExc_Exception;
extern PyObject * PyExc_BaseExceptionGroup;
extern PyObject * PyExc_StopAsyncIteration;
extern PyObject * PyExc_StopIteration;
extern PyObject * PyExc_GeneratorExit;
extern PyObject * PyExc_ArithmeticError;
extern PyObject * PyExc_LookupError;
extern PyObject * PyExc_AssertionError;
extern PyObject * PyExc_AttributeError;
extern PyObject * PyExc_BufferError;
extern PyObject * PyExc_EOFError;
extern PyObject * PyExc_FloatingPointError;
extern PyObject * PyExc_OSError;
extern PyObject * PyExc_ImportError;
extern PyObject * PyExc_ModuleNotFoundError;
extern PyObject * PyExc_IndexError;
extern PyObject * PyExc_KeyError;
extern PyObject * PyExc_KeyboardInterrupt;
extern PyObject * PyExc_MemoryError;
extern PyObject * PyExc_NameError;
extern PyObject * PyExc_OverflowError;
extern PyObject * PyExc_RuntimeError;
extern PyObject * PyExc_RecursionError;
extern PyObject * PyExc_NotImplementedError;
extern PyObject * PyExc_SyntaxError;
extern PyObject * PyExc_IndentationError;
extern PyObject * PyExc_TabError;
extern PyObject * PyExc_ReferenceError;
extern PyObject * PyExc_SystemError;
extern PyObject * PyExc_SystemExit;
extern PyObject * PyExc_TypeError;
extern PyObject * PyExc_UnboundLocalError;
extern PyObject * PyExc_UnicodeError;
extern PyObject * PyExc_UnicodeEncodeError;
extern PyObject * PyExc_UnicodeDecodeError;
extern PyObject * PyExc_UnicodeTranslateError;
extern PyObject * PyExc_ValueError;
extern PyObject * PyExc_ZeroDivisionError;
extern PyObject * PyExc_BlockingIOError;
extern PyObject * PyExc_BrokenPipeError;
extern PyObject * PyExc_ChildProcessError;
extern PyObject * PyExc_ConnectionError;
extern PyObject * PyExc_ConnectionAbortedError;
extern PyObject * PyExc_ConnectionRefusedError;
extern PyObject * PyExc_ConnectionResetError;
extern PyObject * PyExc_FileExistsError;
extern PyObject * PyExc_FileNotFoundError;
extern PyObject * PyExc_InterruptedError;
extern PyObject * PyExc_IsADirectoryError;
extern PyObject * PyExc_NotADirectoryError;
extern PyObject * PyExc_PermissionError;
extern PyObject * PyExc_ProcessLookupError;
extern PyObject * PyExc_TimeoutError;
extern PyObject * PyExc_EnvironmentError;
extern PyObject * PyExc_IOError;
extern PyObject * PyExc_Warning;
extern PyObject * PyExc_UserWarning;
extern PyObject * PyExc_DeprecationWarning;
extern PyObject * PyExc_PendingDeprecationWarning;
extern PyObject * PyExc_SyntaxWarning;
extern PyObject * PyExc_RuntimeWarning;
extern PyObject * PyExc_FutureWarning;
extern PyObject * PyExc_ImportWarning;
extern PyObject * PyExc_UnicodeWarning;
extern PyObject * PyExc_BytesWarning;
extern PyObject * PyExc_EncodingWarning;
extern PyObject * PyExc_ResourceWarning;
int PyErr_BadArgument(void);
PyObject * PyErr_NoMemory(void);
PyObject * PyErr_SetFromErrno(PyObject *);
PyObject * PyErr_SetFromErrnoWithFilenameObject(
PyObject *, PyObject *);
PyObject * PyErr_SetFromErrnoWithFilenameObjects(
PyObject *, PyObject *, PyObject *);
PyObject * PyErr_SetFromErrnoWithFilename(
PyObject *exc,
const char *filename
);
PyObject * PyErr_Format(
PyObject *exception,
const char *format,
...
);
PyObject * PyErr_FormatV(
PyObject *exception,
const char *format,
va_list vargs);
PyObject * PyErr_SetImportErrorSubclass(PyObject *, PyObject *,
PyObject *, PyObject *);
PyObject * PyErr_SetImportError(PyObject *, PyObject *,
PyObject *);
void PyErr_BadInternalCall(void);
void _PyErr_BadInternalCall(const char *filename, int lineno);
PyObject * PyErr_NewException(
const char *name, PyObject *base, PyObject *dict);
PyObject * PyErr_NewExceptionWithDoc(
const char *name, const char *doc, PyObject *base, PyObject *dict);
void PyErr_WriteUnraisable(PyObject *);
int PyErr_CheckSignals(void);
void PyErr_SetInterrupt(void);
int PyErr_SetInterruptEx(int signum);
void PyErr_SyntaxLocation(
const char *filename,
int lineno);
void PyErr_SyntaxLocationEx(
const char *filename,
int lineno,
int col_offset);
PyObject * PyErr_ProgramText(
const char *filename,
int lineno);
PyObject * PyUnicodeDecodeError_Create(
const char *encoding,
const char *object,
Py_ssize_t length,
Py_ssize_t start,
Py_ssize_t end,
const char *reason
);
PyObject * PyUnicodeEncodeError_GetEncoding(PyObject *);
PyObject * PyUnicodeDecodeError_GetEncoding(PyObject *);
PyObject * PyUnicodeEncodeError_GetObject(PyObject *);
PyObject * PyUnicodeDecodeError_GetObject(PyObject *);
PyObject * PyUnicodeTranslateError_GetObject(PyObject *);
int PyUnicodeEncodeError_GetStart(PyObject *, Py_ssize_t *);
int PyUnicodeDecodeError_GetStart(PyObject *, Py_ssize_t *);
int PyUnicodeTranslateError_GetStart(PyObject *, Py_ssize_t *);
int PyUnicodeEncodeError_SetStart(PyObject *, Py_ssize_t);
int PyUnicodeDecodeError_SetStart(PyObject *, Py_ssize_t);
int PyUnicodeTranslateError_SetStart(PyObject *, Py_ssize_t);
int PyUnicodeEncodeError_GetEnd(PyObject *, Py_ssize_t *);
int PyUnicodeDecodeError_GetEnd(PyObject *, Py_ssize_t *);
int PyUnicodeTranslateError_GetEnd(PyObject *, Py_ssize_t *);
int PyUnicodeEncodeError_SetEnd(PyObject *, Py_ssize_t);
int PyUnicodeDecodeError_SetEnd(PyObject *, Py_ssize_t);
int PyUnicodeTranslateError_SetEnd(PyObject *, Py_ssize_t);
PyObject * PyUnicodeEncodeError_GetReason(PyObject *);
PyObject * PyUnicodeDecodeError_GetReason(PyObject *);
PyObject * PyUnicodeTranslateError_GetReason(PyObject *);
int PyUnicodeEncodeError_SetReason(
PyObject *exc,
const char *reason
);
int PyUnicodeDecodeError_SetReason(
PyObject *exc,
const char *reason
);
int PyUnicodeTranslateError_SetReason(
PyObject *exc,
const char *reason
);
int PyOS_snprintf(char *str, size_t size, const char *format, ...)
;
int PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va)
;
typedef struct {
PyObject ob_base; PyObject *dict; PyObject *args; PyObject *notes; PyObject *traceback; PyObject *context; PyObject *cause; char suppress_context;
} PyBaseExceptionObject;
typedef struct {
PyObject ob_base; PyObject *dict; PyObject *args; PyObject *notes; PyObject *traceback; PyObject *context; PyObject *cause; char suppress_context;
PyObject *msg;
PyObject *excs;
} PyBaseExceptionGroupObject;
typedef struct {
PyObject ob_base; PyObject *dict; PyObject *args; PyObject *notes; PyObject *traceback; PyObject *context; PyObject *cause; char suppress_context;
PyObject *msg;
PyObject *filename;
PyObject *lineno;
PyObject *offset;
PyObject *end_lineno;
PyObject *end_offset;
PyObject *text;
PyObject *print_file_and_line;
} PySyntaxErrorObject;
typedef struct {
PyObject ob_base; PyObject *dict; PyObject *args; PyObject *notes; PyObject *traceback; PyObject *context; PyObject *cause; char suppress_context;
PyObject *msg;
PyObject *name;
PyObject *path;
PyObject *name_from;
} PyImportErrorObject;
typedef struct {
PyObject ob_base; PyObject *dict; PyObject *args; PyObject *notes; PyObject *traceback; PyObject *context; PyObject *cause; char suppress_context;
PyObject *encoding;
PyObject *object;
Py_ssize_t start;
Py_ssize_t end;
PyObject *reason;
} PyUnicodeErrorObject;
typedef struct {
PyObject ob_base; PyObject *dict; PyObject *args; PyObject *notes; PyObject *traceback; PyObject *context; PyObject *cause; char suppress_context;
PyObject *code;
} PySystemExitObject;
typedef struct {
PyObject ob_base; PyObject *dict; PyObject *args; PyObject *notes; PyObject *traceback; PyObject *context; PyObject *cause; char suppress_context;
PyObject *myerrno;
PyObject *strerror;
PyObject *filename;
PyObject *filename2;
Py_ssize_t written;
} PyOSErrorObject;
typedef struct {
PyObject ob_base; PyObject *dict; PyObject *args; PyObject *notes; PyObject *traceback; PyObject *context; PyObject *cause; char suppress_context;
PyObject *value;
} PyStopIterationObject;
typedef struct {
PyObject ob_base; PyObject *dict; PyObject *args; PyObject *notes; PyObject *traceback; PyObject *context; PyObject *cause; char suppress_context;
PyObject *name;
} PyNameErrorObject;
typedef struct {
PyObject ob_base; PyObject *dict; PyObject *args; PyObject *notes; PyObject *traceback; PyObject *context; PyObject *cause; char suppress_context;
PyObject *obj;
PyObject *name;
} PyAttributeErrorObject;
typedef PyOSErrorObject PyEnvironmentErrorObject;
void _PyErr_SetKeyError(PyObject *);
_PyErr_StackItem* _PyErr_GetTopmostException(PyThreadState *tstate);
PyObject* _PyErr_GetHandledException(PyThreadState *);
void _PyErr_SetHandledException(PyThreadState *, PyObject *);
void _PyErr_GetExcInfo(PyThreadState *, PyObject **, PyObject **, PyObject **);
void _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *);
void _PyErr_ChainExceptions1(PyObject *);
PyObject * _PyErr_FormatFromCause(
PyObject *exception,
const char *format,
...
);
int _PyException_AddNote(
PyObject *exc,
PyObject *note);
int PySignal_SetWakeupFd(int fd);
int _PyErr_CheckSignals(void);
void PyErr_SyntaxLocationObject(
PyObject *filename,
int lineno,
int col_offset);
void PyErr_RangedSyntaxLocationObject(
PyObject *filename,
int lineno,
int col_offset,
int end_lineno,
int end_col_offset);
PyObject * PyErr_ProgramTextObject(
PyObject *filename,
int lineno);
PyObject * _PyErr_ProgramDecodedTextObject(
PyObject *filename,
int lineno,
const char* encoding);
PyObject * _PyUnicodeTranslateError_Create(
PyObject *object,
Py_ssize_t start,
Py_ssize_t end,
const char *reason
);
void _PyErr_WriteUnraisableMsg(
const char *err_msg,
PyObject *obj);
void _Py_FatalErrorFunc(
const char *func,
const char *message);
void _Py_FatalErrorFormat(
const char *func,
const char *format,
...);
extern PyObject *_PyErr_SetImportErrorWithNameFrom(
PyObject *,
PyObject *,
PyObject *,
PyObject *);
typedef void *PyThread_type_lock;
typedef enum PyLockStatus {
PY_LOCK_FAILURE = 0,
PY_LOCK_ACQUIRED = 1,
PY_LOCK_INTR
} PyLockStatus;
void PyThread_init_thread(void);
unsigned long PyThread_start_new_thread(void (*)(void *), void *);
void PyThread_exit_thread(void);
unsigned long PyThread_get_thread_ident(void);
unsigned long PyThread_get_thread_native_id(void);
PyThread_type_lock PyThread_allocate_lock(void);
void PyThread_free_lock(PyThread_type_lock);
int PyThread_acquire_lock(PyThread_type_lock, int);
PyLockStatus PyThread_acquire_lock_timed(PyThread_type_lock,
long long microseconds,
int intr_flag);
void PyThread_release_lock(PyThread_type_lock);
size_t PyThread_get_stacksize(void);
int PyThread_set_stacksize(size_t);
PyObject* PyThread_GetInfo(void);
int PyThread_create_key(void);
void PyThread_delete_key(int key);
int PyThread_set_key_value(int key,
void *value);
void * PyThread_get_key_value(int key);
void PyThread_delete_key_value(int key);
void PyThread_ReInitTLS(void);
typedef struct _Py_tss_t Py_tss_t;
Py_tss_t * PyThread_tss_alloc(void);
void PyThread_tss_free(Py_tss_t *key);
int PyThread_tss_is_created(Py_tss_t *key);
int PyThread_tss_create(Py_tss_t *key);
void PyThread_tss_delete(Py_tss_t *key);
int PyThread_tss_set(Py_tss_t *key, void *value);
void * PyThread_tss_get(Py_tss_t *key);
struct _Py_tss_t {
int _is_initialized;
pthread_key_t _key;
};
extern PyTypeObject PyContext_Type;
typedef struct _pycontextobject PyContext;
extern PyTypeObject PyContextVar_Type;
typedef struct _pycontextvarobject PyContextVar;
extern PyTypeObject PyContextToken_Type;
typedef struct _pycontexttokenobject PyContextToken;
PyObject * PyContext_New(void);
PyObject * PyContext_Copy(PyObject *);
PyObject * PyContext_CopyCurrent(void);
int PyContext_Enter(PyObject *);
int PyContext_Exit(PyObject *);
PyObject * PyContextVar_New(
const char *name, PyObject *default_value);
int PyContextVar_Get(
PyObject *var, PyObject *default_value, PyObject **value);
PyObject * PyContextVar_Set(PyObject *var, PyObject *value);
int PyContextVar_Reset(PyObject *var, PyObject *token);
PyObject * _PyContext_NewHamtForTests(void);
int _PyArg_Parse_SizeT(PyObject *, const char *, ...);
int _PyArg_ParseTuple_SizeT(PyObject *, const char *, ...);
int _PyArg_ParseTupleAndKeywords_SizeT(PyObject *, PyObject *,
const char *, char **, ...);
int _PyArg_VaParse_SizeT(PyObject *, const char *, va_list);
int _PyArg_VaParseTupleAndKeywords_SizeT(PyObject *, PyObject *,
const char *, char **, va_list);
int PyArg_ValidateKeywordArguments(PyObject *);
int PyArg_UnpackTuple(PyObject *, const char *, Py_ssize_t, Py_ssize_t, ...);
PyObject * _Py_BuildValue_SizeT(const char *, ...);
PyObject * _Py_BuildValue_SizeT(const char *, ...);
PyObject * _Py_VaBuildValue_SizeT(const char *, va_list);
int PyModule_AddObjectRef(PyObject *mod, const char *name, PyObject *value);
int PyModule_AddObject(PyObject *mod, const char *, PyObject *value);
int PyModule_AddIntConstant(PyObject *, const char *, long);
int PyModule_AddStringConstant(PyObject *, const char *, const char *);
int PyModule_AddType(PyObject *module, PyTypeObject *type);
int PyModule_SetDocString(PyObject *, const char *);
int PyModule_AddFunctions(PyObject *, PyMethodDef *);
int PyModule_ExecDef(PyObject *module, PyModuleDef *def);
PyObject * PyModule_Create2(PyModuleDef*, int apiver);
PyObject * PyModule_FromDefAndSpec2(PyModuleDef *def,
PyObject *spec,
int module_api_version);
int _PyArg_UnpackStack(
PyObject *const *args,
Py_ssize_t nargs,
const char *name,
Py_ssize_t min,
Py_ssize_t max,
...);
int _PyArg_NoKeywords(const char *funcname, PyObject *kwargs);
int _PyArg_NoKwnames(const char *funcname, PyObject *kwnames);
int _PyArg_NoPositional(const char *funcname, PyObject *args);
void _PyArg_BadArgument(const char *, const char *, const char *, PyObject *);
int _PyArg_CheckPositional(const char *, Py_ssize_t,
Py_ssize_t, Py_ssize_t);
PyObject ** _Py_VaBuildStack_SizeT(
PyObject **small_stack,
Py_ssize_t small_stack_len,
const char *format,
va_list va,
Py_ssize_t *p_nargs);
typedef struct _PyArg_Parser {
int initialized;
const char *format;
const char * const *keywords;
const char *fname;
const char *custom_msg;
int pos;
int min;
int max;
PyObject *kwtuple;
struct _PyArg_Parser *next;
} _PyArg_Parser;
int _PyArg_ParseTupleAndKeywordsFast_SizeT(PyObject *, PyObject *,
struct _PyArg_Parser *, ...);
int _PyArg_ParseStack_SizeT(
PyObject *const *args,
Py_ssize_t nargs,
const char *format,
...);
int _PyArg_ParseStackAndKeywords_SizeT(
PyObject *const *args,
Py_ssize_t nargs,
PyObject *kwnames,
struct _PyArg_Parser *,
...);
int _PyArg_VaParseTupleAndKeywordsFast_SizeT(PyObject *, PyObject *,
struct _PyArg_Parser *, va_list);
PyObject * const * _PyArg_UnpackKeywords(
PyObject *const *args, Py_ssize_t nargs,
PyObject *kwargs, PyObject *kwnames,
struct _PyArg_Parser *parser,
int minpos, int maxpos, int minkw,
PyObject **buf);
PyObject * const * _PyArg_UnpackKeywordsWithVararg(
PyObject *const *args, Py_ssize_t nargs,
PyObject *kwargs, PyObject *kwnames,
struct _PyArg_Parser *parser,
int minpos, int maxpos, int minkw,
int vararg, PyObject **buf);
PyObject * _PyModule_CreateInitialized(PyModuleDef*, int apiver);
typedef struct {
int cf_flags;
int cf_feature_version;
} PyCompilerFlags;
typedef struct {
int lineno;
int end_lineno;
int col_offset;
int end_col_offset;
} _PyCompilerSrcLocation;
typedef struct {
int ff_features;
_PyCompilerSrcLocation ff_location;
} PyFutureFeatures;
int PyCompile_OpcodeStackEffect(int opcode, int oparg);
int PyCompile_OpcodeStackEffectWithJump(int opcode, int oparg, int jump);
PyObject * Py_CompileString(const char *, const char *, int);
void PyErr_Print(void);
void PyErr_PrintEx(int);
void PyErr_Display(PyObject *, PyObject *, PyObject *);
void PyErr_DisplayException(PyObject *);
extern int (*PyOS_InputHook)(void);
int PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
int _PyRun_SimpleFileObject(
FILE *fp,
PyObject *filename,
int closeit,
PyCompilerFlags *flags);
int PyRun_AnyFileExFlags(
FILE *fp,
const char *filename,
int closeit,
PyCompilerFlags *flags);
int _PyRun_AnyFileObject(
FILE *fp,
PyObject *filename,
int closeit,
PyCompilerFlags *flags);
int PyRun_SimpleFileExFlags(
FILE *fp,
const char *filename,
int closeit,
PyCompilerFlags *flags);
int PyRun_InteractiveOneFlags(
FILE *fp,
const char *filename,
PyCompilerFlags *flags);
int PyRun_InteractiveOneObject(
FILE *fp,
PyObject *filename,
PyCompilerFlags *flags);
int PyRun_InteractiveLoopFlags(
FILE *fp,
const char *filename,
PyCompilerFlags *flags);
int _PyRun_InteractiveLoopObject(
FILE *fp,
PyObject *filename,
PyCompilerFlags *flags);
PyObject * PyRun_StringFlags(const char *, int, PyObject *,
PyObject *, PyCompilerFlags *);
PyObject * PyRun_FileExFlags(
FILE *fp,
const char *filename,
int start,
PyObject *globals,
PyObject *locals,
int closeit,
PyCompilerFlags *flags);
PyObject * Py_CompileStringExFlags(
const char *str,
const char *filename,
int start,
PyCompilerFlags *flags,
int optimize);
PyObject * Py_CompileStringObject(
const char *str,
PyObject *filename, int start,
PyCompilerFlags *flags,
int optimize);
const char * _Py_SourceAsString(
PyObject *cmd,
const char *funcname,
const char *what,
PyCompilerFlags *cf,
PyObject **cmd_copy);
PyObject * PyRun_String(const char *str, int s, PyObject *g, PyObject *l);
int PyRun_AnyFile(FILE *fp, const char *name);
int PyRun_AnyFileEx(FILE *fp, const char *name, int closeit);
int PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);
int PyRun_SimpleString(const char *s);
int PyRun_SimpleFile(FILE *f, const char *p);
int PyRun_SimpleFileEx(FILE *f, const char *p, int c);
int PyRun_InteractiveOne(FILE *f, const char *p);
int PyRun_InteractiveLoop(FILE *f, const char *p);
PyObject * PyRun_File(FILE *fp, const char *p, int s, PyObject *g, PyObject *l);
PyObject * PyRun_FileEx(FILE *fp, const char *p, int s, PyObject *g, PyObject *l, int c);
PyObject * PyRun_FileFlags(FILE *fp, const char *p, int s, PyObject *g, PyObject *l, PyCompilerFlags *flags);
char * PyOS_Readline(FILE *, FILE *, const char *);
extern PyThreadState* _PyOS_ReadlineTState;
extern char *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *);
void Py_Initialize(void);
void Py_InitializeEx(int);
void Py_Finalize(void);
int Py_FinalizeEx(void);
int Py_IsInitialized(void);
PyThreadState * Py_NewInterpreter(void);
void Py_EndInterpreter(PyThreadState *);
int Py_AtExit(void (*func)(void));
void Py_Exit(int);
int Py_Main(int argc, wchar_t **argv);
int Py_BytesMain(int argc, char **argv);
void Py_SetProgramName(const wchar_t *);
wchar_t * Py_GetProgramName(void);
void Py_SetPythonHome(const wchar_t *);
wchar_t * Py_GetPythonHome(void);
wchar_t * Py_GetProgramFullPath(void);
wchar_t * Py_GetPrefix(void);
wchar_t * Py_GetExecPrefix(void);
wchar_t * Py_GetPath(void);
void Py_SetPath(const wchar_t *);
const char * Py_GetVersion(void);
const char * Py_GetPlatform(void);
const char * Py_GetCopyright(void);
const char * Py_GetCompiler(void);
const char * Py_GetBuildInfo(void);
typedef void (*PyOS_sighandler_t)(int);
PyOS_sighandler_t PyOS_getsig(int);
PyOS_sighandler_t PyOS_setsig(int, PyOS_sighandler_t);
extern const unsigned long Py_Version;
int Py_FrozenMain(int argc, char **argv);
int Py_SetStandardStreamEncoding(
const char *encoding,
const char *errors);
PyStatus Py_PreInitialize(
const PyPreConfig *src_config);
PyStatus Py_PreInitializeFromBytesArgs(
const PyPreConfig *src_config,
Py_ssize_t argc,
char **argv);
PyStatus Py_PreInitializeFromArgs(
const PyPreConfig *src_config,
Py_ssize_t argc,
wchar_t **argv);
int _Py_IsCoreInitialized(void);
PyStatus Py_InitializeFromConfig(
const PyConfig *config);
PyStatus _Py_InitializeMain(void);
int Py_RunMain(void);
void Py_ExitStatusException(PyStatus err);
void _Py_RestoreSignals(void);
int Py_FdIsInteractive(FILE *, const char *);
int _Py_FdIsInteractive(FILE *fp, PyObject *filename);
void _Py_SetProgramFullPath(const wchar_t *);
const char * _Py_gitidentifier(void);
const char * _Py_gitversion(void);
int _Py_IsFinalizing(void);
int _PyOS_URandom(void *buffer, Py_ssize_t size);
int _PyOS_URandomNonblock(void *buffer, Py_ssize_t size);
int _Py_CoerceLegacyLocale(int warn);
int _Py_LegacyLocaleDetected(int warn);
char * _Py_SetLocaleFromEnv(int category);
PyStatus _Py_NewInterpreterFromConfig(
PyThreadState **tstate_p,
const _PyInterpreterConfig *config);
PyObject * PyEval_EvalCode(PyObject *, PyObject *, PyObject *);
PyObject * PyEval_EvalCodeEx(PyObject *co,
PyObject *globals,
PyObject *locals,
PyObject *const *args, int argc,
PyObject *const *kwds, int kwdc,
PyObject *const *defs, int defc,
PyObject *kwdefs, PyObject *closure);
PyObject * PyEval_CallObjectWithKeywords(
PyObject *callable,
PyObject *args,
PyObject *kwargs);
PyObject * PyEval_CallFunction(
PyObject *callable, const char *format, ...);
PyObject * PyEval_CallMethod(
PyObject *obj, const char *name, const char *format, ...);
PyObject * PyEval_GetBuiltins(void);
PyObject * PyEval_GetGlobals(void);
PyObject * PyEval_GetLocals(void);
PyFrameObject * PyEval_GetFrame(void);
int Py_AddPendingCall(int (*func)(void *), void *arg);
int Py_MakePendingCalls(void);
void Py_SetRecursionLimit(int);
int Py_GetRecursionLimit(void);
int Py_EnterRecursiveCall(const char *where);
void Py_LeaveRecursiveCall(void);
const char * PyEval_GetFuncName(PyObject *);
const char * PyEval_GetFuncDesc(PyObject *);
PyObject * PyEval_EvalFrame(PyFrameObject *);
PyObject * PyEval_EvalFrameEx(PyFrameObject *f, int exc);
PyThreadState * PyEval_SaveThread(void);
void PyEval_RestoreThread(PyThreadState *);
int PyEval_ThreadsInitialized(void);
void PyEval_InitThreads(void);
void PyEval_AcquireLock(void);
void PyEval_ReleaseLock(void);
void PyEval_AcquireThread(PyThreadState *tstate);
void PyEval_ReleaseThread(PyThreadState *tstate);
void PyEval_SetProfile(Py_tracefunc, PyObject *);
void PyEval_SetProfileAllThreads(Py_tracefunc, PyObject *);
extern int _PyEval_SetProfile(PyThreadState *tstate, Py_tracefunc func, PyObject *arg);
void PyEval_SetTrace(Py_tracefunc, PyObject *);
void PyEval_SetTraceAllThreads(Py_tracefunc, PyObject *);
int _PyEval_SetTrace(PyThreadState *tstate, Py_tracefunc func, PyObject *arg);
PyObject * _PyEval_GetBuiltin(PyObject *);
PyObject * _PyEval_GetBuiltinId(_Py_Identifier *);
int PyEval_MergeCompilerFlags(PyCompilerFlags *cf);
PyObject * _PyEval_EvalFrameDefault(PyThreadState *tstate, struct _PyInterpreterFrame *f, int exc);
void _PyEval_SetSwitchInterval(unsigned long microseconds);
unsigned long _PyEval_GetSwitchInterval(void);
Py_ssize_t PyUnstable_Eval_RequestCodeExtraIndex(freefunc);
static inline Py_ssize_t
_PyEval_RequestCodeExtraIndex(freefunc f) {
return PyUnstable_Eval_RequestCodeExtraIndex(f);
}
int _PyEval_SliceIndex(PyObject *, Py_ssize_t *);
int _PyEval_SliceIndexNotNone(PyObject *, Py_ssize_t *);
PyObject * PySys_GetObject(const char *);
int PySys_SetObject(const char *, PyObject *);
void PySys_SetArgv(int, wchar_t **);
void PySys_SetArgvEx(int, wchar_t **, int);
void PySys_SetPath(const wchar_t *);
void PySys_WriteStdout(const char *format, ...)
;
void PySys_WriteStderr(const char *format, ...)
;
void PySys_FormatStdout(const char *format, ...);
void PySys_FormatStderr(const char *format, ...);
void PySys_ResetWarnOptions(void);
void PySys_AddWarnOption(const wchar_t *);
void PySys_AddWarnOptionUnicode(PyObject *);
int PySys_HasWarnOptions(void);
void PySys_AddXOption(const wchar_t *);
PyObject * PySys_GetXOptions(void);
PyObject * _PySys_GetAttr(PyThreadState *tstate,
PyObject *name);
size_t _PySys_GetSizeOf(PyObject *);
typedef int(*Py_AuditHookFunction)(const char *, PyObject *, void *);
int PySys_Audit(
const char *event,
const char *argFormat,
...);
int PySys_AddAuditHook(Py_AuditHookFunction, void*);
PyObject * PyOS_FSPath(PyObject *path);
int PyOS_InterruptOccurred(void);
void PyOS_AfterFork(void);
int _PyOS_IsMainThread(void);
long PyImport_GetMagicNumber(void);
const char * PyImport_GetMagicTag(void);
PyObject * PyImport_ExecCodeModule(
const char *name,
PyObject *co
);
PyObject * PyImport_ExecCodeModuleEx(
const char *name,
PyObject *co,
const char *pathname
);
PyObject * PyImport_ExecCodeModuleWithPathnames(
const char *name,
PyObject *co,
const char *pathname,
const char *cpathname
);
PyObject * PyImport_ExecCodeModuleObject(
PyObject *name,
PyObject *co,
PyObject *pathname,
PyObject *cpathname
);
PyObject * PyImport_GetModuleDict(void);
PyObject * PyImport_GetModule(PyObject *name);
PyObject * PyImport_AddModuleObject(
PyObject *name
);
PyObject * PyImport_AddModule(
const char *name
);
PyObject * PyImport_ImportModule(
const char *name
);
PyObject * PyImport_ImportModuleNoBlock(
const char *name
);
PyObject * PyImport_ImportModuleLevel(
const char *name,
PyObject *globals,
PyObject *locals,
PyObject *fromlist,
int level
);
PyObject * PyImport_ImportModuleLevelObject(
PyObject *name,
PyObject *globals,
PyObject *locals,
PyObject *fromlist,
int level
);
PyObject * PyImport_GetImporter(PyObject *path);
PyObject * PyImport_Import(PyObject *name);
PyObject * PyImport_ReloadModule(PyObject *m);
int PyImport_ImportFrozenModuleObject(
PyObject *name
);
int PyImport_ImportFrozenModule(
const char *name
);
int PyImport_AppendInittab(
const char *name,
PyObject* (*initfunc)(void)
);
PyObject* PyInit__imp(void);
int _PyImport_IsInitialized(PyInterpreterState *);
PyObject * _PyImport_GetModuleId(_Py_Identifier *name);
int _PyImport_SetModule(PyObject *name, PyObject *module);
int _PyImport_SetModuleString(const char *name, PyObject* module);
void _PyImport_AcquireLock(PyInterpreterState *interp);
int _PyImport_ReleaseLock(PyInterpreterState *interp);
int _PyImport_FixupBuiltin(
PyObject *mod,
const char *name,
PyObject *modules
);
int _PyImport_FixupExtensionObject(PyObject*, PyObject *,
PyObject *, PyObject *);
struct _inittab {
const char *name;
PyObject* (*initfunc)(void);
};
extern struct _inittab * PyImport_Inittab;
int PyImport_ExtendInittab(struct _inittab *newtab);
struct _frozen {
const char *name;
const unsigned char *code;
int size;
int is_package;
PyObject *(*get_code)(void);
};
extern const struct _frozen * PyImport_FrozenModules;
extern PyObject * _PyImport_GetModuleAttr(PyObject *, PyObject *);
extern PyObject * _PyImport_GetModuleAttrString(const char *, const char *);
PyObject * PyObject_CallNoArgs(PyObject *func);
PyObject * PyObject_Call(PyObject *callable,
PyObject *args, PyObject *kwargs);
PyObject * PyObject_CallObject(PyObject *callable,
PyObject *args);
PyObject * _PyObject_CallFunction_SizeT(PyObject *callable,
const char *format, ...);
PyObject * _PyObject_CallMethod_SizeT(PyObject *obj,
const char *name,
const char *format, ...);
PyObject * _PyObject_CallFunction_SizeT(PyObject *callable,
const char *format,
...);
PyObject * _PyObject_CallMethod_SizeT(PyObject *obj,
const char *name,
const char *format,
...);
PyObject * PyObject_CallFunctionObjArgs(PyObject *callable,
...);
PyObject * PyObject_CallMethodObjArgs(
PyObject *obj,
PyObject *name,
...);
Py_ssize_t PyVectorcall_NARGS(size_t nargsf);
PyObject * PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *dict);
PyObject * PyObject_Vectorcall(
PyObject *callable,
PyObject *const *args,
size_t nargsf,
PyObject *kwnames);
PyObject * PyObject_VectorcallMethod(
PyObject *name, PyObject *const *args,
size_t nargsf, PyObject *kwnames);
PyObject * PyObject_Type(PyObject *o);
Py_ssize_t PyObject_Size(PyObject *o);
Py_ssize_t PyObject_Length(PyObject *o);
PyObject * PyObject_GetItem(PyObject *o, PyObject *key);
int PyObject_SetItem(PyObject *o, PyObject *key, PyObject *v);
int PyObject_DelItemString(PyObject *o, const char *key);
int PyObject_DelItem(PyObject *o, PyObject *key);
int PyObject_AsCharBuffer(PyObject *obj,
const char **buffer,
Py_ssize_t *buffer_len);
int PyObject_CheckReadBuffer(PyObject *obj);
int PyObject_AsReadBuffer(PyObject *obj,
const void **buffer,
Py_ssize_t *buffer_len);
int PyObject_AsWriteBuffer(PyObject *obj,
void **buffer,
Py_ssize_t *buffer_len);
PyObject * PyObject_Format(PyObject *obj,
PyObject *format_spec);
PyObject * PyObject_GetIter(PyObject *);
PyObject * PyObject_GetAIter(PyObject *);
int PyIter_Check(PyObject *);
int PyAIter_Check(PyObject *);
PyObject * PyIter_Next(PyObject *);
PySendResult PyIter_Send(PyObject *, PyObject *, PyObject **);
int PyNumber_Check(PyObject *o);
PyObject * PyNumber_Add(PyObject *o1, PyObject *o2);
PyObject * PyNumber_Subtract(PyObject *o1, PyObject *o2);
PyObject * PyNumber_Multiply(PyObject *o1, PyObject *o2);
PyObject * PyNumber_MatrixMultiply(PyObject *o1, PyObject *o2);
PyObject * PyNumber_FloorDivide(PyObject *o1, PyObject *o2);
PyObject * PyNumber_TrueDivide(PyObject *o1, PyObject *o2);
PyObject * PyNumber_Remainder(PyObject *o1, PyObject *o2);
PyObject * PyNumber_Divmod(PyObject *o1, PyObject *o2);
PyObject * PyNumber_Power(PyObject *o1, PyObject *o2,
PyObject *o3);
PyObject * PyNumber_Negative(PyObject *o);
PyObject * PyNumber_Positive(PyObject *o);
PyObject * PyNumber_Absolute(PyObject *o);
PyObject * PyNumber_Invert(PyObject *o);
PyObject * PyNumber_Lshift(PyObject *o1, PyObject *o2);
PyObject * PyNumber_Rshift(PyObject *o1, PyObject *o2);
PyObject * PyNumber_And(PyObject *o1, PyObject *o2);
PyObject * PyNumber_Xor(PyObject *o1, PyObject *o2);
PyObject * PyNumber_Or(PyObject *o1, PyObject *o2);
int PyIndex_Check(PyObject *);
PyObject * PyNumber_Index(PyObject *o);
Py_ssize_t PyNumber_AsSsize_t(PyObject *o, PyObject *exc);
PyObject * PyNumber_Long(PyObject *o);
PyObject * PyNumber_Float(PyObject *o);
PyObject * PyNumber_InPlaceAdd(PyObject *o1, PyObject *o2);
PyObject * PyNumber_InPlaceSubtract(PyObject *o1, PyObject *o2);
PyObject * PyNumber_InPlaceMultiply(PyObject *o1, PyObject *o2);
PyObject * PyNumber_InPlaceMatrixMultiply(PyObject *o1, PyObject *o2);
PyObject * PyNumber_InPlaceFloorDivide(PyObject *o1,
PyObject *o2);
PyObject * PyNumber_InPlaceTrueDivide(PyObject *o1,
PyObject *o2);
PyObject * PyNumber_InPlaceRemainder(PyObject *o1, PyObject *o2);
PyObject * PyNumber_InPlacePower(PyObject *o1, PyObject *o2,
PyObject *o3);
PyObject * PyNumber_InPlaceLshift(PyObject *o1, PyObject *o2);
PyObject * PyNumber_InPlaceRshift(PyObject *o1, PyObject *o2);
PyObject * PyNumber_InPlaceAnd(PyObject *o1, PyObject *o2);
PyObject * PyNumber_InPlaceXor(PyObject *o1, PyObject *o2);
PyObject * PyNumber_InPlaceOr(PyObject *o1, PyObject *o2);
PyObject * PyNumber_ToBase(PyObject *n, int base);
int PySequence_Check(PyObject *o);
Py_ssize_t PySequence_Size(PyObject *o);
Py_ssize_t PySequence_Length(PyObject *o);
PyObject * PySequence_Concat(PyObject *o1, PyObject *o2);
PyObject * PySequence_Repeat(PyObject *o, Py_ssize_t count);
PyObject * PySequence_GetItem(PyObject *o, Py_ssize_t i);
PyObject * PySequence_GetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2);
int PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v);
int PySequence_DelItem(PyObject *o, Py_ssize_t i);
int PySequence_SetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2,
PyObject *v);
int PySequence_DelSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2);
PyObject * PySequence_Tuple(PyObject *o);
PyObject * PySequence_List(PyObject *o);
PyObject * PySequence_Fast(PyObject *o, const char* m);
Py_ssize_t PySequence_Count(PyObject *o, PyObject *value);
int PySequence_Contains(PyObject *seq, PyObject *ob);
int PySequence_In(PyObject *o, PyObject *value);
Py_ssize_t PySequence_Index(PyObject *o, PyObject *value);
PyObject * PySequence_InPlaceConcat(PyObject *o1, PyObject *o2);
PyObject * PySequence_InPlaceRepeat(PyObject *o, Py_ssize_t count);
int PyMapping_Check(PyObject *o);
Py_ssize_t PyMapping_Size(PyObject *o);
Py_ssize_t PyMapping_Length(PyObject *o);
int PyMapping_HasKeyString(PyObject *o, const char *key);
int PyMapping_HasKey(PyObject *o, PyObject *key);
PyObject * PyMapping_Keys(PyObject *o);
PyObject * PyMapping_Values(PyObject *o);
PyObject * PyMapping_Items(PyObject *o);
PyObject * PyMapping_GetItemString(PyObject *o,
const char *key);
int PyMapping_SetItemString(PyObject *o, const char *key,
PyObject *value);
int PyObject_IsInstance(PyObject *object, PyObject *typeorclass);
int PyObject_IsSubclass(PyObject *object, PyObject *typeorclass);
PyObject * _PyStack_AsDict(
PyObject *const *values,
PyObject *kwnames);
PyObject * _Py_CheckFunctionResult(
PyThreadState *tstate,
PyObject *callable,
PyObject *result,
const char *where);
PyObject * _PyObject_MakeTpCall(
PyThreadState *tstate,
PyObject *callable,
PyObject *const *args, Py_ssize_t nargs,
PyObject *keywords);
static inline Py_ssize_t
_PyVectorcall_NARGS(size_t n)
{
return n & ~(((size_t)(1)) << (8 * sizeof(size_t) - 1));
}
vectorcallfunc PyVectorcall_Function(PyObject *callable);
PyObject * PyObject_VectorcallDict(
PyObject *callable,
PyObject *const *args,
size_t nargsf,
PyObject *kwargs);
PyObject * _PyObject_FastCall(
PyObject *func,
PyObject *const *args,
Py_ssize_t nargs);
PyObject * PyObject_CallOneArg(PyObject *func, PyObject *arg);
static inline PyObject *
PyObject_CallMethodNoArgs(PyObject *self, PyObject *name)
{
size_t nargsf = 1 | (((size_t)(1)) << (8 * sizeof(size_t) - 1));
return PyObject_VectorcallMethod(name, &self, nargsf, 0);
}
static inline PyObject *
PyObject_CallMethodOneArg(PyObject *self, PyObject *name, PyObject *arg)
{
PyObject *args[2] = {self, arg};
size_t nargsf = 2 | (((size_t)(1)) << (8 * sizeof(size_t) - 1));
assert(arg != 0);
return PyObject_VectorcallMethod(name, args, nargsf, 0);
}
PyObject * _PyObject_CallMethod(PyObject *obj,
PyObject *name,
const char *format, ...);
PyObject * _PyObject_CallMethodId_SizeT(PyObject *obj,
_Py_Identifier *name,
const char *format, ...);
PyObject * _PyObject_CallMethodId_SizeT(PyObject *obj,
_Py_Identifier *name,
const char *format,
...);
PyObject * _PyObject_CallMethodIdObjArgs(
PyObject *obj,
_Py_Identifier *name,
...);
static inline PyObject *
_PyObject_VectorcallMethodId(
_Py_Identifier *name, PyObject *const *args,
size_t nargsf, PyObject *kwnames)
{
PyObject *oname = _PyUnicode_FromId(name);
if (!oname) {
return 0;
}
return PyObject_VectorcallMethod(oname, args, nargsf, kwnames);
}
static inline PyObject *
_PyObject_CallMethodIdNoArgs(PyObject *self, _Py_Identifier *name)
{
size_t nargsf = 1 | (((size_t)(1)) << (8 * sizeof(size_t) - 1));
return _PyObject_VectorcallMethodId(name, &self, nargsf, 0);
}
static inline PyObject *
_PyObject_CallMethodIdOneArg(PyObject *self, _Py_Identifier *name, PyObject *arg)
{
PyObject *args[2] = {self, arg};
size_t nargsf = 2 | (((size_t)(1)) << (8 * sizeof(size_t) - 1));
assert(arg != 0);
return _PyObject_VectorcallMethodId(name, args, nargsf, 0);
}
int _PyObject_HasLen(PyObject *o);
Py_ssize_t PyObject_LengthHint(PyObject *o, Py_ssize_t);
Py_ssize_t _PySequence_IterSearch(PyObject *seq,
PyObject *obj, int operation);
int _PyObject_RealIsInstance(PyObject *inst, PyObject *cls);
int _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
char *const * _PySequence_BytesToCharpArray(PyObject* self);
void _Py_FreeCharPArray(char *const array[]);
void _Py_add_one_to_index_F(int nd, Py_ssize_t *index,
const Py_ssize_t *shape);
void _Py_add_one_to_index_C(int nd, Py_ssize_t *index,
const Py_ssize_t *shape);
int _Py_convert_optional_to_ssize_t(PyObject *, void *);
PyObject * _PyNumber_Index(PyObject *o);
extern PyTypeObject PyFilter_Type;
extern PyTypeObject PyMap_Type;
extern PyTypeObject PyZip_Type;
extern const unsigned int _Py_ctype_table[256];
extern const unsigned char _Py_ctype_tolower[256];
extern const unsigned char _Py_ctype_toupper[256];
double PyOS_string_to_double(const char *str,
char **endptr,
PyObject *overflow_exception);
char * PyOS_double_to_string(double val,
char format_code,
int precision,
int flags,
int *type);
PyObject * _Py_string_to_number_with_underscores(
const char *str, Py_ssize_t len, const char *what, PyObject *obj, void *arg,
PyObject *(*innerfunc)(const char *, Py_ssize_t, void *));
double _Py_parse_inf_or_nan(const char *p, char **endptr);
int PyOS_mystrnicmp(const char *, const char *, Py_ssize_t);
int PyOS_mystricmp(const char *, const char *);
wchar_t * Py_DecodeLocale(
const char *arg,
size_t *size);
char* Py_EncodeLocale(
const wchar_t *text,
size_t *error_pos);
FILE* _Py_fopen_obj(
PyObject *path,
const char *mode);
int PyTraceMalloc_Track(
unsigned int domain,
uintptr_t ptr,
size_t size);
int PyTraceMalloc_Untrack(
unsigned int domain,
uintptr_t ptr);
PyObject* _PyTraceMalloc_GetTraceback(
unsigned int domain,
uintptr_t ptr);
struct pyruntimestate;
struct _ceval_runtime_state;
void AnnotateRWLockCreate(const char *file, int line,
const volatile void *lock);
void AnnotateRWLockDestroy(const char *file, int line,
const volatile void *lock);
void AnnotateRWLockAcquired(const char *file, int line,
const volatile void *lock, long is_w);
void AnnotateRWLockReleased(const char *file, int line,
const volatile void *lock, long is_w);
void AnnotateBarrierInit(const char *file, int line,
const volatile void *barrier, long count,
long reinitialization_allowed);
void AnnotateBarrierWaitBefore(const char *file, int line,
const volatile void *barrier);
void AnnotateBarrierWaitAfter(const char *file, int line,
const volatile void *barrier);
void AnnotateBarrierDestroy(const char *file, int line,
const volatile void *barrier);
void AnnotateCondVarWait(const char *file, int line,
const volatile void *cv,
const volatile void *lock);
void AnnotateCondVarSignal(const char *file, int line,
const volatile void *cv);
void AnnotateCondVarSignalAll(const char *file, int line,
const volatile void *cv);
void AnnotatePublishMemoryRange(const char *file, int line,
const volatile void *address,
long size);
void AnnotateUnpublishMemoryRange(const char *file, int line,
const volatile void *address,
long size);
void AnnotatePCQCreate(const char *file, int line,
const volatile void *pcq);
void AnnotatePCQDestroy(const char *file, int line,
const volatile void *pcq);
void AnnotatePCQPut(const char *file, int line,
const volatile void *pcq);
void AnnotatePCQGet(const char *file, int line,
const volatile void *pcq);
void AnnotateNewMemory(const char *file, int line,
const volatile void *address,
long size);
void AnnotateExpectRace(const char *file, int line,
const volatile void *address,
const char *description);
void AnnotateBenignRace(const char *file, int line,
const volatile void *address,
const char *description);
void AnnotateBenignRaceSized(const char *file, int line,
const volatile void *address,
long size,
const char *description);
void AnnotateMutexIsUsedAsCondVar(const char *file, int line,
const volatile void *mu);
void AnnotateTraceMemory(const char *file, int line,
const volatile void *arg);
void AnnotateThreadName(const char *file, int line,
const char *name);
void AnnotateIgnoreReadsBegin(const char *file, int line);
void AnnotateIgnoreReadsEnd(const char *file, int line);
void AnnotateIgnoreWritesBegin(const char *file, int line);
void AnnotateIgnoreWritesEnd(const char *file, int line);
void AnnotateEnableRaceDetection(const char *file, int line, int enable);
void AnnotateNoOp(const char *file, int line,
const volatile void *arg);
void AnnotateFlushState(const char *file, int line);
int RunningOnValgrind(void);
typedef enum _Py_memory_order {
_Py_memory_order_relaxed = memory_order_relaxed,
_Py_memory_order_acquire = memory_order_acquire,
_Py_memory_order_release = memory_order_release,
_Py_memory_order_acq_rel = memory_order_acq_rel,
_Py_memory_order_seq_cst = memory_order_seq_cst
} _Py_memory_order;
typedef struct _Py_atomic_address {
atomic_uintptr_t _value;
} _Py_atomic_address;
typedef struct _Py_atomic_int {
atomic_int _value;
} _Py_atomic_int;
struct ast_state {
int initialized;
int recursion_depth;
int recursion_limit;
PyObject *AST_type;
PyObject *Add_singleton;
PyObject *Add_type;
PyObject *And_singleton;
PyObject *And_type;
PyObject *AnnAssign_type;
PyObject *Assert_type;
PyObject *Assign_type;
PyObject *AsyncFor_type;
PyObject *AsyncFunctionDef_type;
PyObject *AsyncWith_type;
PyObject *Attribute_type;
PyObject *AugAssign_type;
PyObject *Await_type;
PyObject *BinOp_type;
PyObject *BitAnd_singleton;
PyObject *BitAnd_type;
PyObject *BitOr_singleton;
PyObject *BitOr_type;
PyObject *BitXor_singleton;
PyObject *BitXor_type;
PyObject *BoolOp_type;
PyObject *Break_type;
PyObject *Call_type;
PyObject *ClassDef_type;
PyObject *Compare_type;
PyObject *Constant_type;
PyObject *Continue_type;
PyObject *Del_singleton;
PyObject *Del_type;
PyObject *Delete_type;
PyObject *DictComp_type;
PyObject *Dict_type;
PyObject *Div_singleton;
PyObject *Div_type;
PyObject *Eq_singleton;
PyObject *Eq_type;
PyObject *ExceptHandler_type;
PyObject *Expr_type;
PyObject *Expression_type;
PyObject *FloorDiv_singleton;
PyObject *FloorDiv_type;
PyObject *For_type;
PyObject *FormattedValue_type;
PyObject *FunctionDef_type;
PyObject *FunctionType_type;
PyObject *GeneratorExp_type;
PyObject *Global_type;
PyObject *GtE_singleton;
PyObject *GtE_type;
PyObject *Gt_singleton;
PyObject *Gt_type;
PyObject *IfExp_type;
PyObject *If_type;
PyObject *ImportFrom_type;
PyObject *Import_type;
PyObject *In_singleton;
PyObject *In_type;
PyObject *Interactive_type;
PyObject *Invert_singleton;
PyObject *Invert_type;
PyObject *IsNot_singleton;
PyObject *IsNot_type;
PyObject *Is_singleton;
PyObject *Is_type;
PyObject *JoinedStr_type;
PyObject *LShift_singleton;
PyObject *LShift_type;
PyObject *Lambda_type;
PyObject *ListComp_type;
PyObject *List_type;
PyObject *Load_singleton;
PyObject *Load_type;
PyObject *LtE_singleton;
PyObject *LtE_type;
PyObject *Lt_singleton;
PyObject *Lt_type;
PyObject *MatMult_singleton;
PyObject *MatMult_type;
PyObject *MatchAs_type;
PyObject *MatchClass_type;
PyObject *MatchMapping_type;
PyObject *MatchOr_type;
PyObject *MatchSequence_type;
PyObject *MatchSingleton_type;
PyObject *MatchStar_type;
PyObject *MatchValue_type;
PyObject *Match_type;
PyObject *Mod_singleton;
PyObject *Mod_type;
PyObject *Module_type;
PyObject *Mult_singleton;
PyObject *Mult_type;
PyObject *Name_type;
PyObject *NamedExpr_type;
PyObject *Nonlocal_type;
PyObject *NotEq_singleton;
PyObject *NotEq_type;
PyObject *NotIn_singleton;
PyObject *NotIn_type;
PyObject *Not_singleton;
PyObject *Not_type;
PyObject *Or_singleton;
PyObject *Or_type;
PyObject *Pass_type;
PyObject *Pow_singleton;
PyObject *Pow_type;
PyObject *RShift_singleton;
PyObject *RShift_type;
PyObject *Raise_type;
PyObject *Return_type;
PyObject *SetComp_type;
PyObject *Set_type;
PyObject *Slice_type;
PyObject *Starred_type;
PyObject *Store_singleton;
PyObject *Store_type;
PyObject *Sub_singleton;
PyObject *Sub_type;
PyObject *Subscript_type;
PyObject *TryStar_type;
PyObject *Try_type;
PyObject *Tuple_type;
PyObject *TypeIgnore_type;
PyObject *UAdd_singleton;
PyObject *UAdd_type;
PyObject *USub_singleton;
PyObject *USub_type;
PyObject *UnaryOp_type;
PyObject *While_type;
PyObject *With_type;
PyObject *YieldFrom_type;
PyObject *Yield_type;
PyObject *__dict__;
PyObject *__doc__;
PyObject *__match_args__;
PyObject *__module__;
PyObject *_attributes;
PyObject *_fields;
PyObject *alias_type;
PyObject *annotation;
PyObject *arg;
PyObject *arg_type;
PyObject *args;
PyObject *argtypes;
PyObject *arguments_type;
PyObject *asname;
PyObject *ast;
PyObject *attr;
PyObject *bases;
PyObject *body;
PyObject *boolop_type;
PyObject *cases;
PyObject *cause;
PyObject *cls;
PyObject *cmpop_type;
PyObject *col_offset;
PyObject *comparators;
PyObject *comprehension_type;
PyObject *context_expr;
PyObject *conversion;
PyObject *ctx;
PyObject *decorator_list;
PyObject *defaults;
PyObject *elt;
PyObject *elts;
PyObject *end_col_offset;
PyObject *end_lineno;
PyObject *exc;
PyObject *excepthandler_type;
PyObject *expr_context_type;
PyObject *expr_type;
PyObject *finalbody;
PyObject *format_spec;
PyObject *func;
PyObject *generators;
PyObject *guard;
PyObject *handlers;
PyObject *id;
PyObject *ifs;
PyObject *is_async;
PyObject *items;
PyObject *iter;
PyObject *key;
PyObject *keys;
PyObject *keyword_type;
PyObject *keywords;
PyObject *kind;
PyObject *kw_defaults;
PyObject *kwarg;
PyObject *kwd_attrs;
PyObject *kwd_patterns;
PyObject *kwonlyargs;
PyObject *left;
PyObject *level;
PyObject *lineno;
PyObject *lower;
PyObject *match_case_type;
PyObject *mod_type;
PyObject *module;
PyObject *msg;
PyObject *name;
PyObject *names;
PyObject *op;
PyObject *operand;
PyObject *operator_type;
PyObject *ops;
PyObject *optional_vars;
PyObject *orelse;
PyObject *pattern;
PyObject *pattern_type;
PyObject *patterns;
PyObject *posonlyargs;
PyObject *rest;
PyObject *returns;
PyObject *right;
PyObject *simple;
PyObject *slice;
PyObject *step;
PyObject *stmt_type;
PyObject *subject;
PyObject *tag;
PyObject *target;
PyObject *targets;
PyObject *test;
PyObject *type;
PyObject *type_comment;
PyObject *type_ignore_type;
PyObject *type_ignores;
PyObject *unaryop_type;
PyObject *upper;
PyObject *value;
PyObject *values;
PyObject *vararg;
PyObject *withitem_type;
};
struct _gil_runtime_state {
unsigned long interval;
_Py_atomic_address last_holder;
_Py_atomic_int locked;
unsigned long switch_number;
pthread_cond_t cond;
pthread_mutex_t mutex;
pthread_cond_t switch_cond;
pthread_mutex_t switch_mutex;
};
typedef enum {
PERF_STATUS_FAILED = -1,
PERF_STATUS_NO_INIT = 0,
PERF_STATUS_OK = 1,
} perf_status_t;
struct _ceval_runtime_state {
struct {
int _not_used;
} perf;
_Py_atomic_int signals_pending;
struct _gil_runtime_state gil;
};
struct _pending_calls {
int busy;
PyThread_type_lock lock;
_Py_atomic_int calls_to_do;
int async_exc;
struct {
int (*func)(void *);
void *arg;
} calls[32];
int first;
int last;
};
struct _ceval_state {
int recursion_limit;
_Py_atomic_int eval_breaker;
_Py_atomic_int gil_drop_request;
_Py_atomic_int gc_scheduled;
struct _pending_calls pending;
};
typedef struct {
uint16_t counter;
uint16_t index;
uint16_t module_keys_version;
uint16_t builtin_keys_version;
} _PyLoadGlobalCache;
typedef struct {
uint16_t counter;
} _PyBinaryOpCache;
typedef struct {
uint16_t counter;
} _PyUnpackSequenceCache;
typedef struct {
uint16_t counter;
} _PyCompareOpCache;
typedef struct {
uint16_t counter;
} _PyBinarySubscrCache;
typedef struct {
uint16_t counter;
uint16_t version[2];
uint16_t index;
} _PyAttrCache;
typedef struct {
uint16_t counter;
uint16_t type_version[2];
uint16_t keys_version[2];
uint16_t descr[4];
} _PyLoadMethodCache;
typedef struct {
uint16_t counter;
uint16_t func_version[2];
uint16_t min_args;
} _PyCallCache;
typedef struct {
uint16_t counter;
} _PyStoreSubscrCache;
typedef struct {
uint16_t counter;
} _PyForIterCache;
typedef struct {
uint16_t counter;
} _PySendCache;
struct callable_cache {
PyObject *isinstance;
PyObject *len;
PyObject *list_append;
PyObject *object__getattribute__;
};
typedef unsigned char _PyLocals_Kind;
static inline _PyLocals_Kind
_PyLocals_GetKind(PyObject *kinds, int i)
{
assert(PyType_HasFeature((Py_TYPE(((PyObject*)((kinds))))), ((1UL << 27))));
assert(0 <= i && i < PyBytes_GET_SIZE(((PyObject*)((kinds)))));
char *ptr = PyBytes_AS_STRING(((PyObject*)((kinds))));
return (_PyLocals_Kind)(ptr[i]);
}
static inline void
_PyLocals_SetKind(PyObject *kinds, int i, _PyLocals_Kind kind)
{
assert(PyType_HasFeature((Py_TYPE(((PyObject*)((kinds))))), ((1UL << 27))));
assert(0 <= i && i < PyBytes_GET_SIZE(((PyObject*)((kinds)))));
char *ptr = PyBytes_AS_STRING(((PyObject*)((kinds))));
ptr[i] = (char) kind;
}
struct _PyCodeConstructor {
PyObject *filename;
PyObject *name;
PyObject *qualname;
int flags;
PyObject *code;
int firstlineno;
PyObject *linetable;
PyObject *consts;
PyObject *names;
PyObject *localsplusnames;
PyObject *localspluskinds;
int argcount;
int posonlyargcount;
int kwonlyargcount;
int stacksize;
PyObject *exceptiontable;
};
int _PyCode_Validate(struct _PyCodeConstructor *);
PyCodeObject * _PyCode_New(struct _PyCodeConstructor *);
extern PyObject* _PyCode_GetVarnames(PyCodeObject *);
extern PyObject* _PyCode_GetCellvars(PyCodeObject *);
extern PyObject* _PyCode_GetFreevars(PyCodeObject *);
extern PyObject* _PyCode_GetCode(PyCodeObject *);
extern int _PyCode_InitAddressRange(PyCodeObject* co, PyCodeAddressRange *bounds);
extern void _PyLineTable_InitAddressRange(
const char *linetable,
Py_ssize_t length,
int firstlineno,
PyCodeAddressRange *range);
extern int _PyLineTable_NextAddressRange(PyCodeAddressRange *range);
extern int _PyLineTable_PreviousAddressRange(PyCodeAddressRange *range);
extern void _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr,
PyObject *name);
extern void _Py_Specialize_StoreAttr(PyObject *owner, _Py_CODEUNIT *instr,
PyObject *name);
extern void _Py_Specialize_LoadGlobal(PyObject *globals, PyObject *builtins,
_Py_CODEUNIT *instr, PyObject *name);
extern void _Py_Specialize_BinarySubscr(PyObject *sub, PyObject *container,
_Py_CODEUNIT *instr);
extern void _Py_Specialize_StoreSubscr(PyObject *container, PyObject *sub,
_Py_CODEUNIT *instr);
extern void _Py_Specialize_Call(PyObject *callable, _Py_CODEUNIT *instr,
int nargs, PyObject *kwnames);
extern void _Py_Specialize_BinaryOp(PyObject *lhs, PyObject *rhs, _Py_CODEUNIT *instr,
int oparg, PyObject **locals);
extern void _Py_Specialize_CompareOp(PyObject *lhs, PyObject *rhs,
_Py_CODEUNIT *instr, int oparg);
extern void _Py_Specialize_UnpackSequence(PyObject *seq, _Py_CODEUNIT *instr,
int oparg);
extern void _Py_Specialize_ForIter(PyObject *iter, _Py_CODEUNIT *instr, int oparg);
extern void _Py_Specialize_Send(PyObject *receiver, _Py_CODEUNIT *instr);
extern void _PyStaticCode_Fini(PyCodeObject *co);
extern int _PyStaticCode_Init(PyCodeObject *co);
static inline void
write_u32(uint16_t *p, uint32_t val)
{
memcpy(p, &val, sizeof(val));
}
static inline void
write_u64(uint16_t *p, uint64_t val)
{
memcpy(p, &val, sizeof(val));
}
static inline void
write_obj(uint16_t *p, PyObject *val)
{
memcpy(p, &val, sizeof(val));
}
static inline uint16_t
read_u16(uint16_t *p)
{
return *p;
}
static inline uint32_t
read_u32(uint16_t *p)
{
uint32_t val;
memcpy(&val, p, sizeof(val));
return val;
}
static inline uint64_t
read_u64(uint16_t *p)
{
uint64_t val;
memcpy(&val, p, sizeof(val));
return val;
}
static inline PyObject *
read_obj(uint16_t *p)
{
PyObject *val;
memcpy(&val, p, sizeof(val));
return val;
}
static inline unsigned char *
parse_varint(unsigned char *p, int *result) {
int val = p[0] & 63;
while (p[0] & 64) {
p++;
val = (val << 6) | (p[0] & 63);
}
*result = val;
return p+1;
}
static inline int
write_varint(uint8_t *ptr, unsigned int val)
{
int written = 1;
while (val >= 64) {
*ptr++ = 64 | (val & 63);
val >>= 6;
written++;
}
*ptr = val;
return written;
}
static inline int
write_signed_varint(uint8_t *ptr, int val)
{
if (val < 0) {
val = ((-val)<<1) | 1;
}
else {
val = val << 1;
}
return write_varint(ptr, val);
}
static inline int
write_location_entry_start(uint8_t *ptr, int code, int length)
{
assert((code & 15) == code);
*ptr = 128 | (code << 3) | (length - 1);
return 1;
}
static inline uint16_t
adaptive_counter_bits(int value, int backoff) {
return (value << 4) |
(backoff & ((1<<4)-1));
}
static inline uint16_t
adaptive_counter_warmup(void) {
return adaptive_counter_bits(1,
1);
}
static inline uint16_t
adaptive_counter_cooldown(void) {
return adaptive_counter_bits(52,
0);
}
static inline uint16_t
adaptive_counter_backoff(uint16_t counter) {
unsigned int backoff = counter & ((1<<4)-1);
backoff++;
if (backoff > (16 - 4)) {
backoff = (16 - 4);
}
unsigned int value = (1 << backoff) - 1;
return adaptive_counter_bits(value, backoff);
}
extern int _PyCode_CreateLineArray(PyCodeObject *co);
static inline int
_PyCode_InitLineArray(PyCodeObject *co)
{
if (co->_co_linearray) {
return 0;
}
return _PyCode_CreateLineArray(co);
}
static inline int
_PyCode_LineNumberFromArray(PyCodeObject *co, int index)
{
assert(co->_co_linearray != 0);
assert(index >= 0);
assert(index < Py_SIZE(((PyObject*)((co)))));
if (co->_co_linearray_entry_size == 2) {
return ((int16_t *)co->_co_linearray)[index];
}
else {
assert(co->_co_linearray_entry_size == 4);
return ((int32_t *)co->_co_linearray)[index];
}
}
typedef struct _PyShimCodeDef {
const uint8_t *code;
int codelen;
int stacksize;
const char *cname;
} _PyShimCodeDef;
extern PyCodeObject *
_Py_MakeShimCode(const _PyShimCodeDef *code);
extern uint32_t _Py_next_func_version;
extern PyTypeObject _PyHamt_Type;
extern PyTypeObject _PyHamt_ArrayNode_Type;
extern PyTypeObject _PyHamt_BitmapNode_Type;
extern PyTypeObject _PyHamt_CollisionNode_Type;
extern PyTypeObject _PyHamtKeys_Type;
extern PyTypeObject _PyHamtValues_Type;
extern PyTypeObject _PyHamtItems_Type;
typedef struct {
PyObject ob_base;
} PyHamtNode;
typedef struct {
PyObject ob_base;
PyHamtNode *h_root;
PyObject *h_weakreflist;
Py_ssize_t h_count;
} PyHamtObject;
typedef struct {
PyVarObject ob_base;
uint32_t b_bitmap;
PyObject *b_array[1];
} PyHamtNode_Bitmap;
typedef struct {
PyHamtNode *i_nodes[8];
Py_ssize_t i_pos[8];
int8_t i_level;
} PyHamtIteratorState;
typedef struct {
PyObject ob_base;
PyHamtObject *hi_obj;
PyHamtIteratorState hi_iter;
binaryfunc hi_yield;
} PyHamtIterator;
PyHamtObject * _PyHamt_New(void);
PyHamtObject * _PyHamt_Assoc(PyHamtObject *o, PyObject *key, PyObject *val);
PyHamtObject * _PyHamt_Without(PyHamtObject *o, PyObject *key);
int _PyHamt_Find(PyHamtObject *o, PyObject *key, PyObject **val);
int _PyHamt_Eq(PyHamtObject *v, PyHamtObject *w);
Py_ssize_t _PyHamt_Len(PyHamtObject *o);
PyObject * _PyHamt_NewIterKeys(PyHamtObject *o);
PyObject * _PyHamt_NewIterValues(PyHamtObject *o);
PyObject * _PyHamt_NewIterItems(PyHamtObject *o);
extern PyTypeObject _PyContextTokenMissing_Type;
PyStatus _PyContext_Init(PyInterpreterState *);
void _PyContext_Fini(PyInterpreterState *);
typedef struct {
PyObject ob_base;
} _PyContextTokenMissing;
struct _Py_context_state {
PyContext *freelist;
int numfree;
};
struct _pycontextobject {
PyObject ob_base;
PyContext *ctx_prev;
PyHamtObject *ctx_vars;
PyObject *ctx_weakreflist;
int ctx_entered;
};
struct _pycontextvarobject {
PyObject ob_base;
PyObject *var_name;
PyObject *var_default;
PyObject *var_cached;
uint64_t var_cached_tsid;
uint64_t var_cached_tsver;
Py_hash_t var_hash;
};
struct _pycontexttokenobject {
PyObject ob_base;
PyContext *tok_ctx;
PyContextVar *tok_var;
PyObject *tok_oldval;
int tok_used;
};
struct _Py_dict_state {
uint64_t global_version;
uint32_t next_keys_version;
PyDictObject *free_list[80];
PyDictKeysObject *keys_free_list[80];
int numfree;
int keys_numfree;
PyDict_WatchCallback watchers[8];
};
static inline void _Py_ADJUST_ERANGE1(double x)
{
if (errno == 0) {
if (x == HUGE_VAL || x == -HUGE_VAL) {
errno = ERANGE;
}
}
else if (errno == ERANGE && x == 0.0) {
errno = 0;
}
}
static inline void _Py_ADJUST_ERANGE2(double x, double y)
{
if (x == HUGE_VAL || x == -HUGE_VAL ||
y == HUGE_VAL || y == -HUGE_VAL)
{
if (errno == 0) {
errno = ERANGE;
}
}
else if (errno == ERANGE) {
errno = 0;
}
}
typedef uint32_t ULong;
struct
Bigint {
struct Bigint *next;
int k, maxwds, sign, wds;
ULong x[1];
};
struct _dtoa_state {
struct Bigint *p5s;
struct Bigint *freelist[7 +1];
double preallocated[((2304 +sizeof(double)-1)/sizeof(double))];
double *preallocated_next;
};
double _Py_dg_strtod(const char *str, char **ptr);
char * _Py_dg_dtoa(double d, int mode, int ndigits,
int *decpt, int *sign, char **rve);
void _Py_dg_freedtoa(char *s);
double _Py_dg_stdnan(int sign);
double _Py_dg_infinity(int sign);
extern PyStatus _PyExc_InitState(PyInterpreterState *);
extern PyStatus _PyExc_InitGlobalObjects(PyInterpreterState *);
extern int _PyExc_InitTypes(PyInterpreterState *);
extern void _PyExc_Fini(PyInterpreterState *);
struct _Py_exc_state {
PyObject *errnomap;
PyBaseExceptionObject *memerrors_freelist;
int memerrors_numfree;
PyObject *PyExc_ExceptionGroup;
};
extern void _PyExc_ClearExceptionGroupType(PyInterpreterState *);
extern void _PyFloat_InitState(PyInterpreterState *);
extern PyStatus _PyFloat_InitTypes(PyInterpreterState *);
extern void _PyFloat_Fini(PyInterpreterState *);
extern void _PyFloat_FiniType(PyInterpreterState *);
enum _py_float_format_type {
_py_float_format_unknown,
_py_float_format_ieee_big_endian,
_py_float_format_ieee_little_endian,
};
struct _Py_float_runtime_state {
enum _py_float_format_type float_format;
enum _py_float_format_type double_format;
};
struct _Py_float_state {
int numfree;
PyFloatObject *free_list;
};
void _PyFloat_ExactDealloc(PyObject *op);
void _PyFloat_DebugMallocStats(FILE* out);
int _PyFloat_FormatAdvancedWriter(
_PyUnicodeWriter *writer,
PyObject *obj,
PyObject *format_spec,
Py_ssize_t start,
Py_ssize_t end);
struct _py_func_state {
uint32_t next_version;
};
extern PyFunctionObject* _PyFunction_FromConstructor(PyFrameConstructor *constr);
extern uint32_t _PyFunction_GetVersionForCurrentState(PyFunctionObject *func);
extern PyObject *_PyGen_yf(PyGenObject *);
extern PyObject *_PyCoro_GetAwaitableIter(PyObject *o);
extern PyObject *_PyAsyncGenValueWrapperNew(PyThreadState *state, PyObject *);
extern void _PyAsyncGen_Fini(PyInterpreterState *);
struct _Py_async_gen_state {
struct _PyAsyncGenWrappedValue* value_freelist[80];
int value_numfree;
struct PyAsyncGenASend* asend_freelist[80];
int asend_numfree;
};
typedef struct {
uintptr_t _gc_next;
uintptr_t _gc_prev;
} PyGC_Head;
static inline PyGC_Head* _Py_AS_GC(PyObject *op) {
return (((PyGC_Head*)(op)) - 1);
}
static inline int _PyObject_GC_IS_TRACKED(PyObject *op) {
PyGC_Head *gc = _Py_AS_GC(op);
return (gc->_gc_next != 0);
}
static inline int _PyObject_GC_MAY_BE_TRACKED(PyObject *obj) {
if (!PyObject_IS_GC(obj)) {
return 0;
}
if (Py_IS_TYPE(((PyObject*)(((obj)))), (&PyTuple_Type))) {
return _PyObject_GC_IS_TRACKED(((PyObject*)(obj)));
}
return 1;
}
static inline PyGC_Head* _PyGCHead_NEXT(PyGC_Head *gc) {
uintptr_t next = gc->_gc_next;
return ((PyGC_Head*)(next));
}
static inline void _PyGCHead_SET_NEXT(PyGC_Head *gc, PyGC_Head *next) {
gc->_gc_next = ((uintptr_t)(next));
}
static inline PyGC_Head* _PyGCHead_PREV(PyGC_Head *gc) {
uintptr_t prev = (gc->_gc_prev & (((uintptr_t) -1) << (2)));
return ((PyGC_Head*)(prev));
}
static inline void _PyGCHead_SET_PREV(PyGC_Head *gc, PyGC_Head *prev) {
uintptr_t uprev = ((uintptr_t)(prev));
assert((uprev & ~(((uintptr_t) -1) << (2))) == 0);
gc->_gc_prev = ((gc->_gc_prev & ~(((uintptr_t) -1) << (2))) | uprev);
}
static inline int _PyGCHead_FINALIZED(PyGC_Head *gc) {
return ((gc->_gc_prev & (1)) != 0);
}
static inline void _PyGCHead_SET_FINALIZED(PyGC_Head *gc) {
gc->_gc_prev |= (1);
}
static inline int _PyGC_FINALIZED(PyObject *op) {
PyGC_Head *gc = _Py_AS_GC(op);
return _PyGCHead_FINALIZED(gc);
}
static inline void _PyGC_SET_FINALIZED(PyObject *op) {
PyGC_Head *gc = _Py_AS_GC(op);
_PyGCHead_SET_FINALIZED(gc);
}
struct gc_generation {
PyGC_Head head;
int threshold;
int count;
};
struct gc_generation_stats {
Py_ssize_t collections;
Py_ssize_t collected;
Py_ssize_t uncollectable;
};
struct _gc_runtime_state {
PyObject *trash_delete_later;
int trash_delete_nesting;
int enabled;
int debug;
struct gc_generation generations[3];
PyGC_Head *generation0;
struct gc_generation permanent_generation;
struct gc_generation_stats generation_stats[3];
int collecting;
PyObject *garbage;
PyObject *callbacks;
Py_ssize_t long_lived_total;
Py_ssize_t long_lived_pending;
};
extern void _PyGC_InitState(struct _gc_runtime_state *);
extern Py_ssize_t _PyGC_CollectNoFail(PyThreadState *tstate);
extern void _PyTuple_ClearFreeList(PyInterpreterState *interp);
extern void _PyFloat_ClearFreeList(PyInterpreterState *interp);
extern void _PyList_ClearFreeList(PyInterpreterState *interp);
extern void _PyDict_ClearFreeList(PyInterpreterState *interp);
extern void _PyAsyncGen_ClearFreeLists(PyInterpreterState *interp);
extern void _PyContext_ClearFreeList(PyInterpreterState *interp);
extern void _Py_ScheduleGC(PyInterpreterState *interp);
extern void _Py_RunGC(PyThreadState *tstate);
struct _import_runtime_state {
struct _inittab *inittab;
Py_ssize_t last_module_index;
struct {
PyThreadState main_tstate;
PyObject *dict;
} extensions;
const char * pkgcontext;
};
struct _import_state {
PyObject *modules;
PyObject *modules_by_index;
PyObject *importlib;
int override_frozen_modules;
int override_multi_interp_extensions_check;
PyObject *import_func;
struct {
PyThread_type_lock mutex;
unsigned long thread;
int level;
} lock;
struct {
int import_level;
_PyTime_t accumulated;
int header;
} find_and_load;
};
extern void _PyImport_ClearCore(PyInterpreterState *interp);
extern Py_ssize_t _PyImport_GetNextModuleIndex(void);
extern const char * _PyImport_ResolveNameWithPackageContext(const char *name);
extern const char * _PyImport_SwapPackageContext(const char *newcontext);
extern int _PyImport_GetDLOpenFlags(PyInterpreterState *interp);
extern void _PyImport_SetDLOpenFlags(PyInterpreterState *interp, int new_val);
extern PyObject * _PyImport_InitModules(PyInterpreterState *interp);
extern PyObject * _PyImport_GetModules(PyInterpreterState *interp);
extern void _PyImport_ClearModules(PyInterpreterState *interp);
extern void _PyImport_ClearModulesByIndex(PyInterpreterState *interp);
extern int _PyImport_InitDefaultImportFunc(PyInterpreterState *interp);
extern int _PyImport_IsDefaultImportFunc(
PyInterpreterState *interp,
PyObject *func);
extern PyObject * _PyImport_GetImportlibLoader(
PyInterpreterState *interp,
const char *loader_name);
extern PyObject * _PyImport_GetImportlibExternalLoader(
PyInterpreterState *interp,
const char *loader_name);
extern PyObject * _PyImport_BlessMyLoader(
PyInterpreterState *interp,
PyObject *module_globals);
extern PyObject * _PyImport_ImportlibModuleRepr(
PyInterpreterState *interp,
PyObject *module);
extern PyStatus _PyImport_Init(void);
extern void _PyImport_Fini(void);
extern void _PyImport_Fini2(void);
extern PyStatus _PyImport_InitCore(
PyThreadState *tstate,
PyObject *sysmod,
int importlib);
extern PyStatus _PyImport_InitExternal(PyThreadState *tstate);
extern void _PyImport_FiniCore(PyInterpreterState *interp);
extern void _PyImport_FiniExternal(PyInterpreterState *interp);
extern PyObject* _PyImport_GetBuiltinModuleNames(void);
struct _module_alias {
const char *name;
const char *orig;
};
extern const struct _frozen * _PyImport_FrozenBootstrap;
extern const struct _frozen * _PyImport_FrozenStdlib;
extern const struct _frozen * _PyImport_FrozenTest;
extern const struct _module_alias * _PyImport_FrozenAliases;
int _PyImport_CheckSubinterpIncompatibleExtensionAllowed(
const char *name);
int _PyImport_ClearExtension(PyObject *name, PyObject *filename);
extern void _PyList_Fini(PyInterpreterState *);
struct _Py_list_state {
PyListObject *free_list[80];
int numfree;
};
extern int
_PyList_AppendTakeRefListResize(PyListObject *self, PyObject *newitem);
static inline int
_PyList_AppendTakeRef(PyListObject *self, PyObject *newitem)
{
assert(self != 0 && newitem != 0);
assert(PyType_HasFeature((Py_TYPE(((PyObject*)((self))))), ((1UL << 25))));
Py_ssize_t len = PyList_GET_SIZE(((PyObject*)((self))));
Py_ssize_t allocated = self->allocated;
assert((size_t)len + 1 < SSIZE_MAX);
if (allocated > len) {
PyList_SET_ITEM(((PyObject*)((self))), (len), ((PyObject*)((newitem))));
Py_SET_SIZE(((PyVarObject*)((self))), (len + 1));
return 0;
}
return _PyList_AppendTakeRefListResize(self, newitem);
}
static inline void
_Py_memory_repeat(char* dest, Py_ssize_t len_dest, Py_ssize_t len_src)
{
assert(len_src > 0);
Py_ssize_t copied = len_src;
while (copied < len_dest) {
Py_ssize_t bytes_to_copy = (((copied) > (len_dest - copied)) ? (len_dest - copied) : (copied));
memcpy(dest + copied, dest, bytes_to_copy);
copied += bytes_to_copy;
}
}
typedef struct {
PyObject ob_base;
Py_ssize_t it_index;
PyListObject *it_seq;
} _PyListIterObject;
extern PyObject *_PyList_FromArraySteal(PyObject *const *src, Py_ssize_t n);
struct _Py_global_strings {
struct {
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("<dictcomp>")]; } _py_anon_dictcomp;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("<genexpr>")]; } _py_anon_genexpr;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("<lambda>")]; } _py_anon_lambda;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("<listcomp>")]; } _py_anon_listcomp;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("<module>")]; } _py_anon_module;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("<setcomp>")]; } _py_anon_setcomp;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("<string>")]; } _py_anon_string;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("<unknown>")]; } _py_anon_unknown;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("}")]; } _py_close_br;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("}}")]; } _py_dbl_close_br;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("{{")]; } _py_dbl_open_br;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("%%")]; } _py_dbl_percent;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof(".")]; } _py_dot;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof(".<locals>")]; } _py_dot_locals;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("")]; } _py_empty;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("json.decoder")]; } _py_json_decoder;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("list index out of range")]; } _py_list_err;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("\n")]; } _py_newline;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("{")]; } _py_open_br;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("%")]; } _py_percent;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("<shim>")]; } _py_shim_name;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("utf-8")]; } _py_utf_8;
} literals;
struct {
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("CANCELLED")]; } _py_CANCELLED;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("FINISHED")]; } _py_FINISHED;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("False")]; } _py_False;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("JSONDecodeError")]; } _py_JSONDecodeError;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("PENDING")]; } _py_PENDING;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("Py_Repr")]; } _py_Py_Repr;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("TextIOWrapper")]; } _py_TextIOWrapper;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("True")]; } _py_True;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("WarningMessage")]; } _py_WarningMessage;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_")]; } _py__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_WindowsConsoleIO")]; } _py__WindowsConsoleIO;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__IOBase_closed")]; } _py___IOBase_closed;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__abc_tpflags__")]; } _py___abc_tpflags__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__abs__")]; } _py___abs__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__abstractmethods__")]; } _py___abstractmethods__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__add__")]; } _py___add__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__aenter__")]; } _py___aenter__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__aexit__")]; } _py___aexit__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__aiter__")]; } _py___aiter__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__all__")]; } _py___all__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__and__")]; } _py___and__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__anext__")]; } _py___anext__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__annotations__")]; } _py___annotations__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__args__")]; } _py___args__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__asyncio_running_event_loop__")]; } _py___asyncio_running_event_loop__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__await__")]; } _py___await__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__bases__")]; } _py___bases__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__bool__")]; } _py___bool__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__build_class__")]; } _py___build_class__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__builtins__")]; } _py___builtins__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__bytes__")]; } _py___bytes__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__call__")]; } _py___call__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__cantrace__")]; } _py___cantrace__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__class__")]; } _py___class__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__class_getitem__")]; } _py___class_getitem__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__classcell__")]; } _py___classcell__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__complex__")]; } _py___complex__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__contains__")]; } _py___contains__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__copy__")]; } _py___copy__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__ctypes_from_outparam__")]; } _py___ctypes_from_outparam__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__del__")]; } _py___del__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__delattr__")]; } _py___delattr__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__delete__")]; } _py___delete__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__delitem__")]; } _py___delitem__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__dict__")]; } _py___dict__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__dictoffset__")]; } _py___dictoffset__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__dir__")]; } _py___dir__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__divmod__")]; } _py___divmod__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__doc__")]; } _py___doc__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__enter__")]; } _py___enter__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__eq__")]; } _py___eq__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__exit__")]; } _py___exit__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__file__")]; } _py___file__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__float__")]; } _py___float__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__floordiv__")]; } _py___floordiv__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__format__")]; } _py___format__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__fspath__")]; } _py___fspath__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__ge__")]; } _py___ge__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__get__")]; } _py___get__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__getattr__")]; } _py___getattr__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__getattribute__")]; } _py___getattribute__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__getinitargs__")]; } _py___getinitargs__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__getitem__")]; } _py___getitem__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__getnewargs__")]; } _py___getnewargs__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__getnewargs_ex__")]; } _py___getnewargs_ex__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__getstate__")]; } _py___getstate__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__gt__")]; } _py___gt__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__hash__")]; } _py___hash__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__iadd__")]; } _py___iadd__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__iand__")]; } _py___iand__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__ifloordiv__")]; } _py___ifloordiv__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__ilshift__")]; } _py___ilshift__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__imatmul__")]; } _py___imatmul__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__imod__")]; } _py___imod__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__import__")]; } _py___import__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__imul__")]; } _py___imul__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__index__")]; } _py___index__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__init__")]; } _py___init__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__init_subclass__")]; } _py___init_subclass__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__instancecheck__")]; } _py___instancecheck__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__int__")]; } _py___int__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__invert__")]; } _py___invert__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__ior__")]; } _py___ior__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__ipow__")]; } _py___ipow__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__irshift__")]; } _py___irshift__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__isabstractmethod__")]; } _py___isabstractmethod__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__isub__")]; } _py___isub__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__iter__")]; } _py___iter__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__itruediv__")]; } _py___itruediv__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__ixor__")]; } _py___ixor__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__le__")]; } _py___le__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__len__")]; } _py___len__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__length_hint__")]; } _py___length_hint__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__lltrace__")]; } _py___lltrace__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__loader__")]; } _py___loader__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__lshift__")]; } _py___lshift__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__lt__")]; } _py___lt__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__main__")]; } _py___main__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__matmul__")]; } _py___matmul__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__missing__")]; } _py___missing__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__mod__")]; } _py___mod__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__module__")]; } _py___module__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__mro_entries__")]; } _py___mro_entries__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__mul__")]; } _py___mul__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__name__")]; } _py___name__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__ne__")]; } _py___ne__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__neg__")]; } _py___neg__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__new__")]; } _py___new__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__newobj__")]; } _py___newobj__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__newobj_ex__")]; } _py___newobj_ex__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__next__")]; } _py___next__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__notes__")]; } _py___notes__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__or__")]; } _py___or__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__orig_class__")]; } _py___orig_class__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__origin__")]; } _py___origin__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__package__")]; } _py___package__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__parameters__")]; } _py___parameters__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__path__")]; } _py___path__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__pos__")]; } _py___pos__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__pow__")]; } _py___pow__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__prepare__")]; } _py___prepare__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__qualname__")]; } _py___qualname__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__radd__")]; } _py___radd__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__rand__")]; } _py___rand__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__rdivmod__")]; } _py___rdivmod__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__reduce__")]; } _py___reduce__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__reduce_ex__")]; } _py___reduce_ex__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__repr__")]; } _py___repr__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__reversed__")]; } _py___reversed__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__rfloordiv__")]; } _py___rfloordiv__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__rlshift__")]; } _py___rlshift__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__rmatmul__")]; } _py___rmatmul__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__rmod__")]; } _py___rmod__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__rmul__")]; } _py___rmul__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__ror__")]; } _py___ror__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__round__")]; } _py___round__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__rpow__")]; } _py___rpow__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__rrshift__")]; } _py___rrshift__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__rshift__")]; } _py___rshift__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__rsub__")]; } _py___rsub__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__rtruediv__")]; } _py___rtruediv__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__rxor__")]; } _py___rxor__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__set__")]; } _py___set__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__set_name__")]; } _py___set_name__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__setattr__")]; } _py___setattr__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__setitem__")]; } _py___setitem__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__setstate__")]; } _py___setstate__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__sizeof__")]; } _py___sizeof__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__slotnames__")]; } _py___slotnames__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__slots__")]; } _py___slots__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__spec__")]; } _py___spec__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__str__")]; } _py___str__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__sub__")]; } _py___sub__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__subclasscheck__")]; } _py___subclasscheck__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__subclasshook__")]; } _py___subclasshook__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__truediv__")]; } _py___truediv__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__trunc__")]; } _py___trunc__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__typing_is_unpacked_typevartuple__")]; } _py___typing_is_unpacked_typevartuple__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__typing_prepare_subst__")]; } _py___typing_prepare_subst__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__typing_subst__")]; } _py___typing_subst__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__typing_unpacked_tuple_args__")]; } _py___typing_unpacked_tuple_args__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__warningregistry__")]; } _py___warningregistry__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__weaklistoffset__")]; } _py___weaklistoffset__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__weakref__")]; } _py___weakref__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("__xor__")]; } _py___xor__;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_abc_impl")]; } _py__abc_impl;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_abstract_")]; } _py__abstract_;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_active")]; } _py__active;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_annotation")]; } _py__annotation;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_anonymous_")]; } _py__anonymous_;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_argtypes_")]; } _py__argtypes_;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_as_parameter_")]; } _py__as_parameter_;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_asyncio_future_blocking")]; } _py__asyncio_future_blocking;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_blksize")]; } _py__blksize;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_bootstrap")]; } _py__bootstrap;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_check_retval_")]; } _py__check_retval_;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_dealloc_warn")]; } _py__dealloc_warn;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_feature_version")]; } _py__feature_version;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_fields_")]; } _py__fields_;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_finalizing")]; } _py__finalizing;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_find_and_load")]; } _py__find_and_load;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_fix_up_module")]; } _py__fix_up_module;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_flags_")]; } _py__flags_;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_get_sourcefile")]; } _py__get_sourcefile;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_handle_fromlist")]; } _py__handle_fromlist;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_initializing")]; } _py__initializing;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_io")]; } _py__io;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_is_text_encoding")]; } _py__is_text_encoding;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_length_")]; } _py__length_;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_limbo")]; } _py__limbo;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_lock_unlock_module")]; } _py__lock_unlock_module;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_loop")]; } _py__loop;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_needs_com_addref_")]; } _py__needs_com_addref_;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_pack_")]; } _py__pack_;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_restype_")]; } _py__restype_;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_showwarnmsg")]; } _py__showwarnmsg;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_shutdown")]; } _py__shutdown;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_slotnames")]; } _py__slotnames;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_strptime_datetime")]; } _py__strptime_datetime;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_swappedbytes_")]; } _py__swappedbytes_;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_type_")]; } _py__type_;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_uninitialized_submodules")]; } _py__uninitialized_submodules;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_warn_unawaited_coroutine")]; } _py__warn_unawaited_coroutine;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("_xoptions")]; } _py__xoptions;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("a")]; } _py_a;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("abs_tol")]; } _py_abs_tol;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("access")]; } _py_access;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("add")]; } _py_add;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("add_done_callback")]; } _py_add_done_callback;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("after_in_child")]; } _py_after_in_child;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("after_in_parent")]; } _py_after_in_parent;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("aggregate_class")]; } _py_aggregate_class;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("append")]; } _py_append;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("argdefs")]; } _py_argdefs;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("arguments")]; } _py_arguments;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("argv")]; } _py_argv;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("as_integer_ratio")]; } _py_as_integer_ratio;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("ast")]; } _py_ast;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("attribute")]; } _py_attribute;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("authorizer_callback")]; } _py_authorizer_callback;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("autocommit")]; } _py_autocommit;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("b")]; } _py_b;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("backtick")]; } _py_backtick;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("base")]; } _py_base;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("before")]; } _py_before;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("big")]; } _py_big;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("binary_form")]; } _py_binary_form;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("block")]; } _py_block;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("buffer")]; } _py_buffer;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("buffer_callback")]; } _py_buffer_callback;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("buffer_size")]; } _py_buffer_size;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("buffering")]; } _py_buffering;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("buffers")]; } _py_buffers;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("bufsize")]; } _py_bufsize;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("builtins")]; } _py_builtins;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("byteorder")]; } _py_byteorder;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("bytes")]; } _py_bytes;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("bytes_per_sep")]; } _py_bytes_per_sep;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("c")]; } _py_c;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("c_call")]; } _py_c_call;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("c_exception")]; } _py_c_exception;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("c_return")]; } _py_c_return;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("cached_statements")]; } _py_cached_statements;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("cadata")]; } _py_cadata;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("cafile")]; } _py_cafile;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("call")]; } _py_call;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("call_exception_handler")]; } _py_call_exception_handler;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("call_soon")]; } _py_call_soon;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("cancel")]; } _py_cancel;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("capath")]; } _py_capath;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("category")]; } _py_category;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("cb_type")]; } _py_cb_type;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("certfile")]; } _py_certfile;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("check_same_thread")]; } _py_check_same_thread;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("clear")]; } _py_clear;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("close")]; } _py_close;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("closed")]; } _py_closed;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("closefd")]; } _py_closefd;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("closure")]; } _py_closure;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("co_argcount")]; } _py_co_argcount;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("co_cellvars")]; } _py_co_cellvars;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("co_code")]; } _py_co_code;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("co_consts")]; } _py_co_consts;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("co_exceptiontable")]; } _py_co_exceptiontable;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("co_filename")]; } _py_co_filename;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("co_firstlineno")]; } _py_co_firstlineno;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("co_flags")]; } _py_co_flags;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("co_freevars")]; } _py_co_freevars;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("co_kwonlyargcount")]; } _py_co_kwonlyargcount;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("co_linetable")]; } _py_co_linetable;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("co_name")]; } _py_co_name;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("co_names")]; } _py_co_names;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("co_nlocals")]; } _py_co_nlocals;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("co_posonlyargcount")]; } _py_co_posonlyargcount;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("co_qualname")]; } _py_co_qualname;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("co_stacksize")]; } _py_co_stacksize;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("co_varnames")]; } _py_co_varnames;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("code")]; } _py_code;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("command")]; } _py_command;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("comment_factory")]; } _py_comment_factory;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("consts")]; } _py_consts;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("context")]; } _py_context;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("cookie")]; } _py_cookie;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("copy")]; } _py_copy;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("copyreg")]; } _py_copyreg;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("coro")]; } _py_coro;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("count")]; } _py_count;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("cwd")]; } _py_cwd;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("d")]; } _py_d;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("data")]; } _py_data;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("database")]; } _py_database;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("decode")]; } _py_decode;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("decoder")]; } _py_decoder;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("default")]; } _py_default;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("defaultaction")]; } _py_defaultaction;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("delete")]; } _py_delete;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("depth")]; } _py_depth;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("detect_types")]; } _py_detect_types;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("deterministic")]; } _py_deterministic;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("device")]; } _py_device;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("dict")]; } _py_dict;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("dictcomp")]; } _py_dictcomp;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("difference_update")]; } _py_difference_update;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("digest")]; } _py_digest;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("digest_size")]; } _py_digest_size;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("digestmod")]; } _py_digestmod;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("dir_fd")]; } _py_dir_fd;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("discard")]; } _py_discard;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("dispatch_table")]; } _py_dispatch_table;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("displayhook")]; } _py_displayhook;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("dklen")]; } _py_dklen;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("doc")]; } _py_doc;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("dont_inherit")]; } _py_dont_inherit;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("dst")]; } _py_dst;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("dst_dir_fd")]; } _py_dst_dir_fd;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("duration")]; } _py_duration;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("e")]; } _py_e;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("effective_ids")]; } _py_effective_ids;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("element_factory")]; } _py_element_factory;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("encode")]; } _py_encode;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("encoding")]; } _py_encoding;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("end")]; } _py_end;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("end_lineno")]; } _py_end_lineno;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("end_offset")]; } _py_end_offset;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("endpos")]; } _py_endpos;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("env")]; } _py_env;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("errors")]; } _py_errors;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("event")]; } _py_event;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("eventmask")]; } _py_eventmask;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("exc_type")]; } _py_exc_type;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("exc_value")]; } _py_exc_value;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("excepthook")]; } _py_excepthook;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("exception")]; } _py_exception;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("exp")]; } _py_exp;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("extend")]; } _py_extend;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("facility")]; } _py_facility;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("factory")]; } _py_factory;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("false")]; } _py_false;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("family")]; } _py_family;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("fanout")]; } _py_fanout;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("fd")]; } _py_fd;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("fd2")]; } _py_fd2;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("fdel")]; } _py_fdel;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("fget")]; } _py_fget;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("file")]; } _py_file;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("file_actions")]; } _py_file_actions;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("filename")]; } _py_filename;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("fileno")]; } _py_fileno;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("filepath")]; } _py_filepath;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("fillvalue")]; } _py_fillvalue;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("filters")]; } _py_filters;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("final")]; } _py_final;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("find_class")]; } _py_find_class;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("fix_imports")]; } _py_fix_imports;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("flags")]; } _py_flags;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("flush")]; } _py_flush;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("follow_symlinks")]; } _py_follow_symlinks;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("format")]; } _py_format;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("frequency")]; } _py_frequency;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("from_param")]; } _py_from_param;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("fromlist")]; } _py_fromlist;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("fromtimestamp")]; } _py_fromtimestamp;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("fromutc")]; } _py_fromutc;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("fset")]; } _py_fset;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("func")]; } _py_func;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("future")]; } _py_future;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("generation")]; } _py_generation;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("genexpr")]; } _py_genexpr;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("get")]; } _py_get;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("get_debug")]; } _py_get_debug;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("get_event_loop")]; } _py_get_event_loop;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("get_loop")]; } _py_get_loop;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("get_source")]; } _py_get_source;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("getattr")]; } _py_getattr;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("getstate")]; } _py_getstate;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("gid")]; } _py_gid;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("globals")]; } _py_globals;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("groupindex")]; } _py_groupindex;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("groups")]; } _py_groups;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("handle")]; } _py_handle;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("hash_name")]; } _py_hash_name;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("header")]; } _py_header;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("headers")]; } _py_headers;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("hi")]; } _py_hi;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("hook")]; } _py_hook;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("id")]; } _py_id;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("ident")]; } _py_ident;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("ignore")]; } _py_ignore;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("imag")]; } _py_imag;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("importlib")]; } _py_importlib;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("in_fd")]; } _py_in_fd;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("incoming")]; } _py_incoming;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("indexgroup")]; } _py_indexgroup;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("inf")]; } _py_inf;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("inheritable")]; } _py_inheritable;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("initial")]; } _py_initial;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("initial_bytes")]; } _py_initial_bytes;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("initial_value")]; } _py_initial_value;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("initval")]; } _py_initval;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("inner_size")]; } _py_inner_size;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("input")]; } _py_input;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("insert_comments")]; } _py_insert_comments;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("insert_pis")]; } _py_insert_pis;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("instructions")]; } _py_instructions;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("intern")]; } _py_intern;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("intersection")]; } _py_intersection;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("isatty")]; } _py_isatty;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("isinstance")]; } _py_isinstance;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("isoformat")]; } _py_isoformat;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("isolation_level")]; } _py_isolation_level;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("istext")]; } _py_istext;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("item")]; } _py_item;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("items")]; } _py_items;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("iter")]; } _py_iter;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("iterable")]; } _py_iterable;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("iterations")]; } _py_iterations;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("join")]; } _py_join;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("jump")]; } _py_jump;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("keepends")]; } _py_keepends;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("key")]; } _py_key;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("keyfile")]; } _py_keyfile;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("keys")]; } _py_keys;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("kind")]; } _py_kind;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("kw")]; } _py_kw;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("kw1")]; } _py_kw1;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("kw2")]; } _py_kw2;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("lambda")]; } _py_lambda;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("last")]; } _py_last;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("last_exc")]; } _py_last_exc;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("last_node")]; } _py_last_node;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("last_traceback")]; } _py_last_traceback;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("last_type")]; } _py_last_type;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("last_value")]; } _py_last_value;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("latin1")]; } _py_latin1;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("leaf_size")]; } _py_leaf_size;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("len")]; } _py_len;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("length")]; } _py_length;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("level")]; } _py_level;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("limit")]; } _py_limit;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("line")]; } _py_line;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("line_buffering")]; } _py_line_buffering;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("lineno")]; } _py_lineno;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("listcomp")]; } _py_listcomp;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("little")]; } _py_little;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("lo")]; } _py_lo;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("locale")]; } _py_locale;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("locals")]; } _py_locals;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("logoption")]; } _py_logoption;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("loop")]; } _py_loop;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("mapping")]; } _py_mapping;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("match")]; } _py_match;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("max_length")]; } _py_max_length;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("maxdigits")]; } _py_maxdigits;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("maxevents")]; } _py_maxevents;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("maxmem")]; } _py_maxmem;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("maxsplit")]; } _py_maxsplit;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("maxvalue")]; } _py_maxvalue;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("memLevel")]; } _py_memLevel;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("memlimit")]; } _py_memlimit;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("message")]; } _py_message;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("metaclass")]; } _py_metaclass;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("method")]; } _py_method;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("mod")]; } _py_mod;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("mode")]; } _py_mode;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("module")]; } _py_module;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("module_globals")]; } _py_module_globals;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("modules")]; } _py_modules;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("mro")]; } _py_mro;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("msg")]; } _py_msg;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("mycmp")]; } _py_mycmp;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("n")]; } _py_n;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("n_arg")]; } _py_n_arg;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("n_fields")]; } _py_n_fields;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("n_sequence_fields")]; } _py_n_sequence_fields;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("n_unnamed_fields")]; } _py_n_unnamed_fields;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("name")]; } _py_name;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("name_from")]; } _py_name_from;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("namespace_separator")]; } _py_namespace_separator;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("namespaces")]; } _py_namespaces;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("narg")]; } _py_narg;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("ndigits")]; } _py_ndigits;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("new_limit")]; } _py_new_limit;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("newline")]; } _py_newline;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("newlines")]; } _py_newlines;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("next")]; } _py_next;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("node_depth")]; } _py_node_depth;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("node_offset")]; } _py_node_offset;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("ns")]; } _py_ns;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("nstype")]; } _py_nstype;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("nt")]; } _py_nt;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("null")]; } _py_null;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("number")]; } _py_number;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("obj")]; } _py_obj;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("object")]; } _py_object;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("offset")]; } _py_offset;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("offset_dst")]; } _py_offset_dst;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("offset_src")]; } _py_offset_src;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("on_type_read")]; } _py_on_type_read;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("onceregistry")]; } _py_onceregistry;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("only_keys")]; } _py_only_keys;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("oparg")]; } _py_oparg;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("opcode")]; } _py_opcode;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("open")]; } _py_open;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("opener")]; } _py_opener;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("operation")]; } _py_operation;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("optimize")]; } _py_optimize;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("options")]; } _py_options;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("order")]; } _py_order;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("out_fd")]; } _py_out_fd;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("outgoing")]; } _py_outgoing;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("overlapped")]; } _py_overlapped;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("owner")]; } _py_owner;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("p")]; } _py_p;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("pages")]; } _py_pages;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("parent")]; } _py_parent;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("password")]; } _py_password;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("path")]; } _py_path;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("pattern")]; } _py_pattern;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("peek")]; } _py_peek;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("persistent_id")]; } _py_persistent_id;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("persistent_load")]; } _py_persistent_load;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("person")]; } _py_person;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("pi_factory")]; } _py_pi_factory;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("pid")]; } _py_pid;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("policy")]; } _py_policy;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("pos")]; } _py_pos;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("pos1")]; } _py_pos1;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("pos2")]; } _py_pos2;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("posix")]; } _py_posix;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("print_file_and_line")]; } _py_print_file_and_line;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("priority")]; } _py_priority;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("progress")]; } _py_progress;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("progress_handler")]; } _py_progress_handler;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("proto")]; } _py_proto;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("protocol")]; } _py_protocol;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("ps1")]; } _py_ps1;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("ps2")]; } _py_ps2;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("query")]; } _py_query;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("quotetabs")]; } _py_quotetabs;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("r")]; } _py_r;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("raw")]; } _py_raw;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("read")]; } _py_read;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("read1")]; } _py_read1;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("readable")]; } _py_readable;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("readall")]; } _py_readall;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("readinto")]; } _py_readinto;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("readinto1")]; } _py_readinto1;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("readline")]; } _py_readline;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("readonly")]; } _py_readonly;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("real")]; } _py_real;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("reducer_override")]; } _py_reducer_override;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("registry")]; } _py_registry;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("rel_tol")]; } _py_rel_tol;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("reload")]; } _py_reload;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("repl")]; } _py_repl;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("replace")]; } _py_replace;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("reserved")]; } _py_reserved;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("reset")]; } _py_reset;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("resetids")]; } _py_resetids;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("return")]; } _py_return;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("reverse")]; } _py_reverse;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("reversed")]; } _py_reversed;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("s")]; } _py_s;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("salt")]; } _py_salt;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("sched_priority")]; } _py_sched_priority;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("scheduler")]; } _py_scheduler;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("seek")]; } _py_seek;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("seekable")]; } _py_seekable;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("selectors")]; } _py_selectors;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("self")]; } _py_self;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("send")]; } _py_send;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("sep")]; } _py_sep;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("sequence")]; } _py_sequence;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("server_hostname")]; } _py_server_hostname;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("server_side")]; } _py_server_side;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("session")]; } _py_session;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("setcomp")]; } _py_setcomp;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("setpgroup")]; } _py_setpgroup;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("setsid")]; } _py_setsid;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("setsigdef")]; } _py_setsigdef;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("setsigmask")]; } _py_setsigmask;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("setstate")]; } _py_setstate;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("shape")]; } _py_shape;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("show_cmd")]; } _py_show_cmd;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("signed")]; } _py_signed;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("size")]; } _py_size;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("sizehint")]; } _py_sizehint;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("skip_file_prefixes")]; } _py_skip_file_prefixes;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("sleep")]; } _py_sleep;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("sock")]; } _py_sock;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("sort")]; } _py_sort;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("sound")]; } _py_sound;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("source")]; } _py_source;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("source_traceback")]; } _py_source_traceback;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("src")]; } _py_src;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("src_dir_fd")]; } _py_src_dir_fd;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("stacklevel")]; } _py_stacklevel;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("start")]; } _py_start;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("statement")]; } _py_statement;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("status")]; } _py_status;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("stderr")]; } _py_stderr;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("stdin")]; } _py_stdin;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("stdout")]; } _py_stdout;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("step")]; } _py_step;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("store_name")]; } _py_store_name;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("strategy")]; } _py_strategy;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("strftime")]; } _py_strftime;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("strict")]; } _py_strict;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("strict_mode")]; } _py_strict_mode;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("string")]; } _py_string;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("sub_key")]; } _py_sub_key;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("symmetric_difference_update")]; } _py_symmetric_difference_update;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("tabsize")]; } _py_tabsize;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("tag")]; } _py_tag;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("target")]; } _py_target;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("target_is_directory")]; } _py_target_is_directory;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("task")]; } _py_task;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("tb_frame")]; } _py_tb_frame;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("tb_lasti")]; } _py_tb_lasti;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("tb_lineno")]; } _py_tb_lineno;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("tb_next")]; } _py_tb_next;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("tell")]; } _py_tell;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("template")]; } _py_template;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("term")]; } _py_term;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("text")]; } _py_text;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("threading")]; } _py_threading;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("throw")]; } _py_throw;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("timeout")]; } _py_timeout;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("times")]; } _py_times;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("timetuple")]; } _py_timetuple;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("top")]; } _py_top;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("trace_callback")]; } _py_trace_callback;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("traceback")]; } _py_traceback;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("trailers")]; } _py_trailers;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("translate")]; } _py_translate;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("true")]; } _py_true;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("truncate")]; } _py_truncate;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("twice")]; } _py_twice;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("txt")]; } _py_txt;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("type")]; } _py_type;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("tz")]; } _py_tz;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("tzname")]; } _py_tzname;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("uid")]; } _py_uid;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("unlink")]; } _py_unlink;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("unraisablehook")]; } _py_unraisablehook;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("uri")]; } _py_uri;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("usedforsecurity")]; } _py_usedforsecurity;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("value")]; } _py_value;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("values")]; } _py_values;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("version")]; } _py_version;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("volume")]; } _py_volume;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("warnings")]; } _py_warnings;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("warnoptions")]; } _py_warnoptions;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("wbits")]; } _py_wbits;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("week")]; } _py_week;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("weekday")]; } _py_weekday;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("which")]; } _py_which;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("who")]; } _py_who;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("withdata")]; } _py_withdata;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("writable")]; } _py_writable;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("write")]; } _py_write;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("write_through")]; } _py_write_through;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("x")]; } _py_x;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("year")]; } _py_year;
struct { PyASCIIObject _ascii; uint8_t _data[sizeof("zdict")]; } _py_zdict;
} identifiers;
struct {
PyASCIIObject _ascii;
uint8_t _data[2];
} ascii[128];
struct {
PyCompactUnicodeObject _latin1;
uint8_t _data[2];
} latin1[128];
};
typedef struct {
PyObject ob_base;
PyObject *md_dict;
PyModuleDef *md_def;
void *md_state;
PyObject *md_weaklist;
PyObject *md_name;
} PyModuleObject;
static inline PyModuleDef* _PyModule_GetDef(PyObject *mod) {
assert(PyObject_TypeCheck(((PyObject*)(((mod)))), (&PyModule_Type)));
return ((PyModuleObject *)mod)->md_def;
}
static inline void* _PyModule_GetState(PyObject* mod) {
assert(PyObject_TypeCheck(((PyObject*)(((mod)))), (&PyModule_Type)));
return ((PyModuleObject *)mod)->md_state;
}
static inline PyObject* _PyModule_GetDict(PyObject *mod) {
assert(PyObject_TypeCheck(((PyObject*)(((mod)))), (&PyModule_Type)));
PyObject *dict = ((PyModuleObject *)mod) -> md_dict;
assert(dict != 0);
return dict;
}
extern PyStatus _PyTypes_InitTypes(PyInterpreterState *);
extern void _PyTypes_FiniTypes(PyInterpreterState *);
extern void _PyTypes_Fini(PyInterpreterState *);
typedef struct wrapperbase pytype_slotdef;
struct type_cache_entry {
unsigned int version;
PyObject *name;
PyObject *value;
};
struct type_cache {
struct type_cache_entry hashtable[1 << 12];
};
typedef struct {
PyTypeObject *type;
PyObject *tp_subclasses;
PyObject *tp_weaklist;
} static_builtin_state;
static inline PyObject **
_PyStaticType_GET_WEAKREFS_LISTPTR(static_builtin_state *state)
{
assert(state != 0);
return &state->tp_weaklist;
}
static inline void *
_PyType_GetModuleState(PyTypeObject *type)
{
assert(PyType_Check(((PyObject*)((type)))));
assert(type->tp_flags & (1UL << 9));
PyHeapTypeObject *et = (PyHeapTypeObject *)type;
assert(et->ht_module);
PyModuleObject *mod = (PyModuleObject *)(et->ht_module);
assert(mod != 0);
return mod->md_state;
}
struct types_state {
struct type_cache type_cache;
size_t num_builtins_initialized;
static_builtin_state builtins[200];
};
extern int _PyStaticType_InitBuiltin(PyTypeObject *type);
extern static_builtin_state * _PyStaticType_GetState(PyTypeObject *);
extern void _PyStaticType_ClearWeakRefs(PyTypeObject *type);
extern void _PyStaticType_Dealloc(PyTypeObject *type);
PyObject *
_Py_type_getattro_impl(PyTypeObject *type, PyObject *name, int *suppress_missing_attribute);
PyObject *
_Py_type_getattro(PyTypeObject *type, PyObject *name);
PyObject *_Py_slot_tp_getattro(PyObject *self, PyObject *name);
PyObject *_Py_slot_tp_getattr_hook(PyObject *self, PyObject *name);
struct _Py_static_objects {
struct {
PyLongObject small_ints[5 + 257];
PyBytesObject bytes_empty;
struct {
PyBytesObject ob;
char eos;
} bytes_characters[256];
struct _Py_global_strings strings;
PyGC_Head _tuple_empty_gc_not_used;
PyTupleObject tuple_empty;
PyGC_Head _hamt_bitmap_node_empty_gc_not_used;
PyHamtNode_Bitmap hamt_bitmap_node_empty;
_PyContextTokenMissing context_token_missing;
} singletons;
};
struct _Py_interp_cached_objects {
PyObject *interned_strings;
PyObject *str_replace_inf;
PyObject *objreduce;
PyObject *type_slots_pname;
pytype_slotdef *type_slots_ptrs[10];
};
struct _Py_interp_static_objects {
struct {
int _not_used;
PyGC_Head _hamt_empty_gc_not_used;
PyHamtObject hamt_empty;
PyBaseExceptionObject last_resort_memory_error;
} singletons;
};
struct _py_object_runtime_state {
int _not_used;
};
struct _py_object_state {
int _not_used;
};
extern PyStatus _PyTuple_InitGlobalObjects(PyInterpreterState *);
extern PyStatus _PyTuple_InitTypes(PyInterpreterState *);
extern void _PyTuple_Fini(PyInterpreterState *);
struct _Py_tuple_state {
PyTupleObject *free_list[20];
int numfree[20];
};
extern PyObject *_PyTuple_FromArray(PyObject *const *, Py_ssize_t);
extern PyObject *_PyTuple_FromArraySteal(PyObject *const *, Py_ssize_t);
typedef struct {
PyObject ob_base;
Py_ssize_t it_index;
PyTupleObject *it_seq;
} _PyTupleIterObject;
struct _fileutils_state {
int force_ascii;
};
typedef enum {
_Py_ERROR_UNKNOWN=0,
_Py_ERROR_STRICT,
_Py_ERROR_SURROGATEESCAPE,
_Py_ERROR_REPLACE,
_Py_ERROR_IGNORE,
_Py_ERROR_BACKSLASHREPLACE,
_Py_ERROR_SURROGATEPASS,
_Py_ERROR_XMLCHARREFREPLACE,
_Py_ERROR_OTHER
} _Py_error_handler;
_Py_error_handler _Py_GetErrorHandler(const char *errors);
int _Py_DecodeLocaleEx(
const char *arg,
wchar_t **wstr,
size_t *wlen,
const char **reason,
int current_locale,
_Py_error_handler errors);
int _Py_EncodeLocaleEx(
const wchar_t *text,
char **str,
size_t *error_pos,
const char **reason,
int current_locale,
_Py_error_handler errors);
char* _Py_EncodeLocaleRaw(
const wchar_t *text,
size_t *error_pos);
PyObject * _Py_device_encoding(int);
int _Py_fstat(
int fd,
struct stat *status);
int _Py_fstat_noraise(
int fd,
struct stat *status);
int _Py_stat(
PyObject *path,
struct stat *status);
int _Py_open(
const char *pathname,
int flags);
int _Py_open_noraise(
const char *pathname,
int flags);
FILE * _Py_wfopen(
const wchar_t *path,
const wchar_t *mode);
Py_ssize_t _Py_read(
int fd,
void *buf,
size_t count);
Py_ssize_t _Py_write(
int fd,
const void *buf,
size_t count);
Py_ssize_t _Py_write_noraise(
int fd,
const void *buf,
size_t count);
int _Py_wreadlink(
const wchar_t *path,
wchar_t *buf,
size_t buflen);
wchar_t* _Py_wgetcwd(
wchar_t *buf,
size_t buflen);
int _Py_get_inheritable(int fd);
int _Py_set_inheritable(int fd, int inheritable,
int *atomic_flag_works);
int _Py_set_inheritable_async_safe(int fd, int inheritable,
int *atomic_flag_works);
int _Py_dup(int fd);
int _Py_get_blocking(int fd);
int _Py_set_blocking(int fd, int blocking);
extern int _Py_HasFileSystemDefaultEncodeErrors;
int _Py_DecodeUTF8Ex(
const char *arg,
Py_ssize_t arglen,
wchar_t **wstr,
size_t *wlen,
const char **reason,
_Py_error_handler errors);
int _Py_EncodeUTF8Ex(
const wchar_t *text,
char **str,
size_t *error_pos,
const char **reason,
int raw_malloc,
_Py_error_handler errors);
wchar_t* _Py_DecodeUTF8_surrogateescape(
const char *arg,
Py_ssize_t arglen,
size_t *wlen);
extern int
_Py_wstat(const wchar_t *, struct stat *);
int _Py_GetForceASCII(void);
void _Py_ResetForceASCII(void);
int _Py_GetLocaleconvNumeric(
struct lconv *lc,
PyObject **decimal_point,
PyObject **thousands_sep);
void _Py_closerange(int first, int last);
wchar_t* _Py_GetLocaleEncoding(void);
PyObject* _Py_GetLocaleEncodingObject(void);
extern int _Py_isabs(const wchar_t *path);
extern int _Py_abspath(const wchar_t *path, wchar_t **abspath_p);
extern wchar_t * _Py_join_relfile(const wchar_t *dirname,
const wchar_t *relfile);
extern int _Py_add_relfile(wchar_t *dirname,
const wchar_t *relfile,
size_t bufsize);
extern size_t _Py_find_basename(const wchar_t *filename);
wchar_t * _Py_normpath(wchar_t *path, Py_ssize_t size);
typedef struct {
int (*getname)(Py_UCS4 code, char* buffer, int buflen,
int with_alias_and_seq);
int (*getcode)(const char* name, int namelen, Py_UCS4* code,
int with_named_seq);
} _PyUnicode_Name_CAPI;
void _PyUnicode_ExactDealloc(PyObject *op);
extern void _PyUnicode_InitState(PyInterpreterState *);
extern PyStatus _PyUnicode_InitGlobalObjects(PyInterpreterState *);
extern PyStatus _PyUnicode_InitTypes(PyInterpreterState *);
extern void _PyUnicode_Fini(PyInterpreterState *);
extern void _PyUnicode_FiniTypes(PyInterpreterState *);
extern PyTypeObject _PyUnicodeASCIIIter_Type;
struct _Py_unicode_runtime_ids {
PyThread_type_lock lock;
Py_ssize_t next_index;
};
struct _Py_unicode_runtime_state {
struct _Py_unicode_runtime_ids ids;
};
struct _Py_unicode_fs_codec {
char *encoding;
int utf8;
char *errors;
_Py_error_handler error_handler;
};
struct _Py_unicode_ids {
Py_ssize_t size;
PyObject **array;
};
struct _Py_unicode_state {
struct _Py_unicode_fs_codec fs_codec;
_PyUnicode_Name_CAPI *ucnhash_capi;
struct _Py_unicode_ids ids;
};
extern void _PyUnicode_InternInPlace(PyInterpreterState *interp, PyObject **p);
extern void _PyUnicode_ClearInterned(PyInterpreterState *interp);
struct _warnings_runtime_state {
PyObject *filters;
PyObject *once_registry;
PyObject *default_action;
long filters_version;
};
extern int _PyWarnings_InitState(PyInterpreterState *interp);
PyObject* _PyWarnings_Init(void);
extern void _PyErr_WarnUnawaitedCoroutine(PyObject *coro);
typedef struct {
PyObject *func;
PyObject *args;
PyObject *kwargs;
} atexit_callback;
struct atexit_state {
atexit_callback **callbacks;
int ncallbacks;
int callback_len;
};
struct _Py_long_state {
int max_str_digits;
};
struct _is {
PyInterpreterState *next;
struct pythreads {
uint64_t next_unique_id;
PyThreadState *head;
long count;
size_t stacksize;
} threads;
struct pyruntimestate *runtime;
int64_t id;
int64_t id_refcount;
int requires_idref;
PyThread_type_lock id_mutex;
int _initialized;
int finalizing;
struct _ceval_state ceval;
struct _gc_runtime_state gc;
struct _import_state imports;
PyObject *sysdict;
PyObject *builtins;
PyObject *codec_search_path;
PyObject *codec_search_cache;
PyObject *codec_error_registry;
int codecs_initialized;
PyConfig config;
unsigned long feature_flags;
PyObject *dict;
PyObject *sysdict_copy;
PyObject *builtins_copy;
_PyFrameEvalFunction eval_frame;
PyFunction_WatchCallback func_watchers[8];
uint8_t active_func_watchers;
Py_ssize_t co_extra_user_count;
freefunc co_extra_freefuncs[255];
struct _warnings_runtime_state warnings;
struct atexit_state atexit;
PyObject *audit_hooks;
PyType_WatchCallback type_watchers[8];
PyCode_WatchCallback code_watchers[8];
uint8_t active_code_watchers;
struct _py_object_state object_state;
struct _Py_unicode_state unicode;
struct _Py_float_state float_state;
struct _Py_long_state long_state;
struct _dtoa_state dtoa;
struct _py_func_state func_state;
PySliceObject *slice_cache;
struct _Py_tuple_state tuple;
struct _Py_list_state list;
struct _Py_dict_state dict_state;
struct _Py_async_gen_state async_gen;
struct _Py_context_state context;
struct _Py_exc_state exc_state;
struct ast_state ast;
struct types_state types;
struct callable_cache callable_cache;
PyCodeObject *interpreter_trampoline;
struct _Py_interp_cached_objects cached_objects;
struct _Py_interp_static_objects static_objects;
PyThreadState _initial_thread;
};
extern void _PyInterpreterState_Clear(PyThreadState *tstate);
struct _xidregitem;
struct _xidregitem {
struct _xidregitem *prev;
struct _xidregitem *next;
PyObject *cls;
crossinterpdatafunc getdata;
};
PyInterpreterState* _PyInterpreterState_LookUpID(int64_t);
int _PyInterpreterState_IDInitref(PyInterpreterState *);
int _PyInterpreterState_IDIncref(PyInterpreterState *);
void _PyInterpreterState_IDDecref(PyInterpreterState *);
typedef PyOS_sighandler_t _Py_sighandler_t;
struct faulthandler_user_signal {
int enabled;
PyObject *file;
int fd;
int all_threads;
int chain;
_Py_sighandler_t previous;
PyInterpreterState *interp;
};
struct _faulthandler_runtime_state {
struct {
int enabled;
PyObject *file;
int fd;
int all_threads;
PyInterpreterState *interp;
} fatal_error;
struct {
PyObject *file;
int fd;
long long timeout_us;
int repeat;
PyInterpreterState *interp;
int exit;
char *header;
size_t header_len;
PyThread_type_lock cancel_event;
PyThread_type_lock running;
} thread;
struct faulthandler_user_signal *user_signals;
};
typedef struct _arena PyArena;
PyArena* _PyArena_New(void);
void _PyArena_Free(PyArena *);
void* _PyArena_Malloc(PyArena *, size_t size);
int _PyArena_AddPyObject(PyArena *, PyObject *);
typedef PyObject * identifier;
typedef PyObject * string;
typedef PyObject * object;
typedef PyObject * constant;
typedef struct {
Py_ssize_t size; void **elements;
} asdl_seq;
typedef struct {
Py_ssize_t size; void **elements;
void *typed_elements[1];
} asdl_generic_seq;
typedef struct {
Py_ssize_t size; void **elements;
PyObject *typed_elements[1];
} asdl_identifier_seq;
typedef struct {
Py_ssize_t size; void **elements;
int typed_elements[1];
} asdl_int_seq;
asdl_generic_seq *_Py_asdl_generic_seq_new(Py_ssize_t size, PyArena *arena);
asdl_identifier_seq *_Py_asdl_identifier_seq_new(Py_ssize_t size, PyArena *arena);
asdl_int_seq *_Py_asdl_int_seq_new(Py_ssize_t size, PyArena *arena);
typedef struct _mod *mod_ty;
typedef struct _stmt *stmt_ty;
typedef struct _expr *expr_ty;
typedef enum _expr_context { Load=1, Store=2, Del=3 } expr_context_ty;
typedef enum _boolop { And=1, Or=2 } boolop_ty;
typedef enum _operator { Add=1, Sub=2, Mult=3, MatMult=4, Div=5, Mod=6, Pow=7,
LShift=8, RShift=9, BitOr=10, BitXor=11, BitAnd=12,
FloorDiv=13 } operator_ty;
typedef enum _unaryop { Invert=1, Not=2, UAdd=3, USub=4 } unaryop_ty;
typedef enum _cmpop { Eq=1, NotEq=2, Lt=3, LtE=4, Gt=5, GtE=6, Is=7, IsNot=8,
In=9, NotIn=10 } cmpop_ty;
typedef struct _comprehension *comprehension_ty;
typedef struct _excepthandler *excepthandler_ty;
typedef struct _arguments *arguments_ty;
typedef struct _arg *arg_ty;
typedef struct _keyword *keyword_ty;
typedef struct _alias *alias_ty;
typedef struct _withitem *withitem_ty;
typedef struct _match_case *match_case_ty;
typedef struct _pattern *pattern_ty;
typedef struct _type_ignore *type_ignore_ty;
typedef struct {
Py_ssize_t size; void **elements;
mod_ty typed_elements[1];
} asdl_mod_seq;
asdl_mod_seq *_Py_asdl_mod_seq_new(Py_ssize_t size, PyArena *arena);
typedef struct {
Py_ssize_t size; void **elements;
stmt_ty typed_elements[1];
} asdl_stmt_seq;
asdl_stmt_seq *_Py_asdl_stmt_seq_new(Py_ssize_t size, PyArena *arena);
typedef struct {
Py_ssize_t size; void **elements;
expr_ty typed_elements[1];
} asdl_expr_seq;
asdl_expr_seq *_Py_asdl_expr_seq_new(Py_ssize_t size, PyArena *arena);
typedef struct {
Py_ssize_t size; void **elements;
comprehension_ty typed_elements[1];
} asdl_comprehension_seq;
asdl_comprehension_seq *_Py_asdl_comprehension_seq_new(Py_ssize_t size, PyArena
*arena);
typedef struct {
Py_ssize_t size; void **elements;
excepthandler_ty typed_elements[1];
} asdl_excepthandler_seq;
asdl_excepthandler_seq *_Py_asdl_excepthandler_seq_new(Py_ssize_t size, PyArena
*arena);
typedef struct {
Py_ssize_t size; void **elements;
arguments_ty typed_elements[1];
} asdl_arguments_seq;
asdl_arguments_seq *_Py_asdl_arguments_seq_new(Py_ssize_t size, PyArena *arena);
typedef struct {
Py_ssize_t size; void **elements;
arg_ty typed_elements[1];
} asdl_arg_seq;
asdl_arg_seq *_Py_asdl_arg_seq_new(Py_ssize_t size, PyArena *arena);
typedef struct {
Py_ssize_t size; void **elements;
keyword_ty typed_elements[1];
} asdl_keyword_seq;
asdl_keyword_seq *_Py_asdl_keyword_seq_new(Py_ssize_t size, PyArena *arena);
typedef struct {
Py_ssize_t size; void **elements;
alias_ty typed_elements[1];
} asdl_alias_seq;
asdl_alias_seq *_Py_asdl_alias_seq_new(Py_ssize_t size, PyArena *arena);
typedef struct {
Py_ssize_t size; void **elements;
withitem_ty typed_elements[1];
} asdl_withitem_seq;
asdl_withitem_seq *_Py_asdl_withitem_seq_new(Py_ssize_t size, PyArena *arena);
typedef struct {
Py_ssize_t size; void **elements;
match_case_ty typed_elements[1];
} asdl_match_case_seq;
asdl_match_case_seq *_Py_asdl_match_case_seq_new(Py_ssize_t size, PyArena
*arena);
typedef struct {
Py_ssize_t size; void **elements;
pattern_ty typed_elements[1];
} asdl_pattern_seq;
asdl_pattern_seq *_Py_asdl_pattern_seq_new(Py_ssize_t size, PyArena *arena);
typedef struct {
Py_ssize_t size; void **elements;
type_ignore_ty typed_elements[1];
} asdl_type_ignore_seq;
asdl_type_ignore_seq *_Py_asdl_type_ignore_seq_new(Py_ssize_t size, PyArena
*arena);
enum _mod_kind {Module_kind=1, Interactive_kind=2, Expression_kind=3,
FunctionType_kind=4};
struct _mod {
enum _mod_kind kind;
union {
struct {
asdl_stmt_seq *body;
asdl_type_ignore_seq *type_ignores;
} Module;
struct {
asdl_stmt_seq *body;
} Interactive;
struct {
expr_ty body;
} Expression;
struct {
asdl_expr_seq *argtypes;
expr_ty returns;
} FunctionType;
} v;
};
enum _stmt_kind {FunctionDef_kind=1, AsyncFunctionDef_kind=2, ClassDef_kind=3,
Return_kind=4, Delete_kind=5, Assign_kind=6,
AugAssign_kind=7, AnnAssign_kind=8, For_kind=9,
AsyncFor_kind=10, While_kind=11, If_kind=12, With_kind=13,
AsyncWith_kind=14, Match_kind=15, Raise_kind=16, Try_kind=17,
TryStar_kind=18, Assert_kind=19, Import_kind=20,
ImportFrom_kind=21, Global_kind=22, Nonlocal_kind=23,
Expr_kind=24, Pass_kind=25, Break_kind=26, Continue_kind=27};
struct _stmt {
enum _stmt_kind kind;
union {
struct {
identifier name;
arguments_ty args;
asdl_stmt_seq *body;
asdl_expr_seq *decorator_list;
expr_ty returns;
string type_comment;
} FunctionDef;
struct {
identifier name;
arguments_ty args;
asdl_stmt_seq *body;
asdl_expr_seq *decorator_list;
expr_ty returns;
string type_comment;
} AsyncFunctionDef;
struct {
identifier name;
asdl_expr_seq *bases;
asdl_keyword_seq *keywords;
asdl_stmt_seq *body;
asdl_expr_seq *decorator_list;
} ClassDef;
struct {
expr_ty value;
} Return;
struct {
asdl_expr_seq *targets;
} Delete;
struct {
asdl_expr_seq *targets;
expr_ty value;
string type_comment;
} Assign;
struct {
expr_ty target;
operator_ty op;
expr_ty value;
} AugAssign;
struct {
expr_ty target;
expr_ty annotation;
expr_ty value;
int simple;
} AnnAssign;
struct {
expr_ty target;
expr_ty iter;
asdl_stmt_seq *body;
asdl_stmt_seq *orelse;
string type_comment;
} For;
struct {
expr_ty target;
expr_ty iter;
asdl_stmt_seq *body;
asdl_stmt_seq *orelse;
string type_comment;
} AsyncFor;
struct {
expr_ty test;
asdl_stmt_seq *body;
asdl_stmt_seq *orelse;
} While;
struct {
expr_ty test;
asdl_stmt_seq *body;
asdl_stmt_seq *orelse;
} If;
struct {
asdl_withitem_seq *items;
asdl_stmt_seq *body;
string type_comment;
} With;
struct {
asdl_withitem_seq *items;
asdl_stmt_seq *body;
string type_comment;
} AsyncWith;
struct {
expr_ty subject;
asdl_match_case_seq *cases;
} Match;
struct {
expr_ty exc;
expr_ty cause;
} Raise;
struct {
asdl_stmt_seq *body;
asdl_excepthandler_seq *handlers;
asdl_stmt_seq *orelse;
asdl_stmt_seq *finalbody;
} Try;
struct {
asdl_stmt_seq *body;
asdl_excepthandler_seq *handlers;
asdl_stmt_seq *orelse;
asdl_stmt_seq *finalbody;
} TryStar;
struct {
expr_ty test;
expr_ty msg;
} Assert;
struct {
asdl_alias_seq *names;
} Import;
struct {
identifier module;
asdl_alias_seq *names;
int level;
} ImportFrom;
struct {
asdl_identifier_seq *names;
} Global;
struct {
asdl_identifier_seq *names;
} Nonlocal;
struct {
expr_ty value;
} Expr;
} v;
int lineno;
int col_offset;
int end_lineno;
int end_col_offset;
};
enum _expr_kind {BoolOp_kind=1, NamedExpr_kind=2, BinOp_kind=3, UnaryOp_kind=4,
Lambda_kind=5, IfExp_kind=6, Dict_kind=7, Set_kind=8,
ListComp_kind=9, SetComp_kind=10, DictComp_kind=11,
GeneratorExp_kind=12, Await_kind=13, Yield_kind=14,
YieldFrom_kind=15, Compare_kind=16, Call_kind=17,
FormattedValue_kind=18, JoinedStr_kind=19, Constant_kind=20,
Attribute_kind=21, Subscript_kind=22, Starred_kind=23,
Name_kind=24, List_kind=25, Tuple_kind=26, Slice_kind=27};
struct _expr {
enum _expr_kind kind;
union {
struct {
boolop_ty op;
asdl_expr_seq *values;
} BoolOp;
struct {
expr_ty target;
expr_ty value;
} NamedExpr;
struct {
expr_ty left;
operator_ty op;
expr_ty right;
} BinOp;
struct {
unaryop_ty op;
expr_ty operand;
} UnaryOp;
struct {
arguments_ty args;
expr_ty body;
} Lambda;
struct {
expr_ty test;
expr_ty body;
expr_ty orelse;
} IfExp;
struct {
asdl_expr_seq *keys;
asdl_expr_seq *values;
} Dict;
struct {
asdl_expr_seq *elts;
} Set;
struct {
expr_ty elt;
asdl_comprehension_seq *generators;
} ListComp;
struct {
expr_ty elt;
asdl_comprehension_seq *generators;
} SetComp;
struct {
expr_ty key;
expr_ty value;
asdl_comprehension_seq *generators;
} DictComp;
struct {
expr_ty elt;
asdl_comprehension_seq *generators;
} GeneratorExp;
struct {
expr_ty value;
} Await;
struct {
expr_ty value;
} Yield;
struct {
expr_ty value;
} YieldFrom;
struct {
expr_ty left;
asdl_int_seq *ops;
asdl_expr_seq *comparators;
} Compare;
struct {
expr_ty func;
asdl_expr_seq *args;
asdl_keyword_seq *keywords;
} Call;
struct {
expr_ty value;
int conversion;
expr_ty format_spec;
} FormattedValue;
struct {
asdl_expr_seq *values;
} JoinedStr;
struct {
constant value;
string kind;
} Constant;
struct {
expr_ty value;
identifier attr;
expr_context_ty ctx;
} Attribute;
struct {
expr_ty value;
expr_ty slice;
expr_context_ty ctx;
} Subscript;
struct {
expr_ty value;
expr_context_ty ctx;
} Starred;
struct {
identifier id;
expr_context_ty ctx;
} Name;
struct {
asdl_expr_seq *elts;
expr_context_ty ctx;
} List;
struct {
asdl_expr_seq *elts;
expr_context_ty ctx;
} Tuple;
struct {
expr_ty lower;
expr_ty upper;
expr_ty step;
} Slice;
} v;
int lineno;
int col_offset;
int end_lineno;
int end_col_offset;
};
struct _comprehension {
expr_ty target;
expr_ty iter;
asdl_expr_seq *ifs;
int is_async;
};
enum _excepthandler_kind {ExceptHandler_kind=1};
struct _excepthandler {
enum _excepthandler_kind kind;
union {
struct {
expr_ty type;
identifier name;
asdl_stmt_seq *body;
} ExceptHandler;
} v;
int lineno;
int col_offset;
int end_lineno;
int end_col_offset;
};
struct _arguments {
asdl_arg_seq *posonlyargs;
asdl_arg_seq *args;
arg_ty vararg;
asdl_arg_seq *kwonlyargs;
asdl_expr_seq *kw_defaults;
arg_ty kwarg;
asdl_expr_seq *defaults;
};
struct _arg {
identifier arg;
expr_ty annotation;
string type_comment;
int lineno;
int col_offset;
int end_lineno;
int end_col_offset;
};
struct _keyword {
identifier arg;
expr_ty value;
int lineno;
int col_offset;
int end_lineno;
int end_col_offset;
};
struct _alias {
identifier name;
identifier asname;
int lineno;
int col_offset;
int end_lineno;
int end_col_offset;
};
struct _withitem {
expr_ty context_expr;
expr_ty optional_vars;
};
struct _match_case {
pattern_ty pattern;
expr_ty guard;
asdl_stmt_seq *body;
};
enum _pattern_kind {MatchValue_kind=1, MatchSingleton_kind=2,
MatchSequence_kind=3, MatchMapping_kind=4,
MatchClass_kind=5, MatchStar_kind=6, MatchAs_kind=7,
MatchOr_kind=8};
struct _pattern {
enum _pattern_kind kind;
union {
struct {
expr_ty value;
} MatchValue;
struct {
constant value;
} MatchSingleton;
struct {
asdl_pattern_seq *patterns;
} MatchSequence;
struct {
asdl_expr_seq *keys;
asdl_pattern_seq *patterns;
identifier rest;
} MatchMapping;
struct {
expr_ty cls;
asdl_pattern_seq *patterns;
asdl_identifier_seq *kwd_attrs;
asdl_pattern_seq *kwd_patterns;
} MatchClass;
struct {
identifier name;
} MatchStar;
struct {
pattern_ty pattern;
identifier name;
} MatchAs;
struct {
asdl_pattern_seq *patterns;
} MatchOr;
} v;
int lineno;
int col_offset;
int end_lineno;
int end_col_offset;
};
enum _type_ignore_kind {TypeIgnore_kind=1};
struct _type_ignore {
enum _type_ignore_kind kind;
union {
struct {
int lineno;
string tag;
} TypeIgnore;
} v;
};
mod_ty _PyAST_Module(asdl_stmt_seq * body, asdl_type_ignore_seq * type_ignores,
PyArena *arena);
mod_ty _PyAST_Interactive(asdl_stmt_seq * body, PyArena *arena);
mod_ty _PyAST_Expression(expr_ty body, PyArena *arena);
mod_ty _PyAST_FunctionType(asdl_expr_seq * argtypes, expr_ty returns, PyArena
*arena);
stmt_ty _PyAST_FunctionDef(identifier name, arguments_ty args, asdl_stmt_seq *
body, asdl_expr_seq * decorator_list, expr_ty
returns, string type_comment, int lineno, int
col_offset, int end_lineno, int end_col_offset,
PyArena *arena);
stmt_ty _PyAST_AsyncFunctionDef(identifier name, arguments_ty args,
asdl_stmt_seq * body, asdl_expr_seq *
decorator_list, expr_ty returns, string
type_comment, int lineno, int col_offset, int
end_lineno, int end_col_offset, PyArena *arena);
stmt_ty _PyAST_ClassDef(identifier name, asdl_expr_seq * bases,
asdl_keyword_seq * keywords, asdl_stmt_seq * body,
asdl_expr_seq * decorator_list, int lineno, int
col_offset, int end_lineno, int end_col_offset, PyArena
*arena);
stmt_ty _PyAST_Return(expr_ty value, int lineno, int col_offset, int
end_lineno, int end_col_offset, PyArena *arena);
stmt_ty _PyAST_Delete(asdl_expr_seq * targets, int lineno, int col_offset, int
end_lineno, int end_col_offset, PyArena *arena);
stmt_ty _PyAST_Assign(asdl_expr_seq * targets, expr_ty value, string
type_comment, int lineno, int col_offset, int end_lineno,
int end_col_offset, PyArena *arena);
stmt_ty _PyAST_AugAssign(expr_ty target, operator_ty op, expr_ty value, int
lineno, int col_offset, int end_lineno, int
end_col_offset, PyArena *arena);
stmt_ty _PyAST_AnnAssign(expr_ty target, expr_ty annotation, expr_ty value, int
simple, int lineno, int col_offset, int end_lineno,
int end_col_offset, PyArena *arena);
stmt_ty _PyAST_For(expr_ty target, expr_ty iter, asdl_stmt_seq * body,
asdl_stmt_seq * orelse, string type_comment, int lineno, int
col_offset, int end_lineno, int end_col_offset, PyArena
*arena);
stmt_ty _PyAST_AsyncFor(expr_ty target, expr_ty iter, asdl_stmt_seq * body,
asdl_stmt_seq * orelse, string type_comment, int
lineno, int col_offset, int end_lineno, int
end_col_offset, PyArena *arena);
stmt_ty _PyAST_While(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq *
orelse, int lineno, int col_offset, int end_lineno, int
end_col_offset, PyArena *arena);
stmt_ty _PyAST_If(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * orelse,
int lineno, int col_offset, int end_lineno, int
end_col_offset, PyArena *arena);
stmt_ty _PyAST_With(asdl_withitem_seq * items, asdl_stmt_seq * body, string
type_comment, int lineno, int col_offset, int end_lineno,
int end_col_offset, PyArena *arena);
stmt_ty _PyAST_AsyncWith(asdl_withitem_seq * items, asdl_stmt_seq * body,
string type_comment, int lineno, int col_offset, int
end_lineno, int end_col_offset, PyArena *arena);
stmt_ty _PyAST_Match(expr_ty subject, asdl_match_case_seq * cases, int lineno,
int col_offset, int end_lineno, int end_col_offset,
PyArena *arena);
stmt_ty _PyAST_Raise(expr_ty exc, expr_ty cause, int lineno, int col_offset,
int end_lineno, int end_col_offset, PyArena *arena);
stmt_ty _PyAST_Try(asdl_stmt_seq * body, asdl_excepthandler_seq * handlers,
asdl_stmt_seq * orelse, asdl_stmt_seq * finalbody, int
lineno, int col_offset, int end_lineno, int end_col_offset,
PyArena *arena);
stmt_ty _PyAST_TryStar(asdl_stmt_seq * body, asdl_excepthandler_seq * handlers,
asdl_stmt_seq * orelse, asdl_stmt_seq * finalbody, int
lineno, int col_offset, int end_lineno, int
end_col_offset, PyArena *arena);
stmt_ty _PyAST_Assert(expr_ty test, expr_ty msg, int lineno, int col_offset,
int end_lineno, int end_col_offset, PyArena *arena);
stmt_ty _PyAST_Import(asdl_alias_seq * names, int lineno, int col_offset, int
end_lineno, int end_col_offset, PyArena *arena);
stmt_ty _PyAST_ImportFrom(identifier module, asdl_alias_seq * names, int level,
int lineno, int col_offset, int end_lineno, int
end_col_offset, PyArena *arena);
stmt_ty _PyAST_Global(asdl_identifier_seq * names, int lineno, int col_offset,
int end_lineno, int end_col_offset, PyArena *arena);
stmt_ty _PyAST_Nonlocal(asdl_identifier_seq * names, int lineno, int
col_offset, int end_lineno, int end_col_offset, PyArena
*arena);
stmt_ty _PyAST_Expr(expr_ty value, int lineno, int col_offset, int end_lineno,
int end_col_offset, PyArena *arena);
stmt_ty _PyAST_Pass(int lineno, int col_offset, int end_lineno, int
end_col_offset, PyArena *arena);
stmt_ty _PyAST_Break(int lineno, int col_offset, int end_lineno, int
end_col_offset, PyArena *arena);
stmt_ty _PyAST_Continue(int lineno, int col_offset, int end_lineno, int
end_col_offset, PyArena *arena);
expr_ty _PyAST_BoolOp(boolop_ty op, asdl_expr_seq * values, int lineno, int
col_offset, int end_lineno, int end_col_offset, PyArena
*arena);
expr_ty _PyAST_NamedExpr(expr_ty target, expr_ty value, int lineno, int
col_offset, int end_lineno, int end_col_offset,
PyArena *arena);
expr_ty _PyAST_BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno,
int col_offset, int end_lineno, int end_col_offset,
PyArena *arena);
expr_ty _PyAST_UnaryOp(unaryop_ty op, expr_ty operand, int lineno, int
col_offset, int end_lineno, int end_col_offset, PyArena
*arena);
expr_ty _PyAST_Lambda(arguments_ty args, expr_ty body, int lineno, int
col_offset, int end_lineno, int end_col_offset, PyArena
*arena);
expr_ty _PyAST_IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno,
int col_offset, int end_lineno, int end_col_offset,
PyArena *arena);
expr_ty _PyAST_Dict(asdl_expr_seq * keys, asdl_expr_seq * values, int lineno,
int col_offset, int end_lineno, int end_col_offset, PyArena
*arena);
expr_ty _PyAST_Set(asdl_expr_seq * elts, int lineno, int col_offset, int
end_lineno, int end_col_offset, PyArena *arena);
expr_ty _PyAST_ListComp(expr_ty elt, asdl_comprehension_seq * generators, int
lineno, int col_offset, int end_lineno, int
end_col_offset, PyArena *arena);
expr_ty _PyAST_SetComp(expr_ty elt, asdl_comprehension_seq * generators, int
lineno, int col_offset, int end_lineno, int
end_col_offset, PyArena *arena);
expr_ty _PyAST_DictComp(expr_ty key, expr_ty value, asdl_comprehension_seq *
generators, int lineno, int col_offset, int end_lineno,
int end_col_offset, PyArena *arena);
expr_ty _PyAST_GeneratorExp(expr_ty elt, asdl_comprehension_seq * generators,
int lineno, int col_offset, int end_lineno, int
end_col_offset, PyArena *arena);
expr_ty _PyAST_Await(expr_ty value, int lineno, int col_offset, int end_lineno,
int end_col_offset, PyArena *arena);
expr_ty _PyAST_Yield(expr_ty value, int lineno, int col_offset, int end_lineno,
int end_col_offset, PyArena *arena);
expr_ty _PyAST_YieldFrom(expr_ty value, int lineno, int col_offset, int
end_lineno, int end_col_offset, PyArena *arena);
expr_ty _PyAST_Compare(expr_ty left, asdl_int_seq * ops, asdl_expr_seq *
comparators, int lineno, int col_offset, int end_lineno,
int end_col_offset, PyArena *arena);
expr_ty _PyAST_Call(expr_ty func, asdl_expr_seq * args, asdl_keyword_seq *
keywords, int lineno, int col_offset, int end_lineno, int
end_col_offset, PyArena *arena);
expr_ty _PyAST_FormattedValue(expr_ty value, int conversion, expr_ty
format_spec, int lineno, int col_offset, int
end_lineno, int end_col_offset, PyArena *arena);
expr_ty _PyAST_JoinedStr(asdl_expr_seq * values, int lineno, int col_offset,
int end_lineno, int end_col_offset, PyArena *arena);
expr_ty _PyAST_Constant(constant value, string kind, int lineno, int
col_offset, int end_lineno, int end_col_offset, PyArena
*arena);
expr_ty _PyAST_Attribute(expr_ty value, identifier attr, expr_context_ty ctx,
int lineno, int col_offset, int end_lineno, int
end_col_offset, PyArena *arena);
expr_ty _PyAST_Subscript(expr_ty value, expr_ty slice, expr_context_ty ctx, int
lineno, int col_offset, int end_lineno, int
end_col_offset, PyArena *arena);
expr_ty _PyAST_Starred(expr_ty value, expr_context_ty ctx, int lineno, int
col_offset, int end_lineno, int end_col_offset, PyArena
*arena);
expr_ty _PyAST_Name(identifier id, expr_context_ty ctx, int lineno, int
col_offset, int end_lineno, int end_col_offset, PyArena
*arena);
expr_ty _PyAST_List(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int
col_offset, int end_lineno, int end_col_offset, PyArena
*arena);
expr_ty _PyAST_Tuple(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int
col_offset, int end_lineno, int end_col_offset, PyArena
*arena);
expr_ty _PyAST_Slice(expr_ty lower, expr_ty upper, expr_ty step, int lineno,
int col_offset, int end_lineno, int end_col_offset,
PyArena *arena);
comprehension_ty _PyAST_comprehension(expr_ty target, expr_ty iter,
asdl_expr_seq * ifs, int is_async,
PyArena *arena);
excepthandler_ty _PyAST_ExceptHandler(expr_ty type, identifier name,
asdl_stmt_seq * body, int lineno, int
col_offset, int end_lineno, int
end_col_offset, PyArena *arena);
arguments_ty _PyAST_arguments(asdl_arg_seq * posonlyargs, asdl_arg_seq * args,
arg_ty vararg, asdl_arg_seq * kwonlyargs,
asdl_expr_seq * kw_defaults, arg_ty kwarg,
asdl_expr_seq * defaults, PyArena *arena);
arg_ty _PyAST_arg(identifier arg, expr_ty annotation, string type_comment, int
lineno, int col_offset, int end_lineno, int end_col_offset,
PyArena *arena);
keyword_ty _PyAST_keyword(identifier arg, expr_ty value, int lineno, int
col_offset, int end_lineno, int end_col_offset,
PyArena *arena);
alias_ty _PyAST_alias(identifier name, identifier asname, int lineno, int
col_offset, int end_lineno, int end_col_offset, PyArena
*arena);
withitem_ty _PyAST_withitem(expr_ty context_expr, expr_ty optional_vars,
PyArena *arena);
match_case_ty _PyAST_match_case(pattern_ty pattern, expr_ty guard,
asdl_stmt_seq * body, PyArena *arena);
pattern_ty _PyAST_MatchValue(expr_ty value, int lineno, int col_offset, int
end_lineno, int end_col_offset, PyArena *arena);
pattern_ty _PyAST_MatchSingleton(constant value, int lineno, int col_offset,
int end_lineno, int end_col_offset, PyArena
*arena);
pattern_ty _PyAST_MatchSequence(asdl_pattern_seq * patterns, int lineno, int
col_offset, int end_lineno, int end_col_offset,
PyArena *arena);
pattern_ty _PyAST_MatchMapping(asdl_expr_seq * keys, asdl_pattern_seq *
patterns, identifier rest, int lineno, int
col_offset, int end_lineno, int end_col_offset,
PyArena *arena);
pattern_ty _PyAST_MatchClass(expr_ty cls, asdl_pattern_seq * patterns,
asdl_identifier_seq * kwd_attrs, asdl_pattern_seq
* kwd_patterns, int lineno, int col_offset, int
end_lineno, int end_col_offset, PyArena *arena);
pattern_ty _PyAST_MatchStar(identifier name, int lineno, int col_offset, int
end_lineno, int end_col_offset, PyArena *arena);
pattern_ty _PyAST_MatchAs(pattern_ty pattern, identifier name, int lineno, int
col_offset, int end_lineno, int end_col_offset,
PyArena *arena);
pattern_ty _PyAST_MatchOr(asdl_pattern_seq * patterns, int lineno, int
col_offset, int end_lineno, int end_col_offset,
PyArena *arena);
type_ignore_ty _PyAST_TypeIgnore(int lineno, string tag, PyArena *arena);
PyObject* PyAST_mod2obj(mod_ty t);
mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode);
int PyAST_Check(PyObject* obj);
extern int _PyAST_Validate(mod_ty);
extern PyObject* _PyAST_ExprAsUnicode(expr_ty);
extern PyObject* _PyAST_GetDocString(asdl_stmt_seq *);
struct _parser_runtime_state {
int _not_used;
struct _expr dummy_name;
};
extern struct _mod* _PyParser_ASTFromString(
const char *str,
PyObject* filename,
int mode,
PyCompilerFlags *flags,
PyArena *arena);
extern struct _mod* _PyParser_ASTFromFile(
FILE *fp,
PyObject *filename_ob,
const char *enc,
int mode,
const char *ps1,
const char *ps2,
PyCompilerFlags *flags,
int *errcode,
PyArena *arena);
typedef struct {
char api_id;
PyMemAllocatorEx alloc;
} debug_alloc_api_t;
struct _pymem_allocators {
struct {
PyMemAllocatorEx raw;
PyMemAllocatorEx mem;
PyMemAllocatorEx obj;
} standard;
struct {
debug_alloc_api_t raw;
debug_alloc_api_t mem;
debug_alloc_api_t obj;
} debug;
PyObjectArenaAllocator obj_arena;
};
int _PyMem_SetDefaultAllocator(
PyMemAllocatorDomain domain,
PyMemAllocatorEx *old_alloc);
static inline int _PyMem_IsPtrFreed(const void *ptr)
{
uintptr_t value = (uintptr_t)ptr;
return (value == 0
|| value == (uintptr_t)0xCDCDCDCD
|| value == (uintptr_t)0xDDDDDDDD
|| value == (uintptr_t)0xFDFDFDFD);
}
int _PyMem_GetAllocatorName(
const char *name,
PyMemAllocatorName *allocator);
int _PyMem_SetupAllocators(PyMemAllocatorName allocator);
struct pyhash_runtime_state {
struct {
int fd;
dev_t st_dev;
ino_t st_ino;
} urandom_cache;
};
uint64_t _Py_KeyedHash(uint64_t, const char *, Py_ssize_t);
struct py_stub_tls_entry {
bool in_use;
void *value;
};
struct _pythread_runtime_state {
int initialized;
struct {
pthread_condattr_t *ptr;
} _condattr_monotonic;
struct {
struct py_stub_tls_entry tls_entries[PTHREAD_KEYS_MAX];
} stubs;
};
typedef unsigned int pymem_uint;
typedef uint8_t pymem_block;
struct pool_header {
union { pymem_block *_padding;
pymem_uint count; } ref;
pymem_block *freeblock;
struct pool_header *nextpool;
struct pool_header *prevpool;
pymem_uint arenaindex;
pymem_uint szidx;
pymem_uint nextoffset;
pymem_uint maxnextoffset;
};
typedef struct pool_header *poolp;
struct arena_object {
uintptr_t address;
pymem_block* pool_address;
pymem_uint nfreepools;
pymem_uint ntotalpools;
struct pool_header* freepools;
struct arena_object* nextarena;
struct arena_object* prevarena;
};
struct _obmalloc_pools {
poolp used[(2 * (((512 / 8) + 7) / 8) * 8)];
};
struct _obmalloc_mgmt {
struct arena_object* arenas;
pymem_uint maxarenas;
struct arena_object* unused_arena_objects;
struct arena_object* usable_arenas;
struct arena_object* nfp2lasta[((1 << 18) / (1 << 12)) + 1];
size_t narenas_currently_allocated;
size_t ntimes_arena_allocated;
size_t narenas_highwater;
Py_ssize_t raw_allocated_blocks;
};
typedef struct {
int32_t tail_hi;
int32_t tail_lo;
} arena_coverage_t;
typedef struct arena_map_bot {
arena_coverage_t arenas[(1 << ((32 - 0) - 18 - 2*0))];
} arena_map_bot_t;
struct _obmalloc_usage {
arena_map_bot_t arena_map_root;
};
struct _obmalloc_state {
int dump_debug_stats;
struct _obmalloc_pools pools;
struct _obmalloc_mgmt mgmt;
struct _obmalloc_usage usage;
};
void *_PyObject_VirtualAlloc(size_t size);
void _PyObject_VirtualFree(void *, size_t size);
Py_ssize_t _Py_GetAllocatedBlocks(void);
struct _signals_runtime_state {
volatile struct {
_Py_atomic_int tripped;
_Py_atomic_address func;
} handlers[64];
volatile struct {
sig_atomic_t fd;
int warn_on_full_buffer;
} wakeup;
_Py_atomic_int is_tripped;
PyObject *default_handler;
PyObject *ignore_handler;
int unhandled_keyboard_interrupt;
};
struct _time_runtime_state {
int ticks_per_second_initialized;
long ticks_per_second;
};
typedef struct _Py_slist_item_s {
struct _Py_slist_item_s *next;
} _Py_slist_item_t;
typedef struct {
_Py_slist_item_t *head;
} _Py_slist_t;
typedef struct {
_Py_slist_item_t _Py_slist_item;
Py_uhash_t key_hash;
void *key;
void *value;
} _Py_hashtable_entry_t;
struct _Py_hashtable_t;
typedef struct _Py_hashtable_t _Py_hashtable_t;
typedef Py_uhash_t (*_Py_hashtable_hash_func) (const void *key);
typedef int (*_Py_hashtable_compare_func) (const void *key1, const void *key2);
typedef void (*_Py_hashtable_destroy_func) (void *key);
typedef _Py_hashtable_entry_t* (*_Py_hashtable_get_entry_func)(_Py_hashtable_t *ht,
const void *key);
typedef struct {
void* (*malloc) (size_t size);
void (*free) (void *ptr);
} _Py_hashtable_allocator_t;
struct _Py_hashtable_t {
size_t nentries;
size_t nbuckets;
_Py_slist_t *buckets;
_Py_hashtable_get_entry_func get_entry_func;
_Py_hashtable_hash_func hash_func;
_Py_hashtable_compare_func compare_func;
_Py_hashtable_destroy_func key_destroy_func;
_Py_hashtable_destroy_func value_destroy_func;
_Py_hashtable_allocator_t alloc;
};
Py_uhash_t _Py_hashtable_hash_ptr(const void *key);
int _Py_hashtable_compare_direct(
const void *key1,
const void *key2);
_Py_hashtable_t * _Py_hashtable_new(
_Py_hashtable_hash_func hash_func,
_Py_hashtable_compare_func compare_func);
_Py_hashtable_t * _Py_hashtable_new_full(
_Py_hashtable_hash_func hash_func,
_Py_hashtable_compare_func compare_func,
_Py_hashtable_destroy_func key_destroy_func,
_Py_hashtable_destroy_func value_destroy_func,
_Py_hashtable_allocator_t *allocator);
void _Py_hashtable_destroy(_Py_hashtable_t *ht);
void _Py_hashtable_clear(_Py_hashtable_t *ht);
typedef int (*_Py_hashtable_foreach_func) (_Py_hashtable_t *ht,
const void *key, const void *value,
void *user_data);
int _Py_hashtable_foreach(
_Py_hashtable_t *ht,
_Py_hashtable_foreach_func func,
void *user_data);
size_t _Py_hashtable_size(const _Py_hashtable_t *ht);
int _Py_hashtable_set(
_Py_hashtable_t *ht,
const void *key,
void *value);
static inline _Py_hashtable_entry_t *
_Py_hashtable_get_entry(_Py_hashtable_t *ht, const void *key)
{
return ht->get_entry_func(ht, key);
}
void* _Py_hashtable_get(_Py_hashtable_t *ht, const void *key);
void* _Py_hashtable_steal(
_Py_hashtable_t *ht,
const void *key);
struct _PyTraceMalloc_Config {
enum {
TRACEMALLOC_NOT_INITIALIZED,
TRACEMALLOC_INITIALIZED,
TRACEMALLOC_FINALIZED
} initialized;
int tracing;
int max_nframe;
};
struct
tracemalloc_frame {
PyObject *filename;
unsigned int lineno;
};
struct tracemalloc_traceback {
Py_uhash_t hash;
uint16_t nframe;
uint16_t total_nframe;
struct tracemalloc_frame frames[1];
};
struct _tracemalloc_runtime_state {
struct _PyTraceMalloc_Config config;
struct {
PyMemAllocatorEx mem;
PyMemAllocatorEx raw;
PyMemAllocatorEx obj;
} allocators;
PyThread_type_lock tables_lock;
size_t traced_memory;
size_t peak_traced_memory;
_Py_hashtable_t *filenames;
struct tracemalloc_traceback *traceback;
_Py_hashtable_t *tracebacks;
_Py_hashtable_t *traces;
_Py_hashtable_t *domains;
struct tracemalloc_traceback empty_traceback;
Py_tss_t reentrant_key;
};
struct _getargs_runtime_state {
PyThread_type_lock mutex;
struct _PyArg_Parser *static_parsers;
};
struct _gilstate_runtime_state {
int check_enabled;
PyInterpreterState *autoInterpreterState;
};
typedef struct _Py_AuditHookEntry {
struct _Py_AuditHookEntry *next;
Py_AuditHookFunction hookCFunction;
void *userData;
} _Py_AuditHookEntry;
typedef struct pyruntimestate {
int _initialized;
int preinitializing;
int preinitialized;
int core_initialized;
int initialized;
_Py_atomic_address _finalizing;
struct _pymem_allocators allocators;
struct _obmalloc_state obmalloc;
struct pyhash_runtime_state pyhash_state;
struct _time_runtime_state time;
struct _pythread_runtime_state threads;
struct _signals_runtime_state signals;
struct pyinterpreters {
PyThread_type_lock mutex;
PyInterpreterState *head;
PyInterpreterState *main;
int64_t next_id;
} interpreters;
struct _xidregistry {
PyThread_type_lock mutex;
struct _xidregitem *head;
} xidregistry;
unsigned long main_thread;
_Py_atomic_address tstate_current;
Py_tss_t autoTSSkey;
Py_tss_t trashTSSkey;
PyWideStringList orig_argv;
struct _parser_runtime_state parser;
void (*exitfuncs[32])(void);
int nexitfuncs;
struct _import_runtime_state imports;
struct _ceval_runtime_state ceval;
struct _gilstate_runtime_state gilstate;
struct _getargs_runtime_state getargs;
struct _fileutils_state fileutils;
struct _faulthandler_runtime_state faulthandler;
struct _tracemalloc_runtime_state tracemalloc;
PyPreConfig preconfig;
Py_OpenCodeHookFunction open_code_hook;
void *open_code_userdata;
_Py_AuditHookEntry *audit_hook_head;
struct _py_object_runtime_state object_state;
struct _Py_float_runtime_state float_state;
struct _Py_unicode_runtime_state unicode_state;
struct {
unsigned int next_version_tag;
} types;
struct _Py_static_objects static_objects;
PyInterpreterState _main_interpreter;
} _PyRuntimeState;
extern _PyRuntimeState _PyRuntime;
PyStatus _PyRuntimeState_Init(_PyRuntimeState *runtime);
void _PyRuntimeState_Fini(_PyRuntimeState *runtime);
PyStatus _PyRuntime_Initialize(void);
void _PyRuntime_Finalize(void);
static inline PyThreadState*
_PyRuntimeState_GetFinalizing(_PyRuntimeState *runtime) {
return (PyThreadState*)atomic_load_explicit(&(((&runtime->_finalizing))->_value), _Py_memory_order_relaxed);
}
static inline void
_PyRuntimeState_SetFinalizing(_PyRuntimeState *runtime, PyThreadState *tstate) {
atomic_store_explicit(&(((&runtime->_finalizing))->_value), ((uintptr_t)tstate), _Py_memory_order_relaxed);
}
static inline int
_Py_IsMainThread(void)
{
unsigned long thread = PyThread_get_thread_ident();
return (thread == _PyRuntime.main_thread);
}
static inline PyInterpreterState *
_PyInterpreterState_Main(void)
{
return _PyRuntime.interpreters.main;
}
static inline int
_Py_IsMainInterpreter(PyInterpreterState *interp)
{
return (interp == _PyInterpreterState_Main());
}
static inline const PyConfig *
_Py_GetMainConfig(void)
{
PyInterpreterState *interp = _PyInterpreterState_Main();
if (interp == 0) {
return 0;
}
return _PyInterpreterState_GetConfig(interp);
}
static inline int
_Py_ThreadCanHandleSignals(PyInterpreterState *interp)
{
return (_Py_IsMainThread() && _Py_IsMainInterpreter(interp));
}
static inline int
_Py_ThreadCanHandlePendingCalls(void)
{
return _Py_IsMainThread();
}
static inline PyThreadState*
_PyRuntimeState_GetThreadState(_PyRuntimeState *runtime)
{
return (PyThreadState*)atomic_load_explicit(&(((&runtime->tstate_current))->_value), _Py_memory_order_relaxed);
}
static inline PyThreadState*
_PyThreadState_GET(void)
{
return _PyRuntimeState_GetThreadState(&_PyRuntime);
}
static inline void
_Py_EnsureFuncTstateNotNULL(const char *func, PyThreadState *tstate)
{
if (tstate == 0) {
_Py_FatalErrorFunc(func,
"the function must be called with the GIL held, "
"after Python initialization and before Python finalization, "
"but the GIL is released (the current Python thread state is NULL)");
}
}
static inline PyInterpreterState* _PyInterpreterState_GET(void) {
PyThreadState *tstate = _PyThreadState_GET();
return tstate->interp;
}
PyThreadState * _PyThreadState_New(PyInterpreterState *interp);
void _PyThreadState_Bind(PyThreadState *tstate);
void _PyThreadState_Init(
PyThreadState *tstate);
void _PyThreadState_DeleteExcept(PyThreadState *tstate);
extern void _PyThreadState_InitDetached(PyThreadState *, PyInterpreterState *);
extern void _PyThreadState_ClearDetached(PyThreadState *);
extern void _PyThreadState_BindDetached(PyThreadState *);
extern void _PyThreadState_UnbindDetached(PyThreadState *);
static inline void
_PyThreadState_UpdateTracingState(PyThreadState *tstate)
{
bool use_tracing =
(tstate->tracing == 0) &&
(tstate->c_tracefunc != 0 || tstate->c_profilefunc != 0);
tstate->cframe->use_tracing = (use_tracing ? 255 : 0);
}
PyThreadState * _PyThreadState_Swap(
_PyRuntimeState *runtime,
PyThreadState *newts);
PyStatus _PyInterpreterState_Enable(_PyRuntimeState *runtime);
int _PyState_AddModule(
PyThreadState *tstate,
PyObject* module,
PyModuleDef* def);
int _PyOS_InterruptOccurred(PyThreadState *tstate);
extern void _Py_FinishPendingCalls(PyThreadState *tstate);
extern void _PyEval_InitRuntimeState(struct _ceval_runtime_state *);
extern void _PyEval_InitState(struct _ceval_state *, PyThread_type_lock);
extern void _PyEval_FiniState(struct _ceval_state *ceval);
void _PyEval_SignalReceived(PyInterpreterState *interp);
int _PyEval_AddPendingCall(
PyInterpreterState *interp,
int (*func)(void *),
void *arg);
void _PyEval_SignalAsyncExc(PyInterpreterState *interp);
extern PyObject* _PyEval_CallTracing(PyObject *func, PyObject *args);
extern PyObject* _PyEval_GetAsyncGenFirstiter(void);
extern PyObject* _PyEval_GetAsyncGenFinalizer(void);
extern int _PyEval_SetAsyncGenFirstiter(PyObject *);
extern int _PyEval_SetAsyncGenFinalizer(PyObject *);
extern int _PyEval_GetCoroutineOriginTrackingDepth(void);
extern int _PyEval_SetCoroutineOriginTrackingDepth(int depth);
extern void _PyEval_Fini(void);
extern PyObject* _PyEval_GetBuiltins(PyThreadState *tstate);
extern PyObject* _PyEval_BuiltinsFromGlobals(
PyThreadState *tstate,
PyObject *globals);
typedef struct {
void* (*init_state)(void);
void (*write_state)(void* state, const void *code_addr,
unsigned int code_size, PyCodeObject* code);
int (*free_state)(void* state);
} _PyPerf_Callbacks;
extern int _PyPerfTrampoline_SetCallbacks(_PyPerf_Callbacks *);
extern void _PyPerfTrampoline_GetCallbacks(_PyPerf_Callbacks *);
extern int _PyPerfTrampoline_Init(int activate);
extern int _PyPerfTrampoline_Fini(void);
extern int _PyIsPerfTrampolineActive(void);
extern PyStatus _PyPerfTrampoline_AfterFork_Child(void);
static inline PyObject*
_PyEval_EvalFrame(PyThreadState *tstate, struct _PyInterpreterFrame *frame, int throwflag)
{
((void)0);
if (tstate->interp->eval_frame == 0) {
return _PyEval_EvalFrameDefault(tstate, frame, throwflag);
}
return tstate->interp->eval_frame(tstate, frame, throwflag);
}
extern PyObject*
_PyEval_Vector(PyThreadState *tstate,
PyFunctionObject *func, PyObject *locals,
PyObject* const* args, size_t argcount,
PyObject *kwnames);
extern int _PyEval_ThreadsInitialized(struct pyruntimestate *runtime);
extern PyStatus _PyEval_InitGIL(PyThreadState *tstate);
extern void _PyEval_FiniGIL(PyInterpreterState *interp);
extern void _PyEval_ReleaseLock(PyThreadState *tstate);
extern void _PyEval_DeactivateOpCache(void);
static inline int _Py_MakeRecCheck(PyThreadState *tstate) {
return tstate->c_recursion_remaining-- <= 0;
}
int _Py_CheckRecursiveCall(
PyThreadState *tstate,
const char *where);
int _Py_CheckRecursiveCallPy(
PyThreadState *tstate);
static inline int _Py_EnterRecursiveCallTstate(PyThreadState *tstate,
const char *where) {
return (_Py_MakeRecCheck(tstate) && _Py_CheckRecursiveCall(tstate, where));
}
static inline int _Py_EnterRecursiveCall(const char *where) {
PyThreadState *tstate = _PyThreadState_GET();
return _Py_EnterRecursiveCallTstate(tstate, where);
}
static inline void _Py_LeaveRecursiveCallTstate(PyThreadState *tstate) {
tstate->c_recursion_remaining++;
}
static inline void _Py_LeaveRecursiveCall(void) {
PyThreadState *tstate = _PyThreadState_GET();
_Py_LeaveRecursiveCallTstate(tstate);
}
extern struct _PyInterpreterFrame* _PyEval_GetFrame(void);
extern PyObject* _Py_MakeCoro(PyFunctionObject *func);
extern int _Py_HandlePending(PyThreadState *tstate);
extern PyStatus _PyErr_InitTypes(PyInterpreterState *);
extern void _PyErr_FiniTypes(PyInterpreterState *);
static inline PyObject* _PyErr_Occurred(PyThreadState *tstate)
{
assert(tstate != 0);
if (tstate->current_exception == 0) {
return 0;
}
return (PyObject *)Py_TYPE(((PyObject*)((tstate->current_exception))));
}
static inline void _PyErr_ClearExcState(_PyErr_StackItem *exc_state)
{
do { * _tmp_op_ptr = &(exc_state->exc_value); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
}
PyObject* _PyErr_StackItemToExcInfoTuple(
_PyErr_StackItem *err_info);
void _PyErr_Fetch(
PyThreadState *tstate,
PyObject **type,
PyObject **value,
PyObject **traceback);
extern PyObject *
_PyErr_GetRaisedException(PyThreadState *tstate);
int _PyErr_ExceptionMatches(
PyThreadState *tstate,
PyObject *exc);
void
_PyErr_SetRaisedException(PyThreadState *tstate, PyObject *exc);
void _PyErr_Restore(
PyThreadState *tstate,
PyObject *type,
PyObject *value,
PyObject *traceback);
void _PyErr_SetObject(
PyThreadState *tstate,
PyObject *type,
PyObject *value);
void _PyErr_ChainStackItem(
_PyErr_StackItem *exc_info);
void _PyErr_Clear(PyThreadState *tstate);
void _PyErr_SetNone(PyThreadState *tstate, PyObject *exception);
PyObject * _PyErr_NoMemory(PyThreadState *tstate);
void _PyErr_SetString(
PyThreadState *tstate,
PyObject *exception,
const char *string);
PyObject * _PyErr_Format(
PyThreadState *tstate,
PyObject *exception,
const char *format,
...);
void _PyErr_NormalizeException(
PyThreadState *tstate,
PyObject **exc,
PyObject **val,
PyObject **tb);
PyObject * _PyErr_FormatFromCauseTstate(
PyThreadState *tstate,
PyObject *exception,
const char *format,
...);
PyObject * _PyExc_CreateExceptionGroup(
const char *msg,
PyObject *excs);
PyObject * _PyExc_PrepReraiseStar(
PyObject *orig,
PyObject *excs);
int _PyErr_CheckSignalsTstate(PyThreadState *tstate);
void _Py_DumpExtensionModules(int fd, PyInterpreterState *interp);
extern PyObject* _Py_Offer_Suggestions(PyObject* exception);
Py_ssize_t _Py_UTF8_Edit_Cost(PyObject *str_a, PyObject *str_b,
Py_ssize_t max_cost);
struct pyruntimestate;
int _PyWideStringList_CheckConsistency(const PyWideStringList *list);
void _PyWideStringList_Clear(PyWideStringList *list);
int _PyWideStringList_Copy(PyWideStringList *list,
const PyWideStringList *list2);
PyStatus _PyWideStringList_Extend(PyWideStringList *list,
const PyWideStringList *list2);
PyObject* _PyWideStringList_AsList(const PyWideStringList *list);
typedef struct _PyArgv {
Py_ssize_t argc;
int use_bytes_argv;
char * const *bytes_argv;
wchar_t * const *wchar_argv;
} _PyArgv;
PyStatus _PyArgv_AsWstrList(const _PyArgv *args,
PyWideStringList *list);
int _Py_str_to_int(
const char *str,
int *result);
const wchar_t* _Py_get_xoption(
const PyWideStringList *xoptions,
const wchar_t *name);
const char* _Py_GetEnv(
int use_environment,
const char *name);
void _Py_get_env_flag(
int use_environment,
int *flag,
const char *name);
void _Py_ClearArgcArgv(void);
typedef struct {
PyWideStringList argv;
PyWideStringList xoptions;
int isolated;
int use_environment;
int dev_mode;
int warn_default_encoding;
} _PyPreCmdline;
extern void _PyPreCmdline_Clear(_PyPreCmdline *cmdline);
extern PyStatus _PyPreCmdline_SetArgv(_PyPreCmdline *cmdline,
const _PyArgv *args);
extern PyStatus _PyPreCmdline_SetConfig(
const _PyPreCmdline *cmdline,
PyConfig *config);
extern PyStatus _PyPreCmdline_Read(_PyPreCmdline *cmdline,
const PyPreConfig *preconfig);
void _PyPreConfig_InitCompatConfig(PyPreConfig *preconfig);
extern void _PyPreConfig_InitFromConfig(
PyPreConfig *preconfig,
const PyConfig *config);
extern PyStatus _PyPreConfig_InitFromPreConfig(
PyPreConfig *preconfig,
const PyPreConfig *config2);
extern PyObject* _PyPreConfig_AsDict(const PyPreConfig *preconfig);
extern void _PyPreConfig_GetConfig(PyPreConfig *preconfig,
const PyConfig *config);
extern PyStatus _PyPreConfig_Read(PyPreConfig *preconfig,
const _PyArgv *args);
extern PyStatus _PyPreConfig_Write(const PyPreConfig *preconfig);
typedef enum {
_PyConfig_INIT_COMPAT = 1,
_PyConfig_INIT_PYTHON = 2,
_PyConfig_INIT_ISOLATED = 3
} _PyConfigInitEnum;
void _PyConfig_InitCompatConfig(PyConfig *config);
extern PyStatus _PyConfig_Copy(
PyConfig *config,
const PyConfig *config2);
extern PyStatus _PyConfig_InitPathConfig(
PyConfig *config,
int compute_path_config);
extern PyStatus _PyConfig_InitImportConfig(PyConfig *config);
extern PyStatus _PyConfig_Read(PyConfig *config, int compute_path_config);
extern PyStatus _PyConfig_Write(const PyConfig *config,
struct pyruntimestate *runtime);
extern PyStatus _PyConfig_SetPyArgv(
PyConfig *config,
const _PyArgv *args);
PyObject* _PyConfig_AsDict(const PyConfig *config);
int _PyConfig_FromDict(PyConfig *config, PyObject *dict);
extern void _Py_DumpPathConfig(PyThreadState *tstate);
PyObject* _Py_Get_Getpath_CodeObject(void);
PyObject* _Py_GetConfigsAsDict(void);
void _Py_FatalRefcountErrorFunc(
const char *func,
const char *message);
static inline void _Py_RefcntAdd(PyObject* op, Py_ssize_t n)
{
op->ob_refcnt += n;
}
static inline void
_Py_DECREF_SPECIALIZED(PyObject *op, const destructor destruct)
{
((void)0);
if (--op->ob_refcnt != 0) {
assert(op->ob_refcnt > 0);
}
else {
destruct(op);
}
}
static inline void
_Py_DECREF_NO_DEALLOC(PyObject *op)
{
((void)0);
op->ob_refcnt--;
}
int _PyType_CheckConsistency(PyTypeObject *type);
int _PyDict_CheckConsistency(PyObject *mp, int check_content);
extern int _PyTraceMalloc_NewReference(PyObject *op);
static inline int
_PyType_HasFeature(PyTypeObject *type, unsigned long feature) {
return ((type->tp_flags & feature) != 0);
}
extern void _PyType_InitCache(PyInterpreterState *interp);
static inline void
_PyObject_Init(PyObject *op, PyTypeObject *typeobj)
{
assert(op != 0);
Py_SET_TYPE(((PyObject*)((op))), typeobj);
if (_PyType_HasFeature(typeobj, (1UL << 9))) {
Py_INCREF(((PyObject*)((typeobj))));
}
_Py_NewReference(op);
}
static inline void
_PyObject_InitVar(PyVarObject *op, PyTypeObject *typeobj, Py_ssize_t size)
{
assert(op != 0);
assert(typeobj != &PyLong_Type);
_PyObject_Init((PyObject *)op, typeobj);
Py_SET_SIZE(((PyVarObject*)((op))), (size));
}
static inline void _PyObject_GC_TRACK(
const char *filename, int lineno,
PyObject *op)
{
((!_PyObject_GC_IS_TRACKED(((PyObject*)(op)))) ? (void)(0) : _PyObject_AssertFailed((op), "!_PyObject_GC_IS_TRACKED(((PyObject*)(op)))", ("object already tracked by the garbage collector"), (filename), (lineno), (__func__)));
PyGC_Head *gc = _Py_AS_GC(op);
(((gc->_gc_prev & (2)) == 0) ? (void)(0) : _PyObject_AssertFailed((op), "(gc->_gc_prev & (2)) == 0", ("object is in generation which is garbage collected"), (filename), (lineno), (__func__)));
PyInterpreterState *interp = _PyInterpreterState_GET();
PyGC_Head *generation0 = interp->gc.generation0;
PyGC_Head *last = (PyGC_Head*)(generation0->_gc_prev);
_PyGCHead_SET_NEXT(last, gc);
_PyGCHead_SET_PREV(gc, last);
_PyGCHead_SET_NEXT(gc, generation0);
generation0->_gc_prev = (uintptr_t)gc;
}
static inline void _PyObject_GC_UNTRACK(
const char *filename, int lineno,
PyObject *op)
{
((_PyObject_GC_IS_TRACKED(((PyObject*)(op)))) ? (void)(0) : _PyObject_AssertFailed((op), "_PyObject_GC_IS_TRACKED(((PyObject*)(op)))", ("object not tracked by the garbage collector"), (filename), (lineno), (__func__)));
PyGC_Head *gc = _Py_AS_GC(op);
PyGC_Head *prev = _PyGCHead_PREV(gc);
PyGC_Head *next = _PyGCHead_NEXT(gc);
_PyGCHead_SET_NEXT(prev, next);
_PyGCHead_SET_PREV(next, prev);
gc->_gc_next = 0;
gc->_gc_prev &= (1);
}
static inline PyObject **
_PyObject_GET_WEAKREFS_LISTPTR(PyObject *op)
{
if (PyType_Check(((PyObject*)((op)))) &&
((PyTypeObject *)op)->tp_flags & (1 << 1)) {
static_builtin_state *state = _PyStaticType_GetState(
(PyTypeObject *)op);
return _PyStaticType_GET_WEAKREFS_LISTPTR(state);
}
Py_ssize_t offset = Py_TYPE(((PyObject*)((op))))->tp_weaklistoffset;
return (PyObject **)((char *)op + offset);
}
static inline PyWeakReference **
_PyObject_GET_WEAKREFS_LISTPTR_FROM_OFFSET(PyObject *op)
{
assert(!PyType_Check(((PyObject*)((op)))) ||
((PyTypeObject *)op)->tp_flags & (1UL << 9));
Py_ssize_t offset = Py_TYPE(((PyObject*)((op))))->tp_weaklistoffset;
return (PyWeakReference **)((char *)op + offset);
}
static inline int
_PyObject_IS_GC(PyObject *obj)
{
return (PyType_HasFeature((Py_TYPE(((PyObject*)((obj))))), (1UL << 14))
&& (Py_TYPE(((PyObject*)((obj))))->tp_is_gc == 0
|| Py_TYPE(((PyObject*)((obj))))->tp_is_gc(obj)));
}
static inline size_t
_PyType_PreHeaderSize(PyTypeObject *tp)
{
return _PyType_HasFeature((tp), (1UL << 14)) * sizeof(PyGC_Head) +
_PyType_HasFeature(tp, ((1 << 3) | (1 << 4))) * 2 * sizeof(PyObject *);
}
void _PyObject_GC_Link(PyObject *op);
extern int _Py_CheckSlotResult(
PyObject *obj,
const char *slot_name,
int success);
static inline int _PyType_SUPPORTS_WEAKREFS(PyTypeObject *type) {
return (type->tp_weaklistoffset != 0);
}
extern PyObject* _PyType_AllocNoTrack(PyTypeObject *type, Py_ssize_t nitems);
extern int _PyObject_InitializeDict(PyObject *obj);
extern int _PyObject_StoreInstanceAttribute(PyObject *obj, PyDictValues *values,
PyObject *name, PyObject *value);
PyObject * _PyObject_GetInstanceAttribute(PyObject *obj, PyDictValues *values,
PyObject *name);
typedef union {
PyObject *dict;
char *values;
} PyDictOrValues;
static inline PyDictOrValues *
_PyObject_DictOrValuesPointer(PyObject *obj)
{
assert(Py_TYPE(((PyObject*)((obj))))->tp_flags & (1 << 4));
return ((PyDictOrValues *)obj)-3;
}
static inline int
_PyDictOrValues_IsValues(PyDictOrValues dorv)
{
return ((uintptr_t)dorv.values) & 1;
}
static inline PyDictValues *
_PyDictOrValues_GetValues(PyDictOrValues dorv)
{
assert(_PyDictOrValues_IsValues(dorv));
return (PyDictValues *)(dorv.values + 1);
}
static inline PyObject *
_PyDictOrValues_GetDict(PyDictOrValues dorv)
{
assert(!_PyDictOrValues_IsValues(dorv));
return dorv.dict;
}
static inline void
_PyDictOrValues_SetValues(PyDictOrValues *ptr, PyDictValues *values)
{
ptr->values = ((char *)values) - 1;
}
extern PyObject ** _PyObject_ComputedDictPointer(PyObject *);
extern void _PyObject_FreeInstanceAttributes(PyObject *obj);
extern int _PyObject_IsInstanceDictEmpty(PyObject *);
extern int _PyType_HasSubclasses(PyTypeObject *);
extern PyObject* _PyType_GetSubclasses(PyTypeObject *);
extern PyObject* _PyObject_GenericTryGetAttr(PyObject *, PyObject *);
static inline PyMemberDef* _PyHeapType_GET_MEMBERS(PyHeapTypeObject *etype) {
return (PyMemberDef*)((char*)etype + Py_TYPE(((PyObject*)((etype))))->tp_basicsize);
}
PyObject * _PyObject_LookupSpecial(PyObject *, PyObject *);
PyObject *PyExc_EnvironmentError = 0;
PyObject *PyExc_IOError = 0;
static struct _Py_exc_state*
get_exc_state(void)
{
PyInterpreterState *interp = _PyInterpreterState_GET();
return &interp->exc_state;
}
static PyObject *
BaseException_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
PyBaseExceptionObject *self;
self = (PyBaseExceptionObject *)type->tp_alloc(type, 0);
if (!self)
return 0;
self->dict = 0;
self->notes = 0;
self->traceback = self->cause = self->context = 0;
self->suppress_context = 0;
if (args) {
self->args = _Py_NewRef(((PyObject*)((args))));
return (PyObject *)self;
}
self->args = PyTuple_New(0);
if (!self->args) {
Py_DECREF(((PyObject*)((self))));
return 0;
}
return (PyObject *)self;
}
static int
BaseException_init(PyBaseExceptionObject *self, PyObject *args, PyObject *kwds)
{
if (!((kwds) == 0 || _PyArg_NoKeywords((Py_TYPE(((PyObject*)((self))))->tp_name), (kwds))))
return -1;
do { * _tmp_dst_ptr = &(self->args); _tmp_old_dst = (*_tmp_dst_ptr); *_tmp_dst_ptr = (_Py_NewRef(((PyObject*)((args))))); Py_XDECREF(((PyObject*)((_tmp_old_dst)))); } while (0);
return 0;
}
static int
BaseException_clear(PyBaseExceptionObject *self)
{
do { * _tmp_op_ptr = &(self->dict); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->args); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->notes); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->traceback); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->cause); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->context); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
return 0;
}
static void
BaseException_dealloc(PyBaseExceptionObject *self)
{
PyObject_GC_UnTrack(self);
do { PyThreadState *_tstate = 0; if (_PyTrash_cond(((PyObject*)((self))), (destructor)(BaseException_dealloc))) { _tstate = _PyThreadState_UncheckedGet(); if (_PyTrash_begin(_tstate, ((PyObject*)(((self)))))) { break; } }
BaseException_clear(self);
Py_TYPE(((PyObject*)((self))))->tp_free((PyObject *)self);
if (_tstate) { _PyTrash_end(_tstate); } } while (0);
}
static int
BaseException_traverse(PyBaseExceptionObject *self, visitproc visit, void *arg)
{
do { if (self->dict) { int vret = visit(((PyObject*)((self->dict))), arg); if (vret) return vret; } } while (0);
do { if (self->args) { int vret = visit(((PyObject*)((self->args))), arg); if (vret) return vret; } } while (0);
do { if (self->notes) { int vret = visit(((PyObject*)((self->notes))), arg); if (vret) return vret; } } while (0);
do { if (self->traceback) { int vret = visit(((PyObject*)((self->traceback))), arg); if (vret) return vret; } } while (0);
do { if (self->cause) { int vret = visit(((PyObject*)((self->cause))), arg); if (vret) return vret; } } while (0);
do { if (self->context) { int vret = visit(((PyObject*)((self->context))), arg); if (vret) return vret; } } while (0);
return 0;
}
static PyObject *
BaseException_str(PyBaseExceptionObject *self)
{
switch (PyTuple_GET_SIZE(((PyObject*)((self->args))))) {
case 0:
return PyUnicode_FromString("");
case 1:
return PyObject_Str(((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((self->args))))), ((1UL << 26)))), ((PyTupleObject*)((self->args))))->ob_item[(0)]));
default:
return PyObject_Str(self->args);
}
}
static PyObject *
BaseException_repr(PyBaseExceptionObject *self)
{
const char *name = _PyType_Name(Py_TYPE(((PyObject*)((self)))));
if (PyTuple_GET_SIZE(((PyObject*)((self->args)))) == 1)
return PyUnicode_FromFormat("%s(%R)", name,
((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((self->args))))), ((1UL << 26)))), ((PyTupleObject*)((self->args))))->ob_item[(0)]));
else
return PyUnicode_FromFormat("%s%R", name, self->args);
}
static PyObject *
BaseException_reduce(PyBaseExceptionObject *self, PyObject *_unused_ignored )
{
if (self->args && self->dict)
return PyTuple_Pack(3, Py_TYPE(((PyObject*)((self)))), self->args, self->dict);
else
return PyTuple_Pack(2, Py_TYPE(((PyObject*)((self)))), self->args);
}
static PyObject *
BaseException_setstate(PyObject *self, PyObject *state)
{
PyObject *d_key, *d_value;
Py_ssize_t i = 0;
if (state != (&_Py_NoneStruct)) {
if (!PyType_HasFeature((Py_TYPE(((PyObject*)((state))))), ((1UL << 29)))) {
PyErr_SetString(PyExc_TypeError, "state is not a dictionary");
return 0;
}
while (PyDict_Next(state, &i, &d_key, &d_value)) {
Py_INCREF(((PyObject*)((d_key))));
Py_INCREF(((PyObject*)((d_value))));
int res = PyObject_SetAttr(self, d_key, d_value);
Py_DECREF(((PyObject*)((d_value))));
Py_DECREF(((PyObject*)((d_key))));
if (res < 0) {
return 0;
}
}
}
return _Py_NewRef(((PyObject*)(((&_Py_NoneStruct)))));
}
static PyObject *
BaseException_with_traceback(PyObject *self, PyObject *tb) {
if (PyException_SetTraceback(self, tb))
return 0;
return _Py_NewRef(((PyObject*)((self))));
}
static const char with_traceback_doc[] = "Exception.with_traceback(tb) --\n set self.__traceback__ to tb and return self.";
static inline PyBaseExceptionObject*
_PyBaseExceptionObject_cast(PyObject *exc)
{
assert(PyType_HasFeature((Py_TYPE(((PyObject*)((exc))))), ((1UL << 30))));
return (PyBaseExceptionObject *)exc;
}
static PyObject *
BaseException_add_note(PyObject *self, PyObject *note)
{
if (!PyType_HasFeature((Py_TYPE(((PyObject*)((note))))), ((1UL << 28)))) {
PyErr_Format(PyExc_TypeError,
"note must be a str, not '%s'",
Py_TYPE(((PyObject*)((note))))->tp_name);
return 0;
}
if (!PyObject_HasAttr(self, &(_PyRuntime.static_objects.singletons.strings.identifiers._py___notes__._ascii.ob_base))) {
PyObject *new_notes = PyList_New(0);
if (new_notes == 0) {
return 0;
}
if (PyObject_SetAttr(self, &(_PyRuntime.static_objects.singletons.strings.identifiers._py___notes__._ascii.ob_base), new_notes) < 0) {
Py_DECREF(((PyObject*)((new_notes))));
return 0;
}
Py_DECREF(((PyObject*)((new_notes))));
}
PyObject *notes = PyObject_GetAttr(self, &(_PyRuntime.static_objects.singletons.strings.identifiers._py___notes__._ascii.ob_base));
if (notes == 0) {
return 0;
}
if (!PyType_HasFeature((Py_TYPE(((PyObject*)((notes))))), ((1UL << 25)))) {
Py_DECREF(((PyObject*)((notes))));
PyErr_SetString(PyExc_TypeError, "Cannot add note: __notes__ is not a list");
return 0;
}
if (PyList_Append(notes, note) < 0) {
Py_DECREF(((PyObject*)((notes))));
return 0;
}
Py_DECREF(((PyObject*)((notes))));
return _Py_NewRef(((PyObject*)(((&_Py_NoneStruct)))));
}
static const char add_note_doc[] = "Exception.add_note(note) --\n add a note to the exception";
static PyMethodDef BaseException_methods[] = {
{"__reduce__", (PyCFunction)BaseException_reduce, 0x0004 },
{"__setstate__", (PyCFunction)BaseException_setstate, 0x0008 },
{"with_traceback", (PyCFunction)BaseException_with_traceback, 0x0008,
with_traceback_doc},
{"add_note", (PyCFunction)BaseException_add_note, 0x0008,
add_note_doc},
{0, 0, 0, 0},
};
static PyObject *
BaseException_get_args(PyBaseExceptionObject *self, void *_unused_ignored )
{
if (self->args == 0) {
return _Py_NewRef(((PyObject*)(((&_Py_NoneStruct)))));
}
return _Py_NewRef(((PyObject*)((self->args))));
}
static int
BaseException_set_args(PyBaseExceptionObject *self, PyObject *val, void *_unused_ignored )
{
PyObject *seq;
if (val == 0) {
PyErr_SetString(PyExc_TypeError, "args may not be deleted");
return -1;
}
seq = PySequence_Tuple(val);
if (!seq)
return -1;
do { * _tmp_dst_ptr = &(self->args); _tmp_old_dst = (*_tmp_dst_ptr); *_tmp_dst_ptr = (seq); Py_XDECREF(((PyObject*)((_tmp_old_dst)))); } while (0);
return 0;
}
static PyObject *
BaseException_get_tb(PyBaseExceptionObject *self, void *_unused_ignored )
{
if (self->traceback == 0) {
return _Py_NewRef(((PyObject*)(((&_Py_NoneStruct)))));
}
return _Py_NewRef(((PyObject*)((self->traceback))));
}
static int
BaseException_set_tb(PyBaseExceptionObject *self, PyObject *tb, void *_unused_ignored )
{
if (tb == 0) {
PyErr_SetString(PyExc_TypeError, "__traceback__ may not be deleted");
return -1;
}
if (Py_IS_TYPE(((PyObject*)(((tb)))), (&PyTraceBack_Type))) {
do { * _tmp_dst_ptr = &(self->traceback); _tmp_old_dst = (*_tmp_dst_ptr); *_tmp_dst_ptr = (_Py_NewRef(((PyObject*)((tb))))); Py_XDECREF(((PyObject*)((_tmp_old_dst)))); } while (0);
}
else if (tb == (&_Py_NoneStruct)) {
do { * _tmp_op_ptr = &(self->traceback); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
}
else {
PyErr_SetString(PyExc_TypeError,
"__traceback__ must be a traceback or None");
return -1;
}
return 0;
}
static PyObject *
BaseException_get_context(PyObject *self, void *_unused_ignored )
{
PyObject *res = PyException_GetContext(self);
if (res)
return res;
return _Py_NewRef(((PyObject*)(((&_Py_NoneStruct)))));
}
static int
BaseException_set_context(PyObject *self, PyObject *arg, void *_unused_ignored )
{
if (arg == 0) {
PyErr_SetString(PyExc_TypeError, "__context__ may not be deleted");
return -1;
} else if (arg == (&_Py_NoneStruct)) {
arg = 0;
} else if (!PyType_HasFeature((Py_TYPE(((PyObject*)((arg))))), ((1UL << 30)))) {
PyErr_SetString(PyExc_TypeError, "exception context must be None "
"or derive from BaseException");
return -1;
} else {
Py_INCREF(((PyObject*)((arg))));
}
PyException_SetContext(self, arg);
return 0;
}
static PyObject *
BaseException_get_cause(PyObject *self, void *_unused_ignored )
{
PyObject *res = PyException_GetCause(self);
if (res)
return res;
return _Py_NewRef(((PyObject*)(((&_Py_NoneStruct)))));
}
static int
BaseException_set_cause(PyObject *self, PyObject *arg, void *_unused_ignored )
{
if (arg == 0) {
PyErr_SetString(PyExc_TypeError, "__cause__ may not be deleted");
return -1;
} else if (arg == (&_Py_NoneStruct)) {
arg = 0;
} else if (!PyType_HasFeature((Py_TYPE(((PyObject*)((arg))))), ((1UL << 30)))) {
PyErr_SetString(PyExc_TypeError, "exception cause must be None "
"or derive from BaseException");
return -1;
} else {
Py_INCREF(((PyObject*)((arg))));
}
PyException_SetCause(self, arg);
return 0;
}
static PyGetSetDef BaseException_getset[] = {
{"__dict__", PyObject_GenericGetDict, PyObject_GenericSetDict},
{"args", (getter)BaseException_get_args, (setter)BaseException_set_args},
{"__traceback__", (getter)BaseException_get_tb, (setter)BaseException_set_tb},
{"__context__", BaseException_get_context,
BaseException_set_context, "exception context"},
{"__cause__", BaseException_get_cause,
BaseException_set_cause, "exception cause"},
{0},
};
PyObject *
PyException_GetTraceback(PyObject *self)
{
PyBaseExceptionObject *base_self = _PyBaseExceptionObject_cast(self);
return _Py_XNewRef(((PyObject*)((base_self->traceback))));
}
int
PyException_SetTraceback(PyObject *self, PyObject *tb)
{
return BaseException_set_tb(_PyBaseExceptionObject_cast(self), tb, 0);
}
PyObject *
PyException_GetCause(PyObject *self)
{
PyObject *cause = _PyBaseExceptionObject_cast(self)->cause;
return _Py_XNewRef(((PyObject*)((cause))));
}
void
PyException_SetCause(PyObject *self, PyObject *cause)
{
PyBaseExceptionObject *base_self = _PyBaseExceptionObject_cast(self);
base_self->suppress_context = 1;
do { * _tmp_dst_ptr = &(base_self->cause); _tmp_old_dst = (*_tmp_dst_ptr); *_tmp_dst_ptr = (cause); Py_XDECREF(((PyObject*)((_tmp_old_dst)))); } while (0);
}
PyObject *
PyException_GetContext(PyObject *self)
{
PyObject *context = _PyBaseExceptionObject_cast(self)->context;
return _Py_XNewRef(((PyObject*)((context))));
}
void
PyException_SetContext(PyObject *self, PyObject *context)
{
do { * _tmp_dst_ptr = &(_PyBaseExceptionObject_cast(self)->context); _tmp_old_dst = (*_tmp_dst_ptr); *_tmp_dst_ptr = (context); Py_XDECREF(((PyObject*)((_tmp_old_dst)))); } while (0);
}
PyObject *
PyException_GetArgs(PyObject *self)
{
PyObject *args = _PyBaseExceptionObject_cast(self)->args;
return _Py_NewRef(((PyObject*)((args))));
}
void
PyException_SetArgs(PyObject *self, PyObject *args)
{
Py_INCREF(((PyObject*)((args))));
do { * _tmp_dst_ptr = &(_PyBaseExceptionObject_cast(self)->args); _tmp_old_dst = (*_tmp_dst_ptr); *_tmp_dst_ptr = (args); Py_XDECREF(((PyObject*)((_tmp_old_dst)))); } while (0);
}
const char *
PyExceptionClass_Name(PyObject *ob)
{
assert((PyType_Check(((PyObject*)(((ob))))) && PyType_HasFeature(((PyTypeObject*)(ob)), ((1UL << 30)))));
return ((PyTypeObject*)ob)->tp_name;
}
static struct PyMemberDef BaseException_members[] = {
{"__suppress_context__", 14,
offsetof(PyBaseExceptionObject, suppress_context)},
{0}
};
static PyTypeObject _PyExc_BaseException = {
{ { 1, (0) }, (0) },
"BaseException",
sizeof(PyBaseExceptionObject),
0,
(destructor)BaseException_dealloc,
0,
0,
0,
0,
(reprfunc)BaseException_repr,
0,
0,
0,
0,
0,
(reprfunc)BaseException_str,
PyObject_GenericGetAttr,
PyObject_GenericSetAttr,
0,
( 0 | 0) | (1UL << 10) | (1UL << 14) |
(1UL << 30),
"Common base class for all exceptions",
(traverseproc)BaseException_traverse,
(inquiry)BaseException_clear,
0,
0,
0,
0,
BaseException_methods,
BaseException_members,
BaseException_getset,
0,
0,
0,
0,
offsetof(PyBaseExceptionObject, dict),
(initproc)BaseException_init,
0,
BaseException_new,
};
PyObject *PyExc_BaseException = (PyObject *)&_PyExc_BaseException;
static PyTypeObject _PyExc_Exception = { { { 1, (0) }, (0) }, "Exception", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Common base class for all non-exit exceptions.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_BaseException, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_Exception = (PyObject *)&_PyExc_Exception;
static PyTypeObject _PyExc_TypeError = { { { 1, (0) }, (0) }, "TypeError", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Inappropriate argument type.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Exception, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_TypeError = (PyObject *)&_PyExc_TypeError;
static PyTypeObject _PyExc_StopAsyncIteration = { { { 1, (0) }, (0) }, "StopAsyncIteration", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Signal the end from iterator.__anext__().", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Exception, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_StopAsyncIteration = (PyObject *)&_PyExc_StopAsyncIteration;
static PyMemberDef StopIteration_members[] = {
{"value", 6, offsetof(PyStopIterationObject, value), 0,
"generator return value"},
{0}
};
static int
StopIteration_init(PyStopIterationObject *self, PyObject *args, PyObject *kwds)
{
Py_ssize_t size = PyTuple_GET_SIZE(((PyObject*)((args))));
PyObject *value;
if (BaseException_init((PyBaseExceptionObject *)self, args, kwds) == -1)
return -1;
do { * _tmp_op_ptr = &(self->value); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
if (size > 0)
value = ((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((args))))), ((1UL << 26)))), ((PyTupleObject*)((args))))->ob_item[(0)]);
else
value = (&_Py_NoneStruct);
self->value = _Py_NewRef(((PyObject*)((value))));
return 0;
}
static int
StopIteration_clear(PyStopIterationObject *self)
{
do { * _tmp_op_ptr = &(self->value); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
return BaseException_clear((PyBaseExceptionObject *)self);
}
static void
StopIteration_dealloc(PyStopIterationObject *self)
{
PyObject_GC_UnTrack(self);
StopIteration_clear(self);
Py_TYPE(((PyObject*)((self))))->tp_free((PyObject *)self);
}
static int
StopIteration_traverse(PyStopIterationObject *self, visitproc visit, void *arg)
{
do { if (self->value) { int vret = visit(((PyObject*)((self->value))), arg); if (vret) return vret; } } while (0);
return BaseException_traverse((PyBaseExceptionObject *)self, visit, arg);
}
static PyTypeObject _PyExc_StopIteration = { { { 1, (0) }, (0) }, "StopIteration", sizeof(PyStopIterationObject), 0, (destructor)StopIteration_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (reprfunc)0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Signal the end from iterator.__next__().", (traverseproc)StopIteration_traverse, (inquiry)StopIteration_clear, 0, 0, 0, 0, 0, StopIteration_members, 0, &_PyExc_Exception, 0, 0, 0, offsetof(PyStopIterationObject, dict), (initproc)StopIteration_init, 0, 0,}; PyObject *PyExc_StopIteration = (PyObject *)&_PyExc_StopIteration;
static PyTypeObject _PyExc_GeneratorExit = { { { 1, (0) }, (0) }, "GeneratorExit", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Request that a generator exit.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_BaseException, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_GeneratorExit = (PyObject *)&_PyExc_GeneratorExit;
static int
SystemExit_init(PySystemExitObject *self, PyObject *args, PyObject *kwds)
{
Py_ssize_t size = PyTuple_GET_SIZE(((PyObject*)((args))));
if (BaseException_init((PyBaseExceptionObject *)self, args, kwds) == -1)
return -1;
if (size == 0)
return 0;
if (size == 1) {
do { * _tmp_dst_ptr = &(self->code); _tmp_old_dst = (*_tmp_dst_ptr); *_tmp_dst_ptr = (_Py_NewRef(((PyObject*)((((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((args))))), ((1UL << 26)))), ((PyTupleObject*)((args))))->ob_item[(0)])))))); Py_XDECREF(((PyObject*)((_tmp_old_dst)))); } while (0);
}
else {
do { * _tmp_dst_ptr = &(self->code); _tmp_old_dst = (*_tmp_dst_ptr); *_tmp_dst_ptr = (_Py_NewRef(((PyObject*)((args))))); Py_XDECREF(((PyObject*)((_tmp_old_dst)))); } while (0);
}
return 0;
}
static int
SystemExit_clear(PySystemExitObject *self)
{
do { * _tmp_op_ptr = &(self->code); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
return BaseException_clear((PyBaseExceptionObject *)self);
}
static void
SystemExit_dealloc(PySystemExitObject *self)
{
_PyObject_GC_UNTRACK("/home/nxpub/dev/experiments/pyresearch/cpython/Objects/tmp3re1uol4", 666, ((PyObject*)((self))));
SystemExit_clear(self);
Py_TYPE(((PyObject*)((self))))->tp_free((PyObject *)self);
}
static int
SystemExit_traverse(PySystemExitObject *self, visitproc visit, void *arg)
{
do { if (self->code) { int vret = visit(((PyObject*)((self->code))), arg); if (vret) return vret; } } while (0);
return BaseException_traverse((PyBaseExceptionObject *)self, visit, arg);
}
static PyMemberDef SystemExit_members[] = {
{"code", 6, offsetof(PySystemExitObject, code), 0,
"exception code"},
{0}
};
static PyTypeObject _PyExc_SystemExit = { { { 1, (0) }, (0) }, "SystemExit", sizeof(PySystemExitObject), 0, (destructor)SystemExit_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (reprfunc)0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Request to exit from the interpreter.", (traverseproc)SystemExit_traverse, (inquiry)SystemExit_clear, 0, 0, 0, 0, 0, SystemExit_members, 0, &_PyExc_BaseException, 0, 0, 0, offsetof(PySystemExitObject, dict), (initproc)SystemExit_init, 0, 0,}; PyObject *PyExc_SystemExit = (PyObject *)&_PyExc_SystemExit;
static inline PyBaseExceptionGroupObject*
_PyBaseExceptionGroupObject_cast(PyObject *exc)
{
assert(PyObject_TypeCheck(((PyObject*)(((exc)))), ((PyTypeObject *)PyExc_BaseExceptionGroup)));
return (PyBaseExceptionGroupObject *)exc;
}
static PyObject *
BaseExceptionGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
struct _Py_exc_state *state = get_exc_state();
PyTypeObject *PyExc_ExceptionGroup =
(PyTypeObject*)state->PyExc_ExceptionGroup;
PyObject *message = 0;
PyObject *exceptions = 0;
if (!_PyArg_ParseTuple_SizeT(args,
"UO:BaseExceptionGroup.__new__",
&message,
&exceptions)) {
return 0;
}
if (!PySequence_Check(exceptions)) {
PyErr_SetString(
PyExc_TypeError,
"second argument (exceptions) must be a sequence");
return 0;
}
exceptions = PySequence_Tuple(exceptions);
if (!exceptions) {
return 0;
}
Py_ssize_t numexcs = PyTuple_GET_SIZE(((PyObject*)((exceptions))));
if (numexcs == 0) {
PyErr_SetString(
PyExc_ValueError,
"second argument (exceptions) must be a non-empty sequence");
goto error;
}
bool nested_base_exceptions = 0;
for (Py_ssize_t i = 0; i < numexcs; i++) {
PyObject *exc = ((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((exceptions))))), ((1UL << 26)))), ((PyTupleObject*)((exceptions))))->ob_item[(i)]);
if (!exc) {
goto error;
}
if (!PyType_HasFeature((Py_TYPE(((PyObject*)((exc))))), ((1UL << 30)))) {
PyErr_Format(
PyExc_ValueError,
"Item %d of second argument (exceptions) is not an exception",
i);
goto error;
}
int is_nonbase_exception = PyObject_IsInstance(exc, PyExc_Exception);
if (is_nonbase_exception < 0) {
goto error;
}
else if (is_nonbase_exception == 0) {
nested_base_exceptions = 1;
}
}
PyTypeObject *cls = type;
if (cls == PyExc_ExceptionGroup) {
if (nested_base_exceptions) {
PyErr_SetString(PyExc_TypeError,
"Cannot nest BaseExceptions in an ExceptionGroup");
goto error;
}
}
else if (cls == (PyTypeObject*)PyExc_BaseExceptionGroup) {
if (!nested_base_exceptions) {
cls = PyExc_ExceptionGroup;
}
}
else {
if (nested_base_exceptions) {
int nonbase = PyObject_IsSubclass((PyObject*)cls, PyExc_Exception);
if (nonbase == -1) {
goto error;
}
else if (nonbase == 1) {
PyErr_Format(PyExc_TypeError,
"Cannot nest BaseExceptions in '%.200s'",
cls->tp_name);
goto error;
}
}
}
if (!cls) {
cls = (PyTypeObject*)PyExc_BaseExceptionGroup;
}
PyBaseExceptionGroupObject *self =
_PyBaseExceptionGroupObject_cast(BaseException_new(cls, args, kwds));
if (!self) {
goto error;
}
self->msg = _Py_NewRef(((PyObject*)((message))));
self->excs = exceptions;
return (PyObject*)self;
error:
Py_DECREF(((PyObject*)((exceptions))));
return 0;
}
PyObject *
_PyExc_CreateExceptionGroup(const char *msg_str, PyObject *excs)
{
PyObject *msg = PyUnicode_FromString(msg_str);
if (!msg) {
return 0;
}
PyObject *args = PyTuple_Pack(2, msg, excs);
Py_DECREF(((PyObject*)((msg))));
if (!args) {
return 0;
}
PyObject *result = PyObject_CallObject(PyExc_BaseExceptionGroup, args);
Py_DECREF(((PyObject*)((args))));
return result;
}
static int
BaseExceptionGroup_init(PyBaseExceptionGroupObject *self,
PyObject *args, PyObject *kwds)
{
if (!((kwds) == 0 || _PyArg_NoKeywords((Py_TYPE(((PyObject*)((self))))->tp_name), (kwds)))) {
return -1;
}
if (BaseException_init((PyBaseExceptionObject *)self, args, kwds) == -1) {
return -1;
}
return 0;
}
static int
BaseExceptionGroup_clear(PyBaseExceptionGroupObject *self)
{
do { * _tmp_op_ptr = &(self->msg); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->excs); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
return BaseException_clear((PyBaseExceptionObject *)self);
}
static void
BaseExceptionGroup_dealloc(PyBaseExceptionGroupObject *self)
{
_PyObject_GC_UNTRACK("/home/nxpub/dev/experiments/pyresearch/cpython/Objects/tmp3re1uol4", 855, ((PyObject*)((self))));
BaseExceptionGroup_clear(self);
Py_TYPE(((PyObject*)((self))))->tp_free((PyObject *)self);
}
static int
BaseExceptionGroup_traverse(PyBaseExceptionGroupObject *self,
visitproc visit, void *arg)
{
do { if (self->msg) { int vret = visit(((PyObject*)((self->msg))), arg); if (vret) return vret; } } while (0);
do { if (self->excs) { int vret = visit(((PyObject*)((self->excs))), arg); if (vret) return vret; } } while (0);
return BaseException_traverse((PyBaseExceptionObject *)self, visit, arg);
}
static PyObject *
BaseExceptionGroup_str(PyBaseExceptionGroupObject *self)
{
assert(self->msg);
assert(PyType_HasFeature((Py_TYPE(((PyObject*)((self->msg))))), ((1UL << 28))));
assert(Py_IS_TYPE(((PyObject*)(((self->excs)))), (&PyTuple_Type)));
Py_ssize_t num_excs = PyTuple_Size(self->excs);
return PyUnicode_FromFormat(
"%S (%zd sub-exception%s)",
self->msg, num_excs, num_excs > 1 ? "s" : "");
}
static PyObject *
BaseExceptionGroup_derive(PyObject *self_, PyObject *args)
{
PyBaseExceptionGroupObject *self = _PyBaseExceptionGroupObject_cast(self_);
PyObject *excs = 0;
if (!_PyArg_ParseTuple_SizeT(args, "O", &excs)) {
return 0;
}
PyObject *init_args = PyTuple_Pack(2, self->msg, excs);
if (!init_args) {
return 0;
}
PyObject *eg = PyObject_CallObject(
PyExc_BaseExceptionGroup, init_args);
Py_DECREF(((PyObject*)((init_args))));
return eg;
}
static int
exceptiongroup_subset(
PyBaseExceptionGroupObject *_orig, PyObject *excs, PyObject **result)
{
PyObject *orig = (PyObject *)_orig;
*result = 0;
Py_ssize_t num_excs = PySequence_Size(excs);
if (num_excs < 0) {
return -1;
}
else if (num_excs == 0) {
return 0;
}
PyObject *eg = _PyObject_CallMethod_SizeT(
orig, "derive", "(O)", excs);
if (!eg) {
return -1;
}
if (!PyObject_TypeCheck(((PyObject*)(((eg)))), ((PyTypeObject *)PyExc_BaseExceptionGroup))) {
PyErr_SetString(PyExc_TypeError,
"derive must return an instance of BaseExceptionGroup");
goto error;
}
PyObject *tb = PyException_GetTraceback(orig);
if (tb) {
int res = PyException_SetTraceback(eg, tb);
Py_DECREF(((PyObject*)((tb))));
if (res < 0) {
goto error;
}
}
PyException_SetContext(eg, PyException_GetContext(orig));
PyException_SetCause(eg, PyException_GetCause(orig));
if (PyObject_HasAttr(orig, &(_PyRuntime.static_objects.singletons.strings.identifiers._py___notes__._ascii.ob_base))) {
PyObject *notes = PyObject_GetAttr(orig, &(_PyRuntime.static_objects.singletons.strings.identifiers._py___notes__._ascii.ob_base));
if (notes == 0) {
goto error;
}
if (PySequence_Check(notes)) {
PyObject *notes_copy = PySequence_List(notes);
Py_DECREF(((PyObject*)((notes))));
if (notes_copy == 0) {
goto error;
}
int res = PyObject_SetAttr(eg, &(_PyRuntime.static_objects.singletons.strings.identifiers._py___notes__._ascii.ob_base), notes_copy);
Py_DECREF(((PyObject*)((notes_copy))));
if (res < 0) {
goto error;
}
}
else {
Py_DECREF(((PyObject*)((notes))));
}
}
*result = eg;
return 0;
error:
Py_DECREF(((PyObject*)((eg))));
return -1;
}
typedef enum {
EXCEPTION_GROUP_MATCH_BY_TYPE = 0,
EXCEPTION_GROUP_MATCH_BY_PREDICATE = 1,
EXCEPTION_GROUP_MATCH_INSTANCE_IDS = 2
} _exceptiongroup_split_matcher_type;
static int
get_matcher_type(PyObject *value,
_exceptiongroup_split_matcher_type *type)
{
assert(value);
if (Py_IS_TYPE(((PyObject*)(((value)))), (&PyFunction_Type))) {
*type = EXCEPTION_GROUP_MATCH_BY_PREDICATE;
return 0;
}
if ((PyType_Check(((PyObject*)(((value))))) && PyType_HasFeature(((PyTypeObject*)(value)), ((1UL << 30))))) {
*type = EXCEPTION_GROUP_MATCH_BY_TYPE;
return 0;
}
if (Py_IS_TYPE(((PyObject*)(((value)))), (&PyTuple_Type))) {
Py_ssize_t n = PyTuple_GET_SIZE(((PyObject*)((value))));
for (Py_ssize_t i=0; i<n; i++) {
if (!(PyType_Check(((PyObject*)(((((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((value))))), ((1UL << 26)))), ((PyTupleObject*)((value))))->ob_item[(i)])))))) && PyType_HasFeature(((PyTypeObject*)(((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((value))))), ((1UL << 26)))), ((PyTupleObject*)((value))))->ob_item[(i)]))), ((1UL << 30))))) {
goto error;
}
}
*type = EXCEPTION_GROUP_MATCH_BY_TYPE;
return 0;
}
error:
PyErr_SetString(
PyExc_TypeError,
"expected a function, exception type or tuple of exception types");
return -1;
}
static int
exceptiongroup_split_check_match(PyObject *exc,
_exceptiongroup_split_matcher_type matcher_type,
PyObject *matcher_value)
{
switch (matcher_type) {
case EXCEPTION_GROUP_MATCH_BY_TYPE: {
assert((PyType_Check(((PyObject*)(((matcher_value))))) && PyType_HasFeature(((PyTypeObject*)(matcher_value)), ((1UL << 30)))) ||
Py_IS_TYPE(((PyObject*)(((matcher_value)))), (&PyTuple_Type)));
return PyErr_GivenExceptionMatches(exc, matcher_value);
}
case EXCEPTION_GROUP_MATCH_BY_PREDICATE: {
assert(Py_IS_TYPE(((PyObject*)(((matcher_value)))), (&PyFunction_Type)));
PyObject *exc_matches = PyObject_CallOneArg(matcher_value, exc);
if (exc_matches == 0) {
return -1;
}
int is_true = PyObject_IsTrue(exc_matches);
Py_DECREF(((PyObject*)((exc_matches))));
return is_true;
}
case EXCEPTION_GROUP_MATCH_INSTANCE_IDS: {
assert((Py_IS_TYPE(((PyObject*)(((matcher_value)))), (&PySet_Type)) || PyType_IsSubtype(Py_TYPE(((PyObject*)((matcher_value)))), &PySet_Type)));
if (!PyObject_TypeCheck(((PyObject*)(((exc)))), ((PyTypeObject *)PyExc_BaseExceptionGroup))) {
PyObject *exc_id = PyLong_FromVoidPtr(exc);
if (exc_id == 0) {
return -1;
}
int res = PySet_Contains(matcher_value, exc_id);
Py_DECREF(((PyObject*)((exc_id))));
return res;
}
return 0;
}
}
return 0;
}
typedef struct {
PyObject *match;
PyObject *rest;
} _exceptiongroup_split_result;
static int
exceptiongroup_split_recursive(PyObject *exc,
_exceptiongroup_split_matcher_type matcher_type,
PyObject *matcher_value,
bool construct_rest,
_exceptiongroup_split_result *result)
{
result->match = 0;
result->rest = 0;
int is_match = exceptiongroup_split_check_match(
exc, matcher_type, matcher_value);
if (is_match < 0) {
return -1;
}
if (is_match) {
result->match = _Py_NewRef(((PyObject*)((exc))));
return 0;
}
else if (!PyObject_TypeCheck(((PyObject*)(((exc)))), ((PyTypeObject *)PyExc_BaseExceptionGroup))) {
if (construct_rest) {
result->rest = _Py_NewRef(((PyObject*)((exc))));
}
return 0;
}
PyBaseExceptionGroupObject *eg = _PyBaseExceptionGroupObject_cast(exc);
assert(Py_IS_TYPE(((PyObject*)(((eg->excs)))), (&PyTuple_Type)));
Py_ssize_t num_excs = PyTuple_Size(eg->excs);
if (num_excs < 0) {
return -1;
}
assert(num_excs > 0);
int retval = -1;
PyObject *match_list = PyList_New(0);
if (!match_list) {
return -1;
}
PyObject *rest_list = 0;
if (construct_rest) {
rest_list = PyList_New(0);
if (!rest_list) {
goto done;
}
}
for (Py_ssize_t i = 0; i < num_excs; i++) {
PyObject *e = ((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((eg->excs))))), ((1UL << 26)))), ((PyTupleObject*)((eg->excs))))->ob_item[(i)]);
_exceptiongroup_split_result rec_result;
if (_Py_EnterRecursiveCall(" in exceptiongroup_split_recursive")) {
goto done;
}
if (exceptiongroup_split_recursive(
e, matcher_type, matcher_value,
construct_rest, &rec_result) < 0) {
assert(!rec_result.match);
assert(!rec_result.rest);
_Py_LeaveRecursiveCall();
goto done;
}
_Py_LeaveRecursiveCall();
if (rec_result.match) {
assert(Py_IS_TYPE(((PyObject*)(((match_list)))), (&PyList_Type)));
if (PyList_Append(match_list, rec_result.match) < 0) {
Py_DECREF(((PyObject*)((rec_result.match))));
Py_XDECREF(((PyObject*)((rec_result.rest))));
goto done;
}
Py_DECREF(((PyObject*)((rec_result.match))));
}
if (rec_result.rest) {
assert(construct_rest);
assert(Py_IS_TYPE(((PyObject*)(((rest_list)))), (&PyList_Type)));
if (PyList_Append(rest_list, rec_result.rest) < 0) {
Py_DECREF(((PyObject*)((rec_result.rest))));
goto done;
}
Py_DECREF(((PyObject*)((rec_result.rest))));
}
}
if (exceptiongroup_subset(eg, match_list, &result->match) < 0) {
goto done;
}
if (construct_rest) {
assert(Py_IS_TYPE(((PyObject*)(((rest_list)))), (&PyList_Type)));
if (exceptiongroup_subset(eg, rest_list, &result->rest) < 0) {
do { * _tmp_op_ptr = &(result->match); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
goto done;
}
}
retval = 0;
done:
Py_DECREF(((PyObject*)((match_list))));
Py_XDECREF(((PyObject*)((rest_list))));
if (retval < 0) {
do { * _tmp_op_ptr = &(result->match); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(result->rest); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
}
return retval;
}
static PyObject *
BaseExceptionGroup_split(PyObject *self, PyObject *args)
{
PyObject *matcher_value = 0;
if (!PyArg_UnpackTuple(args, "split", 1, 1, &matcher_value)) {
return 0;
}
_exceptiongroup_split_matcher_type matcher_type;
if (get_matcher_type(matcher_value, &matcher_type) < 0) {
return 0;
}
_exceptiongroup_split_result split_result;
bool construct_rest = 1;
if (exceptiongroup_split_recursive(
self, matcher_type, matcher_value,
construct_rest, &split_result) < 0) {
return 0;
}
PyObject *result = PyTuple_Pack(
2,
split_result.match ? split_result.match : (&_Py_NoneStruct),
split_result.rest ? split_result.rest : (&_Py_NoneStruct));
Py_XDECREF(((PyObject*)((split_result.match))));
Py_XDECREF(((PyObject*)((split_result.rest))));
return result;
}
static PyObject *
BaseExceptionGroup_subgroup(PyObject *self, PyObject *args)
{
PyObject *matcher_value = 0;
if (!PyArg_UnpackTuple(args, "subgroup", 1, 1, &matcher_value)) {
return 0;
}
_exceptiongroup_split_matcher_type matcher_type;
if (get_matcher_type(matcher_value, &matcher_type) < 0) {
return 0;
}
_exceptiongroup_split_result split_result;
bool construct_rest = 0;
if (exceptiongroup_split_recursive(
self, matcher_type, matcher_value,
construct_rest, &split_result) < 0) {
return 0;
}
PyObject *result = _Py_NewRef(((PyObject*)((split_result.match ? split_result.match : (&_Py_NoneStruct)))));
Py_XDECREF(((PyObject*)((split_result.match))));
assert(!split_result.rest);
return result;
}
static int
collect_exception_group_leaf_ids(PyObject *exc, PyObject *leaf_ids)
{
if ((((exc)) == ((&_Py_NoneStruct)))) {
return 0;
}
assert(PyType_HasFeature((Py_TYPE(((PyObject*)((exc))))), ((1UL << 30))));
assert((Py_IS_TYPE(((PyObject*)(((leaf_ids)))), (&PySet_Type)) || PyType_IsSubtype(Py_TYPE(((PyObject*)((leaf_ids)))), &PySet_Type)));
if (!PyObject_TypeCheck(((PyObject*)(((exc)))), ((PyTypeObject *)PyExc_BaseExceptionGroup))) {
PyObject *exc_id = PyLong_FromVoidPtr(exc);
if (exc_id == 0) {
return -1;
}
int res = PySet_Add(leaf_ids, exc_id);
Py_DECREF(((PyObject*)((exc_id))));
return res;
}
PyBaseExceptionGroupObject *eg = _PyBaseExceptionGroupObject_cast(exc);
Py_ssize_t num_excs = PyTuple_GET_SIZE(((PyObject*)((eg->excs))));
for (Py_ssize_t i = 0; i < num_excs; i++) {
PyObject *e = ((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((eg->excs))))), ((1UL << 26)))), ((PyTupleObject*)((eg->excs))))->ob_item[(i)]);
if (_Py_EnterRecursiveCall(" in collect_exception_group_leaf_ids")) {
return -1;
}
int res = collect_exception_group_leaf_ids(e, leaf_ids);
_Py_LeaveRecursiveCall();
if (res < 0) {
return -1;
}
}
return 0;
}
static PyObject *
exception_group_projection(PyObject *eg, PyObject *keep)
{
assert(PyObject_TypeCheck(((PyObject*)(((eg)))), ((PyTypeObject *)PyExc_BaseExceptionGroup)));
assert(Py_IS_TYPE(((PyObject*)(((keep)))), (&PyList_Type)));
PyObject *leaf_ids = PySet_New(0);
if (!leaf_ids) {
return 0;
}
Py_ssize_t n = PyList_GET_SIZE(((PyObject*)((keep))));
for (Py_ssize_t i = 0; i < n; i++) {
PyObject *e = ((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((keep))))), ((1UL << 25)))), ((PyListObject*)((keep))))->ob_item[(i)]);
assert(e != 0);
assert(PyObject_TypeCheck(((PyObject*)(((e)))), ((PyTypeObject *)PyExc_BaseExceptionGroup)));
if (collect_exception_group_leaf_ids(e, leaf_ids) < 0) {
Py_DECREF(((PyObject*)((leaf_ids))));
return 0;
}
}
_exceptiongroup_split_result split_result;
bool construct_rest = 0;
int err = exceptiongroup_split_recursive(
eg, EXCEPTION_GROUP_MATCH_INSTANCE_IDS, leaf_ids,
construct_rest, &split_result);
Py_DECREF(((PyObject*)((leaf_ids))));
if (err < 0) {
return 0;
}
PyObject *result = split_result.match ?
split_result.match : _Py_NewRef(((PyObject*)(((&_Py_NoneStruct)))));
assert(split_result.rest == 0);
return result;
}
static bool
is_same_exception_metadata(PyObject *exc1, PyObject *exc2)
{
assert(PyType_HasFeature((Py_TYPE(((PyObject*)((exc1))))), ((1UL << 30))));
assert(PyType_HasFeature((Py_TYPE(((PyObject*)((exc2))))), ((1UL << 30))));
PyBaseExceptionObject *e1 = (PyBaseExceptionObject *)exc1;
PyBaseExceptionObject *e2 = (PyBaseExceptionObject *)exc2;
return (e1->notes == e2->notes &&
e1->traceback == e2->traceback &&
e1->cause == e2->cause &&
e1->context == e2->context);
}
PyObject *
_PyExc_PrepReraiseStar(PyObject *orig, PyObject *excs)
{
assert(PyType_HasFeature((Py_TYPE(((PyObject*)((orig))))), ((1UL << 30))));
assert(PyType_HasFeature((Py_TYPE(((PyObject*)((excs))))), ((1UL << 25))));
Py_ssize_t numexcs = PyList_GET_SIZE(((PyObject*)((excs))));
if (numexcs == 0) {
return _Py_NewRef(((PyObject*)(((&_Py_NoneStruct)))));
}
if (!PyObject_TypeCheck(((PyObject*)(((orig)))), ((PyTypeObject *)PyExc_BaseExceptionGroup))) {
assert(numexcs == 1 || (numexcs == 2 && ((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((excs))))), ((1UL << 25)))), ((PyListObject*)((excs))))->ob_item[(1)]) == (&_Py_NoneStruct)));
PyObject *e = ((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((excs))))), ((1UL << 25)))), ((PyListObject*)((excs))))->ob_item[(0)]);
assert(e != 0);
return _Py_NewRef(((PyObject*)((e))));
}
PyObject *raised_list = PyList_New(0);
if (raised_list == 0) {
return 0;
}
PyObject* reraised_list = PyList_New(0);
if (reraised_list == 0) {
Py_DECREF(((PyObject*)((raised_list))));
return 0;
}
PyObject *result = 0;
for (Py_ssize_t i = 0; i < numexcs; i++) {
PyObject *e = ((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((excs))))), ((1UL << 25)))), ((PyListObject*)((excs))))->ob_item[(i)]);
assert(e != 0);
if ((((e)) == ((&_Py_NoneStruct)))) {
continue;
}
bool is_reraise = is_same_exception_metadata(e, orig);
PyObject *append_list = is_reraise ? reraised_list : raised_list;
if (PyList_Append(append_list, e) < 0) {
goto done;
}
}
PyObject *reraised_eg = exception_group_projection(orig, reraised_list);
if (reraised_eg == 0) {
goto done;
}
if (!(((reraised_eg)) == ((&_Py_NoneStruct)))) {
assert(is_same_exception_metadata(reraised_eg, orig));
}
Py_ssize_t num_raised = PyList_GET_SIZE(((PyObject*)((raised_list))));
if (num_raised == 0) {
result = reraised_eg;
}
else if (num_raised > 0) {
int res = 0;
if (!(((reraised_eg)) == ((&_Py_NoneStruct)))) {
res = PyList_Append(raised_list, reraised_eg);
}
Py_DECREF(((PyObject*)((reraised_eg))));
if (res < 0) {
goto done;
}
result = _PyExc_CreateExceptionGroup("", raised_list);
if (result == 0) {
goto done;
}
}
done:
Py_XDECREF(((PyObject*)((raised_list))));
Py_XDECREF(((PyObject*)((reraised_list))));
return result;
}
static PyMemberDef BaseExceptionGroup_members[] = {
{"message", 6, offsetof(PyBaseExceptionGroupObject, msg), 1,
"exception message"},
{"exceptions", 6, offsetof(PyBaseExceptionGroupObject, excs), 1,
"nested exceptions"},
{0}
};
static PyMethodDef BaseExceptionGroup_methods[] = {
{"__class_getitem__", (PyCFunction)Py_GenericAlias,
0x0008|0x0010, "See PEP 585"},
{"derive", (PyCFunction)BaseExceptionGroup_derive, 0x0001},
{"split", (PyCFunction)BaseExceptionGroup_split, 0x0001},
{"subgroup", (PyCFunction)BaseExceptionGroup_subgroup, 0x0001},
{0}
};
static PyTypeObject _PyExc_BaseExceptionGroup = { { { 1, (0) }, (0) }, "BaseExceptionGroup", sizeof(PyBaseExceptionGroupObject), 0, (destructor)BaseExceptionGroup_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (reprfunc)BaseExceptionGroup_str, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "A combination of multiple unrelated exceptions.", (traverseproc)BaseExceptionGroup_traverse, (inquiry)BaseExceptionGroup_clear, 0, 0, 0, 0, BaseExceptionGroup_methods, BaseExceptionGroup_members, 0, &_PyExc_BaseException, 0, 0, 0, offsetof(PyBaseExceptionGroupObject, dict), (initproc)BaseExceptionGroup_init, 0, BaseExceptionGroup_new,}; PyObject *PyExc_BaseExceptionGroup = (PyObject *)&_PyExc_BaseExceptionGroup;
static PyObject*
create_exception_group_class(void) {
struct _Py_exc_state *state = get_exc_state();
PyObject *bases = PyTuple_Pack(
2, PyExc_BaseExceptionGroup, PyExc_Exception);
if (bases == 0) {
return 0;
}
assert(!state->PyExc_ExceptionGroup);
state->PyExc_ExceptionGroup = PyErr_NewException(
"builtins.ExceptionGroup", bases, 0);
Py_DECREF(((PyObject*)((bases))));
return state->PyExc_ExceptionGroup;
}
static PyTypeObject _PyExc_KeyboardInterrupt = { { { 1, (0) }, (0) }, "KeyboardInterrupt", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Program interrupted by user.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_BaseException, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_KeyboardInterrupt = (PyObject *)&_PyExc_KeyboardInterrupt;
static int
ImportError_init(PyImportErrorObject *self, PyObject *args, PyObject *kwds)
{
static char *kwlist[] = {"name", "path", "name_from", 0};
PyObject *empty_tuple;
PyObject *msg = 0;
PyObject *name = 0;
PyObject *path = 0;
PyObject *name_from = 0;
if (BaseException_init((PyBaseExceptionObject *)self, args, 0) == -1)
return -1;
empty_tuple = PyTuple_New(0);
if (!empty_tuple)
return -1;
if (!_PyArg_ParseTupleAndKeywords_SizeT(empty_tuple, kwds, "|$OOO:ImportError", kwlist,
&name, &path, &name_from)) {
Py_DECREF(((PyObject*)((empty_tuple))));
return -1;
}
Py_DECREF(((PyObject*)((empty_tuple))));
do { * _tmp_dst_ptr = &(self->name); _tmp_old_dst = (*_tmp_dst_ptr); *_tmp_dst_ptr = (_Py_XNewRef(((PyObject*)((name))))); Py_XDECREF(((PyObject*)((_tmp_old_dst)))); } while (0);
do { * _tmp_dst_ptr = &(self->path); _tmp_old_dst = (*_tmp_dst_ptr); *_tmp_dst_ptr = (_Py_XNewRef(((PyObject*)((path))))); Py_XDECREF(((PyObject*)((_tmp_old_dst)))); } while (0);
do { * _tmp_dst_ptr = &(self->name_from); _tmp_old_dst = (*_tmp_dst_ptr); *_tmp_dst_ptr = (_Py_XNewRef(((PyObject*)((name_from))))); Py_XDECREF(((PyObject*)((_tmp_old_dst)))); } while (0);
if (PyTuple_GET_SIZE(((PyObject*)((args)))) == 1) {
msg = _Py_NewRef(((PyObject*)((((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((args))))), ((1UL << 26)))), ((PyTupleObject*)((args))))->ob_item[(0)])))));
}
do { * _tmp_dst_ptr = &(self->msg); _tmp_old_dst = (*_tmp_dst_ptr); *_tmp_dst_ptr = (msg); Py_XDECREF(((PyObject*)((_tmp_old_dst)))); } while (0);
return 0;
}
static int
ImportError_clear(PyImportErrorObject *self)
{
do { * _tmp_op_ptr = &(self->msg); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->name); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->path); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->name_from); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
return BaseException_clear((PyBaseExceptionObject *)self);
}
static void
ImportError_dealloc(PyImportErrorObject *self)
{
_PyObject_GC_UNTRACK("/home/nxpub/dev/experiments/pyresearch/cpython/Objects/tmp3re1uol4", 1543, ((PyObject*)((self))));
ImportError_clear(self);
Py_TYPE(((PyObject*)((self))))->tp_free((PyObject *)self);
}
static int
ImportError_traverse(PyImportErrorObject *self, visitproc visit, void *arg)
{
do { if (self->msg) { int vret = visit(((PyObject*)((self->msg))), arg); if (vret) return vret; } } while (0);
do { if (self->name) { int vret = visit(((PyObject*)((self->name))), arg); if (vret) return vret; } } while (0);
do { if (self->path) { int vret = visit(((PyObject*)((self->path))), arg); if (vret) return vret; } } while (0);
do { if (self->name_from) { int vret = visit(((PyObject*)((self->name_from))), arg); if (vret) return vret; } } while (0);
return BaseException_traverse((PyBaseExceptionObject *)self, visit, arg);
}
static PyObject *
ImportError_str(PyImportErrorObject *self)
{
if (self->msg && Py_IS_TYPE(((PyObject*)(((self->msg)))), (&PyUnicode_Type))) {
return _Py_NewRef(((PyObject*)((self->msg))));
}
else {
return BaseException_str((PyBaseExceptionObject *)self);
}
}
static PyObject *
ImportError_getstate(PyImportErrorObject *self)
{
PyObject *dict = ((PyBaseExceptionObject *)self)->dict;
if (self->name || self->path || self->name_from) {
dict = dict ? PyDict_Copy(dict) : PyDict_New();
if (dict == 0)
return 0;
if (self->name && PyDict_SetItem(dict, &(_PyRuntime.static_objects.singletons.strings.identifiers._py_name._ascii.ob_base), self->name) < 0) {
Py_DECREF(((PyObject*)((dict))));
return 0;
}
if (self->path && PyDict_SetItem(dict, &(_PyRuntime.static_objects.singletons.strings.identifiers._py_path._ascii.ob_base), self->path) < 0) {
Py_DECREF(((PyObject*)((dict))));
return 0;
}
if (self->name_from && PyDict_SetItem(dict, &(_PyRuntime.static_objects.singletons.strings.identifiers._py_name_from._ascii.ob_base), self->name_from) < 0) {
Py_DECREF(((PyObject*)((dict))));
return 0;
}
return dict;
}
else if (dict) {
return _Py_NewRef(((PyObject*)((dict))));
}
else {
return _Py_NewRef(((PyObject*)(((&_Py_NoneStruct)))));
}
}
static PyObject *
ImportError_reduce(PyImportErrorObject *self, PyObject *_unused_ignored )
{
PyObject *res;
PyObject *args;
PyObject *state = ImportError_getstate(self);
if (state == 0)
return 0;
args = ((PyBaseExceptionObject *)self)->args;
if (state == (&_Py_NoneStruct))
res = PyTuple_Pack(2, Py_TYPE(((PyObject*)((self)))), args);
else
res = PyTuple_Pack(3, Py_TYPE(((PyObject*)((self)))), args, state);
Py_DECREF(((PyObject*)((state))));
return res;
}
static PyMemberDef ImportError_members[] = {
{"msg", 6, offsetof(PyImportErrorObject, msg), 0,
"exception message"},
{"name", 6, offsetof(PyImportErrorObject, name), 0,
"module name"},
{"path", 6, offsetof(PyImportErrorObject, path), 0,
"module path"},
{"name_from", 6, offsetof(PyImportErrorObject, name_from), 0,
"name imported from module"},
{0}
};
static PyMethodDef ImportError_methods[] = {
{"__reduce__", (PyCFunction)ImportError_reduce, 0x0004},
{0}
};
static PyTypeObject _PyExc_ImportError = { { { 1, (0) }, (0) }, "ImportError", sizeof(PyImportErrorObject), 0, (destructor)ImportError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (reprfunc)ImportError_str, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Import can't find module, or can't find name in " "module.", (traverseproc)ImportError_traverse, (inquiry)ImportError_clear, 0, 0, 0, 0, ImportError_methods, ImportError_members, 0, &_PyExc_Exception, 0, 0, 0, offsetof(PyImportErrorObject, dict), (initproc)ImportError_init, 0, 0,}; PyObject *PyExc_ImportError = (PyObject *)&_PyExc_ImportError;
static PyTypeObject _PyExc_ModuleNotFoundError = { { { 1, (0) }, (0) }, "ModuleNotFoundError", sizeof(PyImportErrorObject), 0, (destructor)ImportError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Module not found.", (traverseproc)ImportError_traverse, (inquiry)ImportError_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_ImportError, 0, 0, 0, offsetof(PyImportErrorObject, dict), (initproc)ImportError_init, 0, 0, }; PyObject *PyExc_ModuleNotFoundError = (PyObject *)&_PyExc_ModuleNotFoundError;
static int
oserror_parse_args(PyObject **p_args,
PyObject **myerrno, PyObject **strerror,
PyObject **filename, PyObject **filename2
)
{
Py_ssize_t nargs;
PyObject *args = *p_args;
PyObject *_winerror = 0;
PyObject **winerror = &_winerror;
nargs = PyTuple_GET_SIZE(((PyObject*)((args))));
if (nargs >= 2 && nargs <= 5) {
if (!PyArg_UnpackTuple(args, "OSError", 2, 5,
myerrno, strerror,
filename, winerror, filename2))
return -1;
}
return 0;
}
static int
oserror_init(PyOSErrorObject *self, PyObject **p_args,
PyObject *myerrno, PyObject *strerror,
PyObject *filename, PyObject *filename2
)
{
PyObject *args = *p_args;
Py_ssize_t nargs = PyTuple_GET_SIZE(((PyObject*)((args))));
if (filename && filename != (&_Py_NoneStruct)) {
if (Py_IS_TYPE(((PyObject*)((self))), ((PyTypeObject *) PyExc_BlockingIOError)) &&
PyNumber_Check(filename)) {
self->written = PyNumber_AsSsize_t(filename, PyExc_ValueError);
if (self->written == -1 && PyErr_Occurred())
return -1;
}
else {
self->filename = _Py_NewRef(((PyObject*)((filename))));
if (filename2 && filename2 != (&_Py_NoneStruct)) {
self->filename2 = _Py_NewRef(((PyObject*)((filename2))));
}
if (nargs >= 2 && nargs <= 5) {
PyObject *subslice = PyTuple_GetSlice(args, 0, 2);
if (!subslice)
return -1;
Py_DECREF(((PyObject*)((args))));
*p_args = args = subslice;
}
}
}
self->myerrno = _Py_XNewRef(((PyObject*)((myerrno))));
self->strerror = _Py_XNewRef(((PyObject*)((strerror))));
do { * _tmp_dst_ptr = &(self->args); _tmp_old_dst = (*_tmp_dst_ptr); *_tmp_dst_ptr = (args); Py_XDECREF(((PyObject*)((_tmp_old_dst)))); } while (0);
*p_args = args = 0;
return 0;
}
static PyObject *
OSError_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
static int
OSError_init(PyOSErrorObject *self, PyObject *args, PyObject *kwds);
static int
oserror_use_init(PyTypeObject *type)
{
if (type->tp_init != (initproc) OSError_init &&
type->tp_new == (newfunc) OSError_new) {
assert((PyObject *) type != PyExc_OSError);
return 1;
}
return 0;
}
static PyObject *
OSError_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
PyOSErrorObject *self = 0;
PyObject *myerrno = 0, *strerror = 0;
PyObject *filename = 0, *filename2 = 0;
Py_INCREF(((PyObject*)((args))));
if (!oserror_use_init(type)) {
if (!((kwds) == 0 || _PyArg_NoKeywords((type->tp_name), (kwds))))
goto error;
if (oserror_parse_args(&args, &myerrno, &strerror,
&filename, &filename2
))
goto error;
struct _Py_exc_state *state = get_exc_state();
if (myerrno && PyType_HasFeature((Py_TYPE(((PyObject*)((myerrno))))), ((1UL << 24))) &&
state->errnomap && (PyObject *) type == PyExc_OSError) {
PyObject *newtype;
newtype = PyDict_GetItemWithError(state->errnomap, myerrno);
if (newtype) {
type = (assert(PyType_Check(((PyObject*)((newtype))))), ((PyTypeObject*)((newtype))));
}
else if (PyErr_Occurred())
goto error;
}
}
self = (PyOSErrorObject *) type->tp_alloc(type, 0);
if (!self)
goto error;
self->dict = 0;
self->traceback = self->cause = self->context = 0;
self->written = -1;
if (!oserror_use_init(type)) {
if (oserror_init(self, &args, myerrno, strerror, filename, filename2
))
goto error;
}
else {
self->args = PyTuple_New(0);
if (self->args == 0)
goto error;
}
Py_XDECREF(((PyObject*)((args))));
return (PyObject *) self;
error:
Py_XDECREF(((PyObject*)((args))));
Py_XDECREF(((PyObject*)((self))));
return 0;
}
static int
OSError_init(PyOSErrorObject *self, PyObject *args, PyObject *kwds)
{
PyObject *myerrno = 0, *strerror = 0;
PyObject *filename = 0, *filename2 = 0;
if (!oserror_use_init(Py_TYPE(((PyObject*)((self))))))
return 0;
if (!((kwds) == 0 || _PyArg_NoKeywords((Py_TYPE(((PyObject*)((self))))->tp_name), (kwds))))
return -1;
Py_INCREF(((PyObject*)((args))));
if (oserror_parse_args(&args, &myerrno, &strerror, &filename, &filename2
))
goto error;
if (oserror_init(self, &args, myerrno, strerror, filename, filename2
))
goto error;
return 0;
error:
Py_DECREF(((PyObject*)((args))));
return -1;
}
static int
OSError_clear(PyOSErrorObject *self)
{
do { * _tmp_op_ptr = &(self->myerrno); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->strerror); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->filename); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->filename2); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
return BaseException_clear((PyBaseExceptionObject *)self);
}
static void
OSError_dealloc(PyOSErrorObject *self)
{
_PyObject_GC_UNTRACK("/home/nxpub/dev/experiments/pyresearch/cpython/Objects/tmp3re1uol4", 1933, ((PyObject*)((self))));
OSError_clear(self);
Py_TYPE(((PyObject*)((self))))->tp_free((PyObject *)self);
}
static int
OSError_traverse(PyOSErrorObject *self, visitproc visit,
void *arg)
{
do { if (self->myerrno) { int vret = visit(((PyObject*)((self->myerrno))), arg); if (vret) return vret; } } while (0);
do { if (self->strerror) { int vret = visit(((PyObject*)((self->strerror))), arg); if (vret) return vret; } } while (0);
do { if (self->filename) { int vret = visit(((PyObject*)((self->filename))), arg); if (vret) return vret; } } while (0);
do { if (self->filename2) { int vret = visit(((PyObject*)((self->filename2))), arg); if (vret) return vret; } } while (0);
return BaseException_traverse((PyBaseExceptionObject *)self, visit, arg);
}
static PyObject *
OSError_str(PyOSErrorObject *self)
{
if (self->filename) {
if (self->filename2) {
return PyUnicode_FromFormat("[Errno %S] %S: %R -> %R",
((self->myerrno)?(self->myerrno):(&_Py_NoneStruct)),
((self->strerror)?(self->strerror):(&_Py_NoneStruct)),
self->filename,
self->filename2);
} else {
return PyUnicode_FromFormat("[Errno %S] %S: %R",
((self->myerrno)?(self->myerrno):(&_Py_NoneStruct)),
((self->strerror)?(self->strerror):(&_Py_NoneStruct)),
self->filename);
}
}
if (self->myerrno && self->strerror)
return PyUnicode_FromFormat("[Errno %S] %S",
self->myerrno, self->strerror);
return BaseException_str((PyBaseExceptionObject *)self);
}
static PyObject *
OSError_reduce(PyOSErrorObject *self, PyObject *_unused_ignored )
{
PyObject *args = self->args;
PyObject *res = 0;
if (PyTuple_GET_SIZE(((PyObject*)((args)))) == 2 && self->filename) {
Py_ssize_t size = self->filename2 ? 5 : 3;
args = PyTuple_New(size);
if (!args)
return 0;
PyTuple_SET_ITEM(((PyObject*)((args))), (0), ((PyObject*)((_Py_NewRef(((PyObject*)((((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((self->args))))), ((1UL << 26)))), ((PyTupleObject*)((self->args))))->ob_item[(0)])))))))));
PyTuple_SET_ITEM(((PyObject*)((args))), (1), ((PyObject*)((_Py_NewRef(((PyObject*)((((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((self->args))))), ((1UL << 26)))), ((PyTupleObject*)((self->args))))->ob_item[(1)])))))))));
PyTuple_SET_ITEM(((PyObject*)((args))), (2), ((PyObject*)((_Py_NewRef(((PyObject*)((self->filename))))))));
if (self->filename2) {
PyTuple_SET_ITEM(((PyObject*)((args))), (3), ((PyObject*)((_Py_NewRef(((PyObject*)(((&_Py_NoneStruct)))))))));
PyTuple_SET_ITEM(((PyObject*)((args))), (4), ((PyObject*)((_Py_NewRef(((PyObject*)((self->filename2))))))));
}
} else
Py_INCREF(((PyObject*)((args))));
if (self->dict)
res = PyTuple_Pack(3, Py_TYPE(((PyObject*)((self)))), args, self->dict);
else
res = PyTuple_Pack(2, Py_TYPE(((PyObject*)((self)))), args);
Py_DECREF(((PyObject*)((args))));
return res;
}
static PyObject *
OSError_written_get(PyOSErrorObject *self, void *context)
{
if (self->written == -1) {
PyErr_SetString(PyExc_AttributeError, "characters_written");
return 0;
}
return PyLong_FromSsize_t(self->written);
}
static int
OSError_written_set(PyOSErrorObject *self, PyObject *arg, void *context)
{
if (arg == 0) {
if (self->written == -1) {
PyErr_SetString(PyExc_AttributeError, "characters_written");
return -1;
}
self->written = -1;
return 0;
}
Py_ssize_t n;
n = PyNumber_AsSsize_t(arg, PyExc_ValueError);
if (n == -1 && PyErr_Occurred())
return -1;
self->written = n;
return 0;
}
static PyMemberDef OSError_members[] = {
{"errno", 6, offsetof(PyOSErrorObject, myerrno), 0,
"POSIX exception code"},
{"strerror", 6, offsetof(PyOSErrorObject, strerror), 0,
"exception strerror"},
{"filename", 6, offsetof(PyOSErrorObject, filename), 0,
"exception filename"},
{"filename2", 6, offsetof(PyOSErrorObject, filename2), 0,
"second exception filename"},
{0}
};
static PyMethodDef OSError_methods[] = {
{"__reduce__", (PyCFunction)OSError_reduce, 0x0004},
{0}
};
static PyGetSetDef OSError_getset[] = {
{"characters_written", (getter) OSError_written_get,
(setter) OSError_written_set, 0},
{0}
};
static PyTypeObject _PyExc_OSError = { { { 1, (0) }, (0) }, "OSError", sizeof(PyOSErrorObject), 0, (destructor)OSError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (reprfunc)OSError_str, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Base class for I/O related errors.", (traverseproc)OSError_traverse, (inquiry)OSError_clear, 0, 0, 0, 0, OSError_methods, OSError_members, OSError_getset, &_PyExc_Exception, 0, 0, 0, offsetof(PyOSErrorObject, dict), (initproc)OSError_init, 0, OSError_new,}; PyObject *PyExc_OSError = (PyObject *)&_PyExc_OSError;
static PyTypeObject _PyExc_BlockingIOError = { { { 1, (0) }, (0) }, "BlockingIOError", sizeof(PyOSErrorObject), 0, (destructor)OSError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "I/O operation would block.", (traverseproc)OSError_traverse, (inquiry)OSError_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_OSError, 0, 0, 0, offsetof(PyOSErrorObject, dict), (initproc)OSError_init, 0, 0, }; PyObject *PyExc_BlockingIOError = (PyObject *)&_PyExc_BlockingIOError;
static PyTypeObject _PyExc_ConnectionError = { { { 1, (0) }, (0) }, "ConnectionError", sizeof(PyOSErrorObject), 0, (destructor)OSError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Connection error.", (traverseproc)OSError_traverse, (inquiry)OSError_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_OSError, 0, 0, 0, offsetof(PyOSErrorObject, dict), (initproc)OSError_init, 0, 0, }; PyObject *PyExc_ConnectionError = (PyObject *)&_PyExc_ConnectionError;
static PyTypeObject _PyExc_ChildProcessError = { { { 1, (0) }, (0) }, "ChildProcessError", sizeof(PyOSErrorObject), 0, (destructor)OSError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Child process error.", (traverseproc)OSError_traverse, (inquiry)OSError_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_OSError, 0, 0, 0, offsetof(PyOSErrorObject, dict), (initproc)OSError_init, 0, 0, }; PyObject *PyExc_ChildProcessError = (PyObject *)&_PyExc_ChildProcessError;
static PyTypeObject _PyExc_BrokenPipeError = { { { 1, (0) }, (0) }, "BrokenPipeError", sizeof(PyOSErrorObject), 0, (destructor)OSError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Broken pipe.", (traverseproc)OSError_traverse, (inquiry)OSError_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_ConnectionError, 0, 0, 0, offsetof(PyOSErrorObject, dict), (initproc)OSError_init, 0, 0, }; PyObject *PyExc_BrokenPipeError = (PyObject *)&_PyExc_BrokenPipeError;
static PyTypeObject _PyExc_ConnectionAbortedError = { { { 1, (0) }, (0) }, "ConnectionAbortedError", sizeof(PyOSErrorObject), 0, (destructor)OSError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Connection aborted.", (traverseproc)OSError_traverse, (inquiry)OSError_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_ConnectionError, 0, 0, 0, offsetof(PyOSErrorObject, dict), (initproc)OSError_init, 0, 0, }; PyObject *PyExc_ConnectionAbortedError = (PyObject *)&_PyExc_ConnectionAbortedError;
static PyTypeObject _PyExc_ConnectionRefusedError = { { { 1, (0) }, (0) }, "ConnectionRefusedError", sizeof(PyOSErrorObject), 0, (destructor)OSError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Connection refused.", (traverseproc)OSError_traverse, (inquiry)OSError_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_ConnectionError, 0, 0, 0, offsetof(PyOSErrorObject, dict), (initproc)OSError_init, 0, 0, }; PyObject *PyExc_ConnectionRefusedError = (PyObject *)&_PyExc_ConnectionRefusedError;
static PyTypeObject _PyExc_ConnectionResetError = { { { 1, (0) }, (0) }, "ConnectionResetError", sizeof(PyOSErrorObject), 0, (destructor)OSError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Connection reset.", (traverseproc)OSError_traverse, (inquiry)OSError_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_ConnectionError, 0, 0, 0, offsetof(PyOSErrorObject, dict), (initproc)OSError_init, 0, 0, }; PyObject *PyExc_ConnectionResetError = (PyObject *)&_PyExc_ConnectionResetError;
static PyTypeObject _PyExc_FileExistsError = { { { 1, (0) }, (0) }, "FileExistsError", sizeof(PyOSErrorObject), 0, (destructor)OSError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "File already exists.", (traverseproc)OSError_traverse, (inquiry)OSError_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_OSError, 0, 0, 0, offsetof(PyOSErrorObject, dict), (initproc)OSError_init, 0, 0, }; PyObject *PyExc_FileExistsError = (PyObject *)&_PyExc_FileExistsError;
static PyTypeObject _PyExc_FileNotFoundError = { { { 1, (0) }, (0) }, "FileNotFoundError", sizeof(PyOSErrorObject), 0, (destructor)OSError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "File not found.", (traverseproc)OSError_traverse, (inquiry)OSError_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_OSError, 0, 0, 0, offsetof(PyOSErrorObject, dict), (initproc)OSError_init, 0, 0, }; PyObject *PyExc_FileNotFoundError = (PyObject *)&_PyExc_FileNotFoundError;
static PyTypeObject _PyExc_IsADirectoryError = { { { 1, (0) }, (0) }, "IsADirectoryError", sizeof(PyOSErrorObject), 0, (destructor)OSError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Operation doesn't work on directories.", (traverseproc)OSError_traverse, (inquiry)OSError_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_OSError, 0, 0, 0, offsetof(PyOSErrorObject, dict), (initproc)OSError_init, 0, 0, }; PyObject *PyExc_IsADirectoryError = (PyObject *)&_PyExc_IsADirectoryError;
static PyTypeObject _PyExc_NotADirectoryError = { { { 1, (0) }, (0) }, "NotADirectoryError", sizeof(PyOSErrorObject), 0, (destructor)OSError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Operation only works on directories.", (traverseproc)OSError_traverse, (inquiry)OSError_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_OSError, 0, 0, 0, offsetof(PyOSErrorObject, dict), (initproc)OSError_init, 0, 0, }; PyObject *PyExc_NotADirectoryError = (PyObject *)&_PyExc_NotADirectoryError;
static PyTypeObject _PyExc_InterruptedError = { { { 1, (0) }, (0) }, "InterruptedError", sizeof(PyOSErrorObject), 0, (destructor)OSError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Interrupted by signal.", (traverseproc)OSError_traverse, (inquiry)OSError_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_OSError, 0, 0, 0, offsetof(PyOSErrorObject, dict), (initproc)OSError_init, 0, 0, }; PyObject *PyExc_InterruptedError = (PyObject *)&_PyExc_InterruptedError;
static PyTypeObject _PyExc_PermissionError = { { { 1, (0) }, (0) }, "PermissionError", sizeof(PyOSErrorObject), 0, (destructor)OSError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Not enough permissions.", (traverseproc)OSError_traverse, (inquiry)OSError_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_OSError, 0, 0, 0, offsetof(PyOSErrorObject, dict), (initproc)OSError_init, 0, 0, }; PyObject *PyExc_PermissionError = (PyObject *)&_PyExc_PermissionError;
static PyTypeObject _PyExc_ProcessLookupError = { { { 1, (0) }, (0) }, "ProcessLookupError", sizeof(PyOSErrorObject), 0, (destructor)OSError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Process not found.", (traverseproc)OSError_traverse, (inquiry)OSError_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_OSError, 0, 0, 0, offsetof(PyOSErrorObject, dict), (initproc)OSError_init, 0, 0, }; PyObject *PyExc_ProcessLookupError = (PyObject *)&_PyExc_ProcessLookupError;
static PyTypeObject _PyExc_TimeoutError = { { { 1, (0) }, (0) }, "TimeoutError", sizeof(PyOSErrorObject), 0, (destructor)OSError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Timeout expired.", (traverseproc)OSError_traverse, (inquiry)OSError_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_OSError, 0, 0, 0, offsetof(PyOSErrorObject, dict), (initproc)OSError_init, 0, 0, }; PyObject *PyExc_TimeoutError = (PyObject *)&_PyExc_TimeoutError;
static PyTypeObject _PyExc_EOFError = { { { 1, (0) }, (0) }, "EOFError", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Read beyond end of file.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Exception, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_EOFError = (PyObject *)&_PyExc_EOFError;
static PyTypeObject _PyExc_RuntimeError = { { { 1, (0) }, (0) }, "RuntimeError", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Unspecified run-time error.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Exception, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_RuntimeError = (PyObject *)&_PyExc_RuntimeError;
static PyTypeObject _PyExc_RecursionError = { { { 1, (0) }, (0) }, "RecursionError", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Recursion limit exceeded.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_RuntimeError, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_RecursionError = (PyObject *)&_PyExc_RecursionError;
static PyTypeObject _PyExc_NotImplementedError = { { { 1, (0) }, (0) }, "NotImplementedError", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Method or function hasn't been implemented yet.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_RuntimeError, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_NotImplementedError = (PyObject *)&_PyExc_NotImplementedError;
static int
NameError_init(PyNameErrorObject *self, PyObject *args, PyObject *kwds)
{
static char *kwlist[] = {"name", 0};
PyObject *name = 0;
if (BaseException_init((PyBaseExceptionObject *)self, args, 0) == -1) {
return -1;
}
PyObject *empty_tuple = PyTuple_New(0);
if (!empty_tuple) {
return -1;
}
if (!_PyArg_ParseTupleAndKeywords_SizeT(empty_tuple, kwds, "|$O:NameError", kwlist,
&name)) {
Py_DECREF(((PyObject*)((empty_tuple))));
return -1;
}
Py_DECREF(((PyObject*)((empty_tuple))));
do { * _tmp_dst_ptr = &(self->name); _tmp_old_dst = (*_tmp_dst_ptr); *_tmp_dst_ptr = (_Py_XNewRef(((PyObject*)((name))))); Py_XDECREF(((PyObject*)((_tmp_old_dst)))); } while (0);
return 0;
}
static int
NameError_clear(PyNameErrorObject *self)
{
do { * _tmp_op_ptr = &(self->name); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
return BaseException_clear((PyBaseExceptionObject *)self);
}
static void
NameError_dealloc(PyNameErrorObject *self)
{
_PyObject_GC_UNTRACK("/home/nxpub/dev/experiments/pyresearch/cpython/Objects/tmp3re1uol4", 2200, ((PyObject*)((self))));
NameError_clear(self);
Py_TYPE(((PyObject*)((self))))->tp_free((PyObject *)self);
}
static int
NameError_traverse(PyNameErrorObject *self, visitproc visit, void *arg)
{
do { if (self->name) { int vret = visit(((PyObject*)((self->name))), arg); if (vret) return vret; } } while (0);
return BaseException_traverse((PyBaseExceptionObject *)self, visit, arg);
}
static PyMemberDef NameError_members[] = {
{"name", 6, offsetof(PyNameErrorObject, name), 0, "name"},
{0}
};
static PyMethodDef NameError_methods[] = {
{0}
};
static PyTypeObject _PyExc_NameError = { { { 1, (0) }, (0) }, "NameError", sizeof(PyNameErrorObject), 0, (destructor)NameError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (reprfunc)BaseException_str, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Name not found globally.", (traverseproc)NameError_traverse, (inquiry)NameError_clear, 0, 0, 0, 0, NameError_methods, NameError_members, 0, &_PyExc_Exception, 0, 0, 0, offsetof(PyNameErrorObject, dict), (initproc)NameError_init, 0, 0,}; PyObject *PyExc_NameError = (PyObject *)&_PyExc_NameError;
static PyTypeObject _PyExc_UnboundLocalError = { { { 1, (0) }, (0) }, "UnboundLocalError", sizeof(PyNameErrorObject), 0, (destructor)NameError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Local name referenced but not bound to a value.", (traverseproc)NameError_traverse, (inquiry)NameError_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_NameError, 0, 0, 0, offsetof(PyNameErrorObject, dict), (initproc)NameError_init, 0, 0, }; PyObject *PyExc_UnboundLocalError = (PyObject *)&_PyExc_UnboundLocalError;
static int
AttributeError_init(PyAttributeErrorObject *self, PyObject *args, PyObject *kwds)
{
static char *kwlist[] = {"name", "obj", 0};
PyObject *name = 0;
PyObject *obj = 0;
if (BaseException_init((PyBaseExceptionObject *)self, args, 0) == -1) {
return -1;
}
PyObject *empty_tuple = PyTuple_New(0);
if (!empty_tuple) {
return -1;
}
if (!_PyArg_ParseTupleAndKeywords_SizeT(empty_tuple, kwds, "|$OO:AttributeError", kwlist,
&name, &obj)) {
Py_DECREF(((PyObject*)((empty_tuple))));
return -1;
}
Py_DECREF(((PyObject*)((empty_tuple))));
do { * _tmp_dst_ptr = &(self->name); _tmp_old_dst = (*_tmp_dst_ptr); *_tmp_dst_ptr = (_Py_XNewRef(((PyObject*)((name))))); Py_XDECREF(((PyObject*)((_tmp_old_dst)))); } while (0);
do { * _tmp_dst_ptr = &(self->obj); _tmp_old_dst = (*_tmp_dst_ptr); *_tmp_dst_ptr = (_Py_XNewRef(((PyObject*)((obj))))); Py_XDECREF(((PyObject*)((_tmp_old_dst)))); } while (0);
return 0;
}
static int
AttributeError_clear(PyAttributeErrorObject *self)
{
do { * _tmp_op_ptr = &(self->obj); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->name); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
return BaseException_clear((PyBaseExceptionObject *)self);
}
static void
AttributeError_dealloc(PyAttributeErrorObject *self)
{
_PyObject_GC_UNTRACK("/home/nxpub/dev/experiments/pyresearch/cpython/Objects/tmp3re1uol4", 2276, ((PyObject*)((self))));
AttributeError_clear(self);
Py_TYPE(((PyObject*)((self))))->tp_free((PyObject *)self);
}
static int
AttributeError_traverse(PyAttributeErrorObject *self, visitproc visit, void *arg)
{
do { if (self->obj) { int vret = visit(((PyObject*)((self->obj))), arg); if (vret) return vret; } } while (0);
do { if (self->name) { int vret = visit(((PyObject*)((self->name))), arg); if (vret) return vret; } } while (0);
return BaseException_traverse((PyBaseExceptionObject *)self, visit, arg);
}
static PyMemberDef AttributeError_members[] = {
{"name", 6, offsetof(PyAttributeErrorObject, name), 0, "attribute name"},
{"obj", 6, offsetof(PyAttributeErrorObject, obj), 0, "object"},
{0}
};
static PyMethodDef AttributeError_methods[] = {
{0}
};
static PyTypeObject _PyExc_AttributeError = { { { 1, (0) }, (0) }, "AttributeError", sizeof(PyAttributeErrorObject), 0, (destructor)AttributeError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (reprfunc)BaseException_str, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Attribute not found.", (traverseproc)AttributeError_traverse, (inquiry)AttributeError_clear, 0, 0, 0, 0, AttributeError_methods, AttributeError_members, 0, &_PyExc_Exception, 0, 0, 0, offsetof(PyAttributeErrorObject, dict), (initproc)AttributeError_init, 0, 0,}; PyObject *PyExc_AttributeError = (PyObject *)&_PyExc_AttributeError;
static int
SyntaxError_init(PySyntaxErrorObject *self, PyObject *args, PyObject *kwds)
{
PyObject *info = 0;
Py_ssize_t lenargs = PyTuple_GET_SIZE(((PyObject*)((args))));
if (BaseException_init((PyBaseExceptionObject *)self, args, kwds) == -1)
return -1;
if (lenargs >= 1) {
do { * _tmp_dst_ptr = &(self->msg); _tmp_old_dst = (*_tmp_dst_ptr); *_tmp_dst_ptr = (_Py_NewRef(((PyObject*)((((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((args))))), ((1UL << 26)))), ((PyTupleObject*)((args))))->ob_item[(0)])))))); Py_XDECREF(((PyObject*)((_tmp_old_dst)))); } while (0);
}
if (lenargs == 2) {
info = ((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((args))))), ((1UL << 26)))), ((PyTupleObject*)((args))))->ob_item[(1)]);
info = PySequence_Tuple(info);
if (!info) {
return -1;
}
self->end_lineno = 0;
self->end_offset = 0;
if (!_PyArg_ParseTuple_SizeT(info, "OOOO|OO",
&self->filename, &self->lineno,
&self->offset, &self->text,
&self->end_lineno, &self->end_offset)) {
Py_DECREF(((PyObject*)((info))));
return -1;
}
Py_INCREF(((PyObject*)((self->filename))));
Py_INCREF(((PyObject*)((self->lineno))));
Py_INCREF(((PyObject*)((self->offset))));
Py_INCREF(((PyObject*)((self->text))));
Py_XINCREF(((PyObject*)((self->end_lineno))));
Py_XINCREF(((PyObject*)((self->end_offset))));
Py_DECREF(((PyObject*)((info))));
if (self->end_lineno != 0 && self->end_offset == 0) {
PyErr_SetString(PyExc_TypeError, "end_offset must be provided when end_lineno is provided");
return -1;
}
}
return 0;
}
static int
SyntaxError_clear(PySyntaxErrorObject *self)
{
do { * _tmp_op_ptr = &(self->msg); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->filename); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->lineno); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->offset); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->end_lineno); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->end_offset); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->text); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->print_file_and_line); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
return BaseException_clear((PyBaseExceptionObject *)self);
}
static void
SyntaxError_dealloc(PySyntaxErrorObject *self)
{
_PyObject_GC_UNTRACK("/home/nxpub/dev/experiments/pyresearch/cpython/Objects/tmp3re1uol4", 2370, ((PyObject*)((self))));
SyntaxError_clear(self);
Py_TYPE(((PyObject*)((self))))->tp_free((PyObject *)self);
}
static int
SyntaxError_traverse(PySyntaxErrorObject *self, visitproc visit, void *arg)
{
do { if (self->msg) { int vret = visit(((PyObject*)((self->msg))), arg); if (vret) return vret; } } while (0);
do { if (self->filename) { int vret = visit(((PyObject*)((self->filename))), arg); if (vret) return vret; } } while (0);
do { if (self->lineno) { int vret = visit(((PyObject*)((self->lineno))), arg); if (vret) return vret; } } while (0);
do { if (self->offset) { int vret = visit(((PyObject*)((self->offset))), arg); if (vret) return vret; } } while (0);
do { if (self->end_lineno) { int vret = visit(((PyObject*)((self->end_lineno))), arg); if (vret) return vret; } } while (0);
do { if (self->end_offset) { int vret = visit(((PyObject*)((self->end_offset))), arg); if (vret) return vret; } } while (0);
do { if (self->text) { int vret = visit(((PyObject*)((self->text))), arg); if (vret) return vret; } } while (0);
do { if (self->print_file_and_line) { int vret = visit(((PyObject*)((self->print_file_and_line))), arg); if (vret) return vret; } } while (0);
return BaseException_traverse((PyBaseExceptionObject *)self, visit, arg);
}
static PyObject*
my_basename(PyObject *name)
{
Py_ssize_t i, size, offset;
int kind;
const void *data;
if (PyUnicode_READY(((PyObject*)((name)))))
return 0;
kind = ((void)0, ((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((name))))), ((1UL << 28)))), ((PyASCIIObject*)((name))))->state.kind));
data = PyUnicode_DATA(((PyObject*)((name))));
size = PyUnicode_GET_LENGTH(((PyObject*)((name))));
offset = 0;
for(i=0; i < size; i++) {
if (PyUnicode_READ(((int)(kind)), ((const void*)(data)), (i)) == L'/') {
offset = i + 1;
}
}
if (offset != 0) {
return PyUnicode_Substring(name, offset, size);
}
else {
return _Py_NewRef(((PyObject*)((name))));
}
}
static PyObject *
SyntaxError_str(PySyntaxErrorObject *self)
{
int have_lineno = 0;
PyObject *filename;
PyObject *result;
int overflow;
if (self->filename && PyType_HasFeature((Py_TYPE(((PyObject*)((self->filename))))), ((1UL << 28)))) {
filename = my_basename(self->filename);
if (filename == 0)
return 0;
} else {
filename = 0;
}
have_lineno = (self->lineno != 0) && Py_IS_TYPE(((PyObject*)(((self->lineno)))), (&PyLong_Type));
if (!filename && !have_lineno)
return PyObject_Str(self->msg ? self->msg : (&_Py_NoneStruct));
if (filename && have_lineno)
result = PyUnicode_FromFormat("%S (%U, line %ld)",
self->msg ? self->msg : (&_Py_NoneStruct),
filename,
PyLong_AsLongAndOverflow(self->lineno, &overflow));
else if (filename)
result = PyUnicode_FromFormat("%S (%U)",
self->msg ? self->msg : (&_Py_NoneStruct),
filename);
else
result = PyUnicode_FromFormat("%S (line %ld)",
self->msg ? self->msg : (&_Py_NoneStruct),
PyLong_AsLongAndOverflow(self->lineno, &overflow));
Py_XDECREF(((PyObject*)((filename))));
return result;
}
static PyMemberDef SyntaxError_members[] = {
{"msg", 6, offsetof(PySyntaxErrorObject, msg), 0,
"exception msg"},
{"filename", 6, offsetof(PySyntaxErrorObject, filename), 0,
"exception filename"},
{"lineno", 6, offsetof(PySyntaxErrorObject, lineno), 0,
"exception lineno"},
{"offset", 6, offsetof(PySyntaxErrorObject, offset), 0,
"exception offset"},
{"text", 6, offsetof(PySyntaxErrorObject, text), 0,
"exception text"},
{"end_lineno", 6, offsetof(PySyntaxErrorObject, end_lineno), 0,
"exception end lineno"},
{"end_offset", 6, offsetof(PySyntaxErrorObject, end_offset), 0,
"exception end offset"},
{"print_file_and_line", 6,
offsetof(PySyntaxErrorObject, print_file_and_line), 0,
"exception print_file_and_line"},
{0}
};
static PyTypeObject _PyExc_SyntaxError = { { { 1, (0) }, (0) }, "SyntaxError", sizeof(PySyntaxErrorObject), 0, (destructor)SyntaxError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (reprfunc)SyntaxError_str, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Invalid syntax.", (traverseproc)SyntaxError_traverse, (inquiry)SyntaxError_clear, 0, 0, 0, 0, 0, SyntaxError_members, 0, &_PyExc_Exception, 0, 0, 0, offsetof(PySyntaxErrorObject, dict), (initproc)SyntaxError_init, 0, 0,}; PyObject *PyExc_SyntaxError = (PyObject *)&_PyExc_SyntaxError;
static PyTypeObject _PyExc_IndentationError = { { { 1, (0) }, (0) }, "IndentationError", sizeof(PySyntaxErrorObject), 0, (destructor)SyntaxError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Improper indentation.", (traverseproc)SyntaxError_traverse, (inquiry)SyntaxError_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_SyntaxError, 0, 0, 0, offsetof(PySyntaxErrorObject, dict), (initproc)SyntaxError_init, 0, 0, }; PyObject *PyExc_IndentationError = (PyObject *)&_PyExc_IndentationError;
static PyTypeObject _PyExc_TabError = { { { 1, (0) }, (0) }, "TabError", sizeof(PySyntaxErrorObject), 0, (destructor)SyntaxError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Improper mixture of spaces and tabs.", (traverseproc)SyntaxError_traverse, (inquiry)SyntaxError_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_IndentationError, 0, 0, 0, offsetof(PySyntaxErrorObject, dict), (initproc)SyntaxError_init, 0, 0, }; PyObject *PyExc_TabError = (PyObject *)&_PyExc_TabError;
static PyTypeObject _PyExc_LookupError = { { { 1, (0) }, (0) }, "LookupError", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Base class for lookup errors.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Exception, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_LookupError = (PyObject *)&_PyExc_LookupError;
static PyTypeObject _PyExc_IndexError = { { { 1, (0) }, (0) }, "IndexError", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Sequence index out of range.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_LookupError, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_IndexError = (PyObject *)&_PyExc_IndexError;
static PyObject *
KeyError_str(PyBaseExceptionObject *self)
{
if (PyTuple_GET_SIZE(((PyObject*)((self->args)))) == 1) {
return PyObject_Repr(((assert(PyType_HasFeature((Py_TYPE(((PyObject*)((self->args))))), ((1UL << 26)))), ((PyTupleObject*)((self->args))))->ob_item[(0)]));
}
return BaseException_str(self);
}
static PyTypeObject _PyExc_KeyError = { { { 1, (0) }, (0) }, "KeyError", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (reprfunc)KeyError_str, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Mapping key not found.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_LookupError, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, 0,}; PyObject *PyExc_KeyError = (PyObject *)&_PyExc_KeyError;
static PyTypeObject _PyExc_ValueError = { { { 1, (0) }, (0) }, "ValueError", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Inappropriate argument value (of correct type).", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Exception, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_ValueError = (PyObject *)&_PyExc_ValueError;
static PyTypeObject _PyExc_UnicodeError = { { { 1, (0) }, (0) }, "UnicodeError", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Unicode related error.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_ValueError, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_UnicodeError = (PyObject *)&_PyExc_UnicodeError;
static PyObject *
get_string(PyObject *attr, const char *name)
{
if (!attr) {
PyErr_Format(PyExc_TypeError, "%.200s attribute not set", name);
return 0;
}
if (!PyType_HasFeature((Py_TYPE(((PyObject*)((attr))))), ((1UL << 27)))) {
PyErr_Format(PyExc_TypeError, "%.200s attribute must be bytes", name);
return 0;
}
return _Py_NewRef(((PyObject*)((attr))));
}
static PyObject *
get_unicode(PyObject *attr, const char *name)
{
if (!attr) {
PyErr_Format(PyExc_TypeError, "%.200s attribute not set", name);
return 0;
}
if (!PyType_HasFeature((Py_TYPE(((PyObject*)((attr))))), ((1UL << 28)))) {
PyErr_Format(PyExc_TypeError,
"%.200s attribute must be unicode", name);
return 0;
}
return _Py_NewRef(((PyObject*)((attr))));
}
static int
set_unicodefromstring(PyObject **attr, const char *value)
{
PyObject *obj = PyUnicode_FromString(value);
if (!obj)
return -1;
do { * _tmp_dst_ptr = &(*attr); _tmp_old_dst = (*_tmp_dst_ptr); *_tmp_dst_ptr = (obj); Py_XDECREF(((PyObject*)((_tmp_old_dst)))); } while (0);
return 0;
}
PyObject *
PyUnicodeEncodeError_GetEncoding(PyObject *exc)
{
return get_unicode(((PyUnicodeErrorObject *)exc)->encoding, "encoding");
}
PyObject *
PyUnicodeDecodeError_GetEncoding(PyObject *exc)
{
return get_unicode(((PyUnicodeErrorObject *)exc)->encoding, "encoding");
}
PyObject *
PyUnicodeEncodeError_GetObject(PyObject *exc)
{
return get_unicode(((PyUnicodeErrorObject *)exc)->object, "object");
}
PyObject *
PyUnicodeDecodeError_GetObject(PyObject *exc)
{
return get_string(((PyUnicodeErrorObject *)exc)->object, "object");
}
PyObject *
PyUnicodeTranslateError_GetObject(PyObject *exc)
{
return get_unicode(((PyUnicodeErrorObject *)exc)->object, "object");
}
int
PyUnicodeEncodeError_GetStart(PyObject *exc, Py_ssize_t *start)
{
Py_ssize_t size;
PyObject *obj = get_unicode(((PyUnicodeErrorObject *)exc)->object,
"object");
if (!obj)
return -1;
*start = ((PyUnicodeErrorObject *)exc)->start;
size = PyUnicode_GET_LENGTH(((PyObject*)((obj))));
if (*start<0)
*start = 0;
if (*start>=size)
*start = size-1;
Py_DECREF(((PyObject*)((obj))));
return 0;
}
int
PyUnicodeDecodeError_GetStart(PyObject *exc, Py_ssize_t *start)
{
Py_ssize_t size;
PyObject *obj = get_string(((PyUnicodeErrorObject *)exc)->object, "object");
if (!obj)
return -1;
size = PyBytes_GET_SIZE(((PyObject*)((obj))));
*start = ((PyUnicodeErrorObject *)exc)->start;
if (*start<0)
*start = 0;
if (*start>=size)
*start = size-1;
Py_DECREF(((PyObject*)((obj))));
return 0;
}
int
PyUnicodeTranslateError_GetStart(PyObject *exc, Py_ssize_t *start)
{
return PyUnicodeEncodeError_GetStart(exc, start);
}
int
PyUnicodeEncodeError_SetStart(PyObject *exc, Py_ssize_t start)
{
((PyUnicodeErrorObject *)exc)->start = start;
return 0;
}
int
PyUnicodeDecodeError_SetStart(PyObject *exc, Py_ssize_t start)
{
((PyUnicodeErrorObject *)exc)->start = start;
return 0;
}
int
PyUnicodeTranslateError_SetStart(PyObject *exc, Py_ssize_t start)
{
((PyUnicodeErrorObject *)exc)->start = start;
return 0;
}
int
PyUnicodeEncodeError_GetEnd(PyObject *exc, Py_ssize_t *end)
{
Py_ssize_t size;
PyObject *obj = get_unicode(((PyUnicodeErrorObject *)exc)->object,
"object");
if (!obj)
return -1;
*end = ((PyUnicodeErrorObject *)exc)->end;
size = PyUnicode_GET_LENGTH(((PyObject*)((obj))));
if (*end<1)
*end = 1;
if (*end>size)
*end = size;
Py_DECREF(((PyObject*)((obj))));
return 0;
}
int
PyUnicodeDecodeError_GetEnd(PyObject *exc, Py_ssize_t *end)
{
Py_ssize_t size;
PyObject *obj = get_string(((PyUnicodeErrorObject *)exc)->object, "object");
if (!obj)
return -1;
size = PyBytes_GET_SIZE(((PyObject*)((obj))));
*end = ((PyUnicodeErrorObject *)exc)->end;
if (*end<1)
*end = 1;
if (*end>size)
*end = size;
Py_DECREF(((PyObject*)((obj))));
return 0;
}
int
PyUnicodeTranslateError_GetEnd(PyObject *exc, Py_ssize_t *end)
{
return PyUnicodeEncodeError_GetEnd(exc, end);
}
int
PyUnicodeEncodeError_SetEnd(PyObject *exc, Py_ssize_t end)
{
((PyUnicodeErrorObject *)exc)->end = end;
return 0;
}
int
PyUnicodeDecodeError_SetEnd(PyObject *exc, Py_ssize_t end)
{
((PyUnicodeErrorObject *)exc)->end = end;
return 0;
}
int
PyUnicodeTranslateError_SetEnd(PyObject *exc, Py_ssize_t end)
{
((PyUnicodeErrorObject *)exc)->end = end;
return 0;
}
PyObject *
PyUnicodeEncodeError_GetReason(PyObject *exc)
{
return get_unicode(((PyUnicodeErrorObject *)exc)->reason, "reason");
}
PyObject *
PyUnicodeDecodeError_GetReason(PyObject *exc)
{
return get_unicode(((PyUnicodeErrorObject *)exc)->reason, "reason");
}
PyObject *
PyUnicodeTranslateError_GetReason(PyObject *exc)
{
return get_unicode(((PyUnicodeErrorObject *)exc)->reason, "reason");
}
int
PyUnicodeEncodeError_SetReason(PyObject *exc, const char *reason)
{
return set_unicodefromstring(&((PyUnicodeErrorObject *)exc)->reason,
reason);
}
int
PyUnicodeDecodeError_SetReason(PyObject *exc, const char *reason)
{
return set_unicodefromstring(&((PyUnicodeErrorObject *)exc)->reason,
reason);
}
int
PyUnicodeTranslateError_SetReason(PyObject *exc, const char *reason)
{
return set_unicodefromstring(&((PyUnicodeErrorObject *)exc)->reason,
reason);
}
static int
UnicodeError_clear(PyUnicodeErrorObject *self)
{
do { * _tmp_op_ptr = &(self->encoding); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->object); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->reason); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
return BaseException_clear((PyBaseExceptionObject *)self);
}
static void
UnicodeError_dealloc(PyUnicodeErrorObject *self)
{
_PyObject_GC_UNTRACK("/home/nxpub/dev/experiments/pyresearch/cpython/Objects/tmp3re1uol4", 2817, ((PyObject*)((self))));
UnicodeError_clear(self);
Py_TYPE(((PyObject*)((self))))->tp_free((PyObject *)self);
}
static int
UnicodeError_traverse(PyUnicodeErrorObject *self, visitproc visit, void *arg)
{
do { if (self->encoding) { int vret = visit(((PyObject*)((self->encoding))), arg); if (vret) return vret; } } while (0);
do { if (self->object) { int vret = visit(((PyObject*)((self->object))), arg); if (vret) return vret; } } while (0);
do { if (self->reason) { int vret = visit(((PyObject*)((self->reason))), arg); if (vret) return vret; } } while (0);
return BaseException_traverse((PyBaseExceptionObject *)self, visit, arg);
}
static PyMemberDef UnicodeError_members[] = {
{"encoding", 6, offsetof(PyUnicodeErrorObject, encoding), 0,
"exception encoding"},
{"object", 6, offsetof(PyUnicodeErrorObject, object), 0,
"exception object"},
{"start", 19, offsetof(PyUnicodeErrorObject, start), 0,
"exception start"},
{"end", 19, offsetof(PyUnicodeErrorObject, end), 0,
"exception end"},
{"reason", 6, offsetof(PyUnicodeErrorObject, reason), 0,
"exception reason"},
{0}
};
static int
UnicodeEncodeError_init(PyObject *self, PyObject *args, PyObject *kwds)
{
PyUnicodeErrorObject *err;
if (BaseException_init((PyBaseExceptionObject *)self, args, kwds) == -1)
return -1;
err = (PyUnicodeErrorObject *)self;
do { * _tmp_op_ptr = &(err->encoding); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(err->object); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(err->reason); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
if (!_PyArg_ParseTuple_SizeT(args, "UUnnU",
&err->encoding, &err->object,
&err->start, &err->end, &err->reason)) {
err->encoding = err->object = err->reason = 0;
return -1;
}
Py_INCREF(((PyObject*)((err->encoding))));
Py_INCREF(((PyObject*)((err->object))));
Py_INCREF(((PyObject*)((err->reason))));
return 0;
}
static PyObject *
UnicodeEncodeError_str(PyObject *self)
{
PyUnicodeErrorObject *uself = (PyUnicodeErrorObject *)self;
PyObject *result = 0;
PyObject *reason_str = 0;
PyObject *encoding_str = 0;
if (!uself->object)
return PyUnicode_FromString("");
reason_str = PyObject_Str(uself->reason);
if (reason_str == 0)
goto done;
encoding_str = PyObject_Str(uself->encoding);
if (encoding_str == 0)
goto done;
if (uself->start < PyUnicode_GET_LENGTH(((PyObject*)((uself->object)))) && uself->end == uself->start+1) {
Py_UCS4 badchar = PyUnicode_ReadChar(uself->object, uself->start);
const char *fmt;
if (badchar <= 0xff)
fmt = "'%U' codec can't encode character '\\x%02x' in position %zd: %U";
else if (badchar <= 0xffff)
fmt = "'%U' codec can't encode character '\\u%04x' in position %zd: %U";
else
fmt = "'%U' codec can't encode character '\\U%08x' in position %zd: %U";
result = PyUnicode_FromFormat(
fmt,
encoding_str,
(int)badchar,
uself->start,
reason_str);
}
else {
result = PyUnicode_FromFormat(
"'%U' codec can't encode characters in position %zd-%zd: %U",
encoding_str,
uself->start,
uself->end-1,
reason_str);
}
done:
Py_XDECREF(((PyObject*)((reason_str))));
Py_XDECREF(((PyObject*)((encoding_str))));
return result;
}
static PyTypeObject _PyExc_UnicodeEncodeError = {
{ { 1, (0) }, (0) },
"UnicodeEncodeError",
sizeof(PyUnicodeErrorObject), 0,
(destructor)UnicodeError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
(reprfunc)UnicodeEncodeError_str, 0, 0, 0,
( 0 | 0) | (1UL << 10) | (1UL << 14),
"Unicode encoding error.", (traverseproc)UnicodeError_traverse,
(inquiry)UnicodeError_clear, 0, 0, 0, 0, 0, UnicodeError_members,
0, &_PyExc_UnicodeError, 0, 0, 0, offsetof(PyUnicodeErrorObject, dict),
(initproc)UnicodeEncodeError_init, 0, BaseException_new,
};
PyObject *PyExc_UnicodeEncodeError = (PyObject *)&_PyExc_UnicodeEncodeError;
static int
UnicodeDecodeError_init(PyObject *self, PyObject *args, PyObject *kwds)
{
PyUnicodeErrorObject *ude;
if (BaseException_init((PyBaseExceptionObject *)self, args, kwds) == -1)
return -1;
ude = (PyUnicodeErrorObject *)self;
do { * _tmp_op_ptr = &(ude->encoding); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(ude->object); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(ude->reason); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
if (!_PyArg_ParseTuple_SizeT(args, "UOnnU",
&ude->encoding, &ude->object,
&ude->start, &ude->end, &ude->reason)) {
ude->encoding = ude->object = ude->reason = 0;
return -1;
}
Py_INCREF(((PyObject*)((ude->encoding))));
Py_INCREF(((PyObject*)((ude->object))));
Py_INCREF(((PyObject*)((ude->reason))));
if (!PyType_HasFeature((Py_TYPE(((PyObject*)((ude->object))))), ((1UL << 27)))) {
Py_buffer view;
if (PyObject_GetBuffer(ude->object, &view, 0) != 0)
goto error;
do { * _tmp_dst_ptr = &(ude->object); _tmp_old_dst = (*_tmp_dst_ptr); *_tmp_dst_ptr = (PyBytes_FromStringAndSize(view.buf, view.len)); Py_XDECREF(((PyObject*)((_tmp_old_dst)))); } while (0);
PyBuffer_Release(&view);
if (!ude->object)
goto error;
}
return 0;
error:
do { * _tmp_op_ptr = &(ude->encoding); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(ude->object); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(ude->reason); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
return -1;
}
static PyObject *
UnicodeDecodeError_str(PyObject *self)
{
PyUnicodeErrorObject *uself = (PyUnicodeErrorObject *)self;
PyObject *result = 0;
PyObject *reason_str = 0;
PyObject *encoding_str = 0;
if (!uself->object)
return PyUnicode_FromString("");
reason_str = PyObject_Str(uself->reason);
if (reason_str == 0)
goto done;
encoding_str = PyObject_Str(uself->encoding);
if (encoding_str == 0)
goto done;
if (uself->start < PyBytes_GET_SIZE(((PyObject*)((uself->object)))) && uself->end == uself->start+1) {
int byte = (int)(PyBytes_AS_STRING(((PyObject*)((((PyUnicodeErrorObject *)self)->object))))[uself->start]&0xff);
result = PyUnicode_FromFormat(
"'%U' codec can't decode byte 0x%02x in position %zd: %U",
encoding_str,
byte,
uself->start,
reason_str);
}
else {
result = PyUnicode_FromFormat(
"'%U' codec can't decode bytes in position %zd-%zd: %U",
encoding_str,
uself->start,
uself->end-1,
reason_str
);
}
done:
Py_XDECREF(((PyObject*)((reason_str))));
Py_XDECREF(((PyObject*)((encoding_str))));
return result;
}
static PyTypeObject _PyExc_UnicodeDecodeError = {
{ { 1, (0) }, (0) },
"UnicodeDecodeError",
sizeof(PyUnicodeErrorObject), 0,
(destructor)UnicodeError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
(reprfunc)UnicodeDecodeError_str, 0, 0, 0,
( 0 | 0) | (1UL << 10) | (1UL << 14),
"Unicode decoding error.", (traverseproc)UnicodeError_traverse,
(inquiry)UnicodeError_clear, 0, 0, 0, 0, 0, UnicodeError_members,
0, &_PyExc_UnicodeError, 0, 0, 0, offsetof(PyUnicodeErrorObject, dict),
(initproc)UnicodeDecodeError_init, 0, BaseException_new,
};
PyObject *PyExc_UnicodeDecodeError = (PyObject *)&_PyExc_UnicodeDecodeError;
PyObject *
PyUnicodeDecodeError_Create(
const char *encoding, const char *object, Py_ssize_t length,
Py_ssize_t start, Py_ssize_t end, const char *reason)
{
return _PyObject_CallFunction_SizeT(PyExc_UnicodeDecodeError, "sy#nns",
encoding, object, length, start, end, reason);
}
static int
UnicodeTranslateError_init(PyUnicodeErrorObject *self, PyObject *args,
PyObject *kwds)
{
if (BaseException_init((PyBaseExceptionObject *)self, args, kwds) == -1)
return -1;
do { * _tmp_op_ptr = &(self->object); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
do { * _tmp_op_ptr = &(self->reason); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
if (!_PyArg_ParseTuple_SizeT(args, "UnnU",
&self->object,
&self->start, &self->end, &self->reason)) {
self->object = self->reason = 0;
return -1;
}
Py_INCREF(((PyObject*)((self->object))));
Py_INCREF(((PyObject*)((self->reason))));
return 0;
}
static PyObject *
UnicodeTranslateError_str(PyObject *self)
{
PyUnicodeErrorObject *uself = (PyUnicodeErrorObject *)self;
PyObject *result = 0;
PyObject *reason_str = 0;
if (!uself->object)
return PyUnicode_FromString("");
reason_str = PyObject_Str(uself->reason);
if (reason_str == 0)
goto done;
if (uself->start < PyUnicode_GET_LENGTH(((PyObject*)((uself->object)))) && uself->end == uself->start+1) {
Py_UCS4 badchar = PyUnicode_ReadChar(uself->object, uself->start);
const char *fmt;
if (badchar <= 0xff)
fmt = "can't translate character '\\x%02x' in position %zd: %U";
else if (badchar <= 0xffff)
fmt = "can't translate character '\\u%04x' in position %zd: %U";
else
fmt = "can't translate character '\\U%08x' in position %zd: %U";
result = PyUnicode_FromFormat(
fmt,
(int)badchar,
uself->start,
reason_str
);
} else {
result = PyUnicode_FromFormat(
"can't translate characters in position %zd-%zd: %U",
uself->start,
uself->end-1,
reason_str
);
}
done:
Py_XDECREF(((PyObject*)((reason_str))));
return result;
}
static PyTypeObject _PyExc_UnicodeTranslateError = {
{ { 1, (0) }, (0) },
"UnicodeTranslateError",
sizeof(PyUnicodeErrorObject), 0,
(destructor)UnicodeError_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
(reprfunc)UnicodeTranslateError_str, 0, 0, 0,
( 0 | 0) | (1UL << 10) | (1UL << 14),
"Unicode translation error.", (traverseproc)UnicodeError_traverse,
(inquiry)UnicodeError_clear, 0, 0, 0, 0, 0, UnicodeError_members,
0, &_PyExc_UnicodeError, 0, 0, 0, offsetof(PyUnicodeErrorObject, dict),
(initproc)UnicodeTranslateError_init, 0, BaseException_new,
};
PyObject *PyExc_UnicodeTranslateError = (PyObject *)&_PyExc_UnicodeTranslateError;
PyObject *
_PyUnicodeTranslateError_Create(
PyObject *object,
Py_ssize_t start, Py_ssize_t end, const char *reason)
{
return _PyObject_CallFunction_SizeT(PyExc_UnicodeTranslateError, "Onns",
object, start, end, reason);
}
static PyTypeObject _PyExc_AssertionError = { { { 1, (0) }, (0) }, "AssertionError", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Assertion failed.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Exception, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_AssertionError = (PyObject *)&_PyExc_AssertionError;
static PyTypeObject _PyExc_ArithmeticError = { { { 1, (0) }, (0) }, "ArithmeticError", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Base class for arithmetic errors.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Exception, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_ArithmeticError = (PyObject *)&_PyExc_ArithmeticError;
static PyTypeObject _PyExc_FloatingPointError = { { { 1, (0) }, (0) }, "FloatingPointError", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Floating point operation failed.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_ArithmeticError, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_FloatingPointError = (PyObject *)&_PyExc_FloatingPointError;
static PyTypeObject _PyExc_OverflowError = { { { 1, (0) }, (0) }, "OverflowError", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Result too large to be represented.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_ArithmeticError, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_OverflowError = (PyObject *)&_PyExc_OverflowError;
static PyTypeObject _PyExc_ZeroDivisionError = { { { 1, (0) }, (0) }, "ZeroDivisionError", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Second argument to a division or modulo operation was zero.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_ArithmeticError, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_ZeroDivisionError = (PyObject *)&_PyExc_ZeroDivisionError;
static PyTypeObject _PyExc_SystemError = { { { 1, (0) }, (0) }, "SystemError", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Internal error in the Python interpreter.\n" "\n" "Please report this to the Python maintainer, along with the traceback,\n" "the Python version, and the hardware/OS platform and version.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Exception, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_SystemError = (PyObject *)&_PyExc_SystemError;
static PyTypeObject _PyExc_ReferenceError = { { { 1, (0) }, (0) }, "ReferenceError", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Weak ref proxy used after referent went away.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Exception, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_ReferenceError = (PyObject *)&_PyExc_ReferenceError;
static PyObject *
get_memory_error(int allow_allocation, PyObject *args, PyObject *kwds)
{
PyBaseExceptionObject *self;
struct _Py_exc_state *state = get_exc_state();
if (state->memerrors_freelist == 0) {
if (!allow_allocation) {
PyInterpreterState *interp = _PyInterpreterState_GET();
return _Py_NewRef(((PyObject*)((&(interp)->static_objects.singletons.last_resort_memory_error))));
}
PyObject *result = BaseException_new((PyTypeObject *)PyExc_MemoryError, args, kwds);
return result;
}
self = state->memerrors_freelist;
self->args = PyTuple_New(0);
if (self->args == 0) {
return 0;
}
state->memerrors_freelist = (PyBaseExceptionObject *) self->dict;
state->memerrors_numfree--;
self->dict = 0;
_Py_NewReference((PyObject *)self);
_PyObject_GC_TRACK("/home/nxpub/dev/experiments/pyresearch/cpython/Objects/tmp3re1uol4", 3242, ((PyObject*)((self))));
return (PyObject *)self;
}
static PyObject *
MemoryError_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
if (type != (PyTypeObject *) PyExc_MemoryError) {
return BaseException_new(type, args, kwds);
}
return get_memory_error(1, args, kwds);
}
PyObject *
_PyErr_NoMemory(PyThreadState *tstate)
{
if (Py_IS_TYPE(((PyObject*)((PyExc_MemoryError))), (0))) {
_Py_FatalErrorFunc(__func__, ("Out of memory and PyExc_MemoryError is not " "initialized yet"));
}
PyObject *err = get_memory_error(0, 0, 0);
if (err != 0) {
_PyErr_SetRaisedException(tstate, err);
}
return 0;
}
static void
MemoryError_dealloc(PyBaseExceptionObject *self)
{
_PyObject_GC_UNTRACK("/home/nxpub/dev/experiments/pyresearch/cpython/Objects/tmp3re1uol4", 3276, ((PyObject*)((self))));
BaseException_clear(self);
if (!Py_IS_TYPE(((PyObject*)((self))), ((PyTypeObject *) PyExc_MemoryError))) {
Py_TYPE(((PyObject*)((self))))->tp_free((PyObject *)self);
return;
}
struct _Py_exc_state *state = get_exc_state();
if (state->memerrors_numfree >= 16) {
Py_TYPE(((PyObject*)((self))))->tp_free((PyObject *)self);
}
else {
self->dict = (PyObject *) state->memerrors_freelist;
state->memerrors_freelist = self;
state->memerrors_numfree++;
}
}
static int
preallocate_memerrors(void)
{
int i;
PyObject *errors[16];
for (i = 0; i < 16; i++) {
errors[i] = MemoryError_new((PyTypeObject *) PyExc_MemoryError,
0, 0);
if (!errors[i]) {
return -1;
}
}
for (i = 0; i < 16; i++) {
Py_DECREF(((PyObject*)((errors[i]))));
}
return 0;
}
static void
free_preallocated_memerrors(struct _Py_exc_state *state)
{
while (state->memerrors_freelist != 0) {
PyObject *self = (PyObject *) state->memerrors_freelist;
state->memerrors_freelist = (PyBaseExceptionObject *)state->memerrors_freelist->dict;
Py_TYPE(((PyObject*)((self))))->tp_free((PyObject *)self);
}
}
PyTypeObject _PyExc_MemoryError = {
{ { 1, (0) }, (0) },
"MemoryError",
sizeof(PyBaseExceptionObject),
0, (destructor)MemoryError_dealloc, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
( 0 | 0) | (1UL << 10) | (1UL << 14),
"Out of memory.", (traverseproc)BaseException_traverse,
(inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Exception,
0, 0, 0, offsetof(PyBaseExceptionObject, dict),
(initproc)BaseException_init, 0, MemoryError_new
};
PyObject *PyExc_MemoryError = (PyObject *) &_PyExc_MemoryError;
static PyTypeObject _PyExc_BufferError = { { { 1, (0) }, (0) }, "BufferError", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Buffer error.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Exception, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_BufferError = (PyObject *)&_PyExc_BufferError;
static PyTypeObject _PyExc_Warning = { { { 1, (0) }, (0) }, "Warning", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Base class for warning categories.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Exception, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_Warning = (PyObject *)&_PyExc_Warning;
static PyTypeObject _PyExc_UserWarning = { { { 1, (0) }, (0) }, "UserWarning", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Base class for warnings generated by user code.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Warning, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_UserWarning = (PyObject *)&_PyExc_UserWarning;
static PyTypeObject _PyExc_DeprecationWarning = { { { 1, (0) }, (0) }, "DeprecationWarning", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Base class for warnings about deprecated features.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Warning, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_DeprecationWarning = (PyObject *)&_PyExc_DeprecationWarning;
static PyTypeObject _PyExc_PendingDeprecationWarning = { { { 1, (0) }, (0) }, "PendingDeprecationWarning", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Base class for warnings about features which will be deprecated\n" "in the future.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Warning, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_PendingDeprecationWarning = (PyObject *)&_PyExc_PendingDeprecationWarning;
static PyTypeObject _PyExc_SyntaxWarning = { { { 1, (0) }, (0) }, "SyntaxWarning", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Base class for warnings about dubious syntax.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Warning, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_SyntaxWarning = (PyObject *)&_PyExc_SyntaxWarning;
static PyTypeObject _PyExc_RuntimeWarning = { { { 1, (0) }, (0) }, "RuntimeWarning", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Base class for warnings about dubious runtime behavior.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Warning, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_RuntimeWarning = (PyObject *)&_PyExc_RuntimeWarning;
static PyTypeObject _PyExc_FutureWarning = { { { 1, (0) }, (0) }, "FutureWarning", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Base class for warnings about constructs that will change semantically\n" "in the future.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Warning, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_FutureWarning = (PyObject *)&_PyExc_FutureWarning;
static PyTypeObject _PyExc_ImportWarning = { { { 1, (0) }, (0) }, "ImportWarning", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Base class for warnings about probable mistakes in module imports", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Warning, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_ImportWarning = (PyObject *)&_PyExc_ImportWarning;
static PyTypeObject _PyExc_UnicodeWarning = { { { 1, (0) }, (0) }, "UnicodeWarning", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Base class for warnings about Unicode related problems, mostly\n" "related to conversion problems.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Warning, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_UnicodeWarning = (PyObject *)&_PyExc_UnicodeWarning;
static PyTypeObject _PyExc_BytesWarning = { { { 1, (0) }, (0) }, "BytesWarning", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Base class for warnings about bytes and buffer related problems, mostly\n" "related to conversion from str or comparing to str.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Warning, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_BytesWarning = (PyObject *)&_PyExc_BytesWarning;
static PyTypeObject _PyExc_EncodingWarning = { { { 1, (0) }, (0) }, "EncodingWarning", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Base class for warnings about encodings.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Warning, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_EncodingWarning = (PyObject *)&_PyExc_EncodingWarning;
static PyTypeObject _PyExc_ResourceWarning = { { { 1, (0) }, (0) }, "ResourceWarning", sizeof(PyBaseExceptionObject), 0, (destructor)BaseException_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( 0 | 0) | (1UL << 10) | (1UL << 14), "Base class for warnings about resource usage.", (traverseproc)BaseException_traverse, (inquiry)BaseException_clear, 0, 0, 0, 0, 0, 0, 0, &_PyExc_Warning, 0, 0, 0, offsetof(PyBaseExceptionObject, dict), (initproc)BaseException_init, 0, BaseException_new,}; PyObject *PyExc_ResourceWarning = (PyObject *)&_PyExc_ResourceWarning;
struct static_exception {
PyTypeObject *exc;
const char *name;
};
static struct static_exception static_exceptions[] = {
{&_PyExc_BaseException, "BaseException"},
{&_PyExc_BaseExceptionGroup, "BaseExceptionGroup"},
{&_PyExc_Exception, "Exception"},
{&_PyExc_GeneratorExit, "GeneratorExit"},
{&_PyExc_KeyboardInterrupt, "KeyboardInterrupt"},
{&_PyExc_SystemExit, "SystemExit"},
{&_PyExc_ArithmeticError, "ArithmeticError"},
{&_PyExc_AssertionError, "AssertionError"},
{&_PyExc_AttributeError, "AttributeError"},
{&_PyExc_BufferError, "BufferError"},
{&_PyExc_EOFError, "EOFError"},
{&_PyExc_ImportError, "ImportError"},
{&_PyExc_LookupError, "LookupError"},
{&_PyExc_MemoryError, "MemoryError"},
{&_PyExc_NameError, "NameError"},
{&_PyExc_OSError, "OSError"},
{&_PyExc_ReferenceError, "ReferenceError"},
{&_PyExc_RuntimeError, "RuntimeError"},
{&_PyExc_StopAsyncIteration, "StopAsyncIteration"},
{&_PyExc_StopIteration, "StopIteration"},
{&_PyExc_SyntaxError, "SyntaxError"},
{&_PyExc_SystemError, "SystemError"},
{&_PyExc_TypeError, "TypeError"},
{&_PyExc_ValueError, "ValueError"},
{&_PyExc_Warning, "Warning"},
{&_PyExc_FloatingPointError, "FloatingPointError"},
{&_PyExc_OverflowError, "OverflowError"},
{&_PyExc_ZeroDivisionError, "ZeroDivisionError"},
{&_PyExc_BytesWarning, "BytesWarning"},
{&_PyExc_DeprecationWarning, "DeprecationWarning"},
{&_PyExc_EncodingWarning, "EncodingWarning"},
{&_PyExc_FutureWarning, "FutureWarning"},
{&_PyExc_ImportWarning, "ImportWarning"},
{&_PyExc_PendingDeprecationWarning, "PendingDeprecationWarning"},
{&_PyExc_ResourceWarning, "ResourceWarning"},
{&_PyExc_RuntimeWarning, "RuntimeWarning"},
{&_PyExc_SyntaxWarning, "SyntaxWarning"},
{&_PyExc_UnicodeWarning, "UnicodeWarning"},
{&_PyExc_UserWarning, "UserWarning"},
{&_PyExc_BlockingIOError, "BlockingIOError"},
{&_PyExc_ChildProcessError, "ChildProcessError"},
{&_PyExc_ConnectionError, "ConnectionError"},
{&_PyExc_FileExistsError, "FileExistsError"},
{&_PyExc_FileNotFoundError, "FileNotFoundError"},
{&_PyExc_InterruptedError, "InterruptedError"},
{&_PyExc_IsADirectoryError, "IsADirectoryError"},
{&_PyExc_NotADirectoryError, "NotADirectoryError"},
{&_PyExc_PermissionError, "PermissionError"},
{&_PyExc_ProcessLookupError, "ProcessLookupError"},
{&_PyExc_TimeoutError, "TimeoutError"},
{&_PyExc_IndentationError, "IndentationError"},
{&_PyExc_IndexError, "IndexError"},
{&_PyExc_KeyError, "KeyError"},
{&_PyExc_ModuleNotFoundError, "ModuleNotFoundError"},
{&_PyExc_NotImplementedError, "NotImplementedError"},
{&_PyExc_RecursionError, "RecursionError"},
{&_PyExc_UnboundLocalError, "UnboundLocalError"},
{&_PyExc_UnicodeError, "UnicodeError"},
{&_PyExc_BrokenPipeError, "BrokenPipeError"},
{&_PyExc_ConnectionAbortedError, "ConnectionAbortedError"},
{&_PyExc_ConnectionRefusedError, "ConnectionRefusedError"},
{&_PyExc_ConnectionResetError, "ConnectionResetError"},
{&_PyExc_TabError, "TabError"},
{&_PyExc_UnicodeDecodeError, "UnicodeDecodeError"},
{&_PyExc_UnicodeEncodeError, "UnicodeEncodeError"},
{&_PyExc_UnicodeTranslateError, "UnicodeTranslateError"},
};
int
_PyExc_InitTypes(PyInterpreterState *interp)
{
if (!_Py_IsMainInterpreter(interp)) {
return 0;
}
for (size_t i=0; i < (sizeof(static_exceptions) / sizeof((static_exceptions)[0]) + (sizeof(char [1 - 2*!(!__builtin_types_compatible_p(typeof(static_exceptions), typeof(&(static_exceptions)[0])))]) - 1)); i++) {
PyTypeObject *exc = static_exceptions[i].exc;
if (_PyStaticType_InitBuiltin(exc) < 0) {
return -1;
}
}
return 0;
}
static void
_PyExc_FiniTypes(PyInterpreterState *interp)
{
if (!_Py_IsMainInterpreter(interp)) {
return;
}
for (Py_ssize_t i=(sizeof(static_exceptions) / sizeof((static_exceptions)[0]) + (sizeof(char [1 - 2*!(!__builtin_types_compatible_p(typeof(static_exceptions), typeof(&(static_exceptions)[0])))]) - 1)) - 1; i >= 0; i--) {
PyTypeObject *exc = static_exceptions[i].exc;
_PyStaticType_Dealloc(exc);
}
}
PyStatus
_PyExc_InitGlobalObjects(PyInterpreterState *interp)
{
if (!_Py_IsMainInterpreter(interp)) {
return (PyStatus){._type = _PyStatus_TYPE_OK,};
}
if (preallocate_memerrors() < 0) {
return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("memory allocation failed")};
}
return (PyStatus){._type = _PyStatus_TYPE_OK,};
}
PyStatus
_PyExc_InitState(PyInterpreterState *interp)
{
struct _Py_exc_state *state = &interp->exc_state;
assert(state->errnomap == 0);
state->errnomap = PyDict_New();
if (!state->errnomap) {
return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("memory allocation failed")};
}
do { PyObject *_code = PyLong_FromLong(EAGAIN); assert(_PyObject_RealIsSubclass(PyExc_BlockingIOError, PyExc_OSError)); if (!_code || PyDict_SetItem(state->errnomap, _code, PyExc_BlockingIOError)) { Py_XDECREF(((PyObject*)((_code)))); return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("errmap insertion problem.")}; } Py_DECREF(((PyObject*)((_code)))); } while (0);
do { PyObject *_code = PyLong_FromLong(EALREADY); assert(_PyObject_RealIsSubclass(PyExc_BlockingIOError, PyExc_OSError)); if (!_code || PyDict_SetItem(state->errnomap, _code, PyExc_BlockingIOError)) { Py_XDECREF(((PyObject*)((_code)))); return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("errmap insertion problem.")}; } Py_DECREF(((PyObject*)((_code)))); } while (0);
do { PyObject *_code = PyLong_FromLong(EINPROGRESS); assert(_PyObject_RealIsSubclass(PyExc_BlockingIOError, PyExc_OSError)); if (!_code || PyDict_SetItem(state->errnomap, _code, PyExc_BlockingIOError)) { Py_XDECREF(((PyObject*)((_code)))); return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("errmap insertion problem.")}; } Py_DECREF(((PyObject*)((_code)))); } while (0);
do { PyObject *_code = PyLong_FromLong(EWOULDBLOCK); assert(_PyObject_RealIsSubclass(PyExc_BlockingIOError, PyExc_OSError)); if (!_code || PyDict_SetItem(state->errnomap, _code, PyExc_BlockingIOError)) { Py_XDECREF(((PyObject*)((_code)))); return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("errmap insertion problem.")}; } Py_DECREF(((PyObject*)((_code)))); } while (0);
do { PyObject *_code = PyLong_FromLong(EPIPE); assert(_PyObject_RealIsSubclass(PyExc_BrokenPipeError, PyExc_OSError)); if (!_code || PyDict_SetItem(state->errnomap, _code, PyExc_BrokenPipeError)) { Py_XDECREF(((PyObject*)((_code)))); return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("errmap insertion problem.")}; } Py_DECREF(((PyObject*)((_code)))); } while (0);
do { PyObject *_code = PyLong_FromLong(ECHILD); assert(_PyObject_RealIsSubclass(PyExc_ChildProcessError, PyExc_OSError)); if (!_code || PyDict_SetItem(state->errnomap, _code, PyExc_ChildProcessError)) { Py_XDECREF(((PyObject*)((_code)))); return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("errmap insertion problem.")}; } Py_DECREF(((PyObject*)((_code)))); } while (0);
do { PyObject *_code = PyLong_FromLong(ECONNABORTED); assert(_PyObject_RealIsSubclass(PyExc_ConnectionAbortedError, PyExc_OSError)); if (!_code || PyDict_SetItem(state->errnomap, _code, PyExc_ConnectionAbortedError)) { Py_XDECREF(((PyObject*)((_code)))); return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("errmap insertion problem.")}; } Py_DECREF(((PyObject*)((_code)))); } while (0);
do { PyObject *_code = PyLong_FromLong(ECONNREFUSED); assert(_PyObject_RealIsSubclass(PyExc_ConnectionRefusedError, PyExc_OSError)); if (!_code || PyDict_SetItem(state->errnomap, _code, PyExc_ConnectionRefusedError)) { Py_XDECREF(((PyObject*)((_code)))); return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("errmap insertion problem.")}; } Py_DECREF(((PyObject*)((_code)))); } while (0);
do { PyObject *_code = PyLong_FromLong(ECONNRESET); assert(_PyObject_RealIsSubclass(PyExc_ConnectionResetError, PyExc_OSError)); if (!_code || PyDict_SetItem(state->errnomap, _code, PyExc_ConnectionResetError)) { Py_XDECREF(((PyObject*)((_code)))); return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("errmap insertion problem.")}; } Py_DECREF(((PyObject*)((_code)))); } while (0);
do { PyObject *_code = PyLong_FromLong(EEXIST); assert(_PyObject_RealIsSubclass(PyExc_FileExistsError, PyExc_OSError)); if (!_code || PyDict_SetItem(state->errnomap, _code, PyExc_FileExistsError)) { Py_XDECREF(((PyObject*)((_code)))); return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("errmap insertion problem.")}; } Py_DECREF(((PyObject*)((_code)))); } while (0);
do { PyObject *_code = PyLong_FromLong(ENOENT); assert(_PyObject_RealIsSubclass(PyExc_FileNotFoundError, PyExc_OSError)); if (!_code || PyDict_SetItem(state->errnomap, _code, PyExc_FileNotFoundError)) { Py_XDECREF(((PyObject*)((_code)))); return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("errmap insertion problem.")}; } Py_DECREF(((PyObject*)((_code)))); } while (0);
do { PyObject *_code = PyLong_FromLong(EISDIR); assert(_PyObject_RealIsSubclass(PyExc_IsADirectoryError, PyExc_OSError)); if (!_code || PyDict_SetItem(state->errnomap, _code, PyExc_IsADirectoryError)) { Py_XDECREF(((PyObject*)((_code)))); return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("errmap insertion problem.")}; } Py_DECREF(((PyObject*)((_code)))); } while (0);
do { PyObject *_code = PyLong_FromLong(ENOTDIR); assert(_PyObject_RealIsSubclass(PyExc_NotADirectoryError, PyExc_OSError)); if (!_code || PyDict_SetItem(state->errnomap, _code, PyExc_NotADirectoryError)) { Py_XDECREF(((PyObject*)((_code)))); return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("errmap insertion problem.")}; } Py_DECREF(((PyObject*)((_code)))); } while (0);
do { PyObject *_code = PyLong_FromLong(EINTR); assert(_PyObject_RealIsSubclass(PyExc_InterruptedError, PyExc_OSError)); if (!_code || PyDict_SetItem(state->errnomap, _code, PyExc_InterruptedError)) { Py_XDECREF(((PyObject*)((_code)))); return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("errmap insertion problem.")}; } Py_DECREF(((PyObject*)((_code)))); } while (0);
do { PyObject *_code = PyLong_FromLong(EACCES); assert(_PyObject_RealIsSubclass(PyExc_PermissionError, PyExc_OSError)); if (!_code || PyDict_SetItem(state->errnomap, _code, PyExc_PermissionError)) { Py_XDECREF(((PyObject*)((_code)))); return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("errmap insertion problem.")}; } Py_DECREF(((PyObject*)((_code)))); } while (0);
do { PyObject *_code = PyLong_FromLong(EPERM); assert(_PyObject_RealIsSubclass(PyExc_PermissionError, PyExc_OSError)); if (!_code || PyDict_SetItem(state->errnomap, _code, PyExc_PermissionError)) { Py_XDECREF(((PyObject*)((_code)))); return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("errmap insertion problem.")}; } Py_DECREF(((PyObject*)((_code)))); } while (0);
do { PyObject *_code = PyLong_FromLong(ESRCH); assert(_PyObject_RealIsSubclass(PyExc_ProcessLookupError, PyExc_OSError)); if (!_code || PyDict_SetItem(state->errnomap, _code, PyExc_ProcessLookupError)) { Py_XDECREF(((PyObject*)((_code)))); return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("errmap insertion problem.")}; } Py_DECREF(((PyObject*)((_code)))); } while (0);
do { PyObject *_code = PyLong_FromLong(ETIMEDOUT); assert(_PyObject_RealIsSubclass(PyExc_TimeoutError, PyExc_OSError)); if (!_code || PyDict_SetItem(state->errnomap, _code, PyExc_TimeoutError)) { Py_XDECREF(((PyObject*)((_code)))); return (PyStatus){ ._type = _PyStatus_TYPE_ERROR, .func = __func__, .err_msg = ("errmap insertion problem.")}; } Py_DECREF(((PyObject*)((_code)))); } while (0);
return (PyStatus){._type = _PyStatus_TYPE_OK,};
}
int
_PyBuiltins_AddExceptions(PyObject *bltinmod)
{
PyObject *mod_dict = PyModule_GetDict(bltinmod);
if (mod_dict == 0) {
return -1;
}
for (size_t i=0; i < (sizeof(static_exceptions) / sizeof((static_exceptions)[0]) + (sizeof(char [1 - 2*!(!__builtin_types_compatible_p(typeof(static_exceptions), typeof(&(static_exceptions)[0])))]) - 1)); i++) {
struct static_exception item = static_exceptions[i];
if (PyDict_SetItemString(mod_dict, item.name, (PyObject*)item.exc)) {
return -1;
}
}
PyObject *PyExc_ExceptionGroup = create_exception_group_class();
if (!PyExc_ExceptionGroup) {
return -1;
}
if (PyDict_SetItemString(mod_dict, "ExceptionGroup", PyExc_ExceptionGroup)) {
return -1;
}
do { PyExc_EnvironmentError = PyExc_OSError; if (PyDict_SetItemString(mod_dict, "EnvironmentError", PyExc_OSError)) { return -1; } } while (0);
do { PyExc_IOError = PyExc_OSError; if (PyDict_SetItemString(mod_dict, "IOError", PyExc_OSError)) { return -1; } } while (0);
return 0;
}
void
_PyExc_ClearExceptionGroupType(PyInterpreterState *interp)
{
struct _Py_exc_state *state = &interp->exc_state;
do { * _tmp_op_ptr = &(state->PyExc_ExceptionGroup); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
}
void
_PyExc_Fini(PyInterpreterState *interp)
{
struct _Py_exc_state *state = &interp->exc_state;
free_preallocated_memerrors(state);
do { * _tmp_op_ptr = &(state->errnomap); _tmp_old_op = (*_tmp_op_ptr); if (_tmp_old_op != 0) { *_tmp_op_ptr = 0; Py_DECREF(((PyObject*)((_tmp_old_op)))); } } while (0);
_PyExc_FiniTypes(interp);
}
int
_PyException_AddNote(PyObject *exc, PyObject *note)
{
if (!PyType_HasFeature((Py_TYPE(((PyObject*)((exc))))), ((1UL << 30)))) {
PyErr_Format(PyExc_TypeError,
"exc must be an exception, not '%s'",
Py_TYPE(((PyObject*)((exc))))->tp_name);
return -1;
}
PyObject *r = BaseException_add_note(exc, note);
int res = r == 0 ? -1 : 0;
Py_XDECREF(((PyObject*)((r))));
return res;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment