Initial Commit / Linux Combined Proof of Concept example
This commit is contained in:
commit
d0d2eae762
935 changed files with 155947 additions and 0 deletions
219
deps_windows/Python-3.11.1/Include/cpython/abstract.h
Normal file
219
deps_windows/Python-3.11.1/Include/cpython/abstract.h
Normal file
|
|
@ -0,0 +1,219 @@
|
|||
#ifndef Py_CPYTHON_ABSTRACTOBJECT_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
/* === Object Protocol ================================================== */
|
||||
|
||||
#ifdef PY_SSIZE_T_CLEAN
|
||||
# define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT
|
||||
#endif
|
||||
|
||||
/* Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple)
|
||||
format to a Python dictionary ("kwargs" dict).
|
||||
|
||||
The type of kwnames keys is not checked. The final function getting
|
||||
arguments is responsible to check if all keys are strings, for example using
|
||||
PyArg_ParseTupleAndKeywords() or PyArg_ValidateKeywordArguments().
|
||||
|
||||
Duplicate keys are merged using the last value. If duplicate keys must raise
|
||||
an exception, the caller is responsible to implement an explicit keys on
|
||||
kwnames. */
|
||||
PyAPI_FUNC(PyObject *) _PyStack_AsDict(
|
||||
PyObject *const *values,
|
||||
PyObject *kwnames);
|
||||
|
||||
/* Suggested size (number of positional arguments) for arrays of PyObject*
|
||||
allocated on a C stack to avoid allocating memory on the heap memory. Such
|
||||
array is used to pass positional arguments to call functions of the
|
||||
PyObject_Vectorcall() family.
|
||||
|
||||
The size is chosen to not abuse the C stack and so limit the risk of stack
|
||||
overflow. The size is also chosen to allow using the small stack for most
|
||||
function calls of the Python standard library. On 64-bit CPU, it allocates
|
||||
40 bytes on the stack. */
|
||||
#define _PY_FASTCALL_SMALL_STACK 5
|
||||
|
||||
PyAPI_FUNC(PyObject *) _Py_CheckFunctionResult(
|
||||
PyThreadState *tstate,
|
||||
PyObject *callable,
|
||||
PyObject *result,
|
||||
const char *where);
|
||||
|
||||
/* === Vectorcall protocol (PEP 590) ============================= */
|
||||
|
||||
/* Call callable using tp_call. Arguments are like PyObject_Vectorcall()
|
||||
or PyObject_FastCallDict() (both forms are supported),
|
||||
except that nargs is plainly the number of arguments without flags. */
|
||||
PyAPI_FUNC(PyObject *) _PyObject_MakeTpCall(
|
||||
PyThreadState *tstate,
|
||||
PyObject *callable,
|
||||
PyObject *const *args, Py_ssize_t nargs,
|
||||
PyObject *keywords);
|
||||
|
||||
#define PY_VECTORCALL_ARGUMENTS_OFFSET \
|
||||
(_Py_STATIC_CAST(size_t, 1) << (8 * sizeof(size_t) - 1))
|
||||
|
||||
static inline Py_ssize_t
|
||||
PyVectorcall_NARGS(size_t n)
|
||||
{
|
||||
return n & ~PY_VECTORCALL_ARGUMENTS_OFFSET;
|
||||
}
|
||||
|
||||
PyAPI_FUNC(vectorcallfunc) PyVectorcall_Function(PyObject *callable);
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyObject_Vectorcall(
|
||||
PyObject *callable,
|
||||
PyObject *const *args,
|
||||
size_t nargsf,
|
||||
PyObject *kwnames);
|
||||
|
||||
// Backwards compatibility aliases for API that was provisional in Python 3.8
|
||||
#define _PyObject_Vectorcall PyObject_Vectorcall
|
||||
#define _PyObject_VectorcallMethod PyObject_VectorcallMethod
|
||||
#define _PyObject_FastCallDict PyObject_VectorcallDict
|
||||
#define _PyVectorcall_Function PyVectorcall_Function
|
||||
#define _PyObject_CallOneArg PyObject_CallOneArg
|
||||
#define _PyObject_CallMethodNoArgs PyObject_CallMethodNoArgs
|
||||
#define _PyObject_CallMethodOneArg PyObject_CallMethodOneArg
|
||||
|
||||
/* Same as PyObject_Vectorcall except that keyword arguments are passed as
|
||||
dict, which may be NULL if there are no keyword arguments. */
|
||||
PyAPI_FUNC(PyObject *) PyObject_VectorcallDict(
|
||||
PyObject *callable,
|
||||
PyObject *const *args,
|
||||
size_t nargsf,
|
||||
PyObject *kwargs);
|
||||
|
||||
/* Call "callable" (which must support vectorcall) with positional arguments
|
||||
"tuple" and keyword arguments "dict". "dict" may also be NULL */
|
||||
PyAPI_FUNC(PyObject *) PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *dict);
|
||||
|
||||
// Same as PyObject_Vectorcall(), except without keyword arguments
|
||||
PyAPI_FUNC(PyObject *) _PyObject_FastCall(
|
||||
PyObject *func,
|
||||
PyObject *const *args,
|
||||
Py_ssize_t nargs);
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyObject_CallOneArg(PyObject *func, PyObject *arg);
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyObject_VectorcallMethod(
|
||||
PyObject *name, PyObject *const *args,
|
||||
size_t nargsf, PyObject *kwnames);
|
||||
|
||||
static inline PyObject *
|
||||
PyObject_CallMethodNoArgs(PyObject *self, PyObject *name)
|
||||
{
|
||||
size_t nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET;
|
||||
return PyObject_VectorcallMethod(name, &self, nargsf, _Py_NULL);
|
||||
}
|
||||
|
||||
static inline PyObject *
|
||||
PyObject_CallMethodOneArg(PyObject *self, PyObject *name, PyObject *arg)
|
||||
{
|
||||
PyObject *args[2] = {self, arg};
|
||||
size_t nargsf = 2 | PY_VECTORCALL_ARGUMENTS_OFFSET;
|
||||
assert(arg != NULL);
|
||||
return PyObject_VectorcallMethod(name, args, nargsf, _Py_NULL);
|
||||
}
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PyObject_CallMethod(PyObject *obj,
|
||||
PyObject *name,
|
||||
const char *format, ...);
|
||||
|
||||
/* Like PyObject_CallMethod(), but expect a _Py_Identifier*
|
||||
as the method name. */
|
||||
PyAPI_FUNC(PyObject *) _PyObject_CallMethodId(PyObject *obj,
|
||||
_Py_Identifier *name,
|
||||
const char *format, ...);
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PyObject_CallMethodId_SizeT(PyObject *obj,
|
||||
_Py_Identifier *name,
|
||||
const char *format,
|
||||
...);
|
||||
|
||||
PyAPI_FUNC(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); /* borrowed */
|
||||
if (!oname) {
|
||||
return _Py_NULL;
|
||||
}
|
||||
return PyObject_VectorcallMethod(oname, args, nargsf, kwnames);
|
||||
}
|
||||
|
||||
static inline PyObject *
|
||||
_PyObject_CallMethodIdNoArgs(PyObject *self, _Py_Identifier *name)
|
||||
{
|
||||
size_t nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET;
|
||||
return _PyObject_VectorcallMethodId(name, &self, nargsf, _Py_NULL);
|
||||
}
|
||||
|
||||
static inline PyObject *
|
||||
_PyObject_CallMethodIdOneArg(PyObject *self, _Py_Identifier *name, PyObject *arg)
|
||||
{
|
||||
PyObject *args[2] = {self, arg};
|
||||
size_t nargsf = 2 | PY_VECTORCALL_ARGUMENTS_OFFSET;
|
||||
assert(arg != NULL);
|
||||
return _PyObject_VectorcallMethodId(name, args, nargsf, _Py_NULL);
|
||||
}
|
||||
|
||||
PyAPI_FUNC(int) _PyObject_HasLen(PyObject *o);
|
||||
|
||||
/* Guess the size of object 'o' using len(o) or o.__length_hint__().
|
||||
If neither of those return a non-negative value, then return the default
|
||||
value. If one of the calls fails, this function returns -1. */
|
||||
PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t);
|
||||
|
||||
/* === Sequence protocol ================================================ */
|
||||
|
||||
/* Assume tp_as_sequence and sq_item exist and that 'i' does not
|
||||
need to be corrected for a negative index. */
|
||||
#define PySequence_ITEM(o, i)\
|
||||
( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) )
|
||||
|
||||
#define PY_ITERSEARCH_COUNT 1
|
||||
#define PY_ITERSEARCH_INDEX 2
|
||||
#define PY_ITERSEARCH_CONTAINS 3
|
||||
|
||||
/* Iterate over seq.
|
||||
|
||||
Result depends on the operation:
|
||||
|
||||
PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if
|
||||
error.
|
||||
PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of
|
||||
obj in seq; set ValueError and return -1 if none found;
|
||||
also return -1 on error.
|
||||
PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on
|
||||
error. */
|
||||
PyAPI_FUNC(Py_ssize_t) _PySequence_IterSearch(PyObject *seq,
|
||||
PyObject *obj, int operation);
|
||||
|
||||
/* === Mapping protocol ================================================= */
|
||||
|
||||
PyAPI_FUNC(int) _PyObject_RealIsInstance(PyObject *inst, PyObject *cls);
|
||||
|
||||
PyAPI_FUNC(int) _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
|
||||
|
||||
PyAPI_FUNC(char *const *) _PySequence_BytesToCharpArray(PyObject* self);
|
||||
|
||||
PyAPI_FUNC(void) _Py_FreeCharPArray(char *const array[]);
|
||||
|
||||
/* For internal use by buffer API functions */
|
||||
PyAPI_FUNC(void) _Py_add_one_to_index_F(int nd, Py_ssize_t *index,
|
||||
const Py_ssize_t *shape);
|
||||
PyAPI_FUNC(void) _Py_add_one_to_index_C(int nd, Py_ssize_t *index,
|
||||
const Py_ssize_t *shape);
|
||||
|
||||
/* Convert Python int to Py_ssize_t. Do nothing if the argument is None. */
|
||||
PyAPI_FUNC(int) _Py_convert_optional_to_ssize_t(PyObject *, void *);
|
||||
|
||||
/* Same as PyNumber_Index but can return an instance of a subclass of int. */
|
||||
PyAPI_FUNC(PyObject *) _PyNumber_Index(PyObject *o);
|
||||
38
deps_windows/Python-3.11.1/Include/cpython/bytearrayobject.h
Normal file
38
deps_windows/Python-3.11.1/Include/cpython/bytearrayobject.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#ifndef Py_CPYTHON_BYTEARRAYOBJECT_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
/* Object layout */
|
||||
typedef struct {
|
||||
PyObject_VAR_HEAD
|
||||
Py_ssize_t ob_alloc; /* How many bytes allocated in ob_bytes */
|
||||
char *ob_bytes; /* Physical backing buffer */
|
||||
char *ob_start; /* Logical start inside ob_bytes */
|
||||
Py_ssize_t ob_exports; /* How many buffer exports */
|
||||
} PyByteArrayObject;
|
||||
|
||||
PyAPI_DATA(char) _PyByteArray_empty_string[];
|
||||
|
||||
/* Macros and static inline functions, trading safety for speed */
|
||||
#define _PyByteArray_CAST(op) \
|
||||
(assert(PyByteArray_Check(op)), _Py_CAST(PyByteArrayObject*, op))
|
||||
|
||||
static inline char* PyByteArray_AS_STRING(PyObject *op)
|
||||
{
|
||||
PyByteArrayObject *self = _PyByteArray_CAST(op);
|
||||
if (Py_SIZE(self)) {
|
||||
return self->ob_start;
|
||||
}
|
||||
return _PyByteArray_empty_string;
|
||||
}
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
|
||||
# define PyByteArray_AS_STRING(self) PyByteArray_AS_STRING(_PyObject_CAST(self))
|
||||
#endif
|
||||
|
||||
static inline Py_ssize_t PyByteArray_GET_SIZE(PyObject *op) {
|
||||
PyByteArrayObject *self = _PyByteArray_CAST(op);
|
||||
return Py_SIZE(self);
|
||||
}
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
|
||||
# define PyByteArray_GET_SIZE(self) PyByteArray_GET_SIZE(_PyObject_CAST(self))
|
||||
#endif
|
||||
133
deps_windows/Python-3.11.1/Include/cpython/bytesobject.h
Normal file
133
deps_windows/Python-3.11.1/Include/cpython/bytesobject.h
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
#ifndef Py_CPYTHON_BYTESOBJECT_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
PyObject_VAR_HEAD
|
||||
Py_DEPRECATED(3.11) Py_hash_t ob_shash;
|
||||
char ob_sval[1];
|
||||
|
||||
/* Invariants:
|
||||
* ob_sval contains space for 'ob_size+1' elements.
|
||||
* ob_sval[ob_size] == 0.
|
||||
* ob_shash is the hash of the byte string or -1 if not computed yet.
|
||||
*/
|
||||
} PyBytesObject;
|
||||
|
||||
PyAPI_FUNC(int) _PyBytes_Resize(PyObject **, Py_ssize_t);
|
||||
PyAPI_FUNC(PyObject*) _PyBytes_FormatEx(
|
||||
const char *format,
|
||||
Py_ssize_t format_len,
|
||||
PyObject *args,
|
||||
int use_bytearray);
|
||||
PyAPI_FUNC(PyObject*) _PyBytes_FromHex(
|
||||
PyObject *string,
|
||||
int use_bytearray);
|
||||
|
||||
/* Helper for PyBytes_DecodeEscape that detects invalid escape chars. */
|
||||
PyAPI_FUNC(PyObject *) _PyBytes_DecodeEscape(const char *, Py_ssize_t,
|
||||
const char *, const char **);
|
||||
|
||||
/* Macros and static inline functions, trading safety for speed */
|
||||
#define _PyBytes_CAST(op) \
|
||||
(assert(PyBytes_Check(op)), _Py_CAST(PyBytesObject*, op))
|
||||
|
||||
static inline char* PyBytes_AS_STRING(PyObject *op)
|
||||
{
|
||||
return _PyBytes_CAST(op)->ob_sval;
|
||||
}
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
|
||||
# define PyBytes_AS_STRING(op) PyBytes_AS_STRING(_PyObject_CAST(op))
|
||||
#endif
|
||||
|
||||
static inline Py_ssize_t PyBytes_GET_SIZE(PyObject *op) {
|
||||
PyBytesObject *self = _PyBytes_CAST(op);
|
||||
return Py_SIZE(self);
|
||||
}
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
|
||||
# define PyBytes_GET_SIZE(self) PyBytes_GET_SIZE(_PyObject_CAST(self))
|
||||
#endif
|
||||
|
||||
/* _PyBytes_Join(sep, x) is like sep.join(x). sep must be PyBytesObject*,
|
||||
x must be an iterable object. */
|
||||
PyAPI_FUNC(PyObject *) _PyBytes_Join(PyObject *sep, PyObject *x);
|
||||
|
||||
|
||||
/* The _PyBytesWriter structure is big: it contains an embedded "stack buffer".
|
||||
A _PyBytesWriter variable must be declared at the end of variables in a
|
||||
function to optimize the memory allocation on the stack. */
|
||||
typedef struct {
|
||||
/* bytes, bytearray or NULL (when the small buffer is used) */
|
||||
PyObject *buffer;
|
||||
|
||||
/* Number of allocated size. */
|
||||
Py_ssize_t allocated;
|
||||
|
||||
/* Minimum number of allocated bytes,
|
||||
incremented by _PyBytesWriter_Prepare() */
|
||||
Py_ssize_t min_size;
|
||||
|
||||
/* If non-zero, use a bytearray instead of a bytes object for buffer. */
|
||||
int use_bytearray;
|
||||
|
||||
/* If non-zero, overallocate the buffer (default: 0).
|
||||
This flag must be zero if use_bytearray is non-zero. */
|
||||
int overallocate;
|
||||
|
||||
/* Stack buffer */
|
||||
int use_small_buffer;
|
||||
char small_buffer[512];
|
||||
} _PyBytesWriter;
|
||||
|
||||
/* Initialize a bytes writer
|
||||
|
||||
By default, the overallocation is disabled. Set the overallocate attribute
|
||||
to control the allocation of the buffer. */
|
||||
PyAPI_FUNC(void) _PyBytesWriter_Init(_PyBytesWriter *writer);
|
||||
|
||||
/* Get the buffer content and reset the writer.
|
||||
Return a bytes object, or a bytearray object if use_bytearray is non-zero.
|
||||
Raise an exception and return NULL on error. */
|
||||
PyAPI_FUNC(PyObject *) _PyBytesWriter_Finish(_PyBytesWriter *writer,
|
||||
void *str);
|
||||
|
||||
/* Deallocate memory of a writer (clear its internal buffer). */
|
||||
PyAPI_FUNC(void) _PyBytesWriter_Dealloc(_PyBytesWriter *writer);
|
||||
|
||||
/* Allocate the buffer to write size bytes.
|
||||
Return the pointer to the beginning of buffer data.
|
||||
Raise an exception and return NULL on error. */
|
||||
PyAPI_FUNC(void*) _PyBytesWriter_Alloc(_PyBytesWriter *writer,
|
||||
Py_ssize_t size);
|
||||
|
||||
/* Ensure that the buffer is large enough to write *size* bytes.
|
||||
Add size to the writer minimum size (min_size attribute).
|
||||
|
||||
str is the current pointer inside the buffer.
|
||||
Return the updated current pointer inside the buffer.
|
||||
Raise an exception and return NULL on error. */
|
||||
PyAPI_FUNC(void*) _PyBytesWriter_Prepare(_PyBytesWriter *writer,
|
||||
void *str,
|
||||
Py_ssize_t size);
|
||||
|
||||
/* Resize the buffer to make it larger.
|
||||
The new buffer may be larger than size bytes because of overallocation.
|
||||
Return the updated current pointer inside the buffer.
|
||||
Raise an exception and return NULL on error.
|
||||
|
||||
Note: size must be greater than the number of allocated bytes in the writer.
|
||||
|
||||
This function doesn't use the writer minimum size (min_size attribute).
|
||||
|
||||
See also _PyBytesWriter_Prepare().
|
||||
*/
|
||||
PyAPI_FUNC(void*) _PyBytesWriter_Resize(_PyBytesWriter *writer,
|
||||
void *str,
|
||||
Py_ssize_t size);
|
||||
|
||||
/* Write bytes.
|
||||
Raise an exception and return NULL on error. */
|
||||
PyAPI_FUNC(void*) _PyBytesWriter_WriteBytes(_PyBytesWriter *writer,
|
||||
void *str,
|
||||
const void *bytes,
|
||||
Py_ssize_t size);
|
||||
31
deps_windows/Python-3.11.1/Include/cpython/cellobject.h
Normal file
31
deps_windows/Python-3.11.1/Include/cpython/cellobject.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/* Cell object interface */
|
||||
|
||||
#ifndef Py_LIMITED_API
|
||||
#ifndef Py_CELLOBJECT_H
|
||||
#define Py_CELLOBJECT_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
/* Content of the cell or NULL when empty */
|
||||
PyObject *ob_ref;
|
||||
} PyCellObject;
|
||||
|
||||
PyAPI_DATA(PyTypeObject) PyCell_Type;
|
||||
|
||||
#define PyCell_Check(op) Py_IS_TYPE(op, &PyCell_Type)
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyCell_New(PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *);
|
||||
PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *);
|
||||
|
||||
#define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref)
|
||||
#define PyCell_SET(op, v) _Py_RVALUE(((PyCellObject *)(op))->ob_ref = (v))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* !Py_TUPLEOBJECT_H */
|
||||
#endif /* Py_LIMITED_API */
|
||||
26
deps_windows/Python-3.11.1/Include/cpython/ceval.h
Normal file
26
deps_windows/Python-3.11.1/Include/cpython/ceval.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#ifndef Py_CPYTHON_CEVAL_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
|
||||
PyAPI_DATA(int) _PyEval_SetProfile(PyThreadState *tstate, Py_tracefunc func, PyObject *arg);
|
||||
PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *);
|
||||
PyAPI_FUNC(int) _PyEval_SetTrace(PyThreadState *tstate, Py_tracefunc func, PyObject *arg);
|
||||
|
||||
/* Helper to look up a builtin object */
|
||||
PyAPI_FUNC(PyObject *) _PyEval_GetBuiltin(PyObject *);
|
||||
PyAPI_FUNC(PyObject *) _PyEval_GetBuiltinId(_Py_Identifier *);
|
||||
/* Look at the current frame's (if any) code's co_flags, and turn on
|
||||
the corresponding compiler flags in cf->cf_flags. Return 1 if any
|
||||
flag was set, else return 0. */
|
||||
PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf);
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PyEval_EvalFrameDefault(PyThreadState *tstate, struct _PyInterpreterFrame *f, int exc);
|
||||
|
||||
PyAPI_FUNC(void) _PyEval_SetSwitchInterval(unsigned long microseconds);
|
||||
PyAPI_FUNC(unsigned long) _PyEval_GetSwitchInterval(void);
|
||||
|
||||
PyAPI_FUNC(Py_ssize_t) _PyEval_RequestCodeExtraIndex(freefunc);
|
||||
|
||||
PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *);
|
||||
PyAPI_FUNC(int) _PyEval_SliceIndexNotNone(PyObject *, Py_ssize_t *);
|
||||
57
deps_windows/Python-3.11.1/Include/cpython/classobject.h
Normal file
57
deps_windows/Python-3.11.1/Include/cpython/classobject.h
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
/* Former class object interface -- now only bound methods are here */
|
||||
|
||||
/* Revealing some structures (not for general use) */
|
||||
|
||||
#ifndef Py_LIMITED_API
|
||||
#ifndef Py_CLASSOBJECT_H
|
||||
#define Py_CLASSOBJECT_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
PyObject *im_func; /* The callable object implementing the method */
|
||||
PyObject *im_self; /* The instance it is bound to */
|
||||
PyObject *im_weakreflist; /* List of weak references */
|
||||
vectorcallfunc vectorcall;
|
||||
} PyMethodObject;
|
||||
|
||||
PyAPI_DATA(PyTypeObject) PyMethod_Type;
|
||||
|
||||
#define PyMethod_Check(op) Py_IS_TYPE(op, &PyMethod_Type)
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *);
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *);
|
||||
|
||||
/* Macros for direct access to these values. Type checks are *not*
|
||||
done, so use with care. */
|
||||
#define PyMethod_GET_FUNCTION(meth) \
|
||||
(((PyMethodObject *)meth) -> im_func)
|
||||
#define PyMethod_GET_SELF(meth) \
|
||||
(((PyMethodObject *)meth) -> im_self)
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
PyObject *func;
|
||||
} PyInstanceMethodObject;
|
||||
|
||||
PyAPI_DATA(PyTypeObject) PyInstanceMethod_Type;
|
||||
|
||||
#define PyInstanceMethod_Check(op) Py_IS_TYPE(op, &PyInstanceMethod_Type)
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyInstanceMethod_New(PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *);
|
||||
|
||||
/* Macros for direct access to these values. Type checks are *not*
|
||||
done, so use with care. */
|
||||
#define PyInstanceMethod_GET_FUNCTION(meth) \
|
||||
(((PyInstanceMethodObject *)meth) -> func)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif // !Py_CLASSOBJECT_H
|
||||
#endif // !Py_LIMITED_API
|
||||
236
deps_windows/Python-3.11.1/Include/cpython/code.h
Normal file
236
deps_windows/Python-3.11.1/Include/cpython/code.h
Normal file
|
|
@ -0,0 +1,236 @@
|
|||
/* Definitions for bytecode */
|
||||
|
||||
#ifndef Py_LIMITED_API
|
||||
#ifndef Py_CODE_H
|
||||
#define Py_CODE_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Each instruction in a code object is a fixed-width value,
|
||||
* currently 2 bytes: 1-byte opcode + 1-byte oparg. The EXTENDED_ARG
|
||||
* opcode allows for larger values but the current limit is 3 uses
|
||||
* of EXTENDED_ARG (see Python/compile.c), for a maximum
|
||||
* 32-bit value. This aligns with the note in Python/compile.c
|
||||
* (compiler_addop_i_line) indicating that the max oparg value is
|
||||
* 2**32 - 1, rather than INT_MAX.
|
||||
*/
|
||||
|
||||
typedef uint16_t _Py_CODEUNIT;
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
# define _Py_OPCODE(word) ((word) >> 8)
|
||||
# define _Py_OPARG(word) ((word) & 255)
|
||||
# define _Py_MAKECODEUNIT(opcode, oparg) (((opcode)<<8)|(oparg))
|
||||
#else
|
||||
# define _Py_OPCODE(word) ((word) & 255)
|
||||
# define _Py_OPARG(word) ((word) >> 8)
|
||||
# define _Py_MAKECODEUNIT(opcode, oparg) ((opcode)|((oparg)<<8))
|
||||
#endif
|
||||
|
||||
// Use "unsigned char" instead of "uint8_t" here to avoid illegal aliasing:
|
||||
#define _Py_SET_OPCODE(word, opcode) (((unsigned char *)&(word))[0] = (opcode))
|
||||
|
||||
// To avoid repeating ourselves in deepfreeze.py, all PyCodeObject members are
|
||||
// defined in this macro:
|
||||
#define _PyCode_DEF(SIZE) { \
|
||||
PyObject_VAR_HEAD \
|
||||
\
|
||||
/* Note only the following fields are used in hash and/or comparisons \
|
||||
* \
|
||||
* - co_name \
|
||||
* - co_argcount \
|
||||
* - co_posonlyargcount \
|
||||
* - co_kwonlyargcount \
|
||||
* - co_nlocals \
|
||||
* - co_stacksize \
|
||||
* - co_flags \
|
||||
* - co_firstlineno \
|
||||
* - co_consts \
|
||||
* - co_names \
|
||||
* - co_localsplusnames \
|
||||
* This is done to preserve the name and line number for tracebacks \
|
||||
* and debuggers; otherwise, constant de-duplication would collapse \
|
||||
* identical functions/lambdas defined on different lines. \
|
||||
*/ \
|
||||
\
|
||||
/* These fields are set with provided values on new code objects. */ \
|
||||
\
|
||||
/* The hottest fields (in the eval loop) are grouped here at the top. */ \
|
||||
PyObject *co_consts; /* list (constants used) */ \
|
||||
PyObject *co_names; /* list of strings (names used) */ \
|
||||
PyObject *co_exceptiontable; /* Byte string encoding exception handling \
|
||||
table */ \
|
||||
int co_flags; /* CO_..., see below */ \
|
||||
short co_warmup; /* Warmup counter for quickening */ \
|
||||
short _co_linearray_entry_size; /* Size of each entry in _co_linearray */ \
|
||||
\
|
||||
/* The rest are not so impactful on performance. */ \
|
||||
int co_argcount; /* #arguments, except *args */ \
|
||||
int co_posonlyargcount; /* #positional only arguments */ \
|
||||
int co_kwonlyargcount; /* #keyword only arguments */ \
|
||||
int co_stacksize; /* #entries needed for evaluation stack */ \
|
||||
int co_firstlineno; /* first source line number */ \
|
||||
\
|
||||
/* redundant values (derived from co_localsplusnames and \
|
||||
co_localspluskinds) */ \
|
||||
int co_nlocalsplus; /* number of local + cell + free variables \
|
||||
*/ \
|
||||
int co_nlocals; /* number of local variables */ \
|
||||
int co_nplaincellvars; /* number of non-arg cell variables */ \
|
||||
int co_ncellvars; /* total number of cell variables */ \
|
||||
int co_nfreevars; /* number of free variables */ \
|
||||
\
|
||||
PyObject *co_localsplusnames; /* tuple mapping offsets to names */ \
|
||||
PyObject *co_localspluskinds; /* Bytes mapping to local kinds (one byte \
|
||||
per variable) */ \
|
||||
PyObject *co_filename; /* unicode (where it was loaded from) */ \
|
||||
PyObject *co_name; /* unicode (name, for reference) */ \
|
||||
PyObject *co_qualname; /* unicode (qualname, for reference) */ \
|
||||
PyObject *co_linetable; /* bytes object that holds location info */ \
|
||||
PyObject *co_weakreflist; /* to support weakrefs to code objects */ \
|
||||
PyObject *_co_code; /* cached co_code object/attribute */ \
|
||||
char *_co_linearray; /* array of line offsets */ \
|
||||
int _co_firsttraceable; /* index of first traceable instruction */ \
|
||||
/* Scratch space for extra data relating to the code object. \
|
||||
Type is a void* to keep the format private in codeobject.c to force \
|
||||
people to go through the proper APIs. */ \
|
||||
void *co_extra; \
|
||||
char co_code_adaptive[(SIZE)]; \
|
||||
}
|
||||
|
||||
/* Bytecode object */
|
||||
struct PyCodeObject _PyCode_DEF(1);
|
||||
|
||||
/* Masks for co_flags above */
|
||||
#define CO_OPTIMIZED 0x0001
|
||||
#define CO_NEWLOCALS 0x0002
|
||||
#define CO_VARARGS 0x0004
|
||||
#define CO_VARKEYWORDS 0x0008
|
||||
#define CO_NESTED 0x0010
|
||||
#define CO_GENERATOR 0x0020
|
||||
|
||||
/* The CO_COROUTINE flag is set for coroutine functions (defined with
|
||||
``async def`` keywords) */
|
||||
#define CO_COROUTINE 0x0080
|
||||
#define CO_ITERABLE_COROUTINE 0x0100
|
||||
#define CO_ASYNC_GENERATOR 0x0200
|
||||
|
||||
/* bpo-39562: These constant values are changed in Python 3.9
|
||||
to prevent collision with compiler flags. CO_FUTURE_ and PyCF_
|
||||
constants must be kept unique. PyCF_ constants can use bits from
|
||||
0x0100 to 0x10000. CO_FUTURE_ constants use bits starting at 0x20000. */
|
||||
#define CO_FUTURE_DIVISION 0x20000
|
||||
#define CO_FUTURE_ABSOLUTE_IMPORT 0x40000 /* do absolute imports by default */
|
||||
#define CO_FUTURE_WITH_STATEMENT 0x80000
|
||||
#define CO_FUTURE_PRINT_FUNCTION 0x100000
|
||||
#define CO_FUTURE_UNICODE_LITERALS 0x200000
|
||||
|
||||
#define CO_FUTURE_BARRY_AS_BDFL 0x400000
|
||||
#define CO_FUTURE_GENERATOR_STOP 0x800000
|
||||
#define CO_FUTURE_ANNOTATIONS 0x1000000
|
||||
|
||||
/* This should be defined if a future statement modifies the syntax.
|
||||
For example, when a keyword is added.
|
||||
*/
|
||||
#define PY_PARSER_REQUIRES_FUTURE_KEYWORD
|
||||
|
||||
#define CO_MAXBLOCKS 20 /* Max static block nesting within a function */
|
||||
|
||||
PyAPI_DATA(PyTypeObject) PyCode_Type;
|
||||
|
||||
#define PyCode_Check(op) Py_IS_TYPE(op, &PyCode_Type)
|
||||
#define PyCode_GetNumFree(op) ((op)->co_nfreevars)
|
||||
#define _PyCode_CODE(CO) ((_Py_CODEUNIT *)(CO)->co_code_adaptive)
|
||||
#define _PyCode_NBYTES(CO) (Py_SIZE(CO) * (Py_ssize_t)sizeof(_Py_CODEUNIT))
|
||||
|
||||
/* Public interface */
|
||||
PyAPI_FUNC(PyCodeObject *) PyCode_New(
|
||||
int, int, int, int, int, PyObject *, PyObject *,
|
||||
PyObject *, PyObject *, PyObject *, PyObject *,
|
||||
PyObject *, PyObject *, PyObject *, int, PyObject *,
|
||||
PyObject *);
|
||||
|
||||
PyAPI_FUNC(PyCodeObject *) PyCode_NewWithPosOnlyArgs(
|
||||
int, int, int, int, int, int, PyObject *, PyObject *,
|
||||
PyObject *, PyObject *, PyObject *, PyObject *,
|
||||
PyObject *, PyObject *, PyObject *, int, PyObject *,
|
||||
PyObject *);
|
||||
/* same as struct above */
|
||||
|
||||
/* Creates a new empty code object with the specified source location. */
|
||||
PyAPI_FUNC(PyCodeObject *)
|
||||
PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno);
|
||||
|
||||
/* Return the line number associated with the specified bytecode index
|
||||
in this code object. If you just need the line number of a frame,
|
||||
use PyFrame_GetLineNumber() instead. */
|
||||
PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int);
|
||||
|
||||
PyAPI_FUNC(int) PyCode_Addr2Location(PyCodeObject *, int, int *, int *, int *, int *);
|
||||
|
||||
/* for internal use only */
|
||||
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;
|
||||
|
||||
/* Update *bounds to describe the first and one-past-the-last instructions in the
|
||||
same line as lasti. Return the number of that line.
|
||||
*/
|
||||
PyAPI_FUNC(int) _PyCode_CheckLineNumber(int lasti, PyCodeAddressRange *bounds);
|
||||
|
||||
/* Create a comparable key used to compare constants taking in account the
|
||||
* object type. It is used to make sure types are not coerced (e.g., float and
|
||||
* complex) _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms
|
||||
*
|
||||
* Return (type(obj), obj, ...): a tuple with variable size (at least 2 items)
|
||||
* depending on the type and the value. The type is the first item to not
|
||||
* compare bytes and str which can raise a BytesWarning exception. */
|
||||
PyAPI_FUNC(PyObject*) _PyCode_ConstantKey(PyObject *obj);
|
||||
|
||||
PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts,
|
||||
PyObject *names, PyObject *lnotab);
|
||||
|
||||
|
||||
PyAPI_FUNC(int) _PyCode_GetExtra(PyObject *code, Py_ssize_t index,
|
||||
void **extra);
|
||||
PyAPI_FUNC(int) _PyCode_SetExtra(PyObject *code, Py_ssize_t index,
|
||||
void *extra);
|
||||
|
||||
/* Equivalent to getattr(code, 'co_code') in Python.
|
||||
Returns a strong reference to a bytes object. */
|
||||
PyAPI_FUNC(PyObject *) PyCode_GetCode(PyCodeObject *code);
|
||||
/* Equivalent to getattr(code, 'co_varnames') in Python. */
|
||||
PyAPI_FUNC(PyObject *) PyCode_GetVarnames(PyCodeObject *code);
|
||||
/* Equivalent to getattr(code, 'co_cellvars') in Python. */
|
||||
PyAPI_FUNC(PyObject *) PyCode_GetCellvars(PyCodeObject *code);
|
||||
/* Equivalent to getattr(code, 'co_freevars') in Python. */
|
||||
PyAPI_FUNC(PyObject *) PyCode_GetFreevars(PyCodeObject *code);
|
||||
|
||||
typedef enum _PyCodeLocationInfoKind {
|
||||
/* short forms are 0 to 9 */
|
||||
PY_CODE_LOCATION_INFO_SHORT0 = 0,
|
||||
/* one lineforms are 10 to 12 */
|
||||
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;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif // !Py_CODE_H
|
||||
#endif // !Py_LIMITED_API
|
||||
54
deps_windows/Python-3.11.1/Include/cpython/compile.h
Normal file
54
deps_windows/Python-3.11.1/Include/cpython/compile.h
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#ifndef Py_CPYTHON_COMPILE_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
/* Public interface */
|
||||
#define PyCF_MASK (CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | \
|
||||
CO_FUTURE_WITH_STATEMENT | CO_FUTURE_PRINT_FUNCTION | \
|
||||
CO_FUTURE_UNICODE_LITERALS | CO_FUTURE_BARRY_AS_BDFL | \
|
||||
CO_FUTURE_GENERATOR_STOP | CO_FUTURE_ANNOTATIONS)
|
||||
#define PyCF_MASK_OBSOLETE (CO_NESTED)
|
||||
|
||||
/* bpo-39562: CO_FUTURE_ and PyCF_ constants must be kept unique.
|
||||
PyCF_ constants can use bits from 0x0100 to 0x10000.
|
||||
CO_FUTURE_ constants use bits starting at 0x20000. */
|
||||
#define PyCF_SOURCE_IS_UTF8 0x0100
|
||||
#define PyCF_DONT_IMPLY_DEDENT 0x0200
|
||||
#define PyCF_ONLY_AST 0x0400
|
||||
#define PyCF_IGNORE_COOKIE 0x0800
|
||||
#define PyCF_TYPE_COMMENTS 0x1000
|
||||
#define PyCF_ALLOW_TOP_LEVEL_AWAIT 0x2000
|
||||
#define PyCF_ALLOW_INCOMPLETE_INPUT 0x4000
|
||||
#define PyCF_COMPILE_MASK (PyCF_ONLY_AST | PyCF_ALLOW_TOP_LEVEL_AWAIT | \
|
||||
PyCF_TYPE_COMMENTS | PyCF_DONT_IMPLY_DEDENT | \
|
||||
PyCF_ALLOW_INCOMPLETE_INPUT)
|
||||
|
||||
typedef struct {
|
||||
int cf_flags; /* bitmask of CO_xxx flags relevant to future */
|
||||
int cf_feature_version; /* minor Python version (PyCF_ONLY_AST) */
|
||||
} PyCompilerFlags;
|
||||
|
||||
#define _PyCompilerFlags_INIT \
|
||||
(PyCompilerFlags){.cf_flags = 0, .cf_feature_version = PY_MINOR_VERSION}
|
||||
|
||||
/* Future feature support */
|
||||
|
||||
typedef struct {
|
||||
int ff_features; /* flags set by future statements */
|
||||
int ff_lineno; /* line number of last future statement */
|
||||
} PyFutureFeatures;
|
||||
|
||||
#define FUTURE_NESTED_SCOPES "nested_scopes"
|
||||
#define FUTURE_GENERATORS "generators"
|
||||
#define FUTURE_DIVISION "division"
|
||||
#define FUTURE_ABSOLUTE_IMPORT "absolute_import"
|
||||
#define FUTURE_WITH_STATEMENT "with_statement"
|
||||
#define FUTURE_PRINT_FUNCTION "print_function"
|
||||
#define FUTURE_UNICODE_LITERALS "unicode_literals"
|
||||
#define FUTURE_BARRY_AS_BDFL "barry_as_FLUFL"
|
||||
#define FUTURE_GENERATOR_STOP "generator_stop"
|
||||
#define FUTURE_ANNOTATIONS "annotations"
|
||||
|
||||
#define PY_INVALID_STACK_EFFECT INT_MAX
|
||||
PyAPI_FUNC(int) PyCompile_OpcodeStackEffect(int opcode, int oparg);
|
||||
PyAPI_FUNC(int) PyCompile_OpcodeStackEffectWithJump(int opcode, int oparg, int jump);
|
||||
44
deps_windows/Python-3.11.1/Include/cpython/complexobject.h
Normal file
44
deps_windows/Python-3.11.1/Include/cpython/complexobject.h
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#ifndef Py_CPYTHON_COMPLEXOBJECT_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
double real;
|
||||
double imag;
|
||||
} Py_complex;
|
||||
|
||||
/* Operations on complex numbers from complexmodule.c */
|
||||
|
||||
PyAPI_FUNC(Py_complex) _Py_c_sum(Py_complex, Py_complex);
|
||||
PyAPI_FUNC(Py_complex) _Py_c_diff(Py_complex, Py_complex);
|
||||
PyAPI_FUNC(Py_complex) _Py_c_neg(Py_complex);
|
||||
PyAPI_FUNC(Py_complex) _Py_c_prod(Py_complex, Py_complex);
|
||||
PyAPI_FUNC(Py_complex) _Py_c_quot(Py_complex, Py_complex);
|
||||
PyAPI_FUNC(Py_complex) _Py_c_pow(Py_complex, Py_complex);
|
||||
PyAPI_FUNC(double) _Py_c_abs(Py_complex);
|
||||
|
||||
/* Complex object interface */
|
||||
|
||||
/*
|
||||
PyComplexObject represents a complex number with double-precision
|
||||
real and imaginary parts.
|
||||
*/
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
Py_complex cval;
|
||||
} PyComplexObject;
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex);
|
||||
|
||||
PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op);
|
||||
|
||||
#ifdef Py_BUILD_CORE
|
||||
/* Format the object based on the format_spec, as defined in PEP 3101
|
||||
(Advanced String Formatting). */
|
||||
extern int _PyComplex_FormatAdvancedWriter(
|
||||
_PyUnicodeWriter *writer,
|
||||
PyObject *obj,
|
||||
PyObject *format_spec,
|
||||
Py_ssize_t start,
|
||||
Py_ssize_t end);
|
||||
#endif // Py_BUILD_CORE
|
||||
78
deps_windows/Python-3.11.1/Include/cpython/context.h
Normal file
78
deps_windows/Python-3.11.1/Include/cpython/context.h
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
#ifndef Py_LIMITED_API
|
||||
#ifndef Py_CONTEXT_H
|
||||
#define Py_CONTEXT_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
PyAPI_DATA(PyTypeObject) PyContext_Type;
|
||||
typedef struct _pycontextobject PyContext;
|
||||
|
||||
PyAPI_DATA(PyTypeObject) PyContextVar_Type;
|
||||
typedef struct _pycontextvarobject PyContextVar;
|
||||
|
||||
PyAPI_DATA(PyTypeObject) PyContextToken_Type;
|
||||
typedef struct _pycontexttokenobject PyContextToken;
|
||||
|
||||
|
||||
#define PyContext_CheckExact(o) Py_IS_TYPE(o, &PyContext_Type)
|
||||
#define PyContextVar_CheckExact(o) Py_IS_TYPE(o, &PyContextVar_Type)
|
||||
#define PyContextToken_CheckExact(o) Py_IS_TYPE(o, &PyContextToken_Type)
|
||||
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyContext_New(void);
|
||||
PyAPI_FUNC(PyObject *) PyContext_Copy(PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyContext_CopyCurrent(void);
|
||||
|
||||
PyAPI_FUNC(int) PyContext_Enter(PyObject *);
|
||||
PyAPI_FUNC(int) PyContext_Exit(PyObject *);
|
||||
|
||||
|
||||
/* Create a new context variable.
|
||||
|
||||
default_value can be NULL.
|
||||
*/
|
||||
PyAPI_FUNC(PyObject *) PyContextVar_New(
|
||||
const char *name, PyObject *default_value);
|
||||
|
||||
|
||||
/* Get a value for the variable.
|
||||
|
||||
Returns -1 if an error occurred during lookup.
|
||||
|
||||
Returns 0 if value either was or was not found.
|
||||
|
||||
If value was found, *value will point to it.
|
||||
If not, it will point to:
|
||||
|
||||
- default_value, if not NULL;
|
||||
- the default value of "var", if not NULL;
|
||||
- NULL.
|
||||
|
||||
'*value' will be a new ref, if not NULL.
|
||||
*/
|
||||
PyAPI_FUNC(int) PyContextVar_Get(
|
||||
PyObject *var, PyObject *default_value, PyObject **value);
|
||||
|
||||
|
||||
/* Set a new value for the variable.
|
||||
Returns NULL if an error occurs.
|
||||
*/
|
||||
PyAPI_FUNC(PyObject *) PyContextVar_Set(PyObject *var, PyObject *value);
|
||||
|
||||
|
||||
/* Reset a variable to its previous value.
|
||||
Returns 0 on success, -1 on error.
|
||||
*/
|
||||
PyAPI_FUNC(int) PyContextVar_Reset(PyObject *var, PyObject *token);
|
||||
|
||||
|
||||
/* This method is exposed only for CPython tests. Don not use it. */
|
||||
PyAPI_FUNC(PyObject *) _PyContext_NewHamtForTests(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* !Py_CONTEXT_H */
|
||||
#endif /* !Py_LIMITED_API */
|
||||
64
deps_windows/Python-3.11.1/Include/cpython/descrobject.h
Normal file
64
deps_windows/Python-3.11.1/Include/cpython/descrobject.h
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
#ifndef Py_CPYTHON_DESCROBJECT_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
/* Flags for above struct */
|
||||
#define PyWrapperFlag_KEYWORDS 1 /* wrapper function takes keyword args */
|
||||
|
||||
/* Various kinds of descriptor objects */
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
PyTypeObject *d_type;
|
||||
PyObject *d_name;
|
||||
PyObject *d_qualname;
|
||||
} PyDescrObject;
|
||||
|
||||
#define PyDescr_COMMON PyDescrObject d_common
|
||||
|
||||
#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
|
||||
#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
|
||||
|
||||
typedef struct {
|
||||
PyDescr_COMMON;
|
||||
PyMethodDef *d_method;
|
||||
vectorcallfunc vectorcall;
|
||||
} PyMethodDescrObject;
|
||||
|
||||
typedef struct {
|
||||
PyDescr_COMMON;
|
||||
PyMemberDef *d_member;
|
||||
} PyMemberDescrObject;
|
||||
|
||||
typedef struct {
|
||||
PyDescr_COMMON;
|
||||
PyGetSetDef *d_getset;
|
||||
} PyGetSetDescrObject;
|
||||
|
||||
typedef struct {
|
||||
PyDescr_COMMON;
|
||||
struct wrapperbase *d_base;
|
||||
void *d_wrapped; /* This can be any function pointer */
|
||||
} PyWrapperDescrObject;
|
||||
|
||||
PyAPI_DATA(PyTypeObject) _PyMethodWrapper_Type;
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *,
|
||||
struct wrapperbase *, void *);
|
||||
PyAPI_FUNC(int) PyDescr_IsData(PyObject *);
|
||||
78
deps_windows/Python-3.11.1/Include/cpython/dictobject.h
Normal file
78
deps_windows/Python-3.11.1/Include/cpython/dictobject.h
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
#ifndef Py_CPYTHON_DICTOBJECT_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
typedef struct _dictkeysobject PyDictKeysObject;
|
||||
typedef struct _dictvalues PyDictValues;
|
||||
|
||||
/* The ma_values pointer is NULL for a combined table
|
||||
* or points to an array of PyObject* for a split table
|
||||
*/
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
|
||||
/* Number of items in the dictionary */
|
||||
Py_ssize_t ma_used;
|
||||
|
||||
/* Dictionary version: globally unique, value change each time
|
||||
the dictionary is modified */
|
||||
uint64_t ma_version_tag;
|
||||
|
||||
PyDictKeysObject *ma_keys;
|
||||
|
||||
/* If ma_values is NULL, the table is "combined": keys and values
|
||||
are stored in ma_keys.
|
||||
|
||||
If ma_values is not NULL, the table is split:
|
||||
keys are stored in ma_keys and values are stored in ma_values */
|
||||
PyDictValues *ma_values;
|
||||
} PyDictObject;
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PyDict_GetItem_KnownHash(PyObject *mp, PyObject *key,
|
||||
Py_hash_t hash);
|
||||
PyAPI_FUNC(PyObject *) _PyDict_GetItemWithError(PyObject *dp, PyObject *key);
|
||||
PyAPI_FUNC(PyObject *) _PyDict_GetItemIdWithError(PyObject *dp,
|
||||
_Py_Identifier *key);
|
||||
PyAPI_FUNC(PyObject *) _PyDict_GetItemStringWithError(PyObject *, const char *);
|
||||
PyAPI_FUNC(PyObject *) PyDict_SetDefault(
|
||||
PyObject *mp, PyObject *key, PyObject *defaultobj);
|
||||
PyAPI_FUNC(int) _PyDict_SetItem_KnownHash(PyObject *mp, PyObject *key,
|
||||
PyObject *item, Py_hash_t hash);
|
||||
PyAPI_FUNC(int) _PyDict_DelItem_KnownHash(PyObject *mp, PyObject *key,
|
||||
Py_hash_t hash);
|
||||
PyAPI_FUNC(int) _PyDict_DelItemIf(PyObject *mp, PyObject *key,
|
||||
int (*predicate)(PyObject *value));
|
||||
PyAPI_FUNC(int) _PyDict_Next(
|
||||
PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value, Py_hash_t *hash);
|
||||
|
||||
/* Get the number of items of a dictionary. */
|
||||
#define PyDict_GET_SIZE(mp) (assert(PyDict_Check(mp)),((PyDictObject *)mp)->ma_used)
|
||||
PyAPI_FUNC(int) _PyDict_Contains_KnownHash(PyObject *, PyObject *, Py_hash_t);
|
||||
PyAPI_FUNC(int) _PyDict_ContainsId(PyObject *, _Py_Identifier *);
|
||||
PyAPI_FUNC(PyObject *) _PyDict_NewPresized(Py_ssize_t minused);
|
||||
PyAPI_FUNC(void) _PyDict_MaybeUntrack(PyObject *mp);
|
||||
PyAPI_FUNC(int) _PyDict_HasOnlyStringKeys(PyObject *mp);
|
||||
PyAPI_FUNC(Py_ssize_t) _PyDict_SizeOf(PyDictObject *);
|
||||
PyAPI_FUNC(PyObject *) _PyDict_Pop(PyObject *, PyObject *, PyObject *);
|
||||
#define _PyDict_HasSplitTable(d) ((d)->ma_values != NULL)
|
||||
|
||||
/* Like PyDict_Merge, but override can be 0, 1 or 2. If override is 0,
|
||||
the first occurrence of a key wins, if override is 1, the last occurrence
|
||||
of a key wins, if override is 2, a KeyError with conflicting key as
|
||||
argument is raised.
|
||||
*/
|
||||
PyAPI_FUNC(int) _PyDict_MergeEx(PyObject *mp, PyObject *other, int override);
|
||||
PyAPI_FUNC(int) _PyDict_SetItemId(PyObject *dp, _Py_Identifier *key, PyObject *item);
|
||||
|
||||
PyAPI_FUNC(int) _PyDict_DelItemId(PyObject *mp, _Py_Identifier *key);
|
||||
PyAPI_FUNC(void) _PyDict_DebugMallocStats(FILE *out);
|
||||
|
||||
/* _PyDictView */
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
PyDictObject *dv_dict;
|
||||
} _PyDictViewObject;
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PyDictView_New(PyObject *, PyTypeObject *);
|
||||
PyAPI_FUNC(PyObject *) _PyDictView_Intersect(PyObject* self, PyObject *other);
|
||||
18
deps_windows/Python-3.11.1/Include/cpython/fileobject.h
Normal file
18
deps_windows/Python-3.11.1/Include/cpython/fileobject.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#ifndef Py_CPYTHON_FILEOBJECT_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
PyAPI_FUNC(char *) Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *);
|
||||
|
||||
/* The std printer acts as a preliminary sys.stderr until the new io
|
||||
infrastructure is in place. */
|
||||
PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int);
|
||||
PyAPI_DATA(PyTypeObject) PyStdPrinter_Type;
|
||||
|
||||
typedef PyObject * (*Py_OpenCodeHookFunction)(PyObject *, void *);
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyFile_OpenCode(const char *utf8path);
|
||||
PyAPI_FUNC(PyObject *) PyFile_OpenCodeObject(PyObject *path);
|
||||
PyAPI_FUNC(int) PyFile_SetOpenCodeHook(Py_OpenCodeHookFunction hook, void *userData);
|
||||
|
||||
PyAPI_FUNC(int) _PyLong_FileDescriptor_Converter(PyObject *, void *);
|
||||
8
deps_windows/Python-3.11.1/Include/cpython/fileutils.h
Normal file
8
deps_windows/Python-3.11.1/Include/cpython/fileutils.h
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef Py_CPYTHON_FILEUTILS_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
// Used by _testcapi which must not use the internal C API
|
||||
PyAPI_FUNC(FILE*) _Py_fopen_obj(
|
||||
PyObject *path,
|
||||
const char *mode);
|
||||
21
deps_windows/Python-3.11.1/Include/cpython/floatobject.h
Normal file
21
deps_windows/Python-3.11.1/Include/cpython/floatobject.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef Py_CPYTHON_FLOATOBJECT_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
double ob_fval;
|
||||
} PyFloatObject;
|
||||
|
||||
// Macro version of PyFloat_AsDouble() trading safety for speed.
|
||||
// It doesn't check if op is a double object.
|
||||
#define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval)
|
||||
|
||||
|
||||
PyAPI_FUNC(int) PyFloat_Pack2(double x, char *p, int le);
|
||||
PyAPI_FUNC(int) PyFloat_Pack4(double x, char *p, int le);
|
||||
PyAPI_FUNC(int) PyFloat_Pack8(double x, char *p, int le);
|
||||
|
||||
PyAPI_FUNC(double) PyFloat_Unpack2(const char *p, int le);
|
||||
PyAPI_FUNC(double) PyFloat_Unpack4(const char *p, int le);
|
||||
PyAPI_FUNC(double) PyFloat_Unpack8(const char *p, int le);
|
||||
29
deps_windows/Python-3.11.1/Include/cpython/frameobject.h
Normal file
29
deps_windows/Python-3.11.1/Include/cpython/frameobject.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* Frame object interface */
|
||||
|
||||
#ifndef Py_CPYTHON_FRAMEOBJECT_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
/* Standard object interface */
|
||||
|
||||
PyAPI_FUNC(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *,
|
||||
PyObject *, PyObject *);
|
||||
|
||||
/* The rest of the interface is specific for frame objects */
|
||||
|
||||
/* Conversions between "fast locals" and locals in dictionary */
|
||||
|
||||
PyAPI_FUNC(void) PyFrame_LocalsToFast(PyFrameObject *, int);
|
||||
|
||||
/* -- Caveat emptor --
|
||||
* The concept of entry frames is an implementation detail of the CPython
|
||||
* interpreter. This API is considered unstable and is provided for the
|
||||
* convenience of debuggers, profilers and state-inspecting tools. Notice that
|
||||
* this API can be changed in future minor versions if the underlying frame
|
||||
* mechanism change or the concept of an 'entry frame' or its semantics becomes
|
||||
* obsolete or outdated. */
|
||||
|
||||
PyAPI_FUNC(int) _PyFrame_IsEntryFrame(PyFrameObject *frame);
|
||||
|
||||
PyAPI_FUNC(int) PyFrame_FastToLocalsWithError(PyFrameObject *f);
|
||||
PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *);
|
||||
113
deps_windows/Python-3.11.1/Include/cpython/funcobject.h
Normal file
113
deps_windows/Python-3.11.1/Include/cpython/funcobject.h
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
/* Function object interface */
|
||||
|
||||
#ifndef Py_LIMITED_API
|
||||
#ifndef Py_FUNCOBJECT_H
|
||||
#define Py_FUNCOBJECT_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#define COMMON_FIELDS(PREFIX) \
|
||||
PyObject *PREFIX ## globals; \
|
||||
PyObject *PREFIX ## builtins; \
|
||||
PyObject *PREFIX ## name; \
|
||||
PyObject *PREFIX ## qualname; \
|
||||
PyObject *PREFIX ## code; /* A code object, the __code__ attribute */ \
|
||||
PyObject *PREFIX ## defaults; /* NULL or a tuple */ \
|
||||
PyObject *PREFIX ## kwdefaults; /* NULL or a dict */ \
|
||||
PyObject *PREFIX ## closure; /* NULL or a tuple of cell objects */
|
||||
|
||||
typedef struct {
|
||||
COMMON_FIELDS(fc_)
|
||||
} PyFrameConstructor;
|
||||
|
||||
/* Function objects and code objects should not be confused with each other:
|
||||
*
|
||||
* Function objects are created by the execution of the 'def' statement.
|
||||
* They reference a code object in their __code__ attribute, which is a
|
||||
* purely syntactic object, i.e. nothing more than a compiled version of some
|
||||
* source code lines. There is one code object per source code "fragment",
|
||||
* but each code object can be referenced by zero or many function objects
|
||||
* depending only on how many times the 'def' statement in the source was
|
||||
* executed so far.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
COMMON_FIELDS(func_)
|
||||
PyObject *func_doc; /* The __doc__ attribute, can be anything */
|
||||
PyObject *func_dict; /* The __dict__ attribute, a dict or NULL */
|
||||
PyObject *func_weakreflist; /* List of weak references */
|
||||
PyObject *func_module; /* The __module__ attribute, can be anything */
|
||||
PyObject *func_annotations; /* Annotations, a dict or NULL */
|
||||
vectorcallfunc vectorcall;
|
||||
/* Version number for use by specializer.
|
||||
* Can set to non-zero when we want to specialize.
|
||||
* Will be set to zero if any of these change:
|
||||
* defaults
|
||||
* kwdefaults (only if the object changes, not the contents of the dict)
|
||||
* code
|
||||
* annotations */
|
||||
uint32_t func_version;
|
||||
|
||||
/* Invariant:
|
||||
* func_closure contains the bindings for func_code->co_freevars, so
|
||||
* PyTuple_Size(func_closure) == PyCode_GetNumFree(func_code)
|
||||
* (func_closure may be NULL if PyCode_GetNumFree(func_code) == 0).
|
||||
*/
|
||||
} PyFunctionObject;
|
||||
|
||||
PyAPI_DATA(PyTypeObject) PyFunction_Type;
|
||||
|
||||
#define PyFunction_Check(op) Py_IS_TYPE(op, &PyFunction_Type)
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyFunction_New(PyObject *, PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyFunction_NewWithQualName(PyObject *, PyObject *, PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyFunction_GetCode(PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyFunction_GetGlobals(PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyFunction_GetModule(PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyFunction_GetDefaults(PyObject *);
|
||||
PyAPI_FUNC(int) PyFunction_SetDefaults(PyObject *, PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyFunction_GetKwDefaults(PyObject *);
|
||||
PyAPI_FUNC(int) PyFunction_SetKwDefaults(PyObject *, PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyFunction_GetClosure(PyObject *);
|
||||
PyAPI_FUNC(int) PyFunction_SetClosure(PyObject *, PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyFunction_GetAnnotations(PyObject *);
|
||||
PyAPI_FUNC(int) PyFunction_SetAnnotations(PyObject *, PyObject *);
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PyFunction_Vectorcall(
|
||||
PyObject *func,
|
||||
PyObject *const *stack,
|
||||
size_t nargsf,
|
||||
PyObject *kwnames);
|
||||
|
||||
/* Macros for direct access to these values. Type checks are *not*
|
||||
done, so use with care. */
|
||||
#define PyFunction_GET_CODE(func) \
|
||||
(((PyFunctionObject *)func) -> func_code)
|
||||
#define PyFunction_GET_GLOBALS(func) \
|
||||
(((PyFunctionObject *)func) -> func_globals)
|
||||
#define PyFunction_GET_MODULE(func) \
|
||||
(((PyFunctionObject *)func) -> func_module)
|
||||
#define PyFunction_GET_DEFAULTS(func) \
|
||||
(((PyFunctionObject *)func) -> func_defaults)
|
||||
#define PyFunction_GET_KW_DEFAULTS(func) \
|
||||
(((PyFunctionObject *)func) -> func_kwdefaults)
|
||||
#define PyFunction_GET_CLOSURE(func) \
|
||||
(((PyFunctionObject *)func) -> func_closure)
|
||||
#define PyFunction_GET_ANNOTATIONS(func) \
|
||||
(((PyFunctionObject *)func) -> func_annotations)
|
||||
|
||||
/* The classmethod and staticmethod types lives here, too */
|
||||
PyAPI_DATA(PyTypeObject) PyClassMethod_Type;
|
||||
PyAPI_DATA(PyTypeObject) PyStaticMethod_Type;
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyClassMethod_New(PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyStaticMethod_New(PyObject *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* !Py_FUNCOBJECT_H */
|
||||
#endif /* Py_LIMITED_API */
|
||||
88
deps_windows/Python-3.11.1/Include/cpython/genobject.h
Normal file
88
deps_windows/Python-3.11.1/Include/cpython/genobject.h
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
/* Generator object interface */
|
||||
|
||||
#ifndef Py_LIMITED_API
|
||||
#ifndef Py_GENOBJECT_H
|
||||
#define Py_GENOBJECT_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* --- Generators --------------------------------------------------------- */
|
||||
|
||||
/* _PyGenObject_HEAD defines the initial segment of generator
|
||||
and coroutine objects. */
|
||||
#define _PyGenObject_HEAD(prefix) \
|
||||
PyObject_HEAD \
|
||||
/* The code object backing the generator */ \
|
||||
PyCodeObject *prefix##_code; \
|
||||
/* List of weak reference. */ \
|
||||
PyObject *prefix##_weakreflist; \
|
||||
/* Name of the generator. */ \
|
||||
PyObject *prefix##_name; \
|
||||
/* Qualified name of the generator. */ \
|
||||
PyObject *prefix##_qualname; \
|
||||
_PyErr_StackItem prefix##_exc_state; \
|
||||
PyObject *prefix##_origin_or_finalizer; \
|
||||
char prefix##_hooks_inited; \
|
||||
char prefix##_closed; \
|
||||
char prefix##_running_async; \
|
||||
/* The frame */ \
|
||||
int8_t prefix##_frame_state; \
|
||||
PyObject *prefix##_iframe[1];
|
||||
|
||||
typedef struct {
|
||||
/* The gi_ prefix is intended to remind of generator-iterator. */
|
||||
_PyGenObject_HEAD(gi)
|
||||
} PyGenObject;
|
||||
|
||||
PyAPI_DATA(PyTypeObject) PyGen_Type;
|
||||
|
||||
#define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type)
|
||||
#define PyGen_CheckExact(op) Py_IS_TYPE(op, &PyGen_Type)
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyGen_New(PyFrameObject *);
|
||||
PyAPI_FUNC(PyObject *) PyGen_NewWithQualName(PyFrameObject *,
|
||||
PyObject *name, PyObject *qualname);
|
||||
PyAPI_FUNC(int) _PyGen_SetStopIterationValue(PyObject *);
|
||||
PyAPI_FUNC(int) _PyGen_FetchStopIterationValue(PyObject **);
|
||||
PyAPI_FUNC(void) _PyGen_Finalize(PyObject *self);
|
||||
|
||||
|
||||
/* --- PyCoroObject ------------------------------------------------------- */
|
||||
|
||||
typedef struct {
|
||||
_PyGenObject_HEAD(cr)
|
||||
} PyCoroObject;
|
||||
|
||||
PyAPI_DATA(PyTypeObject) PyCoro_Type;
|
||||
PyAPI_DATA(PyTypeObject) _PyCoroWrapper_Type;
|
||||
|
||||
#define PyCoro_CheckExact(op) Py_IS_TYPE(op, &PyCoro_Type)
|
||||
PyAPI_FUNC(PyObject *) PyCoro_New(PyFrameObject *,
|
||||
PyObject *name, PyObject *qualname);
|
||||
|
||||
|
||||
/* --- Asynchronous Generators -------------------------------------------- */
|
||||
|
||||
typedef struct {
|
||||
_PyGenObject_HEAD(ag)
|
||||
} PyAsyncGenObject;
|
||||
|
||||
PyAPI_DATA(PyTypeObject) PyAsyncGen_Type;
|
||||
PyAPI_DATA(PyTypeObject) _PyAsyncGenASend_Type;
|
||||
PyAPI_DATA(PyTypeObject) _PyAsyncGenWrappedValue_Type;
|
||||
PyAPI_DATA(PyTypeObject) _PyAsyncGenAThrow_Type;
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyAsyncGen_New(PyFrameObject *,
|
||||
PyObject *name, PyObject *qualname);
|
||||
|
||||
#define PyAsyncGen_CheckExact(op) Py_IS_TYPE(op, &PyAsyncGen_Type)
|
||||
|
||||
|
||||
#undef _PyGenObject_HEAD
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* !Py_GENOBJECT_H */
|
||||
#endif /* Py_LIMITED_API */
|
||||
45
deps_windows/Python-3.11.1/Include/cpython/import.h
Normal file
45
deps_windows/Python-3.11.1/Include/cpython/import.h
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#ifndef Py_CPYTHON_IMPORT_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
PyMODINIT_FUNC PyInit__imp(void);
|
||||
|
||||
PyAPI_FUNC(int) _PyImport_IsInitialized(PyInterpreterState *);
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PyImport_GetModuleId(_Py_Identifier *name);
|
||||
PyAPI_FUNC(int) _PyImport_SetModule(PyObject *name, PyObject *module);
|
||||
PyAPI_FUNC(int) _PyImport_SetModuleString(const char *name, PyObject* module);
|
||||
|
||||
PyAPI_FUNC(void) _PyImport_AcquireLock(void);
|
||||
PyAPI_FUNC(int) _PyImport_ReleaseLock(void);
|
||||
|
||||
PyAPI_FUNC(int) _PyImport_FixupBuiltin(
|
||||
PyObject *mod,
|
||||
const char *name, /* UTF-8 encoded string */
|
||||
PyObject *modules
|
||||
);
|
||||
PyAPI_FUNC(int) _PyImport_FixupExtensionObject(PyObject*, PyObject *,
|
||||
PyObject *, PyObject *);
|
||||
|
||||
struct _inittab {
|
||||
const char *name; /* ASCII encoded string */
|
||||
PyObject* (*initfunc)(void);
|
||||
};
|
||||
PyAPI_DATA(struct _inittab *) PyImport_Inittab;
|
||||
PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab);
|
||||
|
||||
struct _frozen {
|
||||
const char *name; /* ASCII encoded string */
|
||||
const unsigned char *code;
|
||||
int size;
|
||||
int is_package;
|
||||
PyObject *(*get_code)(void);
|
||||
};
|
||||
|
||||
/* Embedding apps may change this pointer to point to their favorite
|
||||
collection of frozen modules: */
|
||||
|
||||
PyAPI_DATA(const struct _frozen *) PyImport_FrozenModules;
|
||||
|
||||
PyAPI_DATA(PyObject *) _PyImport_GetModuleAttr(PyObject *, PyObject *);
|
||||
PyAPI_DATA(PyObject *) _PyImport_GetModuleAttrString(const char *, const char *);
|
||||
257
deps_windows/Python-3.11.1/Include/cpython/initconfig.h
Normal file
257
deps_windows/Python-3.11.1/Include/cpython/initconfig.h
Normal file
|
|
@ -0,0 +1,257 @@
|
|||
#ifndef Py_PYCORECONFIG_H
|
||||
#define Py_PYCORECONFIG_H
|
||||
#ifndef Py_LIMITED_API
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* --- PyStatus ----------------------------------------------- */
|
||||
|
||||
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;
|
||||
|
||||
PyAPI_FUNC(PyStatus) PyStatus_Ok(void);
|
||||
PyAPI_FUNC(PyStatus) PyStatus_Error(const char *err_msg);
|
||||
PyAPI_FUNC(PyStatus) PyStatus_NoMemory(void);
|
||||
PyAPI_FUNC(PyStatus) PyStatus_Exit(int exitcode);
|
||||
PyAPI_FUNC(int) PyStatus_IsError(PyStatus err);
|
||||
PyAPI_FUNC(int) PyStatus_IsExit(PyStatus err);
|
||||
PyAPI_FUNC(int) PyStatus_Exception(PyStatus err);
|
||||
|
||||
/* --- PyWideStringList ------------------------------------------------ */
|
||||
|
||||
typedef struct {
|
||||
/* If length is greater than zero, items must be non-NULL
|
||||
and all items strings must be non-NULL */
|
||||
Py_ssize_t length;
|
||||
wchar_t **items;
|
||||
} PyWideStringList;
|
||||
|
||||
PyAPI_FUNC(PyStatus) PyWideStringList_Append(PyWideStringList *list,
|
||||
const wchar_t *item);
|
||||
PyAPI_FUNC(PyStatus) PyWideStringList_Insert(PyWideStringList *list,
|
||||
Py_ssize_t index,
|
||||
const wchar_t *item);
|
||||
|
||||
|
||||
/* --- PyPreConfig ----------------------------------------------- */
|
||||
|
||||
typedef struct PyPreConfig {
|
||||
int _config_init; /* _PyConfigInitEnum value */
|
||||
|
||||
/* Parse Py_PreInitializeFromBytesArgs() arguments?
|
||||
See PyConfig.parse_argv */
|
||||
int parse_argv;
|
||||
|
||||
/* If greater than 0, enable isolated mode: sys.path contains
|
||||
neither the script's directory nor the user's site-packages directory.
|
||||
|
||||
Set to 1 by the -I command line option. If set to -1 (default), inherit
|
||||
Py_IsolatedFlag value. */
|
||||
int isolated;
|
||||
|
||||
/* If greater than 0: use environment variables.
|
||||
Set to 0 by -E command line option. If set to -1 (default), it is
|
||||
set to !Py_IgnoreEnvironmentFlag. */
|
||||
int use_environment;
|
||||
|
||||
/* Set the LC_CTYPE locale to the user preferred locale? If equals to 0,
|
||||
set coerce_c_locale and coerce_c_locale_warn to 0. */
|
||||
int configure_locale;
|
||||
|
||||
/* Coerce the LC_CTYPE locale if it's equal to "C"? (PEP 538)
|
||||
|
||||
Set to 0 by PYTHONCOERCECLOCALE=0. Set to 1 by PYTHONCOERCECLOCALE=1.
|
||||
Set to 2 if the user preferred LC_CTYPE locale is "C".
|
||||
|
||||
If it is equal to 1, LC_CTYPE locale is read to decide if it should be
|
||||
coerced or not (ex: PYTHONCOERCECLOCALE=1). Internally, it is set to 2
|
||||
if the LC_CTYPE locale must be coerced.
|
||||
|
||||
Disable by default (set to 0). Set it to -1 to let Python decide if it
|
||||
should be enabled or not. */
|
||||
int coerce_c_locale;
|
||||
|
||||
/* Emit a warning if the LC_CTYPE locale is coerced?
|
||||
|
||||
Set to 1 by PYTHONCOERCECLOCALE=warn.
|
||||
|
||||
Disable by default (set to 0). Set it to -1 to let Python decide if it
|
||||
should be enabled or not. */
|
||||
int coerce_c_locale_warn;
|
||||
|
||||
#ifdef MS_WINDOWS
|
||||
/* If greater than 1, use the "mbcs" encoding instead of the UTF-8
|
||||
encoding for the filesystem encoding.
|
||||
|
||||
Set to 1 if the PYTHONLEGACYWINDOWSFSENCODING environment variable is
|
||||
set to a non-empty string. If set to -1 (default), inherit
|
||||
Py_LegacyWindowsFSEncodingFlag value.
|
||||
|
||||
See PEP 529 for more details. */
|
||||
int legacy_windows_fs_encoding;
|
||||
#endif
|
||||
|
||||
/* Enable UTF-8 mode? (PEP 540)
|
||||
|
||||
Disabled by default (equals to 0).
|
||||
|
||||
Set to 1 by "-X utf8" and "-X utf8=1" command line options.
|
||||
Set to 1 by PYTHONUTF8=1 environment variable.
|
||||
|
||||
Set to 0 by "-X utf8=0" and PYTHONUTF8=0.
|
||||
|
||||
If equals to -1, it is set to 1 if the LC_CTYPE locale is "C" or
|
||||
"POSIX", otherwise it is set to 0. Inherit Py_UTF8Mode value value. */
|
||||
int utf8_mode;
|
||||
|
||||
/* If non-zero, enable the Python Development Mode.
|
||||
|
||||
Set to 1 by the -X dev command line option. Set by the PYTHONDEVMODE
|
||||
environment variable. */
|
||||
int dev_mode;
|
||||
|
||||
/* Memory allocator: PYTHONMALLOC env var.
|
||||
See PyMemAllocatorName for valid values. */
|
||||
int allocator;
|
||||
} PyPreConfig;
|
||||
|
||||
PyAPI_FUNC(void) PyPreConfig_InitPythonConfig(PyPreConfig *config);
|
||||
PyAPI_FUNC(void) PyPreConfig_InitIsolatedConfig(PyPreConfig *config);
|
||||
|
||||
|
||||
/* --- PyConfig ---------------------------------------------- */
|
||||
|
||||
/* This structure is best documented in the Doc/c-api/init_config.rst file. */
|
||||
typedef struct PyConfig {
|
||||
int _config_init; /* _PyConfigInitEnum value */
|
||||
|
||||
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 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;
|
||||
#ifdef MS_WINDOWS
|
||||
int legacy_windows_stdio;
|
||||
#endif
|
||||
wchar_t *check_hash_pycs_mode;
|
||||
int use_frozen_modules;
|
||||
int safe_path;
|
||||
|
||||
/* --- Path configuration inputs ------------ */
|
||||
int pathconfig_warnings;
|
||||
wchar_t *program_name;
|
||||
wchar_t *pythonpath_env;
|
||||
wchar_t *home;
|
||||
wchar_t *platlibdir;
|
||||
|
||||
/* --- Path configuration outputs ----------- */
|
||||
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;
|
||||
|
||||
/* --- Parameter only used by Py_Main() ---------- */
|
||||
int skip_source_first_line;
|
||||
wchar_t *run_command;
|
||||
wchar_t *run_module;
|
||||
wchar_t *run_filename;
|
||||
|
||||
/* --- Private fields ---------------------------- */
|
||||
|
||||
// Install importlib? If equals to 0, importlib is not initialized at all.
|
||||
// Needed by freeze_importlib.
|
||||
int _install_importlib;
|
||||
|
||||
// If equal to 0, stop Python initialization before the "main" phase.
|
||||
int _init_main;
|
||||
|
||||
// If non-zero, disallow threads, subprocesses, and fork.
|
||||
// Default: 0.
|
||||
int _isolated_interpreter;
|
||||
|
||||
// If non-zero, we believe we're running from a source tree.
|
||||
int _is_python_build;
|
||||
} PyConfig;
|
||||
|
||||
PyAPI_FUNC(void) PyConfig_InitPythonConfig(PyConfig *config);
|
||||
PyAPI_FUNC(void) PyConfig_InitIsolatedConfig(PyConfig *config);
|
||||
PyAPI_FUNC(void) PyConfig_Clear(PyConfig *);
|
||||
PyAPI_FUNC(PyStatus) PyConfig_SetString(
|
||||
PyConfig *config,
|
||||
wchar_t **config_str,
|
||||
const wchar_t *str);
|
||||
PyAPI_FUNC(PyStatus) PyConfig_SetBytesString(
|
||||
PyConfig *config,
|
||||
wchar_t **config_str,
|
||||
const char *str);
|
||||
PyAPI_FUNC(PyStatus) PyConfig_Read(PyConfig *config);
|
||||
PyAPI_FUNC(PyStatus) PyConfig_SetBytesArgv(
|
||||
PyConfig *config,
|
||||
Py_ssize_t argc,
|
||||
char * const *argv);
|
||||
PyAPI_FUNC(PyStatus) PyConfig_SetArgv(PyConfig *config,
|
||||
Py_ssize_t argc,
|
||||
wchar_t * const *argv);
|
||||
PyAPI_FUNC(PyStatus) PyConfig_SetWideStringList(PyConfig *config,
|
||||
PyWideStringList *list,
|
||||
Py_ssize_t length, wchar_t **items);
|
||||
|
||||
|
||||
/* --- Helper functions --------------------------------------- */
|
||||
|
||||
/* Get the original command line arguments, before Python modified them.
|
||||
|
||||
See also PyConfig.orig_argv. */
|
||||
PyAPI_FUNC(void) Py_GetArgcArgv(int *argc, wchar_t ***argv);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* !Py_LIMITED_API */
|
||||
#endif /* !Py_PYCORECONFIG_H */
|
||||
51
deps_windows/Python-3.11.1/Include/cpython/listobject.h
Normal file
51
deps_windows/Python-3.11.1/Include/cpython/listobject.h
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#ifndef Py_CPYTHON_LISTOBJECT_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
PyObject_VAR_HEAD
|
||||
/* Vector of pointers to list elements. list[0] is ob_item[0], etc. */
|
||||
PyObject **ob_item;
|
||||
|
||||
/* ob_item contains space for 'allocated' elements. The number
|
||||
* currently in use is ob_size.
|
||||
* Invariants:
|
||||
* 0 <= ob_size <= allocated
|
||||
* len(list) == ob_size
|
||||
* ob_item == NULL implies ob_size == allocated == 0
|
||||
* list.sort() temporarily sets allocated to -1 to detect mutations.
|
||||
*
|
||||
* Items must normally not be NULL, except during construction when
|
||||
* the list is not yet visible outside the function that builds it.
|
||||
*/
|
||||
Py_ssize_t allocated;
|
||||
} PyListObject;
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PyList_Extend(PyListObject *, PyObject *);
|
||||
PyAPI_FUNC(void) _PyList_DebugMallocStats(FILE *out);
|
||||
|
||||
/* Cast argument to PyListObject* type. */
|
||||
#define _PyList_CAST(op) \
|
||||
(assert(PyList_Check(op)), _Py_CAST(PyListObject*, (op)))
|
||||
|
||||
// Macros and static inline functions, trading safety for speed
|
||||
|
||||
static inline Py_ssize_t PyList_GET_SIZE(PyObject *op) {
|
||||
PyListObject *list = _PyList_CAST(op);
|
||||
return Py_SIZE(list);
|
||||
}
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
|
||||
# define PyList_GET_SIZE(op) PyList_GET_SIZE(_PyObject_CAST(op))
|
||||
#endif
|
||||
|
||||
#define PyList_GET_ITEM(op, index) (_PyList_CAST(op)->ob_item[index])
|
||||
|
||||
static inline void
|
||||
PyList_SET_ITEM(PyObject *op, Py_ssize_t index, PyObject *value) {
|
||||
PyListObject *list = _PyList_CAST(op);
|
||||
list->ob_item[index] = value;
|
||||
}
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
|
||||
#define PyList_SET_ITEM(op, index, value) \
|
||||
PyList_SET_ITEM(_PyObject_CAST(op), index, _PyObject_CAST(value))
|
||||
#endif
|
||||
93
deps_windows/Python-3.11.1/Include/cpython/longintrepr.h
Normal file
93
deps_windows/Python-3.11.1/Include/cpython/longintrepr.h
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
#ifndef Py_LIMITED_API
|
||||
#ifndef Py_LONGINTREPR_H
|
||||
#define Py_LONGINTREPR_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* This is published for the benefit of "friends" marshal.c and _decimal.c. */
|
||||
|
||||
/* Parameters of the integer representation. There are two different
|
||||
sets of parameters: one set for 30-bit digits, stored in an unsigned 32-bit
|
||||
integer type, and one set for 15-bit digits with each digit stored in an
|
||||
unsigned short. The value of PYLONG_BITS_IN_DIGIT, defined either at
|
||||
configure time or in pyport.h, is used to decide which digit size to use.
|
||||
|
||||
Type 'digit' should be able to hold 2*PyLong_BASE-1, and type 'twodigits'
|
||||
should be an unsigned integer type able to hold all integers up to
|
||||
PyLong_BASE*PyLong_BASE-1. x_sub assumes that 'digit' is an unsigned type,
|
||||
and that overflow is handled by taking the result modulo 2**N for some N >
|
||||
PyLong_SHIFT. The majority of the code doesn't care about the precise
|
||||
value of PyLong_SHIFT, but there are some notable exceptions:
|
||||
|
||||
- PyLong_{As,From}ByteArray require that PyLong_SHIFT be at least 8
|
||||
|
||||
- long_hash() requires that PyLong_SHIFT is *strictly* less than the number
|
||||
of bits in an unsigned long, as do the PyLong <-> long (or unsigned long)
|
||||
conversion functions
|
||||
|
||||
- the Python int <-> size_t/Py_ssize_t conversion functions expect that
|
||||
PyLong_SHIFT is strictly less than the number of bits in a size_t
|
||||
|
||||
- the marshal code currently expects that PyLong_SHIFT is a multiple of 15
|
||||
|
||||
- NSMALLNEGINTS and NSMALLPOSINTS should be small enough to fit in a single
|
||||
digit; with the current values this forces PyLong_SHIFT >= 9
|
||||
|
||||
The values 15 and 30 should fit all of the above requirements, on any
|
||||
platform.
|
||||
*/
|
||||
|
||||
#if PYLONG_BITS_IN_DIGIT == 30
|
||||
typedef uint32_t digit;
|
||||
typedef int32_t sdigit; /* signed variant of digit */
|
||||
typedef uint64_t twodigits;
|
||||
typedef int64_t stwodigits; /* signed variant of twodigits */
|
||||
#define PyLong_SHIFT 30
|
||||
#define _PyLong_DECIMAL_SHIFT 9 /* max(e such that 10**e fits in a digit) */
|
||||
#define _PyLong_DECIMAL_BASE ((digit)1000000000) /* 10 ** DECIMAL_SHIFT */
|
||||
#elif PYLONG_BITS_IN_DIGIT == 15
|
||||
typedef unsigned short digit;
|
||||
typedef short sdigit; /* signed variant of digit */
|
||||
typedef unsigned long twodigits;
|
||||
typedef long stwodigits; /* signed variant of twodigits */
|
||||
#define PyLong_SHIFT 15
|
||||
#define _PyLong_DECIMAL_SHIFT 4 /* max(e such that 10**e fits in a digit) */
|
||||
#define _PyLong_DECIMAL_BASE ((digit)10000) /* 10 ** DECIMAL_SHIFT */
|
||||
#else
|
||||
#error "PYLONG_BITS_IN_DIGIT should be 15 or 30"
|
||||
#endif
|
||||
#define PyLong_BASE ((digit)1 << PyLong_SHIFT)
|
||||
#define PyLong_MASK ((digit)(PyLong_BASE - 1))
|
||||
|
||||
/* Long integer representation.
|
||||
The absolute value of a number is equal to
|
||||
SUM(for i=0 through abs(ob_size)-1) ob_digit[i] * 2**(SHIFT*i)
|
||||
Negative numbers are represented with ob_size < 0;
|
||||
zero is represented by ob_size == 0.
|
||||
In a normalized number, ob_digit[abs(ob_size)-1] (the most significant
|
||||
digit) is never zero. Also, in all cases, for all valid i,
|
||||
0 <= ob_digit[i] <= MASK.
|
||||
The allocation function takes care of allocating extra memory
|
||||
so that ob_digit[0] ... ob_digit[abs(ob_size)-1] are actually available.
|
||||
|
||||
CAUTION: Generic code manipulating subtypes of PyVarObject has to
|
||||
aware that ints abuse ob_size's sign bit.
|
||||
*/
|
||||
|
||||
struct _longobject {
|
||||
PyObject_VAR_HEAD
|
||||
digit ob_digit[1];
|
||||
};
|
||||
|
||||
PyAPI_FUNC(PyLongObject *) _PyLong_New(Py_ssize_t);
|
||||
|
||||
/* Return a copy of src. */
|
||||
PyAPI_FUNC(PyObject *) _PyLong_Copy(PyLongObject *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* !Py_LONGINTREPR_H */
|
||||
#endif /* Py_LIMITED_API */
|
||||
95
deps_windows/Python-3.11.1/Include/cpython/longobject.h
Normal file
95
deps_windows/Python-3.11.1/Include/cpython/longobject.h
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
#ifndef Py_CPYTHON_LONGOBJECT_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
PyAPI_FUNC(int) _PyLong_AsInt(PyObject *);
|
||||
|
||||
PyAPI_FUNC(int) _PyLong_UnsignedShort_Converter(PyObject *, void *);
|
||||
PyAPI_FUNC(int) _PyLong_UnsignedInt_Converter(PyObject *, void *);
|
||||
PyAPI_FUNC(int) _PyLong_UnsignedLong_Converter(PyObject *, void *);
|
||||
PyAPI_FUNC(int) _PyLong_UnsignedLongLong_Converter(PyObject *, void *);
|
||||
PyAPI_FUNC(int) _PyLong_Size_t_Converter(PyObject *, void *);
|
||||
|
||||
/* _PyLong_Frexp returns a double x and an exponent e such that the
|
||||
true value is approximately equal to x * 2**e. e is >= 0. x is
|
||||
0.0 if and only if the input is 0 (in which case, e and x are both
|
||||
zeroes); otherwise, 0.5 <= abs(x) < 1.0. On overflow, which is
|
||||
possible if the number of bits doesn't fit into a Py_ssize_t, sets
|
||||
OverflowError and returns -1.0 for x, 0 for e. */
|
||||
PyAPI_FUNC(double) _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e);
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyLong_FromUnicodeObject(PyObject *u, int base);
|
||||
PyAPI_FUNC(PyObject *) _PyLong_FromBytes(const char *, Py_ssize_t, int);
|
||||
|
||||
/* _PyLong_Sign. Return 0 if v is 0, -1 if v < 0, +1 if v > 0.
|
||||
v must not be NULL, and must be a normalized long.
|
||||
There are no error cases.
|
||||
*/
|
||||
PyAPI_FUNC(int) _PyLong_Sign(PyObject *v);
|
||||
|
||||
/* _PyLong_NumBits. Return the number of bits needed to represent the
|
||||
absolute value of a long. For example, this returns 1 for 1 and -1, 2
|
||||
for 2 and -2, and 2 for 3 and -3. It returns 0 for 0.
|
||||
v must not be NULL, and must be a normalized long.
|
||||
(size_t)-1 is returned and OverflowError set if the true result doesn't
|
||||
fit in a size_t.
|
||||
*/
|
||||
PyAPI_FUNC(size_t) _PyLong_NumBits(PyObject *v);
|
||||
|
||||
/* _PyLong_DivmodNear. Given integers a and b, compute the nearest
|
||||
integer q to the exact quotient a / b, rounding to the nearest even integer
|
||||
in the case of a tie. Return (q, r), where r = a - q*b. The remainder r
|
||||
will satisfy abs(r) <= abs(b)/2, with equality possible only if q is
|
||||
even.
|
||||
*/
|
||||
PyAPI_FUNC(PyObject *) _PyLong_DivmodNear(PyObject *, PyObject *);
|
||||
|
||||
/* _PyLong_FromByteArray: View the n unsigned bytes as a binary integer in
|
||||
base 256, and return a Python int with the same numeric value.
|
||||
If n is 0, the integer is 0. Else:
|
||||
If little_endian is 1/true, bytes[n-1] is the MSB and bytes[0] the LSB;
|
||||
else (little_endian is 0/false) bytes[0] is the MSB and bytes[n-1] the
|
||||
LSB.
|
||||
If is_signed is 0/false, view the bytes as a non-negative integer.
|
||||
If is_signed is 1/true, view the bytes as a 2's-complement integer,
|
||||
non-negative if bit 0x80 of the MSB is clear, negative if set.
|
||||
Error returns:
|
||||
+ Return NULL with the appropriate exception set if there's not
|
||||
enough memory to create the Python int.
|
||||
*/
|
||||
PyAPI_FUNC(PyObject *) _PyLong_FromByteArray(
|
||||
const unsigned char* bytes, size_t n,
|
||||
int little_endian, int is_signed);
|
||||
|
||||
/* _PyLong_AsByteArray: Convert the least-significant 8*n bits of long
|
||||
v to a base-256 integer, stored in array bytes. Normally return 0,
|
||||
return -1 on error.
|
||||
If little_endian is 1/true, store the MSB at bytes[n-1] and the LSB at
|
||||
bytes[0]; else (little_endian is 0/false) store the MSB at bytes[0] and
|
||||
the LSB at bytes[n-1].
|
||||
If is_signed is 0/false, it's an error if v < 0; else (v >= 0) n bytes
|
||||
are filled and there's nothing special about bit 0x80 of the MSB.
|
||||
If is_signed is 1/true, bytes is filled with the 2's-complement
|
||||
representation of v's value. Bit 0x80 of the MSB is the sign bit.
|
||||
Error returns (-1):
|
||||
+ is_signed is 0 and v < 0. TypeError is set in this case, and bytes
|
||||
isn't altered.
|
||||
+ n isn't big enough to hold the full mathematical value of v. For
|
||||
example, if is_signed is 0 and there are more digits in the v than
|
||||
fit in n; or if is_signed is 1, v < 0, and n is just 1 bit shy of
|
||||
being large enough to hold a sign bit. OverflowError is set in this
|
||||
case, but bytes holds the least-significant n bytes of the true value.
|
||||
*/
|
||||
PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
|
||||
unsigned char* bytes, size_t n,
|
||||
int little_endian, int is_signed);
|
||||
|
||||
/* _PyLong_Format: Convert the long to a string object with given base,
|
||||
appending a base prefix of 0[box] if base is 2, 8 or 16. */
|
||||
PyAPI_FUNC(PyObject *) _PyLong_Format(PyObject *obj, int base);
|
||||
|
||||
/* For use by the gcd function in mathmodule.c */
|
||||
PyAPI_FUNC(PyObject *) _PyLong_GCD(PyObject *, PyObject *);
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PyLong_Rshift(PyObject *, size_t);
|
||||
PyAPI_FUNC(PyObject *) _PyLong_Lshift(PyObject *, size_t);
|
||||
74
deps_windows/Python-3.11.1/Include/cpython/methodobject.h
Normal file
74
deps_windows/Python-3.11.1/Include/cpython/methodobject.h
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
#ifndef Py_CPYTHON_METHODOBJECT_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
// PyCFunctionObject structure
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
PyMethodDef *m_ml; /* Description of the C function to call */
|
||||
PyObject *m_self; /* Passed as 'self' arg to the C func, can be NULL */
|
||||
PyObject *m_module; /* The __module__ attribute, can be anything */
|
||||
PyObject *m_weakreflist; /* List of weak references */
|
||||
vectorcallfunc vectorcall;
|
||||
} PyCFunctionObject;
|
||||
|
||||
#define _PyCFunctionObject_CAST(func) \
|
||||
(assert(PyCFunction_Check(func)), \
|
||||
_Py_CAST(PyCFunctionObject*, (func)))
|
||||
|
||||
|
||||
// PyCMethodObject structure
|
||||
|
||||
typedef struct {
|
||||
PyCFunctionObject func;
|
||||
PyTypeObject *mm_class; /* Class that defines this method */
|
||||
} PyCMethodObject;
|
||||
|
||||
#define _PyCMethodObject_CAST(func) \
|
||||
(assert(PyCMethod_Check(func)), \
|
||||
_Py_CAST(PyCMethodObject*, (func)))
|
||||
|
||||
PyAPI_DATA(PyTypeObject) PyCMethod_Type;
|
||||
|
||||
#define PyCMethod_CheckExact(op) Py_IS_TYPE(op, &PyCMethod_Type)
|
||||
#define PyCMethod_Check(op) PyObject_TypeCheck(op, &PyCMethod_Type)
|
||||
|
||||
|
||||
/* Static inline functions for direct access to these values.
|
||||
Type checks are *not* done, so use with care. */
|
||||
static inline PyCFunction PyCFunction_GET_FUNCTION(PyObject *func) {
|
||||
return _PyCFunctionObject_CAST(func)->m_ml->ml_meth;
|
||||
}
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
|
||||
# define PyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(_PyObject_CAST(func))
|
||||
#endif
|
||||
|
||||
static inline PyObject* PyCFunction_GET_SELF(PyObject *func_obj) {
|
||||
PyCFunctionObject *func = _PyCFunctionObject_CAST(func_obj);
|
||||
if (func->m_ml->ml_flags & METH_STATIC) {
|
||||
return _Py_NULL;
|
||||
}
|
||||
return func->m_self;
|
||||
}
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
|
||||
# define PyCFunction_GET_SELF(func) PyCFunction_GET_SELF(_PyObject_CAST(func))
|
||||
#endif
|
||||
|
||||
static inline int PyCFunction_GET_FLAGS(PyObject *func) {
|
||||
return _PyCFunctionObject_CAST(func)->m_ml->ml_flags;
|
||||
}
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
|
||||
# define PyCFunction_GET_FLAGS(func) PyCFunction_GET_FLAGS(_PyObject_CAST(func))
|
||||
#endif
|
||||
|
||||
static inline PyTypeObject* PyCFunction_GET_CLASS(PyObject *func_obj) {
|
||||
PyCFunctionObject *func = _PyCFunctionObject_CAST(func_obj);
|
||||
if (func->m_ml->ml_flags & METH_METHOD) {
|
||||
return _PyCMethodObject_CAST(func)->mm_class;
|
||||
}
|
||||
return _Py_NULL;
|
||||
}
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
|
||||
# define PyCFunction_GET_CLASS(func) PyCFunction_GET_CLASS(_PyObject_CAST(func))
|
||||
#endif
|
||||
107
deps_windows/Python-3.11.1/Include/cpython/modsupport.h
Normal file
107
deps_windows/Python-3.11.1/Include/cpython/modsupport.h
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
#ifndef Py_CPYTHON_MODSUPPORT_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
/* If PY_SSIZE_T_CLEAN is defined, each functions treats #-specifier
|
||||
to mean Py_ssize_t */
|
||||
#ifdef PY_SSIZE_T_CLEAN
|
||||
#define _Py_VaBuildStack _Py_VaBuildStack_SizeT
|
||||
#else
|
||||
PyAPI_FUNC(PyObject *) _Py_VaBuildValue_SizeT(const char *, va_list);
|
||||
PyAPI_FUNC(PyObject **) _Py_VaBuildStack_SizeT(
|
||||
PyObject **small_stack,
|
||||
Py_ssize_t small_stack_len,
|
||||
const char *format,
|
||||
va_list va,
|
||||
Py_ssize_t *p_nargs);
|
||||
#endif
|
||||
|
||||
PyAPI_FUNC(int) _PyArg_UnpackStack(
|
||||
PyObject *const *args,
|
||||
Py_ssize_t nargs,
|
||||
const char *name,
|
||||
Py_ssize_t min,
|
||||
Py_ssize_t max,
|
||||
...);
|
||||
|
||||
PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kwargs);
|
||||
PyAPI_FUNC(int) _PyArg_NoKwnames(const char *funcname, PyObject *kwnames);
|
||||
PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args);
|
||||
#define _PyArg_NoKeywords(funcname, kwargs) \
|
||||
((kwargs) == NULL || _PyArg_NoKeywords((funcname), (kwargs)))
|
||||
#define _PyArg_NoKwnames(funcname, kwnames) \
|
||||
((kwnames) == NULL || _PyArg_NoKwnames((funcname), (kwnames)))
|
||||
#define _PyArg_NoPositional(funcname, args) \
|
||||
((args) == NULL || _PyArg_NoPositional((funcname), (args)))
|
||||
|
||||
PyAPI_FUNC(void) _PyArg_BadArgument(const char *, const char *, const char *, PyObject *);
|
||||
PyAPI_FUNC(int) _PyArg_CheckPositional(const char *, Py_ssize_t,
|
||||
Py_ssize_t, Py_ssize_t);
|
||||
#define _PyArg_CheckPositional(funcname, nargs, min, max) \
|
||||
((!ANY_VARARGS(max) && (min) <= (nargs) && (nargs) <= (max)) \
|
||||
|| _PyArg_CheckPositional((funcname), (nargs), (min), (max)))
|
||||
|
||||
PyAPI_FUNC(PyObject **) _Py_VaBuildStack(
|
||||
PyObject **small_stack,
|
||||
Py_ssize_t small_stack_len,
|
||||
const char *format,
|
||||
va_list va,
|
||||
Py_ssize_t *p_nargs);
|
||||
|
||||
typedef struct _PyArg_Parser {
|
||||
const char *format;
|
||||
const char * const *keywords;
|
||||
const char *fname;
|
||||
const char *custom_msg;
|
||||
int pos; /* number of positional-only arguments */
|
||||
int min; /* minimal number of arguments */
|
||||
int max; /* maximal number of positional arguments */
|
||||
PyObject *kwtuple; /* tuple of keyword parameter names */
|
||||
struct _PyArg_Parser *next;
|
||||
} _PyArg_Parser;
|
||||
|
||||
#ifdef PY_SSIZE_T_CLEAN
|
||||
#define _PyArg_ParseTupleAndKeywordsFast _PyArg_ParseTupleAndKeywordsFast_SizeT
|
||||
#define _PyArg_ParseStack _PyArg_ParseStack_SizeT
|
||||
#define _PyArg_ParseStackAndKeywords _PyArg_ParseStackAndKeywords_SizeT
|
||||
#define _PyArg_VaParseTupleAndKeywordsFast _PyArg_VaParseTupleAndKeywordsFast_SizeT
|
||||
#endif
|
||||
|
||||
PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *,
|
||||
struct _PyArg_Parser *, ...);
|
||||
PyAPI_FUNC(int) _PyArg_ParseStack(
|
||||
PyObject *const *args,
|
||||
Py_ssize_t nargs,
|
||||
const char *format,
|
||||
...);
|
||||
PyAPI_FUNC(int) _PyArg_ParseStackAndKeywords(
|
||||
PyObject *const *args,
|
||||
Py_ssize_t nargs,
|
||||
PyObject *kwnames,
|
||||
struct _PyArg_Parser *,
|
||||
...);
|
||||
PyAPI_FUNC(int) _PyArg_VaParseTupleAndKeywordsFast(PyObject *, PyObject *,
|
||||
struct _PyArg_Parser *, va_list);
|
||||
PyAPI_FUNC(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);
|
||||
|
||||
PyAPI_FUNC(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);
|
||||
|
||||
#define _PyArg_UnpackKeywords(args, nargs, kwargs, kwnames, parser, minpos, maxpos, minkw, buf) \
|
||||
(((minkw) == 0 && (kwargs) == NULL && (kwnames) == NULL && \
|
||||
(minpos) <= (nargs) && (nargs) <= (maxpos) && args != NULL) ? (args) : \
|
||||
_PyArg_UnpackKeywords((args), (nargs), (kwargs), (kwnames), (parser), \
|
||||
(minpos), (maxpos), (minkw), (buf)))
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PyModule_CreateInitialized(PyModuleDef*, int apiver);
|
||||
|
||||
PyAPI_DATA(const char *) _Py_PackageContext;
|
||||
511
deps_windows/Python-3.11.1/Include/cpython/object.h
Normal file
511
deps_windows/Python-3.11.1/Include/cpython/object.h
Normal file
|
|
@ -0,0 +1,511 @@
|
|||
#ifndef Py_CPYTHON_OBJECT_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
PyAPI_FUNC(void) _Py_NewReference(PyObject *op);
|
||||
|
||||
#ifdef Py_TRACE_REFS
|
||||
/* Py_TRACE_REFS is such major surgery that we call external routines. */
|
||||
PyAPI_FUNC(void) _Py_ForgetReference(PyObject *);
|
||||
#endif
|
||||
|
||||
#ifdef Py_REF_DEBUG
|
||||
PyAPI_FUNC(Py_ssize_t) _Py_GetRefTotal(void);
|
||||
#endif
|
||||
|
||||
|
||||
/********************* String Literals ****************************************/
|
||||
/* This structure helps managing static strings. The basic usage goes like this:
|
||||
Instead of doing
|
||||
|
||||
r = PyObject_CallMethod(o, "foo", "args", ...);
|
||||
|
||||
do
|
||||
|
||||
_Py_IDENTIFIER(foo);
|
||||
...
|
||||
r = _PyObject_CallMethodId(o, &PyId_foo, "args", ...);
|
||||
|
||||
PyId_foo is a static variable, either on block level or file level. On first
|
||||
usage, the string "foo" is interned, and the structures are linked. On interpreter
|
||||
shutdown, all strings are released.
|
||||
|
||||
Alternatively, _Py_static_string allows choosing the variable name.
|
||||
_PyUnicode_FromId returns a borrowed reference to the interned string.
|
||||
_PyObject_{Get,Set,Has}AttrId are __getattr__ versions using _Py_Identifier*.
|
||||
*/
|
||||
typedef struct _Py_Identifier {
|
||||
const char* string;
|
||||
// Index in PyInterpreterState.unicode.ids.array. It is process-wide
|
||||
// unique and must be initialized to -1.
|
||||
Py_ssize_t index;
|
||||
} _Py_Identifier;
|
||||
|
||||
#if defined(NEEDS_PY_IDENTIFIER) || !defined(Py_BUILD_CORE)
|
||||
// For now we are keeping _Py_IDENTIFIER for continued use
|
||||
// in non-builtin extensions (and naughty PyPI modules).
|
||||
|
||||
#define _Py_static_string_init(value) { .string = value, .index = -1 }
|
||||
#define _Py_static_string(varname, value) static _Py_Identifier varname = _Py_static_string_init(value)
|
||||
#define _Py_IDENTIFIER(varname) _Py_static_string(PyId_##varname, #varname)
|
||||
|
||||
#endif /* NEEDS_PY_IDENTIFIER */
|
||||
|
||||
typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
|
||||
typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
|
||||
|
||||
typedef PyObject *(*vectorcallfunc)(PyObject *callable, PyObject *const *args,
|
||||
size_t nargsf, PyObject *kwnames);
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* Number implementations must check *both*
|
||||
arguments for proper type and implement the necessary conversions
|
||||
in the slot functions themselves. */
|
||||
|
||||
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; /* the slot formerly known as nb_long */
|
||||
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;
|
||||
|
||||
/* Allow printfunc in the tp_vectorcall_offset slot for
|
||||
* backwards-compatibility */
|
||||
typedef Py_ssize_t printfunc;
|
||||
|
||||
// If this structure is modified, Doc/includes/typestruct.h should be updated
|
||||
// as well.
|
||||
struct _typeobject {
|
||||
PyObject_VAR_HEAD
|
||||
const char *tp_name; /* For printing, in format "<module>.<name>" */
|
||||
Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */
|
||||
|
||||
/* Methods to implement standard operations */
|
||||
|
||||
destructor tp_dealloc;
|
||||
Py_ssize_t tp_vectorcall_offset;
|
||||
getattrfunc tp_getattr;
|
||||
setattrfunc tp_setattr;
|
||||
PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2)
|
||||
or tp_reserved (Python 3) */
|
||||
reprfunc tp_repr;
|
||||
|
||||
/* Method suites for standard classes */
|
||||
|
||||
PyNumberMethods *tp_as_number;
|
||||
PySequenceMethods *tp_as_sequence;
|
||||
PyMappingMethods *tp_as_mapping;
|
||||
|
||||
/* More standard operations (here for binary compatibility) */
|
||||
|
||||
hashfunc tp_hash;
|
||||
ternaryfunc tp_call;
|
||||
reprfunc tp_str;
|
||||
getattrofunc tp_getattro;
|
||||
setattrofunc tp_setattro;
|
||||
|
||||
/* Functions to access object as input/output buffer */
|
||||
PyBufferProcs *tp_as_buffer;
|
||||
|
||||
/* Flags to define presence of optional/expanded features */
|
||||
unsigned long tp_flags;
|
||||
|
||||
const char *tp_doc; /* Documentation string */
|
||||
|
||||
/* Assigned meaning in release 2.0 */
|
||||
/* call function for all accessible objects */
|
||||
traverseproc tp_traverse;
|
||||
|
||||
/* delete references to contained objects */
|
||||
inquiry tp_clear;
|
||||
|
||||
/* Assigned meaning in release 2.1 */
|
||||
/* rich comparisons */
|
||||
richcmpfunc tp_richcompare;
|
||||
|
||||
/* weak reference enabler */
|
||||
Py_ssize_t tp_weaklistoffset;
|
||||
|
||||
/* Iterators */
|
||||
getiterfunc tp_iter;
|
||||
iternextfunc tp_iternext;
|
||||
|
||||
/* Attribute descriptor and subclassing stuff */
|
||||
PyMethodDef *tp_methods;
|
||||
PyMemberDef *tp_members;
|
||||
PyGetSetDef *tp_getset;
|
||||
// Strong reference on a heap type, borrowed reference on a static type
|
||||
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; /* Low-level free-memory routine */
|
||||
inquiry tp_is_gc; /* For PyObject_IS_GC */
|
||||
PyObject *tp_bases;
|
||||
PyObject *tp_mro; /* method resolution order */
|
||||
PyObject *tp_cache;
|
||||
PyObject *tp_subclasses;
|
||||
PyObject *tp_weaklist;
|
||||
destructor tp_del;
|
||||
|
||||
/* Type attribute cache version tag. Added in version 2.6 */
|
||||
unsigned int tp_version_tag;
|
||||
|
||||
destructor tp_finalize;
|
||||
vectorcallfunc tp_vectorcall;
|
||||
};
|
||||
|
||||
/* This struct is used by the specializer
|
||||
* It should should be treated as an opaque blob
|
||||
* by code other than the specializer and interpreter. */
|
||||
struct _specialization_cache {
|
||||
PyObject *getitem;
|
||||
};
|
||||
|
||||
/* The *real* layout of a type object when allocated on the heap */
|
||||
typedef struct _heaptypeobject {
|
||||
/* Note: there's a dependency on the order of these members
|
||||
in slotptr() in typeobject.c . */
|
||||
PyTypeObject ht_type;
|
||||
PyAsyncMethods as_async;
|
||||
PyNumberMethods as_number;
|
||||
PyMappingMethods as_mapping;
|
||||
PySequenceMethods as_sequence; /* as_sequence comes after as_mapping,
|
||||
so that the mapping wins when both
|
||||
the mapping and the sequence define
|
||||
a given operator (e.g. __getitem__).
|
||||
see add_operators() in typeobject.c . */
|
||||
PyBufferProcs as_buffer;
|
||||
PyObject *ht_name, *ht_slots, *ht_qualname;
|
||||
struct _dictkeysobject *ht_cached_keys;
|
||||
PyObject *ht_module;
|
||||
char *_ht_tpname; // Storage for "tp_name"; see PyType_FromModuleAndSpec
|
||||
struct _specialization_cache _spec_cache; // For use by the specializer.
|
||||
/* here are optional user slots, followed by the members. */
|
||||
} PyHeapTypeObject;
|
||||
|
||||
PyAPI_FUNC(const char *) _PyType_Name(PyTypeObject *);
|
||||
PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *);
|
||||
PyAPI_FUNC(PyObject *) _PyType_LookupId(PyTypeObject *, _Py_Identifier *);
|
||||
PyAPI_FUNC(PyObject *) _PyObject_LookupSpecialId(PyObject *, _Py_Identifier *);
|
||||
#ifndef Py_BUILD_CORE
|
||||
// Backward compatibility for 3rd-party extensions
|
||||
// that may be using the old name.
|
||||
#define _PyObject_LookupSpecial _PyObject_LookupSpecialId
|
||||
#endif
|
||||
PyAPI_FUNC(PyTypeObject *) _PyType_CalculateMetaclass(PyTypeObject *, PyObject *);
|
||||
PyAPI_FUNC(PyObject *) _PyType_GetDocFromInternalDoc(const char *, const char *);
|
||||
PyAPI_FUNC(PyObject *) _PyType_GetTextSignatureFromInternalDoc(const char *, const char *);
|
||||
PyAPI_FUNC(PyObject *) PyType_GetModuleByDef(PyTypeObject *, PyModuleDef *);
|
||||
|
||||
PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int);
|
||||
PyAPI_FUNC(void) _Py_BreakPoint(void);
|
||||
PyAPI_FUNC(void) _PyObject_Dump(PyObject *);
|
||||
PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *);
|
||||
|
||||
PyAPI_FUNC(int) _PyObject_IsAbstract(PyObject *);
|
||||
PyAPI_FUNC(PyObject *) _PyObject_GetAttrId(PyObject *, _Py_Identifier *);
|
||||
PyAPI_FUNC(int) _PyObject_SetAttrId(PyObject *, _Py_Identifier *, PyObject *);
|
||||
/* Replacements of PyObject_GetAttr() and _PyObject_GetAttrId() which
|
||||
don't raise AttributeError.
|
||||
|
||||
Return 1 and set *result != NULL if an attribute is found.
|
||||
Return 0 and set *result == NULL if an attribute is not found;
|
||||
an AttributeError is silenced.
|
||||
Return -1 and set *result == NULL if an error other than AttributeError
|
||||
is raised.
|
||||
*/
|
||||
PyAPI_FUNC(int) _PyObject_LookupAttr(PyObject *, PyObject *, PyObject **);
|
||||
PyAPI_FUNC(int) _PyObject_LookupAttrId(PyObject *, _Py_Identifier *, PyObject **);
|
||||
|
||||
PyAPI_FUNC(int) _PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
|
||||
|
||||
PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *);
|
||||
PyAPI_FUNC(PyObject *) _PyObject_NextNotImplemented(PyObject *);
|
||||
PyAPI_FUNC(void) PyObject_CallFinalizer(PyObject *);
|
||||
PyAPI_FUNC(int) PyObject_CallFinalizerFromDealloc(PyObject *);
|
||||
|
||||
/* Same as PyObject_Generic{Get,Set}Attr, but passing the attributes
|
||||
dict as the last parameter. */
|
||||
PyAPI_FUNC(PyObject *)
|
||||
_PyObject_GenericGetAttrWithDict(PyObject *, PyObject *, PyObject *, int);
|
||||
PyAPI_FUNC(int)
|
||||
_PyObject_GenericSetAttrWithDict(PyObject *, PyObject *,
|
||||
PyObject *, PyObject *);
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PyObject_FunctionStr(PyObject *);
|
||||
|
||||
/* Safely decref `op` and set `op` to `op2`.
|
||||
*
|
||||
* As in case of Py_CLEAR "the obvious" code can be deadly:
|
||||
*
|
||||
* Py_DECREF(op);
|
||||
* op = op2;
|
||||
*
|
||||
* The safe way is:
|
||||
*
|
||||
* Py_SETREF(op, op2);
|
||||
*
|
||||
* That arranges to set `op` to `op2` _before_ decref'ing, so that any code
|
||||
* triggered as a side-effect of `op` getting torn down no longer believes
|
||||
* `op` points to a valid object.
|
||||
*
|
||||
* Py_XSETREF is a variant of Py_SETREF that uses Py_XDECREF instead of
|
||||
* Py_DECREF.
|
||||
*/
|
||||
|
||||
#define Py_SETREF(op, op2) \
|
||||
do { \
|
||||
PyObject *_py_tmp = _PyObject_CAST(op); \
|
||||
(op) = (op2); \
|
||||
Py_DECREF(_py_tmp); \
|
||||
} while (0)
|
||||
|
||||
#define Py_XSETREF(op, op2) \
|
||||
do { \
|
||||
PyObject *_py_tmp = _PyObject_CAST(op); \
|
||||
(op) = (op2); \
|
||||
Py_XDECREF(_py_tmp); \
|
||||
} while (0)
|
||||
|
||||
|
||||
PyAPI_DATA(PyTypeObject) _PyNone_Type;
|
||||
PyAPI_DATA(PyTypeObject) _PyNotImplemented_Type;
|
||||
|
||||
/* Maps Py_LT to Py_GT, ..., Py_GE to Py_LE.
|
||||
* Defined in object.c.
|
||||
*/
|
||||
PyAPI_DATA(int) _Py_SwappedOp[];
|
||||
|
||||
PyAPI_FUNC(void)
|
||||
_PyDebugAllocatorStats(FILE *out, const char *block_name, int num_blocks,
|
||||
size_t sizeof_block);
|
||||
PyAPI_FUNC(void)
|
||||
_PyObject_DebugTypeStats(FILE *out);
|
||||
|
||||
/* Define a pair of assertion macros:
|
||||
_PyObject_ASSERT_FROM(), _PyObject_ASSERT_WITH_MSG() and _PyObject_ASSERT().
|
||||
|
||||
These work like the regular C assert(), in that they will abort the
|
||||
process with a message on stderr if the given condition fails to hold,
|
||||
but compile away to nothing if NDEBUG is defined.
|
||||
|
||||
However, before aborting, Python will also try to call _PyObject_Dump() on
|
||||
the given object. This may be of use when investigating bugs in which a
|
||||
particular object is corrupt (e.g. buggy a tp_visit method in an extension
|
||||
module breaking the garbage collector), to help locate the broken objects.
|
||||
|
||||
The WITH_MSG variant allows you to supply an additional message that Python
|
||||
will attempt to print to stderr, after the object dump. */
|
||||
#ifdef NDEBUG
|
||||
/* No debugging: compile away the assertions: */
|
||||
# define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \
|
||||
((void)0)
|
||||
#else
|
||||
/* With debugging: generate checks: */
|
||||
# define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \
|
||||
((expr) \
|
||||
? (void)(0) \
|
||||
: _PyObject_AssertFailed((obj), Py_STRINGIFY(expr), \
|
||||
(msg), (filename), (lineno), (func)))
|
||||
#endif
|
||||
|
||||
#define _PyObject_ASSERT_WITH_MSG(obj, expr, msg) \
|
||||
_PyObject_ASSERT_FROM(obj, expr, msg, __FILE__, __LINE__, __func__)
|
||||
#define _PyObject_ASSERT(obj, expr) \
|
||||
_PyObject_ASSERT_WITH_MSG(obj, expr, NULL)
|
||||
|
||||
#define _PyObject_ASSERT_FAILED_MSG(obj, msg) \
|
||||
_PyObject_AssertFailed((obj), NULL, (msg), __FILE__, __LINE__, __func__)
|
||||
|
||||
/* Declare and define _PyObject_AssertFailed() even when NDEBUG is defined,
|
||||
to avoid causing compiler/linker errors when building extensions without
|
||||
NDEBUG against a Python built with NDEBUG defined.
|
||||
|
||||
msg, expr and function can be NULL. */
|
||||
PyAPI_FUNC(void) _Py_NO_RETURN _PyObject_AssertFailed(
|
||||
PyObject *obj,
|
||||
const char *expr,
|
||||
const char *msg,
|
||||
const char *file,
|
||||
int line,
|
||||
const char *function);
|
||||
|
||||
/* Check if an object is consistent. For example, ensure that the reference
|
||||
counter is greater than or equal to 1, and ensure that ob_type is not NULL.
|
||||
|
||||
Call _PyObject_AssertFailed() if the object is inconsistent.
|
||||
|
||||
If check_content is zero, only check header fields: reduce the overhead.
|
||||
|
||||
The function always return 1. The return value is just here to be able to
|
||||
write:
|
||||
|
||||
assert(_PyObject_CheckConsistency(obj, 1)); */
|
||||
PyAPI_FUNC(int) _PyObject_CheckConsistency(
|
||||
PyObject *op,
|
||||
int check_content);
|
||||
|
||||
|
||||
/* Trashcan mechanism, thanks to Christian Tismer.
|
||||
|
||||
When deallocating a container object, it's possible to trigger an unbounded
|
||||
chain of deallocations, as each Py_DECREF in turn drops the refcount on "the
|
||||
next" object in the chain to 0. This can easily lead to stack overflows,
|
||||
especially in threads (which typically have less stack space to work with).
|
||||
|
||||
A container object can avoid this by bracketing the body of its tp_dealloc
|
||||
function with a pair of macros:
|
||||
|
||||
static void
|
||||
mytype_dealloc(mytype *p)
|
||||
{
|
||||
... declarations go here ...
|
||||
|
||||
PyObject_GC_UnTrack(p); // must untrack first
|
||||
Py_TRASHCAN_BEGIN(p, mytype_dealloc)
|
||||
... The body of the deallocator goes here, including all calls ...
|
||||
... to Py_DECREF on contained objects. ...
|
||||
Py_TRASHCAN_END // there should be no code after this
|
||||
}
|
||||
|
||||
CAUTION: Never return from the middle of the body! If the body needs to
|
||||
"get out early", put a label immediately before the Py_TRASHCAN_END
|
||||
call, and goto it. Else the call-depth counter (see below) will stay
|
||||
above 0 forever, and the trashcan will never get emptied.
|
||||
|
||||
How it works: The BEGIN macro increments a call-depth counter. So long
|
||||
as this counter is small, the body of the deallocator is run directly without
|
||||
further ado. But if the counter gets large, it instead adds p to a list of
|
||||
objects to be deallocated later, skips the body of the deallocator, and
|
||||
resumes execution after the END macro. The tp_dealloc routine then returns
|
||||
without deallocating anything (and so unbounded call-stack depth is avoided).
|
||||
|
||||
When the call stack finishes unwinding again, code generated by the END macro
|
||||
notices this, and calls another routine to deallocate all the objects that
|
||||
may have been added to the list of deferred deallocations. In effect, a
|
||||
chain of N deallocations is broken into (N-1)/(_PyTrash_UNWIND_LEVEL-1) pieces,
|
||||
with the call stack never exceeding a depth of _PyTrash_UNWIND_LEVEL.
|
||||
|
||||
Since the tp_dealloc of a subclass typically calls the tp_dealloc of the base
|
||||
class, we need to ensure that the trashcan is only triggered on the tp_dealloc
|
||||
of the actual class being deallocated. Otherwise we might end up with a
|
||||
partially-deallocated object. To check this, the tp_dealloc function must be
|
||||
passed as second argument to Py_TRASHCAN_BEGIN().
|
||||
*/
|
||||
|
||||
/* Python 3.9 private API, invoked by the macros below. */
|
||||
PyAPI_FUNC(int) _PyTrash_begin(PyThreadState *tstate, PyObject *op);
|
||||
PyAPI_FUNC(void) _PyTrash_end(PyThreadState *tstate);
|
||||
/* Python 3.10 private API, invoked by the Py_TRASHCAN_BEGIN(). */
|
||||
PyAPI_FUNC(int) _PyTrash_cond(PyObject *op, destructor dealloc);
|
||||
|
||||
#define Py_TRASHCAN_BEGIN_CONDITION(op, cond) \
|
||||
do { \
|
||||
PyThreadState *_tstate = NULL; \
|
||||
/* If "cond" is false, then _tstate remains NULL and the deallocator \
|
||||
* is run normally without involving the trashcan */ \
|
||||
if (cond) { \
|
||||
_tstate = PyThreadState_Get(); \
|
||||
if (_PyTrash_begin(_tstate, _PyObject_CAST(op))) { \
|
||||
break; \
|
||||
} \
|
||||
}
|
||||
/* The body of the deallocator is here. */
|
||||
#define Py_TRASHCAN_END \
|
||||
if (_tstate) { \
|
||||
_PyTrash_end(_tstate); \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
#define Py_TRASHCAN_BEGIN(op, dealloc) \
|
||||
Py_TRASHCAN_BEGIN_CONDITION(op, \
|
||||
_PyTrash_cond(_PyObject_CAST(op), (destructor)dealloc))
|
||||
|
||||
/* The following two macros, Py_TRASHCAN_SAFE_BEGIN and
|
||||
* Py_TRASHCAN_SAFE_END, are deprecated since version 3.11 and
|
||||
* will be removed in the future.
|
||||
* Use Py_TRASHCAN_BEGIN and Py_TRASHCAN_END instead.
|
||||
*/
|
||||
Py_DEPRECATED(3.11) typedef int UsingDeprecatedTrashcanMacro;
|
||||
#define Py_TRASHCAN_SAFE_BEGIN(op) \
|
||||
do { \
|
||||
UsingDeprecatedTrashcanMacro cond=1; \
|
||||
Py_TRASHCAN_BEGIN_CONDITION(op, cond);
|
||||
#define Py_TRASHCAN_SAFE_END(op) \
|
||||
Py_TRASHCAN_END; \
|
||||
} while(0);
|
||||
89
deps_windows/Python-3.11.1/Include/cpython/objimpl.h
Normal file
89
deps_windows/Python-3.11.1/Include/cpython/objimpl.h
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
#ifndef Py_CPYTHON_OBJIMPL_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
#define _PyObject_SIZE(typeobj) ( (typeobj)->tp_basicsize )
|
||||
|
||||
/* _PyObject_VAR_SIZE returns the number of bytes (as size_t) allocated for a
|
||||
vrbl-size object with nitems items, exclusive of gc overhead (if any). The
|
||||
value is rounded up to the closest multiple of sizeof(void *), in order to
|
||||
ensure that pointer fields at the end of the object are correctly aligned
|
||||
for the platform (this is of special importance for subclasses of, e.g.,
|
||||
str or int, so that pointers can be stored after the embedded data).
|
||||
|
||||
Note that there's no memory wastage in doing this, as malloc has to
|
||||
return (at worst) pointer-aligned memory anyway.
|
||||
*/
|
||||
#if ((SIZEOF_VOID_P - 1) & SIZEOF_VOID_P) != 0
|
||||
# error "_PyObject_VAR_SIZE requires SIZEOF_VOID_P be a power of 2"
|
||||
#endif
|
||||
|
||||
#define _PyObject_VAR_SIZE(typeobj, nitems) \
|
||||
_Py_SIZE_ROUND_UP((typeobj)->tp_basicsize + \
|
||||
(nitems)*(typeobj)->tp_itemsize, \
|
||||
SIZEOF_VOID_P)
|
||||
|
||||
|
||||
/* This example code implements an object constructor with a custom
|
||||
allocator, where PyObject_New is inlined, and shows the important
|
||||
distinction between two steps (at least):
|
||||
1) the actual allocation of the object storage;
|
||||
2) the initialization of the Python specific fields
|
||||
in this storage with PyObject_{Init, InitVar}.
|
||||
|
||||
PyObject *
|
||||
YourObject_New(...)
|
||||
{
|
||||
PyObject *op;
|
||||
|
||||
op = (PyObject *) Your_Allocator(_PyObject_SIZE(YourTypeStruct));
|
||||
if (op == NULL) {
|
||||
return PyErr_NoMemory();
|
||||
}
|
||||
|
||||
PyObject_Init(op, &YourTypeStruct);
|
||||
|
||||
op->ob_field = value;
|
||||
...
|
||||
return op;
|
||||
}
|
||||
|
||||
Note that in C++, the use of the new operator usually implies that
|
||||
the 1st step is performed automatically for you, so in a C++ class
|
||||
constructor you would start directly with PyObject_Init/InitVar. */
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* user context passed as the first argument to the 2 functions */
|
||||
void *ctx;
|
||||
|
||||
/* allocate an arena of size bytes */
|
||||
void* (*alloc) (void *ctx, size_t size);
|
||||
|
||||
/* free an arena */
|
||||
void (*free) (void *ctx, void *ptr, size_t size);
|
||||
} PyObjectArenaAllocator;
|
||||
|
||||
/* Get the arena allocator. */
|
||||
PyAPI_FUNC(void) PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator);
|
||||
|
||||
/* Set the arena allocator. */
|
||||
PyAPI_FUNC(void) PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator);
|
||||
|
||||
|
||||
/* Test if an object implements the garbage collector protocol */
|
||||
PyAPI_FUNC(int) PyObject_IS_GC(PyObject *obj);
|
||||
|
||||
|
||||
/* Code built with Py_BUILD_CORE must include pycore_gc.h instead which
|
||||
defines a different _PyGC_FINALIZED() macro. */
|
||||
#ifndef Py_BUILD_CORE
|
||||
// Kept for backward compatibility with Python 3.8
|
||||
# define _PyGC_FINALIZED(o) PyObject_GC_IsFinalized(o)
|
||||
#endif
|
||||
|
||||
|
||||
// Test if a type supports weak references
|
||||
PyAPI_FUNC(int) PyType_SUPPORTS_WEAKREFS(PyTypeObject *type);
|
||||
|
||||
PyAPI_FUNC(PyObject **) PyObject_GET_WEAKREFS_LISTPTR(PyObject *op);
|
||||
43
deps_windows/Python-3.11.1/Include/cpython/odictobject.h
Normal file
43
deps_windows/Python-3.11.1/Include/cpython/odictobject.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#ifndef Py_ODICTOBJECT_H
|
||||
#define Py_ODICTOBJECT_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* OrderedDict */
|
||||
/* This API is optional and mostly redundant. */
|
||||
|
||||
#ifndef Py_LIMITED_API
|
||||
|
||||
typedef struct _odictobject PyODictObject;
|
||||
|
||||
PyAPI_DATA(PyTypeObject) PyODict_Type;
|
||||
PyAPI_DATA(PyTypeObject) PyODictIter_Type;
|
||||
PyAPI_DATA(PyTypeObject) PyODictKeys_Type;
|
||||
PyAPI_DATA(PyTypeObject) PyODictItems_Type;
|
||||
PyAPI_DATA(PyTypeObject) PyODictValues_Type;
|
||||
|
||||
#define PyODict_Check(op) PyObject_TypeCheck(op, &PyODict_Type)
|
||||
#define PyODict_CheckExact(op) Py_IS_TYPE(op, &PyODict_Type)
|
||||
#define PyODict_SIZE(op) PyDict_GET_SIZE((op))
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyODict_New(void);
|
||||
PyAPI_FUNC(int) PyODict_SetItem(PyObject *od, PyObject *key, PyObject *item);
|
||||
PyAPI_FUNC(int) PyODict_DelItem(PyObject *od, PyObject *key);
|
||||
|
||||
/* wrappers around PyDict* functions */
|
||||
#define PyODict_GetItem(od, key) PyDict_GetItem(_PyObject_CAST(od), key)
|
||||
#define PyODict_GetItemWithError(od, key) \
|
||||
PyDict_GetItemWithError(_PyObject_CAST(od), key)
|
||||
#define PyODict_Contains(od, key) PyDict_Contains(_PyObject_CAST(od), key)
|
||||
#define PyODict_Size(od) PyDict_Size(_PyObject_CAST(od))
|
||||
#define PyODict_GetItemString(od, key) \
|
||||
PyDict_GetItemString(_PyObject_CAST(od), key)
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* !Py_ODICTOBJECT_H */
|
||||
31
deps_windows/Python-3.11.1/Include/cpython/picklebufobject.h
Normal file
31
deps_windows/Python-3.11.1/Include/cpython/picklebufobject.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/* PickleBuffer object. This is built-in for ease of use from third-party
|
||||
* C extensions.
|
||||
*/
|
||||
|
||||
#ifndef Py_PICKLEBUFOBJECT_H
|
||||
#define Py_PICKLEBUFOBJECT_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef Py_LIMITED_API
|
||||
|
||||
PyAPI_DATA(PyTypeObject) PyPickleBuffer_Type;
|
||||
|
||||
#define PyPickleBuffer_Check(op) Py_IS_TYPE(op, &PyPickleBuffer_Type)
|
||||
|
||||
/* Create a PickleBuffer redirecting to the given buffer-enabled object */
|
||||
PyAPI_FUNC(PyObject *) PyPickleBuffer_FromObject(PyObject *);
|
||||
/* Get the PickleBuffer's underlying view to the original object
|
||||
* (NULL if released)
|
||||
*/
|
||||
PyAPI_FUNC(const Py_buffer *) PyPickleBuffer_GetBuffer(PyObject *);
|
||||
/* Release the PickleBuffer. Returns 0 on success, -1 on error. */
|
||||
PyAPI_FUNC(int) PyPickleBuffer_Release(PyObject *);
|
||||
|
||||
#endif /* !Py_LIMITED_API */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* !Py_PICKLEBUFOBJECT_H */
|
||||
88
deps_windows/Python-3.11.1/Include/cpython/pthread_stubs.h
Normal file
88
deps_windows/Python-3.11.1/Include/cpython/pthread_stubs.h
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
#ifndef Py_CPYTHON_PTRHEAD_STUBS_H
|
||||
#define Py_CPYTHON_PTRHEAD_STUBS_H
|
||||
|
||||
#if !defined(HAVE_PTHREAD_STUBS)
|
||||
# error "this header file requires stubbed pthreads."
|
||||
#endif
|
||||
|
||||
#ifndef _POSIX_THREADS
|
||||
# define _POSIX_THREADS 1
|
||||
#endif
|
||||
|
||||
/* Minimal pthread stubs for CPython.
|
||||
*
|
||||
* The stubs implement the minimum pthread API for CPython.
|
||||
* - pthread_create() fails.
|
||||
* - pthread_exit() calls exit(0).
|
||||
* - pthread_key_*() functions implement minimal TSS without destructor.
|
||||
* - all other functions do nothing and return 0.
|
||||
*/
|
||||
|
||||
#ifdef __wasi__
|
||||
// WASI's bits/alltypes.h provides type definitions when __NEED_ is set.
|
||||
// The header file can be included multiple times.
|
||||
# define __NEED_pthread_cond_t 1
|
||||
# define __NEED_pthread_condattr_t 1
|
||||
# define __NEED_pthread_mutex_t 1
|
||||
# define __NEED_pthread_mutexattr_t 1
|
||||
# define __NEED_pthread_key_t 1
|
||||
# define __NEED_pthread_t 1
|
||||
# define __NEED_pthread_attr_t 1
|
||||
# include <bits/alltypes.h>
|
||||
#else
|
||||
typedef struct { void *__x; } pthread_cond_t;
|
||||
typedef struct { unsigned __attr; } pthread_condattr_t;
|
||||
typedef struct { void *__x; } pthread_mutex_t;
|
||||
typedef struct { unsigned __attr; } pthread_mutexattr_t;
|
||||
typedef unsigned pthread_key_t;
|
||||
typedef unsigned pthread_t;
|
||||
typedef struct { unsigned __attr; } pthread_attr_t;
|
||||
#endif
|
||||
|
||||
// mutex
|
||||
PyAPI_FUNC(int) pthread_mutex_init(pthread_mutex_t *restrict mutex,
|
||||
const pthread_mutexattr_t *restrict attr);
|
||||
PyAPI_FUNC(int) pthread_mutex_destroy(pthread_mutex_t *mutex);
|
||||
PyAPI_FUNC(int) pthread_mutex_trylock(pthread_mutex_t *mutex);
|
||||
PyAPI_FUNC(int) pthread_mutex_lock(pthread_mutex_t *mutex);
|
||||
PyAPI_FUNC(int) pthread_mutex_unlock(pthread_mutex_t *mutex);
|
||||
|
||||
// condition
|
||||
PyAPI_FUNC(int) pthread_cond_init(pthread_cond_t *restrict cond,
|
||||
const pthread_condattr_t *restrict attr);
|
||||
PyAPI_FUNC(int) pthread_cond_destroy(pthread_cond_t *cond);
|
||||
PyAPI_FUNC(int) pthread_cond_wait(pthread_cond_t *restrict cond,
|
||||
pthread_mutex_t *restrict mutex);
|
||||
PyAPI_FUNC(int) pthread_cond_timedwait(pthread_cond_t *restrict cond,
|
||||
pthread_mutex_t *restrict mutex,
|
||||
const struct timespec *restrict abstime);
|
||||
PyAPI_FUNC(int) pthread_cond_signal(pthread_cond_t *cond);
|
||||
PyAPI_FUNC(int) pthread_condattr_init(pthread_condattr_t *attr);
|
||||
PyAPI_FUNC(int) pthread_condattr_setclock(
|
||||
pthread_condattr_t *attr, clockid_t clock_id);
|
||||
|
||||
// pthread
|
||||
PyAPI_FUNC(int) pthread_create(pthread_t *restrict thread,
|
||||
const pthread_attr_t *restrict attr,
|
||||
void *(*start_routine)(void *),
|
||||
void *restrict arg);
|
||||
PyAPI_FUNC(int) pthread_detach(pthread_t thread);
|
||||
PyAPI_FUNC(pthread_t) pthread_self(void);
|
||||
PyAPI_FUNC(int) pthread_exit(void *retval) __attribute__ ((__noreturn__));
|
||||
PyAPI_FUNC(int) pthread_attr_init(pthread_attr_t *attr);
|
||||
PyAPI_FUNC(int) pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize);
|
||||
PyAPI_FUNC(int) pthread_attr_destroy(pthread_attr_t *attr);
|
||||
|
||||
|
||||
// pthread_key
|
||||
#ifndef PTHREAD_KEYS_MAX
|
||||
# define PTHREAD_KEYS_MAX 128
|
||||
#endif
|
||||
|
||||
PyAPI_FUNC(int) pthread_key_create(pthread_key_t *key,
|
||||
void (*destr_function)(void *));
|
||||
PyAPI_FUNC(int) pthread_key_delete(pthread_key_t key);
|
||||
PyAPI_FUNC(void *) pthread_getspecific(pthread_key_t key);
|
||||
PyAPI_FUNC(int) pthread_setspecific(pthread_key_t key, const void *value);
|
||||
|
||||
#endif // Py_CPYTHON_PTRHEAD_STUBS_H
|
||||
39
deps_windows/Python-3.11.1/Include/cpython/pyctype.h
Normal file
39
deps_windows/Python-3.11.1/Include/cpython/pyctype.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#ifndef Py_LIMITED_API
|
||||
#ifndef PYCTYPE_H
|
||||
#define PYCTYPE_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define PY_CTF_LOWER 0x01
|
||||
#define PY_CTF_UPPER 0x02
|
||||
#define PY_CTF_ALPHA (PY_CTF_LOWER|PY_CTF_UPPER)
|
||||
#define PY_CTF_DIGIT 0x04
|
||||
#define PY_CTF_ALNUM (PY_CTF_ALPHA|PY_CTF_DIGIT)
|
||||
#define PY_CTF_SPACE 0x08
|
||||
#define PY_CTF_XDIGIT 0x10
|
||||
|
||||
PyAPI_DATA(const unsigned int) _Py_ctype_table[256];
|
||||
|
||||
/* Unlike their C counterparts, the following macros are not meant to
|
||||
* handle an int with any of the values [EOF, 0-UCHAR_MAX]. The argument
|
||||
* must be a signed/unsigned char. */
|
||||
#define Py_ISLOWER(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_LOWER)
|
||||
#define Py_ISUPPER(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_UPPER)
|
||||
#define Py_ISALPHA(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALPHA)
|
||||
#define Py_ISDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_DIGIT)
|
||||
#define Py_ISXDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_XDIGIT)
|
||||
#define Py_ISALNUM(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALNUM)
|
||||
#define Py_ISSPACE(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_SPACE)
|
||||
|
||||
PyAPI_DATA(const unsigned char) _Py_ctype_tolower[256];
|
||||
PyAPI_DATA(const unsigned char) _Py_ctype_toupper[256];
|
||||
|
||||
#define Py_TOLOWER(c) (_Py_ctype_tolower[Py_CHARMASK(c)])
|
||||
#define Py_TOUPPER(c) (_Py_ctype_toupper[Py_CHARMASK(c)])
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* !PYCTYPE_H */
|
||||
#endif /* !Py_LIMITED_API */
|
||||
38
deps_windows/Python-3.11.1/Include/cpython/pydebug.h
Normal file
38
deps_windows/Python-3.11.1/Include/cpython/pydebug.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#ifndef Py_LIMITED_API
|
||||
#ifndef Py_PYDEBUG_H
|
||||
#define Py_PYDEBUG_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
PyAPI_DATA(int) Py_DebugFlag;
|
||||
PyAPI_DATA(int) Py_VerboseFlag;
|
||||
PyAPI_DATA(int) Py_QuietFlag;
|
||||
PyAPI_DATA(int) Py_InteractiveFlag;
|
||||
PyAPI_DATA(int) Py_InspectFlag;
|
||||
PyAPI_DATA(int) Py_OptimizeFlag;
|
||||
PyAPI_DATA(int) Py_NoSiteFlag;
|
||||
PyAPI_DATA(int) Py_BytesWarningFlag;
|
||||
PyAPI_DATA(int) Py_FrozenFlag;
|
||||
PyAPI_DATA(int) Py_IgnoreEnvironmentFlag;
|
||||
PyAPI_DATA(int) Py_DontWriteBytecodeFlag;
|
||||
PyAPI_DATA(int) Py_NoUserSiteDirectory;
|
||||
PyAPI_DATA(int) Py_UnbufferedStdioFlag;
|
||||
PyAPI_DATA(int) Py_HashRandomizationFlag;
|
||||
PyAPI_DATA(int) Py_IsolatedFlag;
|
||||
|
||||
#ifdef MS_WINDOWS
|
||||
PyAPI_DATA(int) Py_LegacyWindowsFSEncodingFlag;
|
||||
PyAPI_DATA(int) Py_LegacyWindowsStdioFlag;
|
||||
#endif
|
||||
|
||||
/* this is a wrapper around getenv() that pays attention to
|
||||
Py_IgnoreEnvironmentFlag. It should be used for getting variables like
|
||||
PYTHONPATH and PYTHONHOME from the environment */
|
||||
PyAPI_DATA(char*) Py_GETENV(const char *name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* !Py_PYDEBUG_H */
|
||||
#endif /* Py_LIMITED_API */
|
||||
179
deps_windows/Python-3.11.1/Include/cpython/pyerrors.h
Normal file
179
deps_windows/Python-3.11.1/Include/cpython/pyerrors.h
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
#ifndef Py_CPYTHON_ERRORS_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
/* Error objects */
|
||||
|
||||
/* PyException_HEAD defines the initial segment of every exception class. */
|
||||
#define PyException_HEAD PyObject_HEAD PyObject *dict;\
|
||||
PyObject *args; PyObject *notes; PyObject *traceback;\
|
||||
PyObject *context; PyObject *cause;\
|
||||
char suppress_context;
|
||||
|
||||
typedef struct {
|
||||
PyException_HEAD
|
||||
} PyBaseExceptionObject;
|
||||
|
||||
typedef struct {
|
||||
PyException_HEAD
|
||||
PyObject *msg;
|
||||
PyObject *excs;
|
||||
} PyBaseExceptionGroupObject;
|
||||
|
||||
typedef struct {
|
||||
PyException_HEAD
|
||||
PyObject *msg;
|
||||
PyObject *filename;
|
||||
PyObject *lineno;
|
||||
PyObject *offset;
|
||||
PyObject *end_lineno;
|
||||
PyObject *end_offset;
|
||||
PyObject *text;
|
||||
PyObject *print_file_and_line;
|
||||
} PySyntaxErrorObject;
|
||||
|
||||
typedef struct {
|
||||
PyException_HEAD
|
||||
PyObject *msg;
|
||||
PyObject *name;
|
||||
PyObject *path;
|
||||
} PyImportErrorObject;
|
||||
|
||||
typedef struct {
|
||||
PyException_HEAD
|
||||
PyObject *encoding;
|
||||
PyObject *object;
|
||||
Py_ssize_t start;
|
||||
Py_ssize_t end;
|
||||
PyObject *reason;
|
||||
} PyUnicodeErrorObject;
|
||||
|
||||
typedef struct {
|
||||
PyException_HEAD
|
||||
PyObject *code;
|
||||
} PySystemExitObject;
|
||||
|
||||
typedef struct {
|
||||
PyException_HEAD
|
||||
PyObject *myerrno;
|
||||
PyObject *strerror;
|
||||
PyObject *filename;
|
||||
PyObject *filename2;
|
||||
#ifdef MS_WINDOWS
|
||||
PyObject *winerror;
|
||||
#endif
|
||||
Py_ssize_t written; /* only for BlockingIOError, -1 otherwise */
|
||||
} PyOSErrorObject;
|
||||
|
||||
typedef struct {
|
||||
PyException_HEAD
|
||||
PyObject *value;
|
||||
} PyStopIterationObject;
|
||||
|
||||
typedef struct {
|
||||
PyException_HEAD
|
||||
PyObject *name;
|
||||
} PyNameErrorObject;
|
||||
|
||||
typedef struct {
|
||||
PyException_HEAD
|
||||
PyObject *obj;
|
||||
PyObject *name;
|
||||
} PyAttributeErrorObject;
|
||||
|
||||
/* Compatibility typedefs */
|
||||
typedef PyOSErrorObject PyEnvironmentErrorObject;
|
||||
#ifdef MS_WINDOWS
|
||||
typedef PyOSErrorObject PyWindowsErrorObject;
|
||||
#endif
|
||||
|
||||
/* Error handling definitions */
|
||||
|
||||
PyAPI_FUNC(void) _PyErr_SetKeyError(PyObject *);
|
||||
PyAPI_FUNC(_PyErr_StackItem*) _PyErr_GetTopmostException(PyThreadState *tstate);
|
||||
PyAPI_FUNC(PyObject*) _PyErr_GetHandledException(PyThreadState *);
|
||||
PyAPI_FUNC(void) _PyErr_SetHandledException(PyThreadState *, PyObject *);
|
||||
PyAPI_FUNC(void) _PyErr_GetExcInfo(PyThreadState *, PyObject **, PyObject **, PyObject **);
|
||||
|
||||
/* Context manipulation (PEP 3134) */
|
||||
|
||||
PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *);
|
||||
|
||||
/* Like PyErr_Format(), but saves current exception as __context__ and
|
||||
__cause__.
|
||||
*/
|
||||
PyAPI_FUNC(PyObject *) _PyErr_FormatFromCause(
|
||||
PyObject *exception,
|
||||
const char *format, /* ASCII-encoded string */
|
||||
...
|
||||
);
|
||||
|
||||
/* In exceptions.c */
|
||||
|
||||
/* Helper that attempts to replace the current exception with one of the
|
||||
* same type but with a prefix added to the exception text. The resulting
|
||||
* exception description looks like:
|
||||
*
|
||||
* prefix (exc_type: original_exc_str)
|
||||
*
|
||||
* Only some exceptions can be safely replaced. If the function determines
|
||||
* it isn't safe to perform the replacement, it will leave the original
|
||||
* unmodified exception in place.
|
||||
*
|
||||
* Returns a borrowed reference to the new exception (if any), NULL if the
|
||||
* existing exception was left in place.
|
||||
*/
|
||||
PyAPI_FUNC(PyObject *) _PyErr_TrySetFromCause(
|
||||
const char *prefix_format, /* ASCII-encoded string */
|
||||
...
|
||||
);
|
||||
|
||||
/* In signalmodule.c */
|
||||
|
||||
int PySignal_SetWakeupFd(int fd);
|
||||
PyAPI_FUNC(int) _PyErr_CheckSignals(void);
|
||||
|
||||
/* Support for adding program text to SyntaxErrors */
|
||||
|
||||
PyAPI_FUNC(void) PyErr_SyntaxLocationObject(
|
||||
PyObject *filename,
|
||||
int lineno,
|
||||
int col_offset);
|
||||
|
||||
PyAPI_FUNC(void) PyErr_RangedSyntaxLocationObject(
|
||||
PyObject *filename,
|
||||
int lineno,
|
||||
int col_offset,
|
||||
int end_lineno,
|
||||
int end_col_offset);
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyErr_ProgramTextObject(
|
||||
PyObject *filename,
|
||||
int lineno);
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PyErr_ProgramDecodedTextObject(
|
||||
PyObject *filename,
|
||||
int lineno,
|
||||
const char* encoding);
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PyUnicodeTranslateError_Create(
|
||||
PyObject *object,
|
||||
Py_ssize_t start,
|
||||
Py_ssize_t end,
|
||||
const char *reason /* UTF-8 encoded string */
|
||||
);
|
||||
|
||||
PyAPI_FUNC(void) _PyErr_WriteUnraisableMsg(
|
||||
const char *err_msg,
|
||||
PyObject *obj);
|
||||
|
||||
PyAPI_FUNC(void) _Py_NO_RETURN _Py_FatalErrorFunc(
|
||||
const char *func,
|
||||
const char *message);
|
||||
|
||||
PyAPI_FUNC(void) _Py_NO_RETURN _Py_FatalErrorFormat(
|
||||
const char *func,
|
||||
const char *format,
|
||||
...);
|
||||
|
||||
#define Py_FatalError(message) _Py_FatalErrorFunc(__func__, message)
|
||||
15
deps_windows/Python-3.11.1/Include/cpython/pyfpe.h
Normal file
15
deps_windows/Python-3.11.1/Include/cpython/pyfpe.h
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#ifndef Py_PYFPE_H
|
||||
#define Py_PYFPE_H
|
||||
/* Header excluded from the stable API */
|
||||
#ifndef Py_LIMITED_API
|
||||
|
||||
/* These macros used to do something when Python was built with --with-fpectl,
|
||||
* but support for that was dropped in 3.7. We continue to define them though,
|
||||
* to avoid breaking API users.
|
||||
*/
|
||||
|
||||
#define PyFPE_START_PROTECT(err_string, leave_stmt)
|
||||
#define PyFPE_END_PROTECT(v)
|
||||
|
||||
#endif /* !defined(Py_LIMITED_API) */
|
||||
#endif /* !Py_PYFPE_H */
|
||||
17
deps_windows/Python-3.11.1/Include/cpython/pyframe.h
Normal file
17
deps_windows/Python-3.11.1/Include/cpython/pyframe.h
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#ifndef Py_CPYTHON_PYFRAME_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
PyAPI_DATA(PyTypeObject) PyFrame_Type;
|
||||
|
||||
#define PyFrame_Check(op) Py_IS_TYPE((op), &PyFrame_Type)
|
||||
|
||||
PyAPI_FUNC(PyFrameObject *) PyFrame_GetBack(PyFrameObject *frame);
|
||||
PyAPI_FUNC(PyObject *) PyFrame_GetLocals(PyFrameObject *frame);
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyFrame_GetGlobals(PyFrameObject *frame);
|
||||
PyAPI_FUNC(PyObject *) PyFrame_GetBuiltins(PyFrameObject *frame);
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyFrame_GetGenerator(PyFrameObject *frame);
|
||||
PyAPI_FUNC(int) PyFrame_GetLasti(PyFrameObject *frame);
|
||||
|
||||
65
deps_windows/Python-3.11.1/Include/cpython/pylifecycle.h
Normal file
65
deps_windows/Python-3.11.1/Include/cpython/pylifecycle.h
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
#ifndef Py_CPYTHON_PYLIFECYCLE_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
/* Py_FrozenMain is kept out of the Limited API until documented and present
|
||||
in all builds of Python */
|
||||
PyAPI_FUNC(int) Py_FrozenMain(int argc, char **argv);
|
||||
|
||||
/* Only used by applications that embed the interpreter and need to
|
||||
* override the standard encoding determination mechanism
|
||||
*/
|
||||
Py_DEPRECATED(3.11) PyAPI_FUNC(int) Py_SetStandardStreamEncoding(
|
||||
const char *encoding,
|
||||
const char *errors);
|
||||
|
||||
/* PEP 432 Multi-phase initialization API (Private while provisional!) */
|
||||
|
||||
PyAPI_FUNC(PyStatus) Py_PreInitialize(
|
||||
const PyPreConfig *src_config);
|
||||
PyAPI_FUNC(PyStatus) Py_PreInitializeFromBytesArgs(
|
||||
const PyPreConfig *src_config,
|
||||
Py_ssize_t argc,
|
||||
char **argv);
|
||||
PyAPI_FUNC(PyStatus) Py_PreInitializeFromArgs(
|
||||
const PyPreConfig *src_config,
|
||||
Py_ssize_t argc,
|
||||
wchar_t **argv);
|
||||
|
||||
PyAPI_FUNC(int) _Py_IsCoreInitialized(void);
|
||||
|
||||
|
||||
/* Initialization and finalization */
|
||||
|
||||
PyAPI_FUNC(PyStatus) Py_InitializeFromConfig(
|
||||
const PyConfig *config);
|
||||
PyAPI_FUNC(PyStatus) _Py_InitializeMain(void);
|
||||
|
||||
PyAPI_FUNC(int) Py_RunMain(void);
|
||||
|
||||
|
||||
PyAPI_FUNC(void) _Py_NO_RETURN Py_ExitStatusException(PyStatus err);
|
||||
|
||||
/* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. */
|
||||
PyAPI_FUNC(void) _Py_RestoreSignals(void);
|
||||
|
||||
PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *);
|
||||
PyAPI_FUNC(int) _Py_FdIsInteractive(FILE *fp, PyObject *filename);
|
||||
|
||||
Py_DEPRECATED(3.11) PyAPI_FUNC(void) _Py_SetProgramFullPath(const wchar_t *);
|
||||
|
||||
PyAPI_FUNC(const char *) _Py_gitidentifier(void);
|
||||
PyAPI_FUNC(const char *) _Py_gitversion(void);
|
||||
|
||||
PyAPI_FUNC(int) _Py_IsFinalizing(void);
|
||||
|
||||
/* Random */
|
||||
PyAPI_FUNC(int) _PyOS_URandom(void *buffer, Py_ssize_t size);
|
||||
PyAPI_FUNC(int) _PyOS_URandomNonblock(void *buffer, Py_ssize_t size);
|
||||
|
||||
/* Legacy locale support */
|
||||
PyAPI_FUNC(int) _Py_CoerceLegacyLocale(int warn);
|
||||
PyAPI_FUNC(int) _Py_LegacyLocaleDetected(int warn);
|
||||
PyAPI_FUNC(char *) _Py_SetLocaleFromEnv(int category);
|
||||
|
||||
PyAPI_FUNC(PyThreadState *) _Py_NewInterpreter(int isolated_subinterpreter);
|
||||
98
deps_windows/Python-3.11.1/Include/cpython/pymem.h
Normal file
98
deps_windows/Python-3.11.1/Include/cpython/pymem.h
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
#ifndef Py_CPYTHON_PYMEM_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
PyAPI_FUNC(void *) PyMem_RawMalloc(size_t size);
|
||||
PyAPI_FUNC(void *) PyMem_RawCalloc(size_t nelem, size_t elsize);
|
||||
PyAPI_FUNC(void *) PyMem_RawRealloc(void *ptr, size_t new_size);
|
||||
PyAPI_FUNC(void) PyMem_RawFree(void *ptr);
|
||||
|
||||
/* Try to get the allocators name set by _PyMem_SetupAllocators(). */
|
||||
PyAPI_FUNC(const char*) _PyMem_GetCurrentAllocatorName(void);
|
||||
|
||||
/* strdup() using PyMem_RawMalloc() */
|
||||
PyAPI_FUNC(char *) _PyMem_RawStrdup(const char *str);
|
||||
|
||||
/* strdup() using PyMem_Malloc() */
|
||||
PyAPI_FUNC(char *) _PyMem_Strdup(const char *str);
|
||||
|
||||
/* wcsdup() using PyMem_RawMalloc() */
|
||||
PyAPI_FUNC(wchar_t*) _PyMem_RawWcsdup(const wchar_t *str);
|
||||
|
||||
|
||||
typedef enum {
|
||||
/* PyMem_RawMalloc(), PyMem_RawRealloc() and PyMem_RawFree() */
|
||||
PYMEM_DOMAIN_RAW,
|
||||
|
||||
/* PyMem_Malloc(), PyMem_Realloc() and PyMem_Free() */
|
||||
PYMEM_DOMAIN_MEM,
|
||||
|
||||
/* PyObject_Malloc(), PyObject_Realloc() and PyObject_Free() */
|
||||
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,
|
||||
#ifdef WITH_PYMALLOC
|
||||
PYMEM_ALLOCATOR_PYMALLOC = 5,
|
||||
PYMEM_ALLOCATOR_PYMALLOC_DEBUG = 6,
|
||||
#endif
|
||||
} PyMemAllocatorName;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* user context passed as the first argument to the 4 functions */
|
||||
void *ctx;
|
||||
|
||||
/* allocate a memory block */
|
||||
void* (*malloc) (void *ctx, size_t size);
|
||||
|
||||
/* allocate a memory block initialized by zeros */
|
||||
void* (*calloc) (void *ctx, size_t nelem, size_t elsize);
|
||||
|
||||
/* allocate or resize a memory block */
|
||||
void* (*realloc) (void *ctx, void *ptr, size_t new_size);
|
||||
|
||||
/* release a memory block */
|
||||
void (*free) (void *ctx, void *ptr);
|
||||
} PyMemAllocatorEx;
|
||||
|
||||
/* Get the memory block allocator of the specified domain. */
|
||||
PyAPI_FUNC(void) PyMem_GetAllocator(PyMemAllocatorDomain domain,
|
||||
PyMemAllocatorEx *allocator);
|
||||
|
||||
/* Set the memory block allocator of the specified domain.
|
||||
|
||||
The new allocator must return a distinct non-NULL pointer when requesting
|
||||
zero bytes.
|
||||
|
||||
For the PYMEM_DOMAIN_RAW domain, the allocator must be thread-safe: the GIL
|
||||
is not held when the allocator is called.
|
||||
|
||||
If the new allocator is not a hook (don't call the previous allocator), the
|
||||
PyMem_SetupDebugHooks() function must be called to reinstall the debug hooks
|
||||
on top on the new allocator. */
|
||||
PyAPI_FUNC(void) PyMem_SetAllocator(PyMemAllocatorDomain domain,
|
||||
PyMemAllocatorEx *allocator);
|
||||
|
||||
/* Setup hooks to detect bugs in the following Python memory allocator
|
||||
functions:
|
||||
|
||||
- PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree()
|
||||
- PyMem_Malloc(), PyMem_Realloc(), PyMem_Free()
|
||||
- PyObject_Malloc(), PyObject_Realloc() and PyObject_Free()
|
||||
|
||||
Newly allocated memory is filled with the byte 0xCB, freed memory is filled
|
||||
with the byte 0xDB. Additional checks:
|
||||
|
||||
- detect API violations, ex: PyObject_Free() called on a buffer allocated
|
||||
by PyMem_Malloc()
|
||||
- detect write before the start of the buffer (buffer underflow)
|
||||
- detect write after the end of the buffer (buffer overflow)
|
||||
|
||||
The function does nothing if Python is not compiled is debug mode. */
|
||||
PyAPI_FUNC(void) PyMem_SetupDebugHooks(void);
|
||||
366
deps_windows/Python-3.11.1/Include/cpython/pystate.h
Normal file
366
deps_windows/Python-3.11.1/Include/cpython/pystate.h
Normal file
|
|
@ -0,0 +1,366 @@
|
|||
#ifndef Py_CPYTHON_PYSTATE_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
|
||||
PyAPI_FUNC(int) _PyInterpreterState_RequiresIDRef(PyInterpreterState *);
|
||||
PyAPI_FUNC(void) _PyInterpreterState_RequireIDRef(PyInterpreterState *, int);
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PyInterpreterState_GetMainModule(PyInterpreterState *);
|
||||
|
||||
/* State unique per thread */
|
||||
|
||||
/* Py_tracefunc return -1 when raising an exception, or 0 for success. */
|
||||
typedef int (*Py_tracefunc)(PyObject *, PyFrameObject *, int, PyObject *);
|
||||
|
||||
/* The following values are used for 'what' for tracefunc functions
|
||||
*
|
||||
* To add a new kind of trace event, also update "trace_init" in
|
||||
* Python/sysmodule.c to define the Python level event name
|
||||
*/
|
||||
#define PyTrace_CALL 0
|
||||
#define PyTrace_EXCEPTION 1
|
||||
#define PyTrace_LINE 2
|
||||
#define PyTrace_RETURN 3
|
||||
#define PyTrace_C_CALL 4
|
||||
#define PyTrace_C_EXCEPTION 5
|
||||
#define PyTrace_C_RETURN 6
|
||||
#define PyTrace_OPCODE 7
|
||||
|
||||
|
||||
typedef struct {
|
||||
PyCodeObject *code; // The code object for the bounds. May be NULL.
|
||||
PyCodeAddressRange bounds; // Only valid if code != NULL.
|
||||
} PyTraceInfo;
|
||||
|
||||
// Internal structure: you should not use it directly, but use public functions
|
||||
// like PyThreadState_EnterTracing() and PyThreadState_LeaveTracing().
|
||||
typedef struct _PyCFrame {
|
||||
/* This struct will be threaded through the C stack
|
||||
* allowing fast access to per-thread state that needs
|
||||
* to be accessed quickly by the interpreter, but can
|
||||
* be modified outside of the interpreter.
|
||||
*
|
||||
* WARNING: This makes data on the C stack accessible from
|
||||
* heap objects. Care must be taken to maintain stack
|
||||
* discipline and make sure that instances of this struct cannot
|
||||
* accessed outside of their lifetime.
|
||||
*/
|
||||
uint8_t use_tracing; // 0 or 255 (or'ed into opcode, hence 8-bit type)
|
||||
/* Pointer to the currently executing frame (it can be NULL) */
|
||||
struct _PyInterpreterFrame *current_frame;
|
||||
struct _PyCFrame *previous;
|
||||
} _PyCFrame;
|
||||
|
||||
typedef struct _err_stackitem {
|
||||
/* This struct represents a single execution context where we might
|
||||
* be currently handling an exception. It is a per-coroutine state
|
||||
* (coroutine in the computer science sense, including the thread
|
||||
* and generators).
|
||||
*
|
||||
* This is used as an entry on the exception stack, where each
|
||||
* entry indicates if it is currently handling an exception.
|
||||
* This ensures that the exception state is not impacted
|
||||
* by "yields" from an except handler. The thread
|
||||
* always has an entry (the bottom-most one).
|
||||
*/
|
||||
|
||||
/* The exception currently being handled in this context, if any. */
|
||||
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]; /* Variable sized */
|
||||
} _PyStackChunk;
|
||||
|
||||
struct _ts {
|
||||
/* See Python/ceval.c for comments explaining most fields */
|
||||
|
||||
PyThreadState *prev;
|
||||
PyThreadState *next;
|
||||
PyInterpreterState *interp;
|
||||
|
||||
/* Has been initialized to a safe state.
|
||||
|
||||
In order to be effective, this must be set to 0 during or right
|
||||
after allocation. */
|
||||
int _initialized;
|
||||
|
||||
/* Was this thread state statically allocated? */
|
||||
int _static;
|
||||
|
||||
int recursion_remaining;
|
||||
int recursion_limit;
|
||||
int recursion_headroom; /* Allow 50 more calls to handle any errors. */
|
||||
|
||||
/* 'tracing' keeps track of the execution depth when tracing/profiling.
|
||||
This is to prevent the actual trace/profile code from being recorded in
|
||||
the trace/profile. */
|
||||
int tracing;
|
||||
int tracing_what; /* The event currently being traced, if any. */
|
||||
|
||||
/* Pointer to current _PyCFrame in the C stack frame of the currently,
|
||||
* or most recently, executing _PyEval_EvalFrameDefault. */
|
||||
_PyCFrame *cframe;
|
||||
|
||||
Py_tracefunc c_profilefunc;
|
||||
Py_tracefunc c_tracefunc;
|
||||
PyObject *c_profileobj;
|
||||
PyObject *c_traceobj;
|
||||
|
||||
/* The exception currently being raised */
|
||||
PyObject *curexc_type;
|
||||
PyObject *curexc_value;
|
||||
PyObject *curexc_traceback;
|
||||
|
||||
/* Pointer to the top of the exception stack for the exceptions
|
||||
* we may be currently handling. (See _PyErr_StackItem above.)
|
||||
* This is never NULL. */
|
||||
_PyErr_StackItem *exc_info;
|
||||
|
||||
PyObject *dict; /* Stores per-thread state */
|
||||
|
||||
int gilstate_counter;
|
||||
|
||||
PyObject *async_exc; /* Asynchronous exception to raise */
|
||||
unsigned long thread_id; /* Thread id where this tstate was created */
|
||||
|
||||
/* Native thread id where this tstate was created. This will be 0 except on
|
||||
* those platforms that have the notion of native thread id, for which the
|
||||
* macro PY_HAVE_THREAD_NATIVE_ID is then defined.
|
||||
*/
|
||||
unsigned long native_thread_id;
|
||||
|
||||
int trash_delete_nesting;
|
||||
PyObject *trash_delete_later;
|
||||
|
||||
/* Called when a thread state is deleted normally, but not when it
|
||||
* is destroyed after fork().
|
||||
* Pain: to prevent rare but fatal shutdown errors (issue 18808),
|
||||
* Thread.join() must wait for the join'ed thread's tstate to be unlinked
|
||||
* from the tstate chain. That happens at the end of a thread's life,
|
||||
* in pystate.c.
|
||||
* The obvious way doesn't quite work: create a lock which the tstate
|
||||
* unlinking code releases, and have Thread.join() wait to acquire that
|
||||
* lock. The problem is that we _are_ at the end of the thread's life:
|
||||
* if the thread holds the last reference to the lock, decref'ing the
|
||||
* lock will delete the lock, and that may trigger arbitrary Python code
|
||||
* if there's a weakref, with a callback, to the lock. But by this time
|
||||
* _PyRuntime.gilstate.tstate_current is already NULL, so only the simplest
|
||||
* of C code can be allowed to run (in particular it must not be possible to
|
||||
* release the GIL).
|
||||
* So instead of holding the lock directly, the tstate holds a weakref to
|
||||
* the lock: that's the value of on_delete_data below. Decref'ing a
|
||||
* weakref is harmless.
|
||||
* on_delete points to _threadmodule.c's static release_sentinel() function.
|
||||
* After the tstate is unlinked, release_sentinel is called with the
|
||||
* weakref-to-lock (on_delete_data) argument, and release_sentinel releases
|
||||
* the indirectly held lock.
|
||||
*/
|
||||
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;
|
||||
|
||||
/* Unique thread state id. */
|
||||
uint64_t id;
|
||||
|
||||
PyTraceInfo trace_info;
|
||||
|
||||
_PyStackChunk *datastack_chunk;
|
||||
PyObject **datastack_top;
|
||||
PyObject **datastack_limit;
|
||||
/* XXX signal handlers should also be here */
|
||||
|
||||
/* The following fields are here to avoid allocation during init.
|
||||
The data is exposed through PyThreadState pointer fields.
|
||||
These fields should not be accessed directly outside of init.
|
||||
This is indicated by an underscore prefix on the field names.
|
||||
|
||||
All other PyInterpreterState pointer fields are populated when
|
||||
needed and default to NULL.
|
||||
*/
|
||||
// Note some fields do not have a leading underscore for backward
|
||||
// compatibility. See https://bugs.python.org/issue45953#msg412046.
|
||||
|
||||
/* The thread's exception stack entry. (Always the last entry.) */
|
||||
_PyErr_StackItem exc_state;
|
||||
|
||||
/* The bottom-most frame on the stack. */
|
||||
_PyCFrame root_cframe;
|
||||
};
|
||||
|
||||
|
||||
/* other API */
|
||||
|
||||
// Alias for backward compatibility with Python 3.8
|
||||
#define _PyInterpreterState_Get PyInterpreterState_Get
|
||||
|
||||
PyAPI_FUNC(PyThreadState *) _PyThreadState_Prealloc(PyInterpreterState *);
|
||||
|
||||
/* Similar to PyThreadState_Get(), but don't issue a fatal error
|
||||
* if it is NULL. */
|
||||
PyAPI_FUNC(PyThreadState *) _PyThreadState_UncheckedGet(void);
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PyThreadState_GetDict(PyThreadState *tstate);
|
||||
|
||||
// Disable tracing and profiling.
|
||||
PyAPI_FUNC(void) PyThreadState_EnterTracing(PyThreadState *tstate);
|
||||
|
||||
// Reset tracing and profiling: enable them if a trace function or a profile
|
||||
// function is set, otherwise disable them.
|
||||
PyAPI_FUNC(void) PyThreadState_LeaveTracing(PyThreadState *tstate);
|
||||
|
||||
/* PyGILState */
|
||||
|
||||
/* Helper/diagnostic function - return 1 if the current thread
|
||||
currently holds the GIL, 0 otherwise.
|
||||
|
||||
The function returns 1 if _PyGILState_check_enabled is non-zero. */
|
||||
PyAPI_FUNC(int) PyGILState_Check(void);
|
||||
|
||||
/* Get the single PyInterpreterState used by this process' GILState
|
||||
implementation.
|
||||
|
||||
This function doesn't check for error. Return NULL before _PyGILState_Init()
|
||||
is called and after _PyGILState_Fini() is called.
|
||||
|
||||
See also _PyInterpreterState_Get() and _PyInterpreterState_GET(). */
|
||||
PyAPI_FUNC(PyInterpreterState *) _PyGILState_GetInterpreterStateUnsafe(void);
|
||||
|
||||
/* The implementation of sys._current_frames() Returns a dict mapping
|
||||
thread id to that thread's current frame.
|
||||
*/
|
||||
PyAPI_FUNC(PyObject *) _PyThread_CurrentFrames(void);
|
||||
|
||||
/* The implementation of sys._current_exceptions() Returns a dict mapping
|
||||
thread id to that thread's current exception.
|
||||
*/
|
||||
PyAPI_FUNC(PyObject *) _PyThread_CurrentExceptions(void);
|
||||
|
||||
/* Routines for advanced debuggers, requested by David Beazley.
|
||||
Don't use unless you know what you are doing! */
|
||||
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Main(void);
|
||||
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Head(void);
|
||||
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *);
|
||||
PyAPI_FUNC(PyThreadState *) PyInterpreterState_ThreadHead(PyInterpreterState *);
|
||||
PyAPI_FUNC(PyThreadState *) PyThreadState_Next(PyThreadState *);
|
||||
PyAPI_FUNC(void) PyThreadState_DeleteCurrent(void);
|
||||
|
||||
/* Frame evaluation API */
|
||||
|
||||
typedef PyObject* (*_PyFrameEvalFunction)(PyThreadState *tstate, struct _PyInterpreterFrame *, int);
|
||||
|
||||
PyAPI_FUNC(_PyFrameEvalFunction) _PyInterpreterState_GetEvalFrameFunc(
|
||||
PyInterpreterState *interp);
|
||||
PyAPI_FUNC(void) _PyInterpreterState_SetEvalFrameFunc(
|
||||
PyInterpreterState *interp,
|
||||
_PyFrameEvalFunction eval_frame);
|
||||
|
||||
PyAPI_FUNC(const PyConfig*) _PyInterpreterState_GetConfig(PyInterpreterState *interp);
|
||||
|
||||
/* Get a copy of the current interpreter configuration.
|
||||
|
||||
Return 0 on success. Raise an exception and return -1 on error.
|
||||
|
||||
The caller must initialize 'config', using PyConfig_InitPythonConfig()
|
||||
for example.
|
||||
|
||||
Python must be preinitialized to call this method.
|
||||
The caller must hold the GIL. */
|
||||
PyAPI_FUNC(int) _PyInterpreterState_GetConfigCopy(
|
||||
struct PyConfig *config);
|
||||
|
||||
/* Set the configuration of the current interpreter.
|
||||
|
||||
This function should be called during or just after the Python
|
||||
initialization.
|
||||
|
||||
Update the sys module with the new configuration. If the sys module was
|
||||
modified directly after the Python initialization, these changes are lost.
|
||||
|
||||
Some configuration like faulthandler or warnoptions can be updated in the
|
||||
configuration, but don't reconfigure Python (don't enable/disable
|
||||
faulthandler and don't reconfigure warnings filters).
|
||||
|
||||
Return 0 on success. Raise an exception and return -1 on error.
|
||||
|
||||
The configuration should come from _PyInterpreterState_GetConfigCopy(). */
|
||||
PyAPI_FUNC(int) _PyInterpreterState_SetConfig(
|
||||
const struct PyConfig *config);
|
||||
|
||||
// Get the configuration of the current interpreter.
|
||||
// The caller must hold the GIL.
|
||||
PyAPI_FUNC(const PyConfig*) _Py_GetConfig(void);
|
||||
|
||||
|
||||
/* cross-interpreter data */
|
||||
|
||||
// _PyCrossInterpreterData is similar to Py_buffer as an effectively
|
||||
// opaque struct that holds data outside the object machinery. This
|
||||
// is necessary to pass safely between interpreters in the same process.
|
||||
typedef struct _xid _PyCrossInterpreterData;
|
||||
|
||||
struct _xid {
|
||||
// data is the cross-interpreter-safe derivation of a Python object
|
||||
// (see _PyObject_GetCrossInterpreterData). It will be NULL if the
|
||||
// new_object func (below) encodes the data.
|
||||
void *data;
|
||||
// obj is the Python object from which the data was derived. This
|
||||
// is non-NULL only if the data remains bound to the object in some
|
||||
// way, such that the object must be "released" (via a decref) when
|
||||
// the data is released. In that case the code that sets the field,
|
||||
// likely a registered "crossinterpdatafunc", is responsible for
|
||||
// ensuring it owns the reference (i.e. incref).
|
||||
PyObject *obj;
|
||||
// interp is the ID of the owning interpreter of the original
|
||||
// object. It corresponds to the active interpreter when
|
||||
// _PyObject_GetCrossInterpreterData() was called. This should only
|
||||
// be set by the cross-interpreter machinery.
|
||||
//
|
||||
// We use the ID rather than the PyInterpreterState to avoid issues
|
||||
// with deleted interpreters. Note that IDs are never re-used, so
|
||||
// each one will always correspond to a specific interpreter
|
||||
// (whether still alive or not).
|
||||
int64_t interp;
|
||||
// new_object is a function that returns a new object in the current
|
||||
// interpreter given the data. The resulting object (a new
|
||||
// reference) will be equivalent to the original object. This field
|
||||
// is required.
|
||||
PyObject *(*new_object)(_PyCrossInterpreterData *);
|
||||
// free is called when the data is released. If it is NULL then
|
||||
// nothing will be done to free the data. For some types this is
|
||||
// okay (e.g. bytes) and for those types this field should be set
|
||||
// to NULL. However, for most the data was allocated just for
|
||||
// cross-interpreter use, so it must be freed when
|
||||
// _PyCrossInterpreterData_Release is called or the memory will
|
||||
// leak. In that case, at the very least this field should be set
|
||||
// to PyMem_RawFree (the default if not explicitly set to NULL).
|
||||
// The call will happen with the original interpreter activated.
|
||||
void (*free)(void *);
|
||||
};
|
||||
|
||||
PyAPI_FUNC(int) _PyObject_GetCrossInterpreterData(PyObject *, _PyCrossInterpreterData *);
|
||||
PyAPI_FUNC(PyObject *) _PyCrossInterpreterData_NewObject(_PyCrossInterpreterData *);
|
||||
PyAPI_FUNC(void) _PyCrossInterpreterData_Release(_PyCrossInterpreterData *);
|
||||
|
||||
PyAPI_FUNC(int) _PyObject_CheckCrossInterpreterData(PyObject *);
|
||||
|
||||
/* cross-interpreter data registry */
|
||||
|
||||
typedef int (*crossinterpdatafunc)(PyObject *, _PyCrossInterpreterData *);
|
||||
|
||||
PyAPI_FUNC(int) _PyCrossInterpreterData_RegisterClass(PyTypeObject *, crossinterpdatafunc);
|
||||
PyAPI_FUNC(crossinterpdatafunc) _PyCrossInterpreterData_Lookup(PyObject *);
|
||||
121
deps_windows/Python-3.11.1/Include/cpython/pythonrun.h
Normal file
121
deps_windows/Python-3.11.1/Include/cpython/pythonrun.h
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
#ifndef Py_CPYTHON_PYTHONRUN_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
|
||||
PyAPI_FUNC(int) _PyRun_SimpleFileObject(
|
||||
FILE *fp,
|
||||
PyObject *filename,
|
||||
int closeit,
|
||||
PyCompilerFlags *flags);
|
||||
PyAPI_FUNC(int) PyRun_AnyFileExFlags(
|
||||
FILE *fp,
|
||||
const char *filename, /* decoded from the filesystem encoding */
|
||||
int closeit,
|
||||
PyCompilerFlags *flags);
|
||||
PyAPI_FUNC(int) _PyRun_AnyFileObject(
|
||||
FILE *fp,
|
||||
PyObject *filename,
|
||||
int closeit,
|
||||
PyCompilerFlags *flags);
|
||||
PyAPI_FUNC(int) PyRun_SimpleFileExFlags(
|
||||
FILE *fp,
|
||||
const char *filename, /* decoded from the filesystem encoding */
|
||||
int closeit,
|
||||
PyCompilerFlags *flags);
|
||||
PyAPI_FUNC(int) PyRun_InteractiveOneFlags(
|
||||
FILE *fp,
|
||||
const char *filename, /* decoded from the filesystem encoding */
|
||||
PyCompilerFlags *flags);
|
||||
PyAPI_FUNC(int) PyRun_InteractiveOneObject(
|
||||
FILE *fp,
|
||||
PyObject *filename,
|
||||
PyCompilerFlags *flags);
|
||||
PyAPI_FUNC(int) PyRun_InteractiveLoopFlags(
|
||||
FILE *fp,
|
||||
const char *filename, /* decoded from the filesystem encoding */
|
||||
PyCompilerFlags *flags);
|
||||
PyAPI_FUNC(int) _PyRun_InteractiveLoopObject(
|
||||
FILE *fp,
|
||||
PyObject *filename,
|
||||
PyCompilerFlags *flags);
|
||||
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *, int, PyObject *,
|
||||
PyObject *, PyCompilerFlags *);
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyRun_FileExFlags(
|
||||
FILE *fp,
|
||||
const char *filename, /* decoded from the filesystem encoding */
|
||||
int start,
|
||||
PyObject *globals,
|
||||
PyObject *locals,
|
||||
int closeit,
|
||||
PyCompilerFlags *flags);
|
||||
|
||||
|
||||
PyAPI_FUNC(PyObject *) Py_CompileStringExFlags(
|
||||
const char *str,
|
||||
const char *filename, /* decoded from the filesystem encoding */
|
||||
int start,
|
||||
PyCompilerFlags *flags,
|
||||
int optimize);
|
||||
PyAPI_FUNC(PyObject *) Py_CompileStringObject(
|
||||
const char *str,
|
||||
PyObject *filename, int start,
|
||||
PyCompilerFlags *flags,
|
||||
int optimize);
|
||||
|
||||
#define Py_CompileString(str, p, s) Py_CompileStringExFlags(str, p, s, NULL, -1)
|
||||
#define Py_CompileStringFlags(str, p, s, f) Py_CompileStringExFlags(str, p, s, f, -1)
|
||||
|
||||
|
||||
PyAPI_FUNC(const char *) _Py_SourceAsString(
|
||||
PyObject *cmd,
|
||||
const char *funcname,
|
||||
const char *what,
|
||||
PyCompilerFlags *cf,
|
||||
PyObject **cmd_copy);
|
||||
|
||||
|
||||
/* A function flavor is also exported by libpython. It is required when
|
||||
libpython is accessed directly rather than using header files which defines
|
||||
macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to
|
||||
export functions in pythonXX.dll. */
|
||||
PyAPI_FUNC(PyObject *) PyRun_String(const char *str, int s, PyObject *g, PyObject *l);
|
||||
PyAPI_FUNC(int) PyRun_AnyFile(FILE *fp, const char *name);
|
||||
PyAPI_FUNC(int) PyRun_AnyFileEx(FILE *fp, const char *name, int closeit);
|
||||
PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);
|
||||
PyAPI_FUNC(int) PyRun_SimpleString(const char *s);
|
||||
PyAPI_FUNC(int) PyRun_SimpleFile(FILE *f, const char *p);
|
||||
PyAPI_FUNC(int) PyRun_SimpleFileEx(FILE *f, const char *p, int c);
|
||||
PyAPI_FUNC(int) PyRun_InteractiveOne(FILE *f, const char *p);
|
||||
PyAPI_FUNC(int) PyRun_InteractiveLoop(FILE *f, const char *p);
|
||||
PyAPI_FUNC(PyObject *) PyRun_File(FILE *fp, const char *p, int s, PyObject *g, PyObject *l);
|
||||
PyAPI_FUNC(PyObject *) PyRun_FileEx(FILE *fp, const char *p, int s, PyObject *g, PyObject *l, int c);
|
||||
PyAPI_FUNC(PyObject *) PyRun_FileFlags(FILE *fp, const char *p, int s, PyObject *g, PyObject *l, PyCompilerFlags *flags);
|
||||
|
||||
/* Use macros for a bunch of old variants */
|
||||
#define PyRun_String(str, s, g, l) PyRun_StringFlags(str, s, g, l, NULL)
|
||||
#define PyRun_AnyFile(fp, name) PyRun_AnyFileExFlags(fp, name, 0, NULL)
|
||||
#define PyRun_AnyFileEx(fp, name, closeit) \
|
||||
PyRun_AnyFileExFlags(fp, name, closeit, NULL)
|
||||
#define PyRun_AnyFileFlags(fp, name, flags) \
|
||||
PyRun_AnyFileExFlags(fp, name, 0, flags)
|
||||
#define PyRun_SimpleString(s) PyRun_SimpleStringFlags(s, NULL)
|
||||
#define PyRun_SimpleFile(f, p) PyRun_SimpleFileExFlags(f, p, 0, NULL)
|
||||
#define PyRun_SimpleFileEx(f, p, c) PyRun_SimpleFileExFlags(f, p, c, NULL)
|
||||
#define PyRun_InteractiveOne(f, p) PyRun_InteractiveOneFlags(f, p, NULL)
|
||||
#define PyRun_InteractiveLoop(f, p) PyRun_InteractiveLoopFlags(f, p, NULL)
|
||||
#define PyRun_File(fp, p, s, g, l) \
|
||||
PyRun_FileExFlags(fp, p, s, g, l, 0, NULL)
|
||||
#define PyRun_FileEx(fp, p, s, g, l, c) \
|
||||
PyRun_FileExFlags(fp, p, s, g, l, c, NULL)
|
||||
#define PyRun_FileFlags(fp, p, s, g, l, flags) \
|
||||
PyRun_FileExFlags(fp, p, s, g, l, 0, flags)
|
||||
|
||||
|
||||
/* Stuff with no proper home (yet) */
|
||||
PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, const char *);
|
||||
PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState;
|
||||
PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *);
|
||||
42
deps_windows/Python-3.11.1/Include/cpython/pythread.h
Normal file
42
deps_windows/Python-3.11.1/Include/cpython/pythread.h
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#ifndef Py_CPYTHON_PYTHREAD_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
#define PYTHREAD_INVALID_THREAD_ID ((unsigned long)-1)
|
||||
|
||||
#ifdef HAVE_FORK
|
||||
/* Private function to reinitialize a lock at fork in the child process.
|
||||
Reset the lock to the unlocked state.
|
||||
Return 0 on success, return -1 on error. */
|
||||
PyAPI_FUNC(int) _PyThread_at_fork_reinit(PyThread_type_lock *lock);
|
||||
#endif /* HAVE_FORK */
|
||||
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
/* Darwin needs pthread.h to know type name the pthread_key_t. */
|
||||
# include <pthread.h>
|
||||
# define NATIVE_TSS_KEY_T pthread_key_t
|
||||
#elif defined(NT_THREADS)
|
||||
/* In Windows, native TSS key type is DWORD,
|
||||
but hardcode the unsigned long to avoid errors for include directive.
|
||||
*/
|
||||
# define NATIVE_TSS_KEY_T unsigned long
|
||||
#elif defined(HAVE_PTHREAD_STUBS)
|
||||
# include "cpython/pthread_stubs.h"
|
||||
# define NATIVE_TSS_KEY_T pthread_key_t
|
||||
#else
|
||||
# error "Require native threads. See https://bugs.python.org/issue31370"
|
||||
#endif
|
||||
|
||||
/* When Py_LIMITED_API is not defined, the type layout of Py_tss_t is
|
||||
exposed to allow static allocation in the API clients. Even in this case,
|
||||
you must handle TSS keys through API functions due to compatibility.
|
||||
*/
|
||||
struct _Py_tss_t {
|
||||
int _is_initialized;
|
||||
NATIVE_TSS_KEY_T _key;
|
||||
};
|
||||
|
||||
#undef NATIVE_TSS_KEY_T
|
||||
|
||||
/* When static allocation, you must initialize with Py_tss_NEEDS_INIT. */
|
||||
#define Py_tss_NEEDS_INIT {0}
|
||||
323
deps_windows/Python-3.11.1/Include/cpython/pytime.h
Normal file
323
deps_windows/Python-3.11.1/Include/cpython/pytime.h
Normal file
|
|
@ -0,0 +1,323 @@
|
|||
// The _PyTime_t API is written to use timestamp and timeout values stored in
|
||||
// various formats and to read clocks.
|
||||
//
|
||||
// The _PyTime_t type is an integer to support directly common arithmetic
|
||||
// operations like t1 + t2.
|
||||
//
|
||||
// The _PyTime_t API supports a resolution of 1 nanosecond. The _PyTime_t type
|
||||
// is signed to support negative timestamps. The supported range is around
|
||||
// [-292.3 years; +292.3 years]. Using the Unix epoch (January 1st, 1970), the
|
||||
// supported date range is around [1677-09-21; 2262-04-11].
|
||||
//
|
||||
// Formats:
|
||||
//
|
||||
// * seconds
|
||||
// * seconds as a floating pointer number (C double)
|
||||
// * milliseconds (10^-3 seconds)
|
||||
// * microseconds (10^-6 seconds)
|
||||
// * 100 nanoseconds (10^-7 seconds)
|
||||
// * nanoseconds (10^-9 seconds)
|
||||
// * timeval structure, 1 microsecond resolution (10^-6 seconds)
|
||||
// * timespec structure, 1 nanosecond resolution (10^-9 seconds)
|
||||
//
|
||||
// Integer overflows are detected and raise OverflowError. Conversion to a
|
||||
// resolution worse than 1 nanosecond is rounded correctly with the requested
|
||||
// rounding mode. There are 4 rounding modes: floor (towards -inf), ceiling
|
||||
// (towards +inf), half even and up (away from zero).
|
||||
//
|
||||
// Some functions clamp the result in the range [_PyTime_MIN; _PyTime_MAX], so
|
||||
// the caller doesn't have to handle errors and doesn't need to hold the GIL.
|
||||
// For example, _PyTime_Add(t1, t2) computes t1+t2 and clamp the result on
|
||||
// overflow.
|
||||
//
|
||||
// Clocks:
|
||||
//
|
||||
// * System clock
|
||||
// * Monotonic clock
|
||||
// * Performance counter
|
||||
//
|
||||
// Operations like (t * k / q) with integers are implemented in a way to reduce
|
||||
// the risk of integer overflow. Such operation is used to convert a clock
|
||||
// value expressed in ticks with a frequency to _PyTime_t, like
|
||||
// QueryPerformanceCounter() with QueryPerformanceFrequency().
|
||||
|
||||
#ifndef Py_LIMITED_API
|
||||
#ifndef Py_PYTIME_H
|
||||
#define Py_PYTIME_H
|
||||
|
||||
/**************************************************************************
|
||||
Symbols and macros to supply platform-independent interfaces to time related
|
||||
functions and constants
|
||||
**************************************************************************/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* _PyTime_t: Python timestamp with subsecond precision. It can be used to
|
||||
store a duration, and so indirectly a date (related to another date, like
|
||||
UNIX epoch). */
|
||||
typedef int64_t _PyTime_t;
|
||||
// _PyTime_MIN nanoseconds is around -292.3 years
|
||||
#define _PyTime_MIN INT64_MIN
|
||||
// _PyTime_MAX nanoseconds is around +292.3 years
|
||||
#define _PyTime_MAX INT64_MAX
|
||||
#define _SIZEOF_PYTIME_T 8
|
||||
|
||||
typedef enum {
|
||||
/* Round towards minus infinity (-inf).
|
||||
For example, used to read a clock. */
|
||||
_PyTime_ROUND_FLOOR=0,
|
||||
/* Round towards infinity (+inf).
|
||||
For example, used for timeout to wait "at least" N seconds. */
|
||||
_PyTime_ROUND_CEILING=1,
|
||||
/* Round to nearest with ties going to nearest even integer.
|
||||
For example, used to round from a Python float. */
|
||||
_PyTime_ROUND_HALF_EVEN=2,
|
||||
/* Round away from zero
|
||||
For example, used for timeout. _PyTime_ROUND_CEILING rounds
|
||||
-1e-9 to 0 milliseconds which causes bpo-31786 issue.
|
||||
_PyTime_ROUND_UP rounds -1e-9 to -1 millisecond which keeps
|
||||
the timeout sign as expected. select.poll(timeout) must block
|
||||
for negative values." */
|
||||
_PyTime_ROUND_UP=3,
|
||||
/* _PyTime_ROUND_TIMEOUT (an alias for _PyTime_ROUND_UP) should be
|
||||
used for timeouts. */
|
||||
_PyTime_ROUND_TIMEOUT = _PyTime_ROUND_UP
|
||||
} _PyTime_round_t;
|
||||
|
||||
|
||||
/* Convert a time_t to a PyLong. */
|
||||
PyAPI_FUNC(PyObject *) _PyLong_FromTime_t(
|
||||
time_t sec);
|
||||
|
||||
/* Convert a PyLong to a time_t. */
|
||||
PyAPI_FUNC(time_t) _PyLong_AsTime_t(
|
||||
PyObject *obj);
|
||||
|
||||
/* Convert a number of seconds, int or float, to time_t. */
|
||||
PyAPI_FUNC(int) _PyTime_ObjectToTime_t(
|
||||
PyObject *obj,
|
||||
time_t *sec,
|
||||
_PyTime_round_t);
|
||||
|
||||
/* Convert a number of seconds, int or float, to a timeval structure.
|
||||
usec is in the range [0; 999999] and rounded towards zero.
|
||||
For example, -1.2 is converted to (-2, 800000). */
|
||||
PyAPI_FUNC(int) _PyTime_ObjectToTimeval(
|
||||
PyObject *obj,
|
||||
time_t *sec,
|
||||
long *usec,
|
||||
_PyTime_round_t);
|
||||
|
||||
/* Convert a number of seconds, int or float, to a timespec structure.
|
||||
nsec is in the range [0; 999999999] and rounded towards zero.
|
||||
For example, -1.2 is converted to (-2, 800000000). */
|
||||
PyAPI_FUNC(int) _PyTime_ObjectToTimespec(
|
||||
PyObject *obj,
|
||||
time_t *sec,
|
||||
long *nsec,
|
||||
_PyTime_round_t);
|
||||
|
||||
|
||||
/* Create a timestamp from a number of seconds. */
|
||||
PyAPI_FUNC(_PyTime_t) _PyTime_FromSeconds(int seconds);
|
||||
|
||||
/* Macro to create a timestamp from a number of seconds, no integer overflow.
|
||||
Only use the macro for small values, prefer _PyTime_FromSeconds(). */
|
||||
#define _PYTIME_FROMSECONDS(seconds) \
|
||||
((_PyTime_t)(seconds) * (1000 * 1000 * 1000))
|
||||
|
||||
/* Create a timestamp from a number of nanoseconds. */
|
||||
PyAPI_FUNC(_PyTime_t) _PyTime_FromNanoseconds(_PyTime_t ns);
|
||||
|
||||
/* Create a timestamp from nanoseconds (Python int). */
|
||||
PyAPI_FUNC(int) _PyTime_FromNanosecondsObject(_PyTime_t *t,
|
||||
PyObject *obj);
|
||||
|
||||
/* Convert a number of seconds (Python float or int) to a timestamp.
|
||||
Raise an exception and return -1 on error, return 0 on success. */
|
||||
PyAPI_FUNC(int) _PyTime_FromSecondsObject(_PyTime_t *t,
|
||||
PyObject *obj,
|
||||
_PyTime_round_t round);
|
||||
|
||||
/* Convert a number of milliseconds (Python float or int, 10^-3) to a timestamp.
|
||||
Raise an exception and return -1 on error, return 0 on success. */
|
||||
PyAPI_FUNC(int) _PyTime_FromMillisecondsObject(_PyTime_t *t,
|
||||
PyObject *obj,
|
||||
_PyTime_round_t round);
|
||||
|
||||
/* Convert a timestamp to a number of seconds as a C double. */
|
||||
PyAPI_FUNC(double) _PyTime_AsSecondsDouble(_PyTime_t t);
|
||||
|
||||
/* Convert timestamp to a number of milliseconds (10^-3 seconds). */
|
||||
PyAPI_FUNC(_PyTime_t) _PyTime_AsMilliseconds(_PyTime_t t,
|
||||
_PyTime_round_t round);
|
||||
|
||||
/* Convert timestamp to a number of microseconds (10^-6 seconds). */
|
||||
PyAPI_FUNC(_PyTime_t) _PyTime_AsMicroseconds(_PyTime_t t,
|
||||
_PyTime_round_t round);
|
||||
|
||||
/* Convert timestamp to a number of nanoseconds (10^-9 seconds). */
|
||||
PyAPI_FUNC(_PyTime_t) _PyTime_AsNanoseconds(_PyTime_t t);
|
||||
|
||||
#ifdef MS_WINDOWS
|
||||
// Convert timestamp to a number of 100 nanoseconds (10^-7 seconds).
|
||||
PyAPI_FUNC(_PyTime_t) _PyTime_As100Nanoseconds(_PyTime_t t,
|
||||
_PyTime_round_t round);
|
||||
#endif
|
||||
|
||||
/* Convert timestamp to a number of nanoseconds (10^-9 seconds) as a Python int
|
||||
object. */
|
||||
PyAPI_FUNC(PyObject *) _PyTime_AsNanosecondsObject(_PyTime_t t);
|
||||
|
||||
#ifndef MS_WINDOWS
|
||||
/* Create a timestamp from a timeval structure.
|
||||
Raise an exception and return -1 on overflow, return 0 on success. */
|
||||
PyAPI_FUNC(int) _PyTime_FromTimeval(_PyTime_t *tp, struct timeval *tv);
|
||||
#endif
|
||||
|
||||
/* Convert a timestamp to a timeval structure (microsecond resolution).
|
||||
tv_usec is always positive.
|
||||
Raise an exception and return -1 if the conversion overflowed,
|
||||
return 0 on success. */
|
||||
PyAPI_FUNC(int) _PyTime_AsTimeval(_PyTime_t t,
|
||||
struct timeval *tv,
|
||||
_PyTime_round_t round);
|
||||
|
||||
/* Similar to _PyTime_AsTimeval() but don't raise an exception on overflow.
|
||||
On overflow, clamp tv_sec to _PyTime_t min/max. */
|
||||
PyAPI_FUNC(void) _PyTime_AsTimeval_clamp(_PyTime_t t,
|
||||
struct timeval *tv,
|
||||
_PyTime_round_t round);
|
||||
|
||||
/* Convert a timestamp to a number of seconds (secs) and microseconds (us).
|
||||
us is always positive. This function is similar to _PyTime_AsTimeval()
|
||||
except that secs is always a time_t type, whereas the timeval structure
|
||||
uses a C long for tv_sec on Windows.
|
||||
Raise an exception and return -1 if the conversion overflowed,
|
||||
return 0 on success. */
|
||||
PyAPI_FUNC(int) _PyTime_AsTimevalTime_t(
|
||||
_PyTime_t t,
|
||||
time_t *secs,
|
||||
int *us,
|
||||
_PyTime_round_t round);
|
||||
|
||||
#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_KQUEUE)
|
||||
/* Create a timestamp from a timespec structure.
|
||||
Raise an exception and return -1 on overflow, return 0 on success. */
|
||||
PyAPI_FUNC(int) _PyTime_FromTimespec(_PyTime_t *tp, struct timespec *ts);
|
||||
|
||||
/* Convert a timestamp to a timespec structure (nanosecond resolution).
|
||||
tv_nsec is always positive.
|
||||
Raise an exception and return -1 on error, return 0 on success. */
|
||||
PyAPI_FUNC(int) _PyTime_AsTimespec(_PyTime_t t, struct timespec *ts);
|
||||
|
||||
/* Similar to _PyTime_AsTimespec() but don't raise an exception on overflow.
|
||||
On overflow, clamp tv_sec to _PyTime_t min/max. */
|
||||
PyAPI_FUNC(void) _PyTime_AsTimespec_clamp(_PyTime_t t, struct timespec *ts);
|
||||
#endif
|
||||
|
||||
|
||||
// Compute t1 + t2. Clamp to [_PyTime_MIN; _PyTime_MAX] on overflow.
|
||||
PyAPI_FUNC(_PyTime_t) _PyTime_Add(_PyTime_t t1, _PyTime_t t2);
|
||||
|
||||
/* Compute ticks * mul / div.
|
||||
Clamp to [_PyTime_MIN; _PyTime_MAX] on overflow.
|
||||
The caller must ensure that ((div - 1) * mul) cannot overflow. */
|
||||
PyAPI_FUNC(_PyTime_t) _PyTime_MulDiv(_PyTime_t ticks,
|
||||
_PyTime_t mul,
|
||||
_PyTime_t div);
|
||||
|
||||
/* Structure used by time.get_clock_info() */
|
||||
typedef struct {
|
||||
const char *implementation;
|
||||
int monotonic;
|
||||
int adjustable;
|
||||
double resolution;
|
||||
} _Py_clock_info_t;
|
||||
|
||||
/* Get the current time from the system clock.
|
||||
|
||||
If the internal clock fails, silently ignore the error and return 0.
|
||||
On integer overflow, silently ignore the overflow and clamp the clock to
|
||||
[_PyTime_MIN; _PyTime_MAX].
|
||||
|
||||
Use _PyTime_GetSystemClockWithInfo() to check for failure. */
|
||||
PyAPI_FUNC(_PyTime_t) _PyTime_GetSystemClock(void);
|
||||
|
||||
/* Get the current time from the system clock.
|
||||
* On success, set *t and *info (if not NULL), and return 0.
|
||||
* On error, raise an exception and return -1.
|
||||
*/
|
||||
PyAPI_FUNC(int) _PyTime_GetSystemClockWithInfo(
|
||||
_PyTime_t *t,
|
||||
_Py_clock_info_t *info);
|
||||
|
||||
/* Get the time of a monotonic clock, i.e. a clock that cannot go backwards.
|
||||
The clock is not affected by system clock updates. The reference point of
|
||||
the returned value is undefined, so that only the difference between the
|
||||
results of consecutive calls is valid.
|
||||
|
||||
If the internal clock fails, silently ignore the error and return 0.
|
||||
On integer overflow, silently ignore the overflow and clamp the clock to
|
||||
[_PyTime_MIN; _PyTime_MAX].
|
||||
|
||||
Use _PyTime_GetMonotonicClockWithInfo() to check for failure. */
|
||||
PyAPI_FUNC(_PyTime_t) _PyTime_GetMonotonicClock(void);
|
||||
|
||||
/* Get the time of a monotonic clock, i.e. a clock that cannot go backwards.
|
||||
The clock is not affected by system clock updates. The reference point of
|
||||
the returned value is undefined, so that only the difference between the
|
||||
results of consecutive calls is valid.
|
||||
|
||||
Fill info (if set) with information of the function used to get the time.
|
||||
|
||||
Return 0 on success, raise an exception and return -1 on error. */
|
||||
PyAPI_FUNC(int) _PyTime_GetMonotonicClockWithInfo(
|
||||
_PyTime_t *t,
|
||||
_Py_clock_info_t *info);
|
||||
|
||||
|
||||
/* Converts a timestamp to the Gregorian time, using the local time zone.
|
||||
Return 0 on success, raise an exception and return -1 on error. */
|
||||
PyAPI_FUNC(int) _PyTime_localtime(time_t t, struct tm *tm);
|
||||
|
||||
/* Converts a timestamp to the Gregorian time, assuming UTC.
|
||||
Return 0 on success, raise an exception and return -1 on error. */
|
||||
PyAPI_FUNC(int) _PyTime_gmtime(time_t t, struct tm *tm);
|
||||
|
||||
/* Get the performance counter: clock with the highest available resolution to
|
||||
measure a short duration.
|
||||
|
||||
If the internal clock fails, silently ignore the error and return 0.
|
||||
On integer overflow, silently ignore the overflow and clamp the clock to
|
||||
[_PyTime_MIN; _PyTime_MAX].
|
||||
|
||||
Use _PyTime_GetPerfCounterWithInfo() to check for failure. */
|
||||
PyAPI_FUNC(_PyTime_t) _PyTime_GetPerfCounter(void);
|
||||
|
||||
/* Get the performance counter: clock with the highest available resolution to
|
||||
measure a short duration.
|
||||
|
||||
Fill info (if set) with information of the function used to get the time.
|
||||
|
||||
Return 0 on success, raise an exception and return -1 on error. */
|
||||
PyAPI_FUNC(int) _PyTime_GetPerfCounterWithInfo(
|
||||
_PyTime_t *t,
|
||||
_Py_clock_info_t *info);
|
||||
|
||||
|
||||
// Create a deadline.
|
||||
// Pseudo code: _PyTime_GetMonotonicClock() + timeout.
|
||||
PyAPI_FUNC(_PyTime_t) _PyDeadline_Init(_PyTime_t timeout);
|
||||
|
||||
// Get remaining time from a deadline.
|
||||
// Pseudo code: deadline - _PyTime_GetMonotonicClock().
|
||||
PyAPI_FUNC(_PyTime_t) _PyDeadline_Get(_PyTime_t deadline);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* Py_PYTIME_H */
|
||||
#endif /* Py_LIMITED_API */
|
||||
67
deps_windows/Python-3.11.1/Include/cpython/setobject.h
Normal file
67
deps_windows/Python-3.11.1/Include/cpython/setobject.h
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
#ifndef Py_CPYTHON_SETOBJECT_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
/* There are three kinds of entries in the table:
|
||||
|
||||
1. Unused: key == NULL and hash == 0
|
||||
2. Dummy: key == dummy and hash == -1
|
||||
3. Active: key != NULL and key != dummy and hash != -1
|
||||
|
||||
The hash field of Unused slots is always zero.
|
||||
|
||||
The hash field of Dummy slots are set to -1
|
||||
meaning that dummy entries can be detected by
|
||||
either entry->key==dummy or by entry->hash==-1.
|
||||
*/
|
||||
|
||||
#define PySet_MINSIZE 8
|
||||
|
||||
typedef struct {
|
||||
PyObject *key;
|
||||
Py_hash_t hash; /* Cached hash code of the key */
|
||||
} setentry;
|
||||
|
||||
/* The SetObject data structure is shared by set and frozenset objects.
|
||||
|
||||
Invariant for sets:
|
||||
- hash is -1
|
||||
|
||||
Invariants for frozensets:
|
||||
- data is immutable.
|
||||
- hash is the hash of the frozenset or -1 if not computed yet.
|
||||
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
|
||||
Py_ssize_t fill; /* Number active and dummy entries*/
|
||||
Py_ssize_t used; /* Number active entries */
|
||||
|
||||
/* The table contains mask + 1 slots, and that's a power of 2.
|
||||
* We store the mask instead of the size because the mask is more
|
||||
* frequently needed.
|
||||
*/
|
||||
Py_ssize_t mask;
|
||||
|
||||
/* The table points to a fixed-size smalltable for small tables
|
||||
* or to additional malloc'ed memory for bigger tables.
|
||||
* The table pointer is never NULL which saves us from repeated
|
||||
* runtime null-tests.
|
||||
*/
|
||||
setentry *table;
|
||||
Py_hash_t hash; /* Only used by frozenset objects */
|
||||
Py_ssize_t finger; /* Search finger for pop() */
|
||||
|
||||
setentry smalltable[PySet_MINSIZE];
|
||||
PyObject *weakreflist; /* List of weak references */
|
||||
} PySetObject;
|
||||
|
||||
#define PySet_GET_SIZE(so) \
|
||||
(assert(PyAnySet_Check(so)), (((PySetObject *)(so))->used))
|
||||
|
||||
PyAPI_DATA(PyObject *) _PySet_Dummy;
|
||||
|
||||
PyAPI_FUNC(int) _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, Py_hash_t *hash);
|
||||
PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable);
|
||||
16
deps_windows/Python-3.11.1/Include/cpython/sysmodule.h
Normal file
16
deps_windows/Python-3.11.1/Include/cpython/sysmodule.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#ifndef Py_CPYTHON_SYSMODULE_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PySys_GetAttr(PyThreadState *tstate,
|
||||
PyObject *name);
|
||||
|
||||
PyAPI_FUNC(size_t) _PySys_GetSizeOf(PyObject *);
|
||||
|
||||
typedef int(*Py_AuditHookFunction)(const char *, PyObject *, void *);
|
||||
|
||||
PyAPI_FUNC(int) PySys_Audit(
|
||||
const char *event,
|
||||
const char *argFormat,
|
||||
...);
|
||||
PyAPI_FUNC(int) PySys_AddAuditHook(Py_AuditHookFunction, void*);
|
||||
16
deps_windows/Python-3.11.1/Include/cpython/traceback.h
Normal file
16
deps_windows/Python-3.11.1/Include/cpython/traceback.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#ifndef Py_CPYTHON_TRACEBACK_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
typedef struct _traceback PyTracebackObject;
|
||||
|
||||
struct _traceback {
|
||||
PyObject_HEAD
|
||||
PyTracebackObject *tb_next;
|
||||
PyFrameObject *tb_frame;
|
||||
int tb_lasti;
|
||||
int tb_lineno;
|
||||
};
|
||||
|
||||
PyAPI_FUNC(int) _Py_DisplaySourceLine(PyObject *, PyObject *, int, int, int *, PyObject **);
|
||||
PyAPI_FUNC(void) _PyTraceback_Add(const char *, const char *, int);
|
||||
43
deps_windows/Python-3.11.1/Include/cpython/tupleobject.h
Normal file
43
deps_windows/Python-3.11.1/Include/cpython/tupleobject.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#ifndef Py_CPYTHON_TUPLEOBJECT_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
PyObject_VAR_HEAD
|
||||
/* ob_item contains space for 'ob_size' elements.
|
||||
Items must normally not be NULL, except during construction when
|
||||
the tuple is not yet visible outside the function that builds it. */
|
||||
PyObject *ob_item[1];
|
||||
} PyTupleObject;
|
||||
|
||||
PyAPI_FUNC(int) _PyTuple_Resize(PyObject **, Py_ssize_t);
|
||||
PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *);
|
||||
|
||||
/* Cast argument to PyTupleObject* type. */
|
||||
#define _PyTuple_CAST(op) \
|
||||
(assert(PyTuple_Check(op)), _Py_CAST(PyTupleObject*, (op)))
|
||||
|
||||
// Macros and static inline functions, trading safety for speed
|
||||
|
||||
static inline Py_ssize_t PyTuple_GET_SIZE(PyObject *op) {
|
||||
PyTupleObject *tuple = _PyTuple_CAST(op);
|
||||
return Py_SIZE(tuple);
|
||||
}
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
|
||||
# define PyTuple_GET_SIZE(op) PyTuple_GET_SIZE(_PyObject_CAST(op))
|
||||
#endif
|
||||
|
||||
#define PyTuple_GET_ITEM(op, index) (_PyTuple_CAST(op)->ob_item[index])
|
||||
|
||||
/* Function *only* to be used to fill in brand new tuples */
|
||||
static inline void
|
||||
PyTuple_SET_ITEM(PyObject *op, Py_ssize_t index, PyObject *value) {
|
||||
PyTupleObject *tuple = _PyTuple_CAST(op);
|
||||
tuple->ob_item[index] = value;
|
||||
}
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
|
||||
#define PyTuple_SET_ITEM(op, index, value) \
|
||||
PyTuple_SET_ITEM(_PyObject_CAST(op), index, _PyObject_CAST(value))
|
||||
#endif
|
||||
|
||||
PyAPI_FUNC(void) _PyTuple_DebugMallocStats(FILE *out);
|
||||
1153
deps_windows/Python-3.11.1/Include/cpython/unicodeobject.h
Normal file
1153
deps_windows/Python-3.11.1/Include/cpython/unicodeobject.h
Normal file
File diff suppressed because it is too large
Load diff
20
deps_windows/Python-3.11.1/Include/cpython/warnings.h
Normal file
20
deps_windows/Python-3.11.1/Include/cpython/warnings.h
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#ifndef Py_CPYTHON_WARNINGS_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
PyAPI_FUNC(int) PyErr_WarnExplicitObject(
|
||||
PyObject *category,
|
||||
PyObject *message,
|
||||
PyObject *filename,
|
||||
int lineno,
|
||||
PyObject *module,
|
||||
PyObject *registry);
|
||||
|
||||
PyAPI_FUNC(int) PyErr_WarnExplicitFormat(
|
||||
PyObject *category,
|
||||
const char *filename, int lineno,
|
||||
const char *module, PyObject *registry,
|
||||
const char *format, ...);
|
||||
|
||||
// DEPRECATED: Use PyErr_WarnEx() instead.
|
||||
#define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1)
|
||||
58
deps_windows/Python-3.11.1/Include/cpython/weakrefobject.h
Normal file
58
deps_windows/Python-3.11.1/Include/cpython/weakrefobject.h
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
#ifndef Py_CPYTHON_WEAKREFOBJECT_H
|
||||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
/* PyWeakReference is the base struct for the Python ReferenceType, ProxyType,
|
||||
* and CallableProxyType.
|
||||
*/
|
||||
struct _PyWeakReference {
|
||||
PyObject_HEAD
|
||||
|
||||
/* The object to which this is a weak reference, or Py_None if none.
|
||||
* Note that this is a stealth reference: wr_object's refcount is
|
||||
* not incremented to reflect this pointer.
|
||||
*/
|
||||
PyObject *wr_object;
|
||||
|
||||
/* A callable to invoke when wr_object dies, or NULL if none. */
|
||||
PyObject *wr_callback;
|
||||
|
||||
/* A cache for wr_object's hash code. As usual for hashes, this is -1
|
||||
* if the hash code isn't known yet.
|
||||
*/
|
||||
Py_hash_t hash;
|
||||
|
||||
/* If wr_object is weakly referenced, wr_object has a doubly-linked NULL-
|
||||
* terminated list of weak references to it. These are the list pointers.
|
||||
* If wr_object goes away, wr_object is set to Py_None, and these pointers
|
||||
* have no meaning then.
|
||||
*/
|
||||
PyWeakReference *wr_prev;
|
||||
PyWeakReference *wr_next;
|
||||
vectorcallfunc vectorcall;
|
||||
};
|
||||
|
||||
PyAPI_FUNC(Py_ssize_t) _PyWeakref_GetWeakrefCount(PyWeakReference *head);
|
||||
|
||||
PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self);
|
||||
|
||||
static inline PyObject* PyWeakref_GET_OBJECT(PyObject *ref_obj) {
|
||||
PyWeakReference *ref;
|
||||
PyObject *obj;
|
||||
assert(PyWeakref_Check(ref_obj));
|
||||
ref = _Py_CAST(PyWeakReference*, ref_obj);
|
||||
obj = ref->wr_object;
|
||||
// Explanation for the Py_REFCNT() check: when a weakref's target is part
|
||||
// of a long chain of deallocations which triggers the trashcan mechanism,
|
||||
// clearing the weakrefs can be delayed long after the target's refcount
|
||||
// has dropped to zero. In the meantime, code accessing the weakref will
|
||||
// be able to "see" the target object even though it is supposed to be
|
||||
// unreachable. See issue gh-60806.
|
||||
if (Py_REFCNT(obj) > 0) {
|
||||
return obj;
|
||||
}
|
||||
return Py_None;
|
||||
}
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
|
||||
# define PyWeakref_GET_OBJECT(ref) PyWeakref_GET_OBJECT(_PyObject_CAST(ref))
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue