File indexing completed on 2025-01-18 10:06:41
0001 #ifndef Py_CPYTHON_MODSUPPORT_H
0002 # error "this header file must not be included directly"
0003 #endif
0004
0005
0006
0007 #ifdef PY_SSIZE_T_CLEAN
0008 #define _Py_VaBuildStack _Py_VaBuildStack_SizeT
0009 #else
0010 PyAPI_FUNC(PyObject *) _Py_VaBuildValue_SizeT(const char *, va_list);
0011 PyAPI_FUNC(PyObject **) _Py_VaBuildStack_SizeT(
0012 PyObject **small_stack,
0013 Py_ssize_t small_stack_len,
0014 const char *format,
0015 va_list va,
0016 Py_ssize_t *p_nargs);
0017 #endif
0018
0019 PyAPI_FUNC(int) _PyArg_UnpackStack(
0020 PyObject *const *args,
0021 Py_ssize_t nargs,
0022 const char *name,
0023 Py_ssize_t min,
0024 Py_ssize_t max,
0025 ...);
0026
0027 PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kwargs);
0028 PyAPI_FUNC(int) _PyArg_NoKwnames(const char *funcname, PyObject *kwnames);
0029 PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args);
0030 #define _PyArg_NoKeywords(funcname, kwargs) \
0031 ((kwargs) == NULL || _PyArg_NoKeywords((funcname), (kwargs)))
0032 #define _PyArg_NoKwnames(funcname, kwnames) \
0033 ((kwnames) == NULL || _PyArg_NoKwnames((funcname), (kwnames)))
0034 #define _PyArg_NoPositional(funcname, args) \
0035 ((args) == NULL || _PyArg_NoPositional((funcname), (args)))
0036
0037 #define _Py_ANY_VARARGS(n) ((n) == PY_SSIZE_T_MAX)
0038
0039 PyAPI_FUNC(void) _PyArg_BadArgument(const char *, const char *, const char *, PyObject *);
0040 PyAPI_FUNC(int) _PyArg_CheckPositional(const char *, Py_ssize_t,
0041 Py_ssize_t, Py_ssize_t);
0042 #define _PyArg_CheckPositional(funcname, nargs, min, max) \
0043 ((!_Py_ANY_VARARGS(max) && (min) <= (nargs) && (nargs) <= (max)) \
0044 || _PyArg_CheckPositional((funcname), (nargs), (min), (max)))
0045
0046 PyAPI_FUNC(PyObject **) _Py_VaBuildStack(
0047 PyObject **small_stack,
0048 Py_ssize_t small_stack_len,
0049 const char *format,
0050 va_list va,
0051 Py_ssize_t *p_nargs);
0052
0053 typedef struct _PyArg_Parser {
0054 int initialized;
0055 const char *format;
0056 const char * const *keywords;
0057 const char *fname;
0058 const char *custom_msg;
0059 int pos;
0060 int min;
0061 int max;
0062 PyObject *kwtuple;
0063 struct _PyArg_Parser *next;
0064 } _PyArg_Parser;
0065
0066 #ifdef PY_SSIZE_T_CLEAN
0067 #define _PyArg_ParseTupleAndKeywordsFast _PyArg_ParseTupleAndKeywordsFast_SizeT
0068 #define _PyArg_ParseStack _PyArg_ParseStack_SizeT
0069 #define _PyArg_ParseStackAndKeywords _PyArg_ParseStackAndKeywords_SizeT
0070 #define _PyArg_VaParseTupleAndKeywordsFast _PyArg_VaParseTupleAndKeywordsFast_SizeT
0071 #endif
0072
0073 PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *,
0074 struct _PyArg_Parser *, ...);
0075 PyAPI_FUNC(int) _PyArg_ParseStack(
0076 PyObject *const *args,
0077 Py_ssize_t nargs,
0078 const char *format,
0079 ...);
0080 PyAPI_FUNC(int) _PyArg_ParseStackAndKeywords(
0081 PyObject *const *args,
0082 Py_ssize_t nargs,
0083 PyObject *kwnames,
0084 struct _PyArg_Parser *,
0085 ...);
0086 PyAPI_FUNC(int) _PyArg_VaParseTupleAndKeywordsFast(PyObject *, PyObject *,
0087 struct _PyArg_Parser *, va_list);
0088 PyAPI_FUNC(PyObject * const *) _PyArg_UnpackKeywords(
0089 PyObject *const *args, Py_ssize_t nargs,
0090 PyObject *kwargs, PyObject *kwnames,
0091 struct _PyArg_Parser *parser,
0092 int minpos, int maxpos, int minkw,
0093 PyObject **buf);
0094
0095 PyAPI_FUNC(PyObject * const *) _PyArg_UnpackKeywordsWithVararg(
0096 PyObject *const *args, Py_ssize_t nargs,
0097 PyObject *kwargs, PyObject *kwnames,
0098 struct _PyArg_Parser *parser,
0099 int minpos, int maxpos, int minkw,
0100 int vararg, PyObject **buf);
0101
0102 #define _PyArg_UnpackKeywords(args, nargs, kwargs, kwnames, parser, minpos, maxpos, minkw, buf) \
0103 (((minkw) == 0 && (kwargs) == NULL && (kwnames) == NULL && \
0104 (minpos) <= (nargs) && (nargs) <= (maxpos) && (args) != NULL) ? (args) : \
0105 _PyArg_UnpackKeywords((args), (nargs), (kwargs), (kwnames), (parser), \
0106 (minpos), (maxpos), (minkw), (buf)))
0107
0108 PyAPI_FUNC(PyObject *) _PyModule_CreateInitialized(PyModuleDef*, int apiver);
0109 PyAPI_FUNC(int) _PyModule_Add(PyObject *, const char *, PyObject *);