mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-27 04:50:28 +00:00
python-3.6.zip added from Github
README.cosmo contains the necessary links.
This commit is contained in:
parent
75fc601ff5
commit
0c4c56ff39
4219 changed files with 1968626 additions and 0 deletions
520
third_party/python/Modules/clinic/_asynciomodule.c.h
generated
vendored
Normal file
520
third_party/python/Modules/clinic/_asynciomodule.c.h
generated
vendored
Normal file
|
@ -0,0 +1,520 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Future___init____doc__,
|
||||
"Future(*, loop=None)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"This class is *almost* compatible with concurrent.futures.Future.\n"
|
||||
"\n"
|
||||
" Differences:\n"
|
||||
"\n"
|
||||
" - result() and exception() do not take a timeout argument and\n"
|
||||
" raise an exception when the future isn\'t done yet.\n"
|
||||
"\n"
|
||||
" - Callbacks registered with add_done_callback() are always called\n"
|
||||
" via the event loop\'s call_soon_threadsafe().\n"
|
||||
"\n"
|
||||
" - This class is not compatible with the wait() and as_completed()\n"
|
||||
" methods in the concurrent.futures package.");
|
||||
|
||||
static int
|
||||
_asyncio_Future___init___impl(FutureObj *self, PyObject *loop);
|
||||
|
||||
static int
|
||||
_asyncio_Future___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
int return_value = -1;
|
||||
static const char * const _keywords[] = {"loop", NULL};
|
||||
static _PyArg_Parser _parser = {"|$O:Future", _keywords, 0};
|
||||
PyObject *loop = Py_None;
|
||||
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
|
||||
&loop)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _asyncio_Future___init___impl((FutureObj *)self, loop);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Future_result__doc__,
|
||||
"result($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the result this future represents.\n"
|
||||
"\n"
|
||||
"If the future has been cancelled, raises CancelledError. If the\n"
|
||||
"future\'s result isn\'t yet available, raises InvalidStateError. If\n"
|
||||
"the future is done and has an exception set, this exception is raised.");
|
||||
|
||||
#define _ASYNCIO_FUTURE_RESULT_METHODDEF \
|
||||
{"result", (PyCFunction)_asyncio_Future_result, METH_NOARGS, _asyncio_Future_result__doc__},
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Future_result_impl(FutureObj *self);
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Future_result(FutureObj *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _asyncio_Future_result_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Future_exception__doc__,
|
||||
"exception($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the exception that was set on this future.\n"
|
||||
"\n"
|
||||
"The exception (or None if no exception was set) is returned only if\n"
|
||||
"the future is done. If the future has been cancelled, raises\n"
|
||||
"CancelledError. If the future isn\'t done yet, raises\n"
|
||||
"InvalidStateError.");
|
||||
|
||||
#define _ASYNCIO_FUTURE_EXCEPTION_METHODDEF \
|
||||
{"exception", (PyCFunction)_asyncio_Future_exception, METH_NOARGS, _asyncio_Future_exception__doc__},
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Future_exception_impl(FutureObj *self);
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Future_exception(FutureObj *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _asyncio_Future_exception_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Future_set_result__doc__,
|
||||
"set_result($self, res, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Mark the future done and set its result.\n"
|
||||
"\n"
|
||||
"If the future is already done when this method is called, raises\n"
|
||||
"InvalidStateError.");
|
||||
|
||||
#define _ASYNCIO_FUTURE_SET_RESULT_METHODDEF \
|
||||
{"set_result", (PyCFunction)_asyncio_Future_set_result, METH_O, _asyncio_Future_set_result__doc__},
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Future_set_exception__doc__,
|
||||
"set_exception($self, exception, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Mark the future done and set an exception.\n"
|
||||
"\n"
|
||||
"If the future is already done when this method is called, raises\n"
|
||||
"InvalidStateError.");
|
||||
|
||||
#define _ASYNCIO_FUTURE_SET_EXCEPTION_METHODDEF \
|
||||
{"set_exception", (PyCFunction)_asyncio_Future_set_exception, METH_O, _asyncio_Future_set_exception__doc__},
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Future_add_done_callback__doc__,
|
||||
"add_done_callback($self, fn, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Add a callback to be run when the future becomes done.\n"
|
||||
"\n"
|
||||
"The callback is called with a single argument - the future object. If\n"
|
||||
"the future is already done when this is called, the callback is\n"
|
||||
"scheduled with call_soon.");
|
||||
|
||||
#define _ASYNCIO_FUTURE_ADD_DONE_CALLBACK_METHODDEF \
|
||||
{"add_done_callback", (PyCFunction)_asyncio_Future_add_done_callback, METH_O, _asyncio_Future_add_done_callback__doc__},
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Future_remove_done_callback__doc__,
|
||||
"remove_done_callback($self, fn, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Remove all instances of a callback from the \"call when done\" list.\n"
|
||||
"\n"
|
||||
"Returns the number of callbacks removed.");
|
||||
|
||||
#define _ASYNCIO_FUTURE_REMOVE_DONE_CALLBACK_METHODDEF \
|
||||
{"remove_done_callback", (PyCFunction)_asyncio_Future_remove_done_callback, METH_O, _asyncio_Future_remove_done_callback__doc__},
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Future_cancel__doc__,
|
||||
"cancel($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Cancel the future and schedule callbacks.\n"
|
||||
"\n"
|
||||
"If the future is already done or cancelled, return False. Otherwise,\n"
|
||||
"change the future\'s state to cancelled, schedule the callbacks and\n"
|
||||
"return True.");
|
||||
|
||||
#define _ASYNCIO_FUTURE_CANCEL_METHODDEF \
|
||||
{"cancel", (PyCFunction)_asyncio_Future_cancel, METH_NOARGS, _asyncio_Future_cancel__doc__},
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Future_cancel_impl(FutureObj *self);
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Future_cancel(FutureObj *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _asyncio_Future_cancel_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Future_cancelled__doc__,
|
||||
"cancelled($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return True if the future was cancelled.");
|
||||
|
||||
#define _ASYNCIO_FUTURE_CANCELLED_METHODDEF \
|
||||
{"cancelled", (PyCFunction)_asyncio_Future_cancelled, METH_NOARGS, _asyncio_Future_cancelled__doc__},
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Future_cancelled_impl(FutureObj *self);
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Future_cancelled(FutureObj *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _asyncio_Future_cancelled_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Future_done__doc__,
|
||||
"done($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return True if the future is done.\n"
|
||||
"\n"
|
||||
"Done means either that a result / exception are available, or that the\n"
|
||||
"future was cancelled.");
|
||||
|
||||
#define _ASYNCIO_FUTURE_DONE_METHODDEF \
|
||||
{"done", (PyCFunction)_asyncio_Future_done, METH_NOARGS, _asyncio_Future_done__doc__},
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Future_done_impl(FutureObj *self);
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Future_done(FutureObj *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _asyncio_Future_done_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Future__repr_info__doc__,
|
||||
"_repr_info($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ASYNCIO_FUTURE__REPR_INFO_METHODDEF \
|
||||
{"_repr_info", (PyCFunction)_asyncio_Future__repr_info, METH_NOARGS, _asyncio_Future__repr_info__doc__},
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Future__repr_info_impl(FutureObj *self);
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Future__repr_info(FutureObj *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _asyncio_Future__repr_info_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Future__schedule_callbacks__doc__,
|
||||
"_schedule_callbacks($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ASYNCIO_FUTURE__SCHEDULE_CALLBACKS_METHODDEF \
|
||||
{"_schedule_callbacks", (PyCFunction)_asyncio_Future__schedule_callbacks, METH_NOARGS, _asyncio_Future__schedule_callbacks__doc__},
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Future__schedule_callbacks_impl(FutureObj *self);
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Future__schedule_callbacks(FutureObj *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _asyncio_Future__schedule_callbacks_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Task___init____doc__,
|
||||
"Task(coro, *, loop=None)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"A coroutine wrapped in a Future.");
|
||||
|
||||
static int
|
||||
_asyncio_Task___init___impl(TaskObj *self, PyObject *coro, PyObject *loop);
|
||||
|
||||
static int
|
||||
_asyncio_Task___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
int return_value = -1;
|
||||
static const char * const _keywords[] = {"coro", "loop", NULL};
|
||||
static _PyArg_Parser _parser = {"O|$O:Task", _keywords, 0};
|
||||
PyObject *coro;
|
||||
PyObject *loop = Py_None;
|
||||
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
|
||||
&coro, &loop)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _asyncio_Task___init___impl((TaskObj *)self, coro, loop);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Task_current_task__doc__,
|
||||
"current_task($type, /, loop=None)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the currently running task in an event loop or None.\n"
|
||||
"\n"
|
||||
"By default the current task for the current event loop is returned.\n"
|
||||
"\n"
|
||||
"None is returned when called not in the context of a Task.");
|
||||
|
||||
#define _ASYNCIO_TASK_CURRENT_TASK_METHODDEF \
|
||||
{"current_task", (PyCFunction)_asyncio_Task_current_task, METH_FASTCALL|METH_CLASS, _asyncio_Task_current_task__doc__},
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Task_current_task_impl(PyTypeObject *type, PyObject *loop);
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Task_current_task(PyTypeObject *type, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"loop", NULL};
|
||||
static _PyArg_Parser _parser = {"|O:current_task", _keywords, 0};
|
||||
PyObject *loop = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&loop)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _asyncio_Task_current_task_impl(type, loop);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Task_all_tasks__doc__,
|
||||
"all_tasks($type, /, loop=None)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a set of all tasks for an event loop.\n"
|
||||
"\n"
|
||||
"By default all tasks for the current event loop are returned.");
|
||||
|
||||
#define _ASYNCIO_TASK_ALL_TASKS_METHODDEF \
|
||||
{"all_tasks", (PyCFunction)_asyncio_Task_all_tasks, METH_FASTCALL|METH_CLASS, _asyncio_Task_all_tasks__doc__},
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Task_all_tasks_impl(PyTypeObject *type, PyObject *loop);
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Task_all_tasks(PyTypeObject *type, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"loop", NULL};
|
||||
static _PyArg_Parser _parser = {"|O:all_tasks", _keywords, 0};
|
||||
PyObject *loop = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&loop)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _asyncio_Task_all_tasks_impl(type, loop);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Task__repr_info__doc__,
|
||||
"_repr_info($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ASYNCIO_TASK__REPR_INFO_METHODDEF \
|
||||
{"_repr_info", (PyCFunction)_asyncio_Task__repr_info, METH_NOARGS, _asyncio_Task__repr_info__doc__},
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Task__repr_info_impl(TaskObj *self);
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Task__repr_info(TaskObj *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _asyncio_Task__repr_info_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Task_cancel__doc__,
|
||||
"cancel($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Request that this task cancel itself.\n"
|
||||
"\n"
|
||||
"This arranges for a CancelledError to be thrown into the\n"
|
||||
"wrapped coroutine on the next cycle through the event loop.\n"
|
||||
"The coroutine then has a chance to clean up or even deny\n"
|
||||
"the request using try/except/finally.\n"
|
||||
"\n"
|
||||
"Unlike Future.cancel, this does not guarantee that the\n"
|
||||
"task will be cancelled: the exception might be caught and\n"
|
||||
"acted upon, delaying cancellation of the task or preventing\n"
|
||||
"cancellation completely. The task may also return a value or\n"
|
||||
"raise a different exception.\n"
|
||||
"\n"
|
||||
"Immediately after this method is called, Task.cancelled() will\n"
|
||||
"not return True (unless the task was already cancelled). A\n"
|
||||
"task will be marked as cancelled when the wrapped coroutine\n"
|
||||
"terminates with a CancelledError exception (even if cancel()\n"
|
||||
"was not called).");
|
||||
|
||||
#define _ASYNCIO_TASK_CANCEL_METHODDEF \
|
||||
{"cancel", (PyCFunction)_asyncio_Task_cancel, METH_NOARGS, _asyncio_Task_cancel__doc__},
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Task_cancel_impl(TaskObj *self);
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Task_cancel(TaskObj *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _asyncio_Task_cancel_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Task_get_stack__doc__,
|
||||
"get_stack($self, /, *, limit=None)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the list of stack frames for this task\'s coroutine.\n"
|
||||
"\n"
|
||||
"If the coroutine is not done, this returns the stack where it is\n"
|
||||
"suspended. If the coroutine has completed successfully or was\n"
|
||||
"cancelled, this returns an empty list. If the coroutine was\n"
|
||||
"terminated by an exception, this returns the list of traceback\n"
|
||||
"frames.\n"
|
||||
"\n"
|
||||
"The frames are always ordered from oldest to newest.\n"
|
||||
"\n"
|
||||
"The optional limit gives the maximum number of frames to\n"
|
||||
"return; by default all available frames are returned. Its\n"
|
||||
"meaning differs depending on whether a stack or a traceback is\n"
|
||||
"returned: the newest frames of a stack are returned, but the\n"
|
||||
"oldest frames of a traceback are returned. (This matches the\n"
|
||||
"behavior of the traceback module.)\n"
|
||||
"\n"
|
||||
"For reasons beyond our control, only one stack frame is\n"
|
||||
"returned for a suspended coroutine.");
|
||||
|
||||
#define _ASYNCIO_TASK_GET_STACK_METHODDEF \
|
||||
{"get_stack", (PyCFunction)_asyncio_Task_get_stack, METH_FASTCALL, _asyncio_Task_get_stack__doc__},
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Task_get_stack_impl(TaskObj *self, PyObject *limit);
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Task_get_stack(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"limit", NULL};
|
||||
static _PyArg_Parser _parser = {"|$O:get_stack", _keywords, 0};
|
||||
PyObject *limit = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&limit)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _asyncio_Task_get_stack_impl(self, limit);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Task_print_stack__doc__,
|
||||
"print_stack($self, /, *, limit=None, file=None)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Print the stack or traceback for this task\'s coroutine.\n"
|
||||
"\n"
|
||||
"This produces output similar to that of the traceback module,\n"
|
||||
"for the frames retrieved by get_stack(). The limit argument\n"
|
||||
"is passed to get_stack(). The file argument is an I/O stream\n"
|
||||
"to which the output is written; by default output is written\n"
|
||||
"to sys.stderr.");
|
||||
|
||||
#define _ASYNCIO_TASK_PRINT_STACK_METHODDEF \
|
||||
{"print_stack", (PyCFunction)_asyncio_Task_print_stack, METH_FASTCALL, _asyncio_Task_print_stack__doc__},
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Task_print_stack_impl(TaskObj *self, PyObject *limit,
|
||||
PyObject *file);
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Task_print_stack(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"limit", "file", NULL};
|
||||
static _PyArg_Parser _parser = {"|$OO:print_stack", _keywords, 0};
|
||||
PyObject *limit = Py_None;
|
||||
PyObject *file = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&limit, &file)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _asyncio_Task_print_stack_impl(self, limit, file);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Task__step__doc__,
|
||||
"_step($self, /, exc=None)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ASYNCIO_TASK__STEP_METHODDEF \
|
||||
{"_step", (PyCFunction)_asyncio_Task__step, METH_FASTCALL, _asyncio_Task__step__doc__},
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Task__step_impl(TaskObj *self, PyObject *exc);
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Task__step(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"exc", NULL};
|
||||
static _PyArg_Parser _parser = {"|O:_step", _keywords, 0};
|
||||
PyObject *exc = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&exc)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _asyncio_Task__step_impl(self, exc);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_asyncio_Task__wakeup__doc__,
|
||||
"_wakeup($self, /, fut)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ASYNCIO_TASK__WAKEUP_METHODDEF \
|
||||
{"_wakeup", (PyCFunction)_asyncio_Task__wakeup, METH_FASTCALL, _asyncio_Task__wakeup__doc__},
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Task__wakeup_impl(TaskObj *self, PyObject *fut);
|
||||
|
||||
static PyObject *
|
||||
_asyncio_Task__wakeup(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"fut", NULL};
|
||||
static _PyArg_Parser _parser = {"O:_wakeup", _keywords, 0};
|
||||
PyObject *fut;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&fut)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _asyncio_Task__wakeup_impl(self, fut);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=7441872b13652085 input=a9049054013a1b77]*/
|
177
third_party/python/Modules/clinic/_bz2module.c.h
generated
vendored
Normal file
177
third_party/python/Modules/clinic/_bz2module.c.h
generated
vendored
Normal file
|
@ -0,0 +1,177 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(_bz2_BZ2Compressor_compress__doc__,
|
||||
"compress($self, data, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Provide data to the compressor object.\n"
|
||||
"\n"
|
||||
"Returns a chunk of compressed data if possible, or b\'\' otherwise.\n"
|
||||
"\n"
|
||||
"When you have finished providing data to the compressor, call the\n"
|
||||
"flush() method to finish the compression process.");
|
||||
|
||||
#define _BZ2_BZ2COMPRESSOR_COMPRESS_METHODDEF \
|
||||
{"compress", (PyCFunction)_bz2_BZ2Compressor_compress, METH_O, _bz2_BZ2Compressor_compress__doc__},
|
||||
|
||||
static PyObject *
|
||||
_bz2_BZ2Compressor_compress_impl(BZ2Compressor *self, Py_buffer *data);
|
||||
|
||||
static PyObject *
|
||||
_bz2_BZ2Compressor_compress(BZ2Compressor *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
|
||||
if (!PyArg_Parse(arg, "y*:compress", &data)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _bz2_BZ2Compressor_compress_impl(self, &data);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_bz2_BZ2Compressor_flush__doc__,
|
||||
"flush($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Finish the compression process.\n"
|
||||
"\n"
|
||||
"Returns the compressed data left in internal buffers.\n"
|
||||
"\n"
|
||||
"The compressor object may not be used after this method is called.");
|
||||
|
||||
#define _BZ2_BZ2COMPRESSOR_FLUSH_METHODDEF \
|
||||
{"flush", (PyCFunction)_bz2_BZ2Compressor_flush, METH_NOARGS, _bz2_BZ2Compressor_flush__doc__},
|
||||
|
||||
static PyObject *
|
||||
_bz2_BZ2Compressor_flush_impl(BZ2Compressor *self);
|
||||
|
||||
static PyObject *
|
||||
_bz2_BZ2Compressor_flush(BZ2Compressor *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _bz2_BZ2Compressor_flush_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_bz2_BZ2Compressor___init____doc__,
|
||||
"BZ2Compressor(compresslevel=9, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Create a compressor object for compressing data incrementally.\n"
|
||||
"\n"
|
||||
" compresslevel\n"
|
||||
" Compression level, as a number between 1 and 9.\n"
|
||||
"\n"
|
||||
"For one-shot compression, use the compress() function instead.");
|
||||
|
||||
static int
|
||||
_bz2_BZ2Compressor___init___impl(BZ2Compressor *self, int compresslevel);
|
||||
|
||||
static int
|
||||
_bz2_BZ2Compressor___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
int return_value = -1;
|
||||
int compresslevel = 9;
|
||||
|
||||
if ((Py_TYPE(self) == &BZ2Compressor_Type) &&
|
||||
!_PyArg_NoKeywords("BZ2Compressor", kwargs)) {
|
||||
goto exit;
|
||||
}
|
||||
if (!PyArg_ParseTuple(args, "|i:BZ2Compressor",
|
||||
&compresslevel)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _bz2_BZ2Compressor___init___impl((BZ2Compressor *)self, compresslevel);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_bz2_BZ2Decompressor_decompress__doc__,
|
||||
"decompress($self, /, data, max_length=-1)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Decompress *data*, returning uncompressed data as bytes.\n"
|
||||
"\n"
|
||||
"If *max_length* is nonnegative, returns at most *max_length* bytes of\n"
|
||||
"decompressed data. If this limit is reached and further output can be\n"
|
||||
"produced, *self.needs_input* will be set to ``False``. In this case, the next\n"
|
||||
"call to *decompress()* may provide *data* as b\'\' to obtain more of the output.\n"
|
||||
"\n"
|
||||
"If all of the input data was decompressed and returned (either because this\n"
|
||||
"was less than *max_length* bytes, or because *max_length* was negative),\n"
|
||||
"*self.needs_input* will be set to True.\n"
|
||||
"\n"
|
||||
"Attempting to decompress data after the end of stream is reached raises an\n"
|
||||
"EOFError. Any data found after the end of the stream is ignored and saved in\n"
|
||||
"the unused_data attribute.");
|
||||
|
||||
#define _BZ2_BZ2DECOMPRESSOR_DECOMPRESS_METHODDEF \
|
||||
{"decompress", (PyCFunction)_bz2_BZ2Decompressor_decompress, METH_FASTCALL, _bz2_BZ2Decompressor_decompress__doc__},
|
||||
|
||||
static PyObject *
|
||||
_bz2_BZ2Decompressor_decompress_impl(BZ2Decompressor *self, Py_buffer *data,
|
||||
Py_ssize_t max_length);
|
||||
|
||||
static PyObject *
|
||||
_bz2_BZ2Decompressor_decompress(BZ2Decompressor *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"data", "max_length", NULL};
|
||||
static _PyArg_Parser _parser = {"y*|n:decompress", _keywords, 0};
|
||||
Py_buffer data = {NULL, NULL};
|
||||
Py_ssize_t max_length = -1;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&data, &max_length)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _bz2_BZ2Decompressor_decompress_impl(self, &data, max_length);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_bz2_BZ2Decompressor___init____doc__,
|
||||
"BZ2Decompressor()\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Create a decompressor object for decompressing data incrementally.\n"
|
||||
"\n"
|
||||
"For one-shot decompression, use the decompress() function instead.");
|
||||
|
||||
static int
|
||||
_bz2_BZ2Decompressor___init___impl(BZ2Decompressor *self);
|
||||
|
||||
static int
|
||||
_bz2_BZ2Decompressor___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
int return_value = -1;
|
||||
|
||||
if ((Py_TYPE(self) == &BZ2Decompressor_Type) &&
|
||||
!_PyArg_NoPositional("BZ2Decompressor", args)) {
|
||||
goto exit;
|
||||
}
|
||||
if ((Py_TYPE(self) == &BZ2Decompressor_Type) &&
|
||||
!_PyArg_NoKeywords("BZ2Decompressor", kwargs)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _bz2_BZ2Decompressor___init___impl((BZ2Decompressor *)self);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=7e57af0b368d3e55 input=a9049054013a1b77]*/
|
1539
third_party/python/Modules/clinic/_codecsmodule.c.h
generated
vendored
Normal file
1539
third_party/python/Modules/clinic/_codecsmodule.c.h
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
38
third_party/python/Modules/clinic/_cryptmodule.c.h
generated
vendored
Normal file
38
third_party/python/Modules/clinic/_cryptmodule.c.h
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(crypt_crypt__doc__,
|
||||
"crypt($module, word, salt, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Hash a *word* with the given *salt* and return the hashed password.\n"
|
||||
"\n"
|
||||
"*word* will usually be a user\'s password. *salt* (either a random 2 or 16\n"
|
||||
"character string, possibly prefixed with $digit$ to indicate the method)\n"
|
||||
"will be used to perturb the encryption algorithm and produce distinct\n"
|
||||
"results for a given *word*.");
|
||||
|
||||
#define CRYPT_CRYPT_METHODDEF \
|
||||
{"crypt", (PyCFunction)crypt_crypt, METH_VARARGS, crypt_crypt__doc__},
|
||||
|
||||
static PyObject *
|
||||
crypt_crypt_impl(PyObject *module, const char *word, const char *salt);
|
||||
|
||||
static PyObject *
|
||||
crypt_crypt(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *word;
|
||||
const char *salt;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "ss:crypt",
|
||||
&word, &salt)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = crypt_crypt_impl(module, word, salt);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=8dfc88264e662df4 input=a9049054013a1b77]*/
|
75
third_party/python/Modules/clinic/_cursesmodule.c.h
generated
vendored
Normal file
75
third_party/python/Modules/clinic/_cursesmodule.c.h
generated
vendored
Normal file
|
@ -0,0 +1,75 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(curses_window_addch__doc__,
|
||||
"addch([y, x,] ch, [attr])\n"
|
||||
"Paint character ch at (y, x) with attributes attr.\n"
|
||||
"\n"
|
||||
" y\n"
|
||||
" Y-coordinate.\n"
|
||||
" x\n"
|
||||
" X-coordinate.\n"
|
||||
" ch\n"
|
||||
" Character to add.\n"
|
||||
" attr\n"
|
||||
" Attributes for the character.\n"
|
||||
"\n"
|
||||
"Paint character ch at (y, x) with attributes attr,\n"
|
||||
"overwriting any character previously painted at that location.\n"
|
||||
"By default, the character position and attributes are the\n"
|
||||
"current settings for the window object.");
|
||||
|
||||
#define CURSES_WINDOW_ADDCH_METHODDEF \
|
||||
{"addch", (PyCFunction)curses_window_addch, METH_VARARGS, curses_window_addch__doc__},
|
||||
|
||||
static PyObject *
|
||||
curses_window_addch_impl(PyCursesWindowObject *self, int group_left_1, int y,
|
||||
int x, PyObject *ch, int group_right_1, long attr);
|
||||
|
||||
static PyObject *
|
||||
curses_window_addch(PyCursesWindowObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int group_left_1 = 0;
|
||||
int y = 0;
|
||||
int x = 0;
|
||||
PyObject *ch;
|
||||
int group_right_1 = 0;
|
||||
long attr = 0;
|
||||
|
||||
switch (PyTuple_GET_SIZE(args)) {
|
||||
case 1:
|
||||
if (!PyArg_ParseTuple(args, "O:addch", &ch)) {
|
||||
goto exit;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (!PyArg_ParseTuple(args, "Ol:addch", &ch, &attr)) {
|
||||
goto exit;
|
||||
}
|
||||
group_right_1 = 1;
|
||||
break;
|
||||
case 3:
|
||||
if (!PyArg_ParseTuple(args, "iiO:addch", &y, &x, &ch)) {
|
||||
goto exit;
|
||||
}
|
||||
group_left_1 = 1;
|
||||
break;
|
||||
case 4:
|
||||
if (!PyArg_ParseTuple(args, "iiOl:addch", &y, &x, &ch, &attr)) {
|
||||
goto exit;
|
||||
}
|
||||
group_right_1 = 1;
|
||||
group_left_1 = 1;
|
||||
break;
|
||||
default:
|
||||
PyErr_SetString(PyExc_TypeError, "curses.window.addch requires 1 to 4 arguments");
|
||||
goto exit;
|
||||
}
|
||||
return_value = curses_window_addch_impl(self, group_left_1, y, x, ch, group_right_1, attr);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=13ffc5f8d79cbfbf input=a9049054013a1b77]*/
|
39
third_party/python/Modules/clinic/_datetimemodule.c.h
generated
vendored
Normal file
39
third_party/python/Modules/clinic/_datetimemodule.c.h
generated
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(datetime_datetime_now__doc__,
|
||||
"now($type, /, tz=None)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns new datetime object representing current time local to tz.\n"
|
||||
"\n"
|
||||
" tz\n"
|
||||
" Timezone object.\n"
|
||||
"\n"
|
||||
"If no tz is specified, uses local timezone.");
|
||||
|
||||
#define DATETIME_DATETIME_NOW_METHODDEF \
|
||||
{"now", (PyCFunction)datetime_datetime_now, METH_FASTCALL|METH_CLASS, datetime_datetime_now__doc__},
|
||||
|
||||
static PyObject *
|
||||
datetime_datetime_now_impl(PyTypeObject *type, PyObject *tz);
|
||||
|
||||
static PyObject *
|
||||
datetime_datetime_now(PyTypeObject *type, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"tz", NULL};
|
||||
static _PyArg_Parser _parser = {"|O:now", _keywords, 0};
|
||||
PyObject *tz = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&tz)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = datetime_datetime_now_impl(type, tz);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=8aaac0705add61ca input=a9049054013a1b77]*/
|
144
third_party/python/Modules/clinic/_dbmmodule.c.h
generated
vendored
Normal file
144
third_party/python/Modules/clinic/_dbmmodule.c.h
generated
vendored
Normal file
|
@ -0,0 +1,144 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(_dbm_dbm_close__doc__,
|
||||
"close($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Close the database.");
|
||||
|
||||
#define _DBM_DBM_CLOSE_METHODDEF \
|
||||
{"close", (PyCFunction)_dbm_dbm_close, METH_NOARGS, _dbm_dbm_close__doc__},
|
||||
|
||||
static PyObject *
|
||||
_dbm_dbm_close_impl(dbmobject *self);
|
||||
|
||||
static PyObject *
|
||||
_dbm_dbm_close(dbmobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _dbm_dbm_close_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_dbm_dbm_keys__doc__,
|
||||
"keys($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a list of all keys in the database.");
|
||||
|
||||
#define _DBM_DBM_KEYS_METHODDEF \
|
||||
{"keys", (PyCFunction)_dbm_dbm_keys, METH_NOARGS, _dbm_dbm_keys__doc__},
|
||||
|
||||
static PyObject *
|
||||
_dbm_dbm_keys_impl(dbmobject *self);
|
||||
|
||||
static PyObject *
|
||||
_dbm_dbm_keys(dbmobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _dbm_dbm_keys_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_dbm_dbm_get__doc__,
|
||||
"get($self, key, default=None, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the value for key if present, otherwise default.");
|
||||
|
||||
#define _DBM_DBM_GET_METHODDEF \
|
||||
{"get", (PyCFunction)_dbm_dbm_get, METH_VARARGS, _dbm_dbm_get__doc__},
|
||||
|
||||
static PyObject *
|
||||
_dbm_dbm_get_impl(dbmobject *self, const char *key,
|
||||
Py_ssize_clean_t key_length, PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
_dbm_dbm_get(dbmobject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *key;
|
||||
Py_ssize_clean_t key_length;
|
||||
PyObject *default_value = Py_None;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "s#|O:get",
|
||||
&key, &key_length, &default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _dbm_dbm_get_impl(self, key, key_length, default_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_dbm_dbm_setdefault__doc__,
|
||||
"setdefault($self, key, default=b\'\', /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the value for key if present, otherwise default.\n"
|
||||
"\n"
|
||||
"If key is not in the database, it is inserted with default as the value.");
|
||||
|
||||
#define _DBM_DBM_SETDEFAULT_METHODDEF \
|
||||
{"setdefault", (PyCFunction)_dbm_dbm_setdefault, METH_VARARGS, _dbm_dbm_setdefault__doc__},
|
||||
|
||||
static PyObject *
|
||||
_dbm_dbm_setdefault_impl(dbmobject *self, const char *key,
|
||||
Py_ssize_clean_t key_length,
|
||||
PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
_dbm_dbm_setdefault(dbmobject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *key;
|
||||
Py_ssize_clean_t key_length;
|
||||
PyObject *default_value = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "s#|O:setdefault",
|
||||
&key, &key_length, &default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _dbm_dbm_setdefault_impl(self, key, key_length, default_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(dbmopen__doc__,
|
||||
"open($module, filename, flags=\'r\', mode=0o666, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a database object.\n"
|
||||
"\n"
|
||||
" filename\n"
|
||||
" The filename to open.\n"
|
||||
" flags\n"
|
||||
" How to open the file. \"r\" for reading, \"w\" for writing, etc.\n"
|
||||
" mode\n"
|
||||
" If creating a new file, the mode bits for the new file\n"
|
||||
" (e.g. os.O_RDWR).");
|
||||
|
||||
#define DBMOPEN_METHODDEF \
|
||||
{"open", (PyCFunction)dbmopen, METH_VARARGS, dbmopen__doc__},
|
||||
|
||||
static PyObject *
|
||||
dbmopen_impl(PyObject *module, PyObject *filename, const char *flags,
|
||||
int mode);
|
||||
|
||||
static PyObject *
|
||||
dbmopen(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *filename;
|
||||
const char *flags = "r";
|
||||
int mode = 438;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "U|si:open",
|
||||
&filename, &flags, &mode)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = dbmopen_impl(module, filename, flags, mode);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=919cc4337be4a5d3 input=a9049054013a1b77]*/
|
705
third_party/python/Modules/clinic/_elementtree.c.h
generated
vendored
Normal file
705
third_party/python/Modules/clinic/_elementtree.c.h
generated
vendored
Normal file
|
@ -0,0 +1,705 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element_append__doc__,
|
||||
"append($self, subelement, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_APPEND_METHODDEF \
|
||||
{"append", (PyCFunction)_elementtree_Element_append, METH_O, _elementtree_Element_append__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_append_impl(ElementObject *self, PyObject *subelement);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_append(ElementObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *subelement;
|
||||
|
||||
if (!PyArg_Parse(arg, "O!:append", &Element_Type, &subelement)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_Element_append_impl(self, subelement);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element_clear__doc__,
|
||||
"clear($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_CLEAR_METHODDEF \
|
||||
{"clear", (PyCFunction)_elementtree_Element_clear, METH_NOARGS, _elementtree_Element_clear__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_clear_impl(ElementObject *self);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_clear(ElementObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _elementtree_Element_clear_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element___copy____doc__,
|
||||
"__copy__($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT___COPY___METHODDEF \
|
||||
{"__copy__", (PyCFunction)_elementtree_Element___copy__, METH_NOARGS, _elementtree_Element___copy____doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element___copy___impl(ElementObject *self);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element___copy__(ElementObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _elementtree_Element___copy___impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element___deepcopy____doc__,
|
||||
"__deepcopy__($self, memo, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT___DEEPCOPY___METHODDEF \
|
||||
{"__deepcopy__", (PyCFunction)_elementtree_Element___deepcopy__, METH_O, _elementtree_Element___deepcopy____doc__},
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element___sizeof____doc__,
|
||||
"__sizeof__($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT___SIZEOF___METHODDEF \
|
||||
{"__sizeof__", (PyCFunction)_elementtree_Element___sizeof__, METH_NOARGS, _elementtree_Element___sizeof____doc__},
|
||||
|
||||
static Py_ssize_t
|
||||
_elementtree_Element___sizeof___impl(ElementObject *self);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element___sizeof__(ElementObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t _return_value;
|
||||
|
||||
_return_value = _elementtree_Element___sizeof___impl(self);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromSsize_t(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element___getstate____doc__,
|
||||
"__getstate__($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT___GETSTATE___METHODDEF \
|
||||
{"__getstate__", (PyCFunction)_elementtree_Element___getstate__, METH_NOARGS, _elementtree_Element___getstate____doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element___getstate___impl(ElementObject *self);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element___getstate__(ElementObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _elementtree_Element___getstate___impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element___setstate____doc__,
|
||||
"__setstate__($self, state, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT___SETSTATE___METHODDEF \
|
||||
{"__setstate__", (PyCFunction)_elementtree_Element___setstate__, METH_O, _elementtree_Element___setstate____doc__},
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element_extend__doc__,
|
||||
"extend($self, elements, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_EXTEND_METHODDEF \
|
||||
{"extend", (PyCFunction)_elementtree_Element_extend, METH_O, _elementtree_Element_extend__doc__},
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element_find__doc__,
|
||||
"find($self, /, path, namespaces=None)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_FIND_METHODDEF \
|
||||
{"find", (PyCFunction)_elementtree_Element_find, METH_FASTCALL, _elementtree_Element_find__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_find_impl(ElementObject *self, PyObject *path,
|
||||
PyObject *namespaces);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_find(ElementObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"path", "namespaces", NULL};
|
||||
static _PyArg_Parser _parser = {"O|O:find", _keywords, 0};
|
||||
PyObject *path;
|
||||
PyObject *namespaces = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&path, &namespaces)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_Element_find_impl(self, path, namespaces);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element_findtext__doc__,
|
||||
"findtext($self, /, path, default=None, namespaces=None)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_FINDTEXT_METHODDEF \
|
||||
{"findtext", (PyCFunction)_elementtree_Element_findtext, METH_FASTCALL, _elementtree_Element_findtext__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_findtext_impl(ElementObject *self, PyObject *path,
|
||||
PyObject *default_value,
|
||||
PyObject *namespaces);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_findtext(ElementObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"path", "default", "namespaces", NULL};
|
||||
static _PyArg_Parser _parser = {"O|OO:findtext", _keywords, 0};
|
||||
PyObject *path;
|
||||
PyObject *default_value = Py_None;
|
||||
PyObject *namespaces = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&path, &default_value, &namespaces)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_Element_findtext_impl(self, path, default_value, namespaces);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element_findall__doc__,
|
||||
"findall($self, /, path, namespaces=None)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_FINDALL_METHODDEF \
|
||||
{"findall", (PyCFunction)_elementtree_Element_findall, METH_FASTCALL, _elementtree_Element_findall__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_findall_impl(ElementObject *self, PyObject *path,
|
||||
PyObject *namespaces);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_findall(ElementObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"path", "namespaces", NULL};
|
||||
static _PyArg_Parser _parser = {"O|O:findall", _keywords, 0};
|
||||
PyObject *path;
|
||||
PyObject *namespaces = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&path, &namespaces)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_Element_findall_impl(self, path, namespaces);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element_iterfind__doc__,
|
||||
"iterfind($self, /, path, namespaces=None)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_ITERFIND_METHODDEF \
|
||||
{"iterfind", (PyCFunction)_elementtree_Element_iterfind, METH_FASTCALL, _elementtree_Element_iterfind__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_iterfind_impl(ElementObject *self, PyObject *path,
|
||||
PyObject *namespaces);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_iterfind(ElementObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"path", "namespaces", NULL};
|
||||
static _PyArg_Parser _parser = {"O|O:iterfind", _keywords, 0};
|
||||
PyObject *path;
|
||||
PyObject *namespaces = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&path, &namespaces)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_Element_iterfind_impl(self, path, namespaces);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element_get__doc__,
|
||||
"get($self, /, key, default=None)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_GET_METHODDEF \
|
||||
{"get", (PyCFunction)_elementtree_Element_get, METH_FASTCALL, _elementtree_Element_get__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_get_impl(ElementObject *self, PyObject *key,
|
||||
PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_get(ElementObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"key", "default", NULL};
|
||||
static _PyArg_Parser _parser = {"O|O:get", _keywords, 0};
|
||||
PyObject *key;
|
||||
PyObject *default_value = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&key, &default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_Element_get_impl(self, key, default_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element_getchildren__doc__,
|
||||
"getchildren($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_GETCHILDREN_METHODDEF \
|
||||
{"getchildren", (PyCFunction)_elementtree_Element_getchildren, METH_NOARGS, _elementtree_Element_getchildren__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_getchildren_impl(ElementObject *self);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_getchildren(ElementObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _elementtree_Element_getchildren_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element_iter__doc__,
|
||||
"iter($self, /, tag=None)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_ITER_METHODDEF \
|
||||
{"iter", (PyCFunction)_elementtree_Element_iter, METH_FASTCALL, _elementtree_Element_iter__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_iter_impl(ElementObject *self, PyObject *tag);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_iter(ElementObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"tag", NULL};
|
||||
static _PyArg_Parser _parser = {"|O:iter", _keywords, 0};
|
||||
PyObject *tag = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&tag)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_Element_iter_impl(self, tag);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element_itertext__doc__,
|
||||
"itertext($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_ITERTEXT_METHODDEF \
|
||||
{"itertext", (PyCFunction)_elementtree_Element_itertext, METH_NOARGS, _elementtree_Element_itertext__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_itertext_impl(ElementObject *self);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_itertext(ElementObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _elementtree_Element_itertext_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element_insert__doc__,
|
||||
"insert($self, index, subelement, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_INSERT_METHODDEF \
|
||||
{"insert", (PyCFunction)_elementtree_Element_insert, METH_VARARGS, _elementtree_Element_insert__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_insert_impl(ElementObject *self, Py_ssize_t index,
|
||||
PyObject *subelement);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_insert(ElementObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t index;
|
||||
PyObject *subelement;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "nO!:insert",
|
||||
&index, &Element_Type, &subelement)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_Element_insert_impl(self, index, subelement);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element_items__doc__,
|
||||
"items($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_ITEMS_METHODDEF \
|
||||
{"items", (PyCFunction)_elementtree_Element_items, METH_NOARGS, _elementtree_Element_items__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_items_impl(ElementObject *self);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_items(ElementObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _elementtree_Element_items_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element_keys__doc__,
|
||||
"keys($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_KEYS_METHODDEF \
|
||||
{"keys", (PyCFunction)_elementtree_Element_keys, METH_NOARGS, _elementtree_Element_keys__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_keys_impl(ElementObject *self);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_keys(ElementObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _elementtree_Element_keys_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element_makeelement__doc__,
|
||||
"makeelement($self, tag, attrib, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_MAKEELEMENT_METHODDEF \
|
||||
{"makeelement", (PyCFunction)_elementtree_Element_makeelement, METH_VARARGS, _elementtree_Element_makeelement__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_makeelement_impl(ElementObject *self, PyObject *tag,
|
||||
PyObject *attrib);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_makeelement(ElementObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *tag;
|
||||
PyObject *attrib;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "makeelement",
|
||||
2, 2,
|
||||
&tag, &attrib)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_Element_makeelement_impl(self, tag, attrib);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element_remove__doc__,
|
||||
"remove($self, subelement, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_REMOVE_METHODDEF \
|
||||
{"remove", (PyCFunction)_elementtree_Element_remove, METH_O, _elementtree_Element_remove__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_remove_impl(ElementObject *self, PyObject *subelement);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_remove(ElementObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *subelement;
|
||||
|
||||
if (!PyArg_Parse(arg, "O!:remove", &Element_Type, &subelement)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_Element_remove_impl(self, subelement);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_Element_set__doc__,
|
||||
"set($self, key, value, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_SET_METHODDEF \
|
||||
{"set", (PyCFunction)_elementtree_Element_set, METH_VARARGS, _elementtree_Element_set__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_set_impl(ElementObject *self, PyObject *key,
|
||||
PyObject *value);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_set(ElementObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *key;
|
||||
PyObject *value;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "set",
|
||||
2, 2,
|
||||
&key, &value)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_Element_set_impl(self, key, value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
static int
|
||||
_elementtree_TreeBuilder___init___impl(TreeBuilderObject *self,
|
||||
PyObject *element_factory);
|
||||
|
||||
static int
|
||||
_elementtree_TreeBuilder___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
int return_value = -1;
|
||||
static const char * const _keywords[] = {"element_factory", NULL};
|
||||
static _PyArg_Parser _parser = {"|O:TreeBuilder", _keywords, 0};
|
||||
PyObject *element_factory = NULL;
|
||||
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
|
||||
&element_factory)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_TreeBuilder___init___impl((TreeBuilderObject *)self, element_factory);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_TreeBuilder_data__doc__,
|
||||
"data($self, data, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_TREEBUILDER_DATA_METHODDEF \
|
||||
{"data", (PyCFunction)_elementtree_TreeBuilder_data, METH_O, _elementtree_TreeBuilder_data__doc__},
|
||||
|
||||
PyDoc_STRVAR(_elementtree_TreeBuilder_end__doc__,
|
||||
"end($self, tag, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_TREEBUILDER_END_METHODDEF \
|
||||
{"end", (PyCFunction)_elementtree_TreeBuilder_end, METH_O, _elementtree_TreeBuilder_end__doc__},
|
||||
|
||||
PyDoc_STRVAR(_elementtree_TreeBuilder_close__doc__,
|
||||
"close($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_TREEBUILDER_CLOSE_METHODDEF \
|
||||
{"close", (PyCFunction)_elementtree_TreeBuilder_close, METH_NOARGS, _elementtree_TreeBuilder_close__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_TreeBuilder_close_impl(TreeBuilderObject *self);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_TreeBuilder_close(TreeBuilderObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _elementtree_TreeBuilder_close_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_TreeBuilder_start__doc__,
|
||||
"start($self, tag, attrs=None, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_TREEBUILDER_START_METHODDEF \
|
||||
{"start", (PyCFunction)_elementtree_TreeBuilder_start, METH_VARARGS, _elementtree_TreeBuilder_start__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_TreeBuilder_start_impl(TreeBuilderObject *self, PyObject *tag,
|
||||
PyObject *attrs);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_TreeBuilder_start(TreeBuilderObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *tag;
|
||||
PyObject *attrs = Py_None;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "start",
|
||||
1, 2,
|
||||
&tag, &attrs)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_TreeBuilder_start_impl(self, tag, attrs);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
static int
|
||||
_elementtree_XMLParser___init___impl(XMLParserObject *self, PyObject *html,
|
||||
PyObject *target, const char *encoding);
|
||||
|
||||
static int
|
||||
_elementtree_XMLParser___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
int return_value = -1;
|
||||
static const char * const _keywords[] = {"html", "target", "encoding", NULL};
|
||||
static _PyArg_Parser _parser = {"|OOz:XMLParser", _keywords, 0};
|
||||
PyObject *html = NULL;
|
||||
PyObject *target = NULL;
|
||||
const char *encoding = NULL;
|
||||
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
|
||||
&html, &target, &encoding)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_XMLParser___init___impl((XMLParserObject *)self, html, target, encoding);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_XMLParser_close__doc__,
|
||||
"close($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_XMLPARSER_CLOSE_METHODDEF \
|
||||
{"close", (PyCFunction)_elementtree_XMLParser_close, METH_NOARGS, _elementtree_XMLParser_close__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_XMLParser_close_impl(XMLParserObject *self);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_XMLParser_close(XMLParserObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _elementtree_XMLParser_close_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_XMLParser_feed__doc__,
|
||||
"feed($self, data, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_XMLPARSER_FEED_METHODDEF \
|
||||
{"feed", (PyCFunction)_elementtree_XMLParser_feed, METH_O, _elementtree_XMLParser_feed__doc__},
|
||||
|
||||
PyDoc_STRVAR(_elementtree_XMLParser__parse_whole__doc__,
|
||||
"_parse_whole($self, file, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_XMLPARSER__PARSE_WHOLE_METHODDEF \
|
||||
{"_parse_whole", (PyCFunction)_elementtree_XMLParser__parse_whole, METH_O, _elementtree_XMLParser__parse_whole__doc__},
|
||||
|
||||
PyDoc_STRVAR(_elementtree_XMLParser_doctype__doc__,
|
||||
"doctype($self, name, pubid, system, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_XMLPARSER_DOCTYPE_METHODDEF \
|
||||
{"doctype", (PyCFunction)_elementtree_XMLParser_doctype, METH_VARARGS, _elementtree_XMLParser_doctype__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_XMLParser_doctype_impl(XMLParserObject *self, PyObject *name,
|
||||
PyObject *pubid, PyObject *system);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_XMLParser_doctype(XMLParserObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
PyObject *pubid;
|
||||
PyObject *system;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "doctype",
|
||||
3, 3,
|
||||
&name, &pubid, &system)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_XMLParser_doctype_impl(self, name, pubid, system);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_elementtree_XMLParser__setevents__doc__,
|
||||
"_setevents($self, events_queue, events_to_report=None, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_XMLPARSER__SETEVENTS_METHODDEF \
|
||||
{"_setevents", (PyCFunction)_elementtree_XMLParser__setevents, METH_VARARGS, _elementtree_XMLParser__setevents__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_XMLParser__setevents_impl(XMLParserObject *self,
|
||||
PyObject *events_queue,
|
||||
PyObject *events_to_report);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_XMLParser__setevents(XMLParserObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *events_queue;
|
||||
PyObject *events_to_report = Py_None;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "_setevents",
|
||||
1, 2,
|
||||
&events_queue, &events_to_report)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_XMLParser__setevents_impl(self, events_queue, events_to_report);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=b4a571a98ced3163 input=a9049054013a1b77]*/
|
257
third_party/python/Modules/clinic/_gdbmmodule.c.h
generated
vendored
Normal file
257
third_party/python/Modules/clinic/_gdbmmodule.c.h
generated
vendored
Normal file
|
@ -0,0 +1,257 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(_gdbm_gdbm_get__doc__,
|
||||
"get($self, key, default=None, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Get the value for key, or default if not present.");
|
||||
|
||||
#define _GDBM_GDBM_GET_METHODDEF \
|
||||
{"get", (PyCFunction)_gdbm_gdbm_get, METH_VARARGS, _gdbm_gdbm_get__doc__},
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_get_impl(dbmobject *self, PyObject *key, PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_get(dbmobject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *key;
|
||||
PyObject *default_value = Py_None;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "get",
|
||||
1, 2,
|
||||
&key, &default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _gdbm_gdbm_get_impl(self, key, default_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_gdbm_gdbm_setdefault__doc__,
|
||||
"setdefault($self, key, default=None, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Get value for key, or set it to default and return default if not present.");
|
||||
|
||||
#define _GDBM_GDBM_SETDEFAULT_METHODDEF \
|
||||
{"setdefault", (PyCFunction)_gdbm_gdbm_setdefault, METH_VARARGS, _gdbm_gdbm_setdefault__doc__},
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_setdefault_impl(dbmobject *self, PyObject *key,
|
||||
PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_setdefault(dbmobject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *key;
|
||||
PyObject *default_value = Py_None;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "setdefault",
|
||||
1, 2,
|
||||
&key, &default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _gdbm_gdbm_setdefault_impl(self, key, default_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_gdbm_gdbm_close__doc__,
|
||||
"close($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Close the database.");
|
||||
|
||||
#define _GDBM_GDBM_CLOSE_METHODDEF \
|
||||
{"close", (PyCFunction)_gdbm_gdbm_close, METH_NOARGS, _gdbm_gdbm_close__doc__},
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_close_impl(dbmobject *self);
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_close(dbmobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _gdbm_gdbm_close_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_gdbm_gdbm_keys__doc__,
|
||||
"keys($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Get a list of all keys in the database.");
|
||||
|
||||
#define _GDBM_GDBM_KEYS_METHODDEF \
|
||||
{"keys", (PyCFunction)_gdbm_gdbm_keys, METH_NOARGS, _gdbm_gdbm_keys__doc__},
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_keys_impl(dbmobject *self);
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_keys(dbmobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _gdbm_gdbm_keys_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_gdbm_gdbm_firstkey__doc__,
|
||||
"firstkey($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the starting key for the traversal.\n"
|
||||
"\n"
|
||||
"It\'s possible to loop over every key in the database using this method\n"
|
||||
"and the nextkey() method. The traversal is ordered by GDBM\'s internal\n"
|
||||
"hash values, and won\'t be sorted by the key values.");
|
||||
|
||||
#define _GDBM_GDBM_FIRSTKEY_METHODDEF \
|
||||
{"firstkey", (PyCFunction)_gdbm_gdbm_firstkey, METH_NOARGS, _gdbm_gdbm_firstkey__doc__},
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_firstkey_impl(dbmobject *self);
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_firstkey(dbmobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _gdbm_gdbm_firstkey_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_gdbm_gdbm_nextkey__doc__,
|
||||
"nextkey($self, key, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns the key that follows key in the traversal.\n"
|
||||
"\n"
|
||||
"The following code prints every key in the database db, without having\n"
|
||||
"to create a list in memory that contains them all:\n"
|
||||
"\n"
|
||||
" k = db.firstkey()\n"
|
||||
" while k != None:\n"
|
||||
" print(k)\n"
|
||||
" k = db.nextkey(k)");
|
||||
|
||||
#define _GDBM_GDBM_NEXTKEY_METHODDEF \
|
||||
{"nextkey", (PyCFunction)_gdbm_gdbm_nextkey, METH_O, _gdbm_gdbm_nextkey__doc__},
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_nextkey_impl(dbmobject *self, const char *key,
|
||||
Py_ssize_clean_t key_length);
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_nextkey(dbmobject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *key;
|
||||
Py_ssize_clean_t key_length;
|
||||
|
||||
if (!PyArg_Parse(arg, "s#:nextkey", &key, &key_length)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _gdbm_gdbm_nextkey_impl(self, key, key_length);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_gdbm_gdbm_reorganize__doc__,
|
||||
"reorganize($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Reorganize the database.\n"
|
||||
"\n"
|
||||
"If you have carried out a lot of deletions and would like to shrink\n"
|
||||
"the space used by the GDBM file, this routine will reorganize the\n"
|
||||
"database. GDBM will not shorten the length of a database file except\n"
|
||||
"by using this reorganization; otherwise, deleted file space will be\n"
|
||||
"kept and reused as new (key,value) pairs are added.");
|
||||
|
||||
#define _GDBM_GDBM_REORGANIZE_METHODDEF \
|
||||
{"reorganize", (PyCFunction)_gdbm_gdbm_reorganize, METH_NOARGS, _gdbm_gdbm_reorganize__doc__},
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_reorganize_impl(dbmobject *self);
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_reorganize(dbmobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _gdbm_gdbm_reorganize_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_gdbm_gdbm_sync__doc__,
|
||||
"sync($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Flush the database to the disk file.\n"
|
||||
"\n"
|
||||
"When the database has been opened in fast mode, this method forces\n"
|
||||
"any unwritten data to be written to the disk.");
|
||||
|
||||
#define _GDBM_GDBM_SYNC_METHODDEF \
|
||||
{"sync", (PyCFunction)_gdbm_gdbm_sync, METH_NOARGS, _gdbm_gdbm_sync__doc__},
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_sync_impl(dbmobject *self);
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_sync(dbmobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _gdbm_gdbm_sync_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(dbmopen__doc__,
|
||||
"open($module, filename, flags=\'r\', mode=0o666, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Open a dbm database and return a dbm object.\n"
|
||||
"\n"
|
||||
"The filename argument is the name of the database file.\n"
|
||||
"\n"
|
||||
"The optional flags argument can be \'r\' (to open an existing database\n"
|
||||
"for reading only -- default), \'w\' (to open an existing database for\n"
|
||||
"reading and writing), \'c\' (which creates the database if it doesn\'t\n"
|
||||
"exist), or \'n\' (which always creates a new empty database).\n"
|
||||
"\n"
|
||||
"Some versions of gdbm support additional flags which must be\n"
|
||||
"appended to one of the flags described above. The module constant\n"
|
||||
"\'open_flags\' is a string of valid additional flags. The \'f\' flag\n"
|
||||
"opens the database in fast mode; altered data will not automatically\n"
|
||||
"be written to the disk after every change. This results in faster\n"
|
||||
"writes to the database, but may result in an inconsistent database\n"
|
||||
"if the program crashes while the database is still open. Use the\n"
|
||||
"sync() method to force any unwritten data to be written to the disk.\n"
|
||||
"The \'s\' flag causes all database operations to be synchronized to\n"
|
||||
"disk. The \'u\' flag disables locking of the database file.\n"
|
||||
"\n"
|
||||
"The optional mode argument is the Unix mode of the file, used only\n"
|
||||
"when the database has to be created. It defaults to octal 0o666.");
|
||||
|
||||
#define DBMOPEN_METHODDEF \
|
||||
{"open", (PyCFunction)dbmopen, METH_VARARGS, dbmopen__doc__},
|
||||
|
||||
static PyObject *
|
||||
dbmopen_impl(PyObject *module, PyObject *filename, const char *flags,
|
||||
int mode);
|
||||
|
||||
static PyObject *
|
||||
dbmopen(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *filename;
|
||||
const char *flags = "r";
|
||||
int mode = 438;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "U|si:open",
|
||||
&filename, &flags, &mode)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = dbmopen_impl(module, filename, flags, mode);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=afb99364ac420d10 input=a9049054013a1b77]*/
|
60
third_party/python/Modules/clinic/_hashopenssl.c.h
generated
vendored
Normal file
60
third_party/python/Modules/clinic/_hashopenssl.c.h
generated
vendored
Normal file
|
@ -0,0 +1,60 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
#if (OPENSSL_VERSION_NUMBER > 0x10100000L && !defined(OPENSSL_NO_SCRYPT) && !defined(LIBRESSL_VERSION_NUMBER))
|
||||
|
||||
PyDoc_STRVAR(_hashlib_scrypt__doc__,
|
||||
"scrypt($module, /, password, *, salt=None, n=None, r=None, p=None,\n"
|
||||
" maxmem=0, dklen=64)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"scrypt password-based key derivation function.");
|
||||
|
||||
#define _HASHLIB_SCRYPT_METHODDEF \
|
||||
{"scrypt", (PyCFunction)_hashlib_scrypt, METH_FASTCALL, _hashlib_scrypt__doc__},
|
||||
|
||||
static PyObject *
|
||||
_hashlib_scrypt_impl(PyObject *module, Py_buffer *password, Py_buffer *salt,
|
||||
PyObject *n_obj, PyObject *r_obj, PyObject *p_obj,
|
||||
long maxmem, long dklen);
|
||||
|
||||
static PyObject *
|
||||
_hashlib_scrypt(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"password", "salt", "n", "r", "p", "maxmem", "dklen", NULL};
|
||||
static _PyArg_Parser _parser = {"y*|$y*O!O!O!ll:scrypt", _keywords, 0};
|
||||
Py_buffer password = {NULL, NULL};
|
||||
Py_buffer salt = {NULL, NULL};
|
||||
PyObject *n_obj = Py_None;
|
||||
PyObject *r_obj = Py_None;
|
||||
PyObject *p_obj = Py_None;
|
||||
long maxmem = 0;
|
||||
long dklen = 64;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&password, &salt, &PyLong_Type, &n_obj, &PyLong_Type, &r_obj, &PyLong_Type, &p_obj, &maxmem, &dklen)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _hashlib_scrypt_impl(module, &password, &salt, n_obj, r_obj, p_obj, maxmem, dklen);
|
||||
|
||||
exit:
|
||||
/* Cleanup for password */
|
||||
if (password.obj) {
|
||||
PyBuffer_Release(&password);
|
||||
}
|
||||
/* Cleanup for salt */
|
||||
if (salt.obj) {
|
||||
PyBuffer_Release(&salt);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* (OPENSSL_VERSION_NUMBER > 0x10100000L && !defined(OPENSSL_NO_SCRYPT) && !defined(LIBRESSL_VERSION_NUMBER)) */
|
||||
|
||||
#ifndef _HASHLIB_SCRYPT_METHODDEF
|
||||
#define _HASHLIB_SCRYPT_METHODDEF
|
||||
#endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */
|
||||
/*[clinic end generated code: output=118cd7036fa0fb52 input=a9049054013a1b77]*/
|
259
third_party/python/Modules/clinic/_lzmamodule.c.h
generated
vendored
Normal file
259
third_party/python/Modules/clinic/_lzmamodule.c.h
generated
vendored
Normal file
|
@ -0,0 +1,259 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(_lzma_LZMACompressor_compress__doc__,
|
||||
"compress($self, data, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Provide data to the compressor object.\n"
|
||||
"\n"
|
||||
"Returns a chunk of compressed data if possible, or b\'\' otherwise.\n"
|
||||
"\n"
|
||||
"When you have finished providing data to the compressor, call the\n"
|
||||
"flush() method to finish the compression process.");
|
||||
|
||||
#define _LZMA_LZMACOMPRESSOR_COMPRESS_METHODDEF \
|
||||
{"compress", (PyCFunction)_lzma_LZMACompressor_compress, METH_O, _lzma_LZMACompressor_compress__doc__},
|
||||
|
||||
static PyObject *
|
||||
_lzma_LZMACompressor_compress_impl(Compressor *self, Py_buffer *data);
|
||||
|
||||
static PyObject *
|
||||
_lzma_LZMACompressor_compress(Compressor *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
|
||||
if (!PyArg_Parse(arg, "y*:compress", &data)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _lzma_LZMACompressor_compress_impl(self, &data);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_lzma_LZMACompressor_flush__doc__,
|
||||
"flush($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Finish the compression process.\n"
|
||||
"\n"
|
||||
"Returns the compressed data left in internal buffers.\n"
|
||||
"\n"
|
||||
"The compressor object may not be used after this method is called.");
|
||||
|
||||
#define _LZMA_LZMACOMPRESSOR_FLUSH_METHODDEF \
|
||||
{"flush", (PyCFunction)_lzma_LZMACompressor_flush, METH_NOARGS, _lzma_LZMACompressor_flush__doc__},
|
||||
|
||||
static PyObject *
|
||||
_lzma_LZMACompressor_flush_impl(Compressor *self);
|
||||
|
||||
static PyObject *
|
||||
_lzma_LZMACompressor_flush(Compressor *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _lzma_LZMACompressor_flush_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_lzma_LZMADecompressor_decompress__doc__,
|
||||
"decompress($self, /, data, max_length=-1)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Decompress *data*, returning uncompressed data as bytes.\n"
|
||||
"\n"
|
||||
"If *max_length* is nonnegative, returns at most *max_length* bytes of\n"
|
||||
"decompressed data. If this limit is reached and further output can be\n"
|
||||
"produced, *self.needs_input* will be set to ``False``. In this case, the next\n"
|
||||
"call to *decompress()* may provide *data* as b\'\' to obtain more of the output.\n"
|
||||
"\n"
|
||||
"If all of the input data was decompressed and returned (either because this\n"
|
||||
"was less than *max_length* bytes, or because *max_length* was negative),\n"
|
||||
"*self.needs_input* will be set to True.\n"
|
||||
"\n"
|
||||
"Attempting to decompress data after the end of stream is reached raises an\n"
|
||||
"EOFError. Any data found after the end of the stream is ignored and saved in\n"
|
||||
"the unused_data attribute.");
|
||||
|
||||
#define _LZMA_LZMADECOMPRESSOR_DECOMPRESS_METHODDEF \
|
||||
{"decompress", (PyCFunction)_lzma_LZMADecompressor_decompress, METH_FASTCALL, _lzma_LZMADecompressor_decompress__doc__},
|
||||
|
||||
static PyObject *
|
||||
_lzma_LZMADecompressor_decompress_impl(Decompressor *self, Py_buffer *data,
|
||||
Py_ssize_t max_length);
|
||||
|
||||
static PyObject *
|
||||
_lzma_LZMADecompressor_decompress(Decompressor *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"data", "max_length", NULL};
|
||||
static _PyArg_Parser _parser = {"y*|n:decompress", _keywords, 0};
|
||||
Py_buffer data = {NULL, NULL};
|
||||
Py_ssize_t max_length = -1;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&data, &max_length)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _lzma_LZMADecompressor_decompress_impl(self, &data, max_length);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_lzma_LZMADecompressor___init____doc__,
|
||||
"LZMADecompressor(format=FORMAT_AUTO, memlimit=None, filters=None)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Create a decompressor object for decompressing data incrementally.\n"
|
||||
"\n"
|
||||
" format\n"
|
||||
" Specifies the container format of the input stream. If this is\n"
|
||||
" FORMAT_AUTO (the default), the decompressor will automatically detect\n"
|
||||
" whether the input is FORMAT_XZ or FORMAT_ALONE. Streams created with\n"
|
||||
" FORMAT_RAW cannot be autodetected.\n"
|
||||
" memlimit\n"
|
||||
" Limit the amount of memory used by the decompressor. This will cause\n"
|
||||
" decompression to fail if the input cannot be decompressed within the\n"
|
||||
" given limit.\n"
|
||||
" filters\n"
|
||||
" A custom filter chain. This argument is required for FORMAT_RAW, and\n"
|
||||
" not accepted with any other format. When provided, this should be a\n"
|
||||
" sequence of dicts, each indicating the ID and options for a single\n"
|
||||
" filter.\n"
|
||||
"\n"
|
||||
"For one-shot decompression, use the decompress() function instead.");
|
||||
|
||||
static int
|
||||
_lzma_LZMADecompressor___init___impl(Decompressor *self, int format,
|
||||
PyObject *memlimit, PyObject *filters);
|
||||
|
||||
static int
|
||||
_lzma_LZMADecompressor___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
int return_value = -1;
|
||||
static const char * const _keywords[] = {"format", "memlimit", "filters", NULL};
|
||||
static _PyArg_Parser _parser = {"|iOO:LZMADecompressor", _keywords, 0};
|
||||
int format = FORMAT_AUTO;
|
||||
PyObject *memlimit = Py_None;
|
||||
PyObject *filters = Py_None;
|
||||
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
|
||||
&format, &memlimit, &filters)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _lzma_LZMADecompressor___init___impl((Decompressor *)self, format, memlimit, filters);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_lzma_is_check_supported__doc__,
|
||||
"is_check_supported($module, check_id, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Test whether the given integrity check is supported.\n"
|
||||
"\n"
|
||||
"Always returns True for CHECK_NONE and CHECK_CRC32.");
|
||||
|
||||
#define _LZMA_IS_CHECK_SUPPORTED_METHODDEF \
|
||||
{"is_check_supported", (PyCFunction)_lzma_is_check_supported, METH_O, _lzma_is_check_supported__doc__},
|
||||
|
||||
static PyObject *
|
||||
_lzma_is_check_supported_impl(PyObject *module, int check_id);
|
||||
|
||||
static PyObject *
|
||||
_lzma_is_check_supported(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int check_id;
|
||||
|
||||
if (!PyArg_Parse(arg, "i:is_check_supported", &check_id)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _lzma_is_check_supported_impl(module, check_id);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_lzma__encode_filter_properties__doc__,
|
||||
"_encode_filter_properties($module, filter, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a bytes object encoding the options (properties) of the filter specified by *filter* (a dict).\n"
|
||||
"\n"
|
||||
"The result does not include the filter ID itself, only the options.");
|
||||
|
||||
#define _LZMA__ENCODE_FILTER_PROPERTIES_METHODDEF \
|
||||
{"_encode_filter_properties", (PyCFunction)_lzma__encode_filter_properties, METH_O, _lzma__encode_filter_properties__doc__},
|
||||
|
||||
static PyObject *
|
||||
_lzma__encode_filter_properties_impl(PyObject *module, lzma_filter filter);
|
||||
|
||||
static PyObject *
|
||||
_lzma__encode_filter_properties(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
lzma_filter filter = {LZMA_VLI_UNKNOWN, NULL};
|
||||
|
||||
if (!PyArg_Parse(arg, "O&:_encode_filter_properties", lzma_filter_converter, &filter)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _lzma__encode_filter_properties_impl(module, filter);
|
||||
|
||||
exit:
|
||||
/* Cleanup for filter */
|
||||
if (filter.id != LZMA_VLI_UNKNOWN)
|
||||
PyMem_Free(filter.options);
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_lzma__decode_filter_properties__doc__,
|
||||
"_decode_filter_properties($module, filter_id, encoded_props, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a bytes object encoding the options (properties) of the filter specified by *filter* (a dict).\n"
|
||||
"\n"
|
||||
"The result does not include the filter ID itself, only the options.");
|
||||
|
||||
#define _LZMA__DECODE_FILTER_PROPERTIES_METHODDEF \
|
||||
{"_decode_filter_properties", (PyCFunction)_lzma__decode_filter_properties, METH_VARARGS, _lzma__decode_filter_properties__doc__},
|
||||
|
||||
static PyObject *
|
||||
_lzma__decode_filter_properties_impl(PyObject *module, lzma_vli filter_id,
|
||||
Py_buffer *encoded_props);
|
||||
|
||||
static PyObject *
|
||||
_lzma__decode_filter_properties(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
lzma_vli filter_id;
|
||||
Py_buffer encoded_props = {NULL, NULL};
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O&y*:_decode_filter_properties",
|
||||
lzma_vli_converter, &filter_id, &encoded_props)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _lzma__decode_filter_properties_impl(module, filter_id, &encoded_props);
|
||||
|
||||
exit:
|
||||
/* Cleanup for encoded_props */
|
||||
if (encoded_props.obj) {
|
||||
PyBuffer_Release(&encoded_props);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=f27abae460122706 input=a9049054013a1b77]*/
|
38
third_party/python/Modules/clinic/_opcode.c.h
generated
vendored
Normal file
38
third_party/python/Modules/clinic/_opcode.c.h
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(_opcode_stack_effect__doc__,
|
||||
"stack_effect($module, opcode, oparg=None, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Compute the stack effect of the opcode.");
|
||||
|
||||
#define _OPCODE_STACK_EFFECT_METHODDEF \
|
||||
{"stack_effect", (PyCFunction)_opcode_stack_effect, METH_VARARGS, _opcode_stack_effect__doc__},
|
||||
|
||||
static int
|
||||
_opcode_stack_effect_impl(PyObject *module, int opcode, PyObject *oparg);
|
||||
|
||||
static PyObject *
|
||||
_opcode_stack_effect(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int opcode;
|
||||
PyObject *oparg = Py_None;
|
||||
int _return_value;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i|O:stack_effect",
|
||||
&opcode, &oparg)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = _opcode_stack_effect_impl(module, opcode, oparg);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromLong((long)_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=4d91c6a765097853 input=a9049054013a1b77]*/
|
563
third_party/python/Modules/clinic/_pickle.c.h
generated
vendored
Normal file
563
third_party/python/Modules/clinic/_pickle.c.h
generated
vendored
Normal file
|
@ -0,0 +1,563 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(_pickle_Pickler_clear_memo__doc__,
|
||||
"clear_memo($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Clears the pickler\'s \"memo\".\n"
|
||||
"\n"
|
||||
"The memo is the data structure that remembers which objects the\n"
|
||||
"pickler has already seen, so that shared or recursive objects are\n"
|
||||
"pickled by reference and not by value. This method is useful when\n"
|
||||
"re-using picklers.");
|
||||
|
||||
#define _PICKLE_PICKLER_CLEAR_MEMO_METHODDEF \
|
||||
{"clear_memo", (PyCFunction)_pickle_Pickler_clear_memo, METH_NOARGS, _pickle_Pickler_clear_memo__doc__},
|
||||
|
||||
static PyObject *
|
||||
_pickle_Pickler_clear_memo_impl(PicklerObject *self);
|
||||
|
||||
static PyObject *
|
||||
_pickle_Pickler_clear_memo(PicklerObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _pickle_Pickler_clear_memo_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_pickle_Pickler_dump__doc__,
|
||||
"dump($self, obj, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Write a pickled representation of the given object to the open file.");
|
||||
|
||||
#define _PICKLE_PICKLER_DUMP_METHODDEF \
|
||||
{"dump", (PyCFunction)_pickle_Pickler_dump, METH_O, _pickle_Pickler_dump__doc__},
|
||||
|
||||
PyDoc_STRVAR(_pickle_Pickler___sizeof____doc__,
|
||||
"__sizeof__($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns size in memory, in bytes.");
|
||||
|
||||
#define _PICKLE_PICKLER___SIZEOF___METHODDEF \
|
||||
{"__sizeof__", (PyCFunction)_pickle_Pickler___sizeof__, METH_NOARGS, _pickle_Pickler___sizeof____doc__},
|
||||
|
||||
static Py_ssize_t
|
||||
_pickle_Pickler___sizeof___impl(PicklerObject *self);
|
||||
|
||||
static PyObject *
|
||||
_pickle_Pickler___sizeof__(PicklerObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t _return_value;
|
||||
|
||||
_return_value = _pickle_Pickler___sizeof___impl(self);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromSsize_t(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_pickle_Pickler___init____doc__,
|
||||
"Pickler(file, protocol=None, fix_imports=True)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"This takes a binary file for writing a pickle data stream.\n"
|
||||
"\n"
|
||||
"The optional *protocol* argument tells the pickler to use the given\n"
|
||||
"protocol; supported protocols are 0, 1, 2, 3 and 4. The default\n"
|
||||
"protocol is 3; a backward-incompatible protocol designed for Python 3.\n"
|
||||
"\n"
|
||||
"Specifying a negative protocol version selects the highest protocol\n"
|
||||
"version supported. The higher the protocol used, the more recent the\n"
|
||||
"version of Python needed to read the pickle produced.\n"
|
||||
"\n"
|
||||
"The *file* argument must have a write() method that accepts a single\n"
|
||||
"bytes argument. It can thus be a file object opened for binary\n"
|
||||
"writing, an io.BytesIO instance, or any other custom object that meets\n"
|
||||
"this interface.\n"
|
||||
"\n"
|
||||
"If *fix_imports* is True and protocol is less than 3, pickle will try\n"
|
||||
"to map the new Python 3 names to the old module names used in Python\n"
|
||||
"2, so that the pickle data stream is readable with Python 2.");
|
||||
|
||||
static int
|
||||
_pickle_Pickler___init___impl(PicklerObject *self, PyObject *file,
|
||||
PyObject *protocol, int fix_imports);
|
||||
|
||||
static int
|
||||
_pickle_Pickler___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
int return_value = -1;
|
||||
static const char * const _keywords[] = {"file", "protocol", "fix_imports", NULL};
|
||||
static _PyArg_Parser _parser = {"O|Op:Pickler", _keywords, 0};
|
||||
PyObject *file;
|
||||
PyObject *protocol = NULL;
|
||||
int fix_imports = 1;
|
||||
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
|
||||
&file, &protocol, &fix_imports)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _pickle_Pickler___init___impl((PicklerObject *)self, file, protocol, fix_imports);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_pickle_PicklerMemoProxy_clear__doc__,
|
||||
"clear($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Remove all items from memo.");
|
||||
|
||||
#define _PICKLE_PICKLERMEMOPROXY_CLEAR_METHODDEF \
|
||||
{"clear", (PyCFunction)_pickle_PicklerMemoProxy_clear, METH_NOARGS, _pickle_PicklerMemoProxy_clear__doc__},
|
||||
|
||||
static PyObject *
|
||||
_pickle_PicklerMemoProxy_clear_impl(PicklerMemoProxyObject *self);
|
||||
|
||||
static PyObject *
|
||||
_pickle_PicklerMemoProxy_clear(PicklerMemoProxyObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _pickle_PicklerMemoProxy_clear_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_pickle_PicklerMemoProxy_copy__doc__,
|
||||
"copy($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Copy the memo to a new object.");
|
||||
|
||||
#define _PICKLE_PICKLERMEMOPROXY_COPY_METHODDEF \
|
||||
{"copy", (PyCFunction)_pickle_PicklerMemoProxy_copy, METH_NOARGS, _pickle_PicklerMemoProxy_copy__doc__},
|
||||
|
||||
static PyObject *
|
||||
_pickle_PicklerMemoProxy_copy_impl(PicklerMemoProxyObject *self);
|
||||
|
||||
static PyObject *
|
||||
_pickle_PicklerMemoProxy_copy(PicklerMemoProxyObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _pickle_PicklerMemoProxy_copy_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_pickle_PicklerMemoProxy___reduce____doc__,
|
||||
"__reduce__($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Implement pickle support.");
|
||||
|
||||
#define _PICKLE_PICKLERMEMOPROXY___REDUCE___METHODDEF \
|
||||
{"__reduce__", (PyCFunction)_pickle_PicklerMemoProxy___reduce__, METH_NOARGS, _pickle_PicklerMemoProxy___reduce____doc__},
|
||||
|
||||
static PyObject *
|
||||
_pickle_PicklerMemoProxy___reduce___impl(PicklerMemoProxyObject *self);
|
||||
|
||||
static PyObject *
|
||||
_pickle_PicklerMemoProxy___reduce__(PicklerMemoProxyObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _pickle_PicklerMemoProxy___reduce___impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_pickle_Unpickler_load__doc__,
|
||||
"load($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Load a pickle.\n"
|
||||
"\n"
|
||||
"Read a pickled object representation from the open file object given\n"
|
||||
"in the constructor, and return the reconstituted object hierarchy\n"
|
||||
"specified therein.");
|
||||
|
||||
#define _PICKLE_UNPICKLER_LOAD_METHODDEF \
|
||||
{"load", (PyCFunction)_pickle_Unpickler_load, METH_NOARGS, _pickle_Unpickler_load__doc__},
|
||||
|
||||
static PyObject *
|
||||
_pickle_Unpickler_load_impl(UnpicklerObject *self);
|
||||
|
||||
static PyObject *
|
||||
_pickle_Unpickler_load(UnpicklerObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _pickle_Unpickler_load_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_pickle_Unpickler_find_class__doc__,
|
||||
"find_class($self, module_name, global_name, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return an object from a specified module.\n"
|
||||
"\n"
|
||||
"If necessary, the module will be imported. Subclasses may override\n"
|
||||
"this method (e.g. to restrict unpickling of arbitrary classes and\n"
|
||||
"functions).\n"
|
||||
"\n"
|
||||
"This method is called whenever a class or a function object is\n"
|
||||
"needed. Both arguments passed are str objects.");
|
||||
|
||||
#define _PICKLE_UNPICKLER_FIND_CLASS_METHODDEF \
|
||||
{"find_class", (PyCFunction)_pickle_Unpickler_find_class, METH_VARARGS, _pickle_Unpickler_find_class__doc__},
|
||||
|
||||
static PyObject *
|
||||
_pickle_Unpickler_find_class_impl(UnpicklerObject *self,
|
||||
PyObject *module_name,
|
||||
PyObject *global_name);
|
||||
|
||||
static PyObject *
|
||||
_pickle_Unpickler_find_class(UnpicklerObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *module_name;
|
||||
PyObject *global_name;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "find_class",
|
||||
2, 2,
|
||||
&module_name, &global_name)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _pickle_Unpickler_find_class_impl(self, module_name, global_name);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_pickle_Unpickler___sizeof____doc__,
|
||||
"__sizeof__($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns size in memory, in bytes.");
|
||||
|
||||
#define _PICKLE_UNPICKLER___SIZEOF___METHODDEF \
|
||||
{"__sizeof__", (PyCFunction)_pickle_Unpickler___sizeof__, METH_NOARGS, _pickle_Unpickler___sizeof____doc__},
|
||||
|
||||
static Py_ssize_t
|
||||
_pickle_Unpickler___sizeof___impl(UnpicklerObject *self);
|
||||
|
||||
static PyObject *
|
||||
_pickle_Unpickler___sizeof__(UnpicklerObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t _return_value;
|
||||
|
||||
_return_value = _pickle_Unpickler___sizeof___impl(self);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromSsize_t(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_pickle_Unpickler___init____doc__,
|
||||
"Unpickler(file, *, fix_imports=True, encoding=\'ASCII\', errors=\'strict\')\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"This takes a binary file for reading a pickle data stream.\n"
|
||||
"\n"
|
||||
"The protocol version of the pickle is detected automatically, so no\n"
|
||||
"protocol argument is needed. Bytes past the pickled object\'s\n"
|
||||
"representation are ignored.\n"
|
||||
"\n"
|
||||
"The argument *file* must have two methods, a read() method that takes\n"
|
||||
"an integer argument, and a readline() method that requires no\n"
|
||||
"arguments. Both methods should return bytes. Thus *file* can be a\n"
|
||||
"binary file object opened for reading, an io.BytesIO object, or any\n"
|
||||
"other custom object that meets this interface.\n"
|
||||
"\n"
|
||||
"Optional keyword arguments are *fix_imports*, *encoding* and *errors*,\n"
|
||||
"which are used to control compatibility support for pickle stream\n"
|
||||
"generated by Python 2. If *fix_imports* is True, pickle will try to\n"
|
||||
"map the old Python 2 names to the new names used in Python 3. The\n"
|
||||
"*encoding* and *errors* tell pickle how to decode 8-bit string\n"
|
||||
"instances pickled by Python 2; these default to \'ASCII\' and \'strict\',\n"
|
||||
"respectively. The *encoding* can be \'bytes\' to read these 8-bit\n"
|
||||
"string instances as bytes objects.");
|
||||
|
||||
static int
|
||||
_pickle_Unpickler___init___impl(UnpicklerObject *self, PyObject *file,
|
||||
int fix_imports, const char *encoding,
|
||||
const char *errors);
|
||||
|
||||
static int
|
||||
_pickle_Unpickler___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
int return_value = -1;
|
||||
static const char * const _keywords[] = {"file", "fix_imports", "encoding", "errors", NULL};
|
||||
static _PyArg_Parser _parser = {"O|$pss:Unpickler", _keywords, 0};
|
||||
PyObject *file;
|
||||
int fix_imports = 1;
|
||||
const char *encoding = "ASCII";
|
||||
const char *errors = "strict";
|
||||
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
|
||||
&file, &fix_imports, &encoding, &errors)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _pickle_Unpickler___init___impl((UnpicklerObject *)self, file, fix_imports, encoding, errors);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_clear__doc__,
|
||||
"clear($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Remove all items from memo.");
|
||||
|
||||
#define _PICKLE_UNPICKLERMEMOPROXY_CLEAR_METHODDEF \
|
||||
{"clear", (PyCFunction)_pickle_UnpicklerMemoProxy_clear, METH_NOARGS, _pickle_UnpicklerMemoProxy_clear__doc__},
|
||||
|
||||
static PyObject *
|
||||
_pickle_UnpicklerMemoProxy_clear_impl(UnpicklerMemoProxyObject *self);
|
||||
|
||||
static PyObject *
|
||||
_pickle_UnpicklerMemoProxy_clear(UnpicklerMemoProxyObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _pickle_UnpicklerMemoProxy_clear_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_copy__doc__,
|
||||
"copy($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Copy the memo to a new object.");
|
||||
|
||||
#define _PICKLE_UNPICKLERMEMOPROXY_COPY_METHODDEF \
|
||||
{"copy", (PyCFunction)_pickle_UnpicklerMemoProxy_copy, METH_NOARGS, _pickle_UnpicklerMemoProxy_copy__doc__},
|
||||
|
||||
static PyObject *
|
||||
_pickle_UnpicklerMemoProxy_copy_impl(UnpicklerMemoProxyObject *self);
|
||||
|
||||
static PyObject *
|
||||
_pickle_UnpicklerMemoProxy_copy(UnpicklerMemoProxyObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _pickle_UnpicklerMemoProxy_copy_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_pickle_UnpicklerMemoProxy___reduce____doc__,
|
||||
"__reduce__($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Implement pickling support.");
|
||||
|
||||
#define _PICKLE_UNPICKLERMEMOPROXY___REDUCE___METHODDEF \
|
||||
{"__reduce__", (PyCFunction)_pickle_UnpicklerMemoProxy___reduce__, METH_NOARGS, _pickle_UnpicklerMemoProxy___reduce____doc__},
|
||||
|
||||
static PyObject *
|
||||
_pickle_UnpicklerMemoProxy___reduce___impl(UnpicklerMemoProxyObject *self);
|
||||
|
||||
static PyObject *
|
||||
_pickle_UnpicklerMemoProxy___reduce__(UnpicklerMemoProxyObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _pickle_UnpicklerMemoProxy___reduce___impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_pickle_dump__doc__,
|
||||
"dump($module, /, obj, file, protocol=None, *, fix_imports=True)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Write a pickled representation of obj to the open file object file.\n"
|
||||
"\n"
|
||||
"This is equivalent to ``Pickler(file, protocol).dump(obj)``, but may\n"
|
||||
"be more efficient.\n"
|
||||
"\n"
|
||||
"The optional *protocol* argument tells the pickler to use the given\n"
|
||||
"protocol supported protocols are 0, 1, 2, 3 and 4. The default\n"
|
||||
"protocol is 3; a backward-incompatible protocol designed for Python 3.\n"
|
||||
"\n"
|
||||
"Specifying a negative protocol version selects the highest protocol\n"
|
||||
"version supported. The higher the protocol used, the more recent the\n"
|
||||
"version of Python needed to read the pickle produced.\n"
|
||||
"\n"
|
||||
"The *file* argument must have a write() method that accepts a single\n"
|
||||
"bytes argument. It can thus be a file object opened for binary\n"
|
||||
"writing, an io.BytesIO instance, or any other custom object that meets\n"
|
||||
"this interface.\n"
|
||||
"\n"
|
||||
"If *fix_imports* is True and protocol is less than 3, pickle will try\n"
|
||||
"to map the new Python 3 names to the old module names used in Python\n"
|
||||
"2, so that the pickle data stream is readable with Python 2.");
|
||||
|
||||
#define _PICKLE_DUMP_METHODDEF \
|
||||
{"dump", (PyCFunction)_pickle_dump, METH_FASTCALL, _pickle_dump__doc__},
|
||||
|
||||
static PyObject *
|
||||
_pickle_dump_impl(PyObject *module, PyObject *obj, PyObject *file,
|
||||
PyObject *protocol, int fix_imports);
|
||||
|
||||
static PyObject *
|
||||
_pickle_dump(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"obj", "file", "protocol", "fix_imports", NULL};
|
||||
static _PyArg_Parser _parser = {"OO|O$p:dump", _keywords, 0};
|
||||
PyObject *obj;
|
||||
PyObject *file;
|
||||
PyObject *protocol = NULL;
|
||||
int fix_imports = 1;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&obj, &file, &protocol, &fix_imports)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _pickle_dump_impl(module, obj, file, protocol, fix_imports);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_pickle_dumps__doc__,
|
||||
"dumps($module, /, obj, protocol=None, *, fix_imports=True)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the pickled representation of the object as a bytes object.\n"
|
||||
"\n"
|
||||
"The optional *protocol* argument tells the pickler to use the given\n"
|
||||
"protocol; supported protocols are 0, 1, 2, 3 and 4. The default\n"
|
||||
"protocol is 3; a backward-incompatible protocol designed for Python 3.\n"
|
||||
"\n"
|
||||
"Specifying a negative protocol version selects the highest protocol\n"
|
||||
"version supported. The higher the protocol used, the more recent the\n"
|
||||
"version of Python needed to read the pickle produced.\n"
|
||||
"\n"
|
||||
"If *fix_imports* is True and *protocol* is less than 3, pickle will\n"
|
||||
"try to map the new Python 3 names to the old module names used in\n"
|
||||
"Python 2, so that the pickle data stream is readable with Python 2.");
|
||||
|
||||
#define _PICKLE_DUMPS_METHODDEF \
|
||||
{"dumps", (PyCFunction)_pickle_dumps, METH_FASTCALL, _pickle_dumps__doc__},
|
||||
|
||||
static PyObject *
|
||||
_pickle_dumps_impl(PyObject *module, PyObject *obj, PyObject *protocol,
|
||||
int fix_imports);
|
||||
|
||||
static PyObject *
|
||||
_pickle_dumps(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"obj", "protocol", "fix_imports", NULL};
|
||||
static _PyArg_Parser _parser = {"O|O$p:dumps", _keywords, 0};
|
||||
PyObject *obj;
|
||||
PyObject *protocol = NULL;
|
||||
int fix_imports = 1;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&obj, &protocol, &fix_imports)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _pickle_dumps_impl(module, obj, protocol, fix_imports);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_pickle_load__doc__,
|
||||
"load($module, /, file, *, fix_imports=True, encoding=\'ASCII\',\n"
|
||||
" errors=\'strict\')\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Read and return an object from the pickle data stored in a file.\n"
|
||||
"\n"
|
||||
"This is equivalent to ``Unpickler(file).load()``, but may be more\n"
|
||||
"efficient.\n"
|
||||
"\n"
|
||||
"The protocol version of the pickle is detected automatically, so no\n"
|
||||
"protocol argument is needed. Bytes past the pickled object\'s\n"
|
||||
"representation are ignored.\n"
|
||||
"\n"
|
||||
"The argument *file* must have two methods, a read() method that takes\n"
|
||||
"an integer argument, and a readline() method that requires no\n"
|
||||
"arguments. Both methods should return bytes. Thus *file* can be a\n"
|
||||
"binary file object opened for reading, an io.BytesIO object, or any\n"
|
||||
"other custom object that meets this interface.\n"
|
||||
"\n"
|
||||
"Optional keyword arguments are *fix_imports*, *encoding* and *errors*,\n"
|
||||
"which are used to control compatibility support for pickle stream\n"
|
||||
"generated by Python 2. If *fix_imports* is True, pickle will try to\n"
|
||||
"map the old Python 2 names to the new names used in Python 3. The\n"
|
||||
"*encoding* and *errors* tell pickle how to decode 8-bit string\n"
|
||||
"instances pickled by Python 2; these default to \'ASCII\' and \'strict\',\n"
|
||||
"respectively. The *encoding* can be \'bytes\' to read these 8-bit\n"
|
||||
"string instances as bytes objects.");
|
||||
|
||||
#define _PICKLE_LOAD_METHODDEF \
|
||||
{"load", (PyCFunction)_pickle_load, METH_FASTCALL, _pickle_load__doc__},
|
||||
|
||||
static PyObject *
|
||||
_pickle_load_impl(PyObject *module, PyObject *file, int fix_imports,
|
||||
const char *encoding, const char *errors);
|
||||
|
||||
static PyObject *
|
||||
_pickle_load(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"file", "fix_imports", "encoding", "errors", NULL};
|
||||
static _PyArg_Parser _parser = {"O|$pss:load", _keywords, 0};
|
||||
PyObject *file;
|
||||
int fix_imports = 1;
|
||||
const char *encoding = "ASCII";
|
||||
const char *errors = "strict";
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&file, &fix_imports, &encoding, &errors)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _pickle_load_impl(module, file, fix_imports, encoding, errors);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_pickle_loads__doc__,
|
||||
"loads($module, /, data, *, fix_imports=True, encoding=\'ASCII\',\n"
|
||||
" errors=\'strict\')\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Read and return an object from the given pickle data.\n"
|
||||
"\n"
|
||||
"The protocol version of the pickle is detected automatically, so no\n"
|
||||
"protocol argument is needed. Bytes past the pickled object\'s\n"
|
||||
"representation are ignored.\n"
|
||||
"\n"
|
||||
"Optional keyword arguments are *fix_imports*, *encoding* and *errors*,\n"
|
||||
"which are used to control compatibility support for pickle stream\n"
|
||||
"generated by Python 2. If *fix_imports* is True, pickle will try to\n"
|
||||
"map the old Python 2 names to the new names used in Python 3. The\n"
|
||||
"*encoding* and *errors* tell pickle how to decode 8-bit string\n"
|
||||
"instances pickled by Python 2; these default to \'ASCII\' and \'strict\',\n"
|
||||
"respectively. The *encoding* can be \'bytes\' to read these 8-bit\n"
|
||||
"string instances as bytes objects.");
|
||||
|
||||
#define _PICKLE_LOADS_METHODDEF \
|
||||
{"loads", (PyCFunction)_pickle_loads, METH_FASTCALL, _pickle_loads__doc__},
|
||||
|
||||
static PyObject *
|
||||
_pickle_loads_impl(PyObject *module, PyObject *data, int fix_imports,
|
||||
const char *encoding, const char *errors);
|
||||
|
||||
static PyObject *
|
||||
_pickle_loads(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"data", "fix_imports", "encoding", "errors", NULL};
|
||||
static _PyArg_Parser _parser = {"O|$pss:loads", _keywords, 0};
|
||||
PyObject *data;
|
||||
int fix_imports = 1;
|
||||
const char *encoding = "ASCII";
|
||||
const char *errors = "strict";
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&data, &fix_imports, &encoding, &errors)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _pickle_loads_impl(module, data, fix_imports, encoding, errors);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=82be137b3c09cb9f input=a9049054013a1b77]*/
|
731
third_party/python/Modules/clinic/_sre.c.h
generated
vendored
Normal file
731
third_party/python/Modules/clinic/_sre.c.h
generated
vendored
Normal file
|
@ -0,0 +1,731 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(_sre_getcodesize__doc__,
|
||||
"getcodesize($module, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _SRE_GETCODESIZE_METHODDEF \
|
||||
{"getcodesize", (PyCFunction)_sre_getcodesize, METH_NOARGS, _sre_getcodesize__doc__},
|
||||
|
||||
static int
|
||||
_sre_getcodesize_impl(PyObject *module);
|
||||
|
||||
static PyObject *
|
||||
_sre_getcodesize(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int _return_value;
|
||||
|
||||
_return_value = _sre_getcodesize_impl(module);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromLong((long)_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_getlower__doc__,
|
||||
"getlower($module, character, flags, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _SRE_GETLOWER_METHODDEF \
|
||||
{"getlower", (PyCFunction)_sre_getlower, METH_VARARGS, _sre_getlower__doc__},
|
||||
|
||||
static int
|
||||
_sre_getlower_impl(PyObject *module, int character, int flags);
|
||||
|
||||
static PyObject *
|
||||
_sre_getlower(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int character;
|
||||
int flags;
|
||||
int _return_value;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "ii:getlower",
|
||||
&character, &flags)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = _sre_getlower_impl(module, character, flags);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromLong((long)_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Pattern_match__doc__,
|
||||
"match($self, /, string=None, pos=0, endpos=sys.maxsize, *, pattern=None)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Matches zero or more characters at the beginning of the string.");
|
||||
|
||||
#define _SRE_SRE_PATTERN_MATCH_METHODDEF \
|
||||
{"match", (PyCFunction)_sre_SRE_Pattern_match, METH_FASTCALL, _sre_SRE_Pattern_match__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern_match_impl(PatternObject *self, PyObject *string,
|
||||
Py_ssize_t pos, Py_ssize_t endpos,
|
||||
PyObject *pattern);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern_match(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"string", "pos", "endpos", "pattern", NULL};
|
||||
static _PyArg_Parser _parser = {"|Onn$O:match", _keywords, 0};
|
||||
PyObject *string = NULL;
|
||||
Py_ssize_t pos = 0;
|
||||
Py_ssize_t endpos = PY_SSIZE_T_MAX;
|
||||
PyObject *pattern = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&string, &pos, &endpos, &pattern)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sre_SRE_Pattern_match_impl(self, string, pos, endpos, pattern);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Pattern_fullmatch__doc__,
|
||||
"fullmatch($self, /, string=None, pos=0, endpos=sys.maxsize, *,\n"
|
||||
" pattern=None)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Matches against all of the string");
|
||||
|
||||
#define _SRE_SRE_PATTERN_FULLMATCH_METHODDEF \
|
||||
{"fullmatch", (PyCFunction)_sre_SRE_Pattern_fullmatch, METH_FASTCALL, _sre_SRE_Pattern_fullmatch__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern_fullmatch_impl(PatternObject *self, PyObject *string,
|
||||
Py_ssize_t pos, Py_ssize_t endpos,
|
||||
PyObject *pattern);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern_fullmatch(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"string", "pos", "endpos", "pattern", NULL};
|
||||
static _PyArg_Parser _parser = {"|Onn$O:fullmatch", _keywords, 0};
|
||||
PyObject *string = NULL;
|
||||
Py_ssize_t pos = 0;
|
||||
Py_ssize_t endpos = PY_SSIZE_T_MAX;
|
||||
PyObject *pattern = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&string, &pos, &endpos, &pattern)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sre_SRE_Pattern_fullmatch_impl(self, string, pos, endpos, pattern);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Pattern_search__doc__,
|
||||
"search($self, /, string=None, pos=0, endpos=sys.maxsize, *,\n"
|
||||
" pattern=None)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Scan through string looking for a match, and return a corresponding match object instance.\n"
|
||||
"\n"
|
||||
"Return None if no position in the string matches.");
|
||||
|
||||
#define _SRE_SRE_PATTERN_SEARCH_METHODDEF \
|
||||
{"search", (PyCFunction)_sre_SRE_Pattern_search, METH_FASTCALL, _sre_SRE_Pattern_search__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern_search_impl(PatternObject *self, PyObject *string,
|
||||
Py_ssize_t pos, Py_ssize_t endpos,
|
||||
PyObject *pattern);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern_search(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"string", "pos", "endpos", "pattern", NULL};
|
||||
static _PyArg_Parser _parser = {"|Onn$O:search", _keywords, 0};
|
||||
PyObject *string = NULL;
|
||||
Py_ssize_t pos = 0;
|
||||
Py_ssize_t endpos = PY_SSIZE_T_MAX;
|
||||
PyObject *pattern = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&string, &pos, &endpos, &pattern)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sre_SRE_Pattern_search_impl(self, string, pos, endpos, pattern);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Pattern_findall__doc__,
|
||||
"findall($self, /, string=None, pos=0, endpos=sys.maxsize, *,\n"
|
||||
" source=None)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a list of all non-overlapping matches of pattern in string.");
|
||||
|
||||
#define _SRE_SRE_PATTERN_FINDALL_METHODDEF \
|
||||
{"findall", (PyCFunction)_sre_SRE_Pattern_findall, METH_FASTCALL, _sre_SRE_Pattern_findall__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern_findall_impl(PatternObject *self, PyObject *string,
|
||||
Py_ssize_t pos, Py_ssize_t endpos,
|
||||
PyObject *source);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern_findall(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"string", "pos", "endpos", "source", NULL};
|
||||
static _PyArg_Parser _parser = {"|Onn$O:findall", _keywords, 0};
|
||||
PyObject *string = NULL;
|
||||
Py_ssize_t pos = 0;
|
||||
Py_ssize_t endpos = PY_SSIZE_T_MAX;
|
||||
PyObject *source = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&string, &pos, &endpos, &source)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sre_SRE_Pattern_findall_impl(self, string, pos, endpos, source);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Pattern_finditer__doc__,
|
||||
"finditer($self, /, string, pos=0, endpos=sys.maxsize)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return an iterator over all non-overlapping matches for the RE pattern in string.\n"
|
||||
"\n"
|
||||
"For each match, the iterator returns a match object.");
|
||||
|
||||
#define _SRE_SRE_PATTERN_FINDITER_METHODDEF \
|
||||
{"finditer", (PyCFunction)_sre_SRE_Pattern_finditer, METH_FASTCALL, _sre_SRE_Pattern_finditer__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern_finditer_impl(PatternObject *self, PyObject *string,
|
||||
Py_ssize_t pos, Py_ssize_t endpos);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern_finditer(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"string", "pos", "endpos", NULL};
|
||||
static _PyArg_Parser _parser = {"O|nn:finditer", _keywords, 0};
|
||||
PyObject *string;
|
||||
Py_ssize_t pos = 0;
|
||||
Py_ssize_t endpos = PY_SSIZE_T_MAX;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&string, &pos, &endpos)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sre_SRE_Pattern_finditer_impl(self, string, pos, endpos);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Pattern_scanner__doc__,
|
||||
"scanner($self, /, string, pos=0, endpos=sys.maxsize)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _SRE_SRE_PATTERN_SCANNER_METHODDEF \
|
||||
{"scanner", (PyCFunction)_sre_SRE_Pattern_scanner, METH_FASTCALL, _sre_SRE_Pattern_scanner__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern_scanner_impl(PatternObject *self, PyObject *string,
|
||||
Py_ssize_t pos, Py_ssize_t endpos);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern_scanner(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"string", "pos", "endpos", NULL};
|
||||
static _PyArg_Parser _parser = {"O|nn:scanner", _keywords, 0};
|
||||
PyObject *string;
|
||||
Py_ssize_t pos = 0;
|
||||
Py_ssize_t endpos = PY_SSIZE_T_MAX;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&string, &pos, &endpos)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sre_SRE_Pattern_scanner_impl(self, string, pos, endpos);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Pattern_split__doc__,
|
||||
"split($self, /, string=None, maxsplit=0, *, source=None)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Split string by the occurrences of pattern.");
|
||||
|
||||
#define _SRE_SRE_PATTERN_SPLIT_METHODDEF \
|
||||
{"split", (PyCFunction)_sre_SRE_Pattern_split, METH_FASTCALL, _sre_SRE_Pattern_split__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern_split_impl(PatternObject *self, PyObject *string,
|
||||
Py_ssize_t maxsplit, PyObject *source);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern_split(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"string", "maxsplit", "source", NULL};
|
||||
static _PyArg_Parser _parser = {"|On$O:split", _keywords, 0};
|
||||
PyObject *string = NULL;
|
||||
Py_ssize_t maxsplit = 0;
|
||||
PyObject *source = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&string, &maxsplit, &source)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sre_SRE_Pattern_split_impl(self, string, maxsplit, source);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Pattern_sub__doc__,
|
||||
"sub($self, /, repl, string, count=0)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.");
|
||||
|
||||
#define _SRE_SRE_PATTERN_SUB_METHODDEF \
|
||||
{"sub", (PyCFunction)_sre_SRE_Pattern_sub, METH_FASTCALL, _sre_SRE_Pattern_sub__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern_sub_impl(PatternObject *self, PyObject *repl,
|
||||
PyObject *string, Py_ssize_t count);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern_sub(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"repl", "string", "count", NULL};
|
||||
static _PyArg_Parser _parser = {"OO|n:sub", _keywords, 0};
|
||||
PyObject *repl;
|
||||
PyObject *string;
|
||||
Py_ssize_t count = 0;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&repl, &string, &count)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sre_SRE_Pattern_sub_impl(self, repl, string, count);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Pattern_subn__doc__,
|
||||
"subn($self, /, repl, string, count=0)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the tuple (new_string, number_of_subs_made) found by replacing the leftmost non-overlapping occurrences of pattern with the replacement repl.");
|
||||
|
||||
#define _SRE_SRE_PATTERN_SUBN_METHODDEF \
|
||||
{"subn", (PyCFunction)_sre_SRE_Pattern_subn, METH_FASTCALL, _sre_SRE_Pattern_subn__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern_subn_impl(PatternObject *self, PyObject *repl,
|
||||
PyObject *string, Py_ssize_t count);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern_subn(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"repl", "string", "count", NULL};
|
||||
static _PyArg_Parser _parser = {"OO|n:subn", _keywords, 0};
|
||||
PyObject *repl;
|
||||
PyObject *string;
|
||||
Py_ssize_t count = 0;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&repl, &string, &count)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sre_SRE_Pattern_subn_impl(self, repl, string, count);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Pattern___copy____doc__,
|
||||
"__copy__($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _SRE_SRE_PATTERN___COPY___METHODDEF \
|
||||
{"__copy__", (PyCFunction)_sre_SRE_Pattern___copy__, METH_NOARGS, _sre_SRE_Pattern___copy____doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern___copy___impl(PatternObject *self);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern___copy__(PatternObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _sre_SRE_Pattern___copy___impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Pattern___deepcopy____doc__,
|
||||
"__deepcopy__($self, /, memo)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _SRE_SRE_PATTERN___DEEPCOPY___METHODDEF \
|
||||
{"__deepcopy__", (PyCFunction)_sre_SRE_Pattern___deepcopy__, METH_FASTCALL, _sre_SRE_Pattern___deepcopy____doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern___deepcopy___impl(PatternObject *self, PyObject *memo);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Pattern___deepcopy__(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"memo", NULL};
|
||||
static _PyArg_Parser _parser = {"O:__deepcopy__", _keywords, 0};
|
||||
PyObject *memo;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&memo)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sre_SRE_Pattern___deepcopy___impl(self, memo);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_compile__doc__,
|
||||
"compile($module, /, pattern, flags, code, groups, groupindex,\n"
|
||||
" indexgroup)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _SRE_COMPILE_METHODDEF \
|
||||
{"compile", (PyCFunction)_sre_compile, METH_FASTCALL, _sre_compile__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_compile_impl(PyObject *module, PyObject *pattern, int flags,
|
||||
PyObject *code, Py_ssize_t groups, PyObject *groupindex,
|
||||
PyObject *indexgroup);
|
||||
|
||||
static PyObject *
|
||||
_sre_compile(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"pattern", "flags", "code", "groups", "groupindex", "indexgroup", NULL};
|
||||
static _PyArg_Parser _parser = {"OiO!nOO:compile", _keywords, 0};
|
||||
PyObject *pattern;
|
||||
int flags;
|
||||
PyObject *code;
|
||||
Py_ssize_t groups;
|
||||
PyObject *groupindex;
|
||||
PyObject *indexgroup;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&pattern, &flags, &PyList_Type, &code, &groups, &groupindex, &indexgroup)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sre_compile_impl(module, pattern, flags, code, groups, groupindex, indexgroup);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Match_expand__doc__,
|
||||
"expand($self, /, template)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the string obtained by doing backslash substitution on the string template, as done by the sub() method.");
|
||||
|
||||
#define _SRE_SRE_MATCH_EXPAND_METHODDEF \
|
||||
{"expand", (PyCFunction)_sre_SRE_Match_expand, METH_FASTCALL, _sre_SRE_Match_expand__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Match_expand_impl(MatchObject *self, PyObject *template);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Match_expand(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"template", NULL};
|
||||
static _PyArg_Parser _parser = {"O:expand", _keywords, 0};
|
||||
PyObject *template;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&template)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sre_SRE_Match_expand_impl(self, template);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Match_groups__doc__,
|
||||
"groups($self, /, default=None)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a tuple containing all the subgroups of the match, from 1.\n"
|
||||
"\n"
|
||||
" default\n"
|
||||
" Is used for groups that did not participate in the match.");
|
||||
|
||||
#define _SRE_SRE_MATCH_GROUPS_METHODDEF \
|
||||
{"groups", (PyCFunction)_sre_SRE_Match_groups, METH_FASTCALL, _sre_SRE_Match_groups__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Match_groups_impl(MatchObject *self, PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Match_groups(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"default", NULL};
|
||||
static _PyArg_Parser _parser = {"|O:groups", _keywords, 0};
|
||||
PyObject *default_value = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sre_SRE_Match_groups_impl(self, default_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Match_groupdict__doc__,
|
||||
"groupdict($self, /, default=None)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a dictionary containing all the named subgroups of the match, keyed by the subgroup name.\n"
|
||||
"\n"
|
||||
" default\n"
|
||||
" Is used for groups that did not participate in the match.");
|
||||
|
||||
#define _SRE_SRE_MATCH_GROUPDICT_METHODDEF \
|
||||
{"groupdict", (PyCFunction)_sre_SRE_Match_groupdict, METH_FASTCALL, _sre_SRE_Match_groupdict__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Match_groupdict_impl(MatchObject *self, PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Match_groupdict(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"default", NULL};
|
||||
static _PyArg_Parser _parser = {"|O:groupdict", _keywords, 0};
|
||||
PyObject *default_value = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sre_SRE_Match_groupdict_impl(self, default_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Match_start__doc__,
|
||||
"start($self, group=0, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return index of the start of the substring matched by group.");
|
||||
|
||||
#define _SRE_SRE_MATCH_START_METHODDEF \
|
||||
{"start", (PyCFunction)_sre_SRE_Match_start, METH_VARARGS, _sre_SRE_Match_start__doc__},
|
||||
|
||||
static Py_ssize_t
|
||||
_sre_SRE_Match_start_impl(MatchObject *self, PyObject *group);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Match_start(MatchObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *group = NULL;
|
||||
Py_ssize_t _return_value;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "start",
|
||||
0, 1,
|
||||
&group)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = _sre_SRE_Match_start_impl(self, group);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromSsize_t(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Match_end__doc__,
|
||||
"end($self, group=0, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return index of the end of the substring matched by group.");
|
||||
|
||||
#define _SRE_SRE_MATCH_END_METHODDEF \
|
||||
{"end", (PyCFunction)_sre_SRE_Match_end, METH_VARARGS, _sre_SRE_Match_end__doc__},
|
||||
|
||||
static Py_ssize_t
|
||||
_sre_SRE_Match_end_impl(MatchObject *self, PyObject *group);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Match_end(MatchObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *group = NULL;
|
||||
Py_ssize_t _return_value;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "end",
|
||||
0, 1,
|
||||
&group)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = _sre_SRE_Match_end_impl(self, group);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromSsize_t(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Match_span__doc__,
|
||||
"span($self, group=0, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"For MatchObject m, return the 2-tuple (m.start(group), m.end(group)).");
|
||||
|
||||
#define _SRE_SRE_MATCH_SPAN_METHODDEF \
|
||||
{"span", (PyCFunction)_sre_SRE_Match_span, METH_VARARGS, _sre_SRE_Match_span__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Match_span_impl(MatchObject *self, PyObject *group);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Match_span(MatchObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *group = NULL;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "span",
|
||||
0, 1,
|
||||
&group)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sre_SRE_Match_span_impl(self, group);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Match___copy____doc__,
|
||||
"__copy__($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _SRE_SRE_MATCH___COPY___METHODDEF \
|
||||
{"__copy__", (PyCFunction)_sre_SRE_Match___copy__, METH_NOARGS, _sre_SRE_Match___copy____doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Match___copy___impl(MatchObject *self);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Match___copy__(MatchObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _sre_SRE_Match___copy___impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Match___deepcopy____doc__,
|
||||
"__deepcopy__($self, /, memo)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _SRE_SRE_MATCH___DEEPCOPY___METHODDEF \
|
||||
{"__deepcopy__", (PyCFunction)_sre_SRE_Match___deepcopy__, METH_FASTCALL, _sre_SRE_Match___deepcopy____doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Match___deepcopy___impl(MatchObject *self, PyObject *memo);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Match___deepcopy__(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"memo", NULL};
|
||||
static _PyArg_Parser _parser = {"O:__deepcopy__", _keywords, 0};
|
||||
PyObject *memo;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&memo)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sre_SRE_Match___deepcopy___impl(self, memo);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Scanner_match__doc__,
|
||||
"match($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _SRE_SRE_SCANNER_MATCH_METHODDEF \
|
||||
{"match", (PyCFunction)_sre_SRE_Scanner_match, METH_NOARGS, _sre_SRE_Scanner_match__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Scanner_match_impl(ScannerObject *self);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Scanner_match(ScannerObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _sre_SRE_Scanner_match_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sre_SRE_Scanner_search__doc__,
|
||||
"search($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _SRE_SRE_SCANNER_SEARCH_METHODDEF \
|
||||
{"search", (PyCFunction)_sre_SRE_Scanner_search, METH_NOARGS, _sre_SRE_Scanner_search__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Scanner_search_impl(ScannerObject *self);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Scanner_search(ScannerObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _sre_SRE_Scanner_search_impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=a4a246bca1963bc9 input=a9049054013a1b77]*/
|
1189
third_party/python/Modules/clinic/_ssl.c.h
generated
vendored
Normal file
1189
third_party/python/Modules/clinic/_ssl.c.h
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
641
third_party/python/Modules/clinic/_tkinter.c.h
generated
vendored
Normal file
641
third_party/python/Modules/clinic/_tkinter.c.h
generated
vendored
Normal file
|
@ -0,0 +1,641 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_eval__doc__,
|
||||
"eval($self, script, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_EVAL_METHODDEF \
|
||||
{"eval", (PyCFunction)_tkinter_tkapp_eval, METH_O, _tkinter_tkapp_eval__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_eval_impl(TkappObject *self, const char *script);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_eval(TkappObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *script;
|
||||
|
||||
if (!PyArg_Parse(arg, "s:eval", &script)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _tkinter_tkapp_eval_impl(self, script);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_evalfile__doc__,
|
||||
"evalfile($self, fileName, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_EVALFILE_METHODDEF \
|
||||
{"evalfile", (PyCFunction)_tkinter_tkapp_evalfile, METH_O, _tkinter_tkapp_evalfile__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_evalfile_impl(TkappObject *self, const char *fileName);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_evalfile(TkappObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *fileName;
|
||||
|
||||
if (!PyArg_Parse(arg, "s:evalfile", &fileName)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _tkinter_tkapp_evalfile_impl(self, fileName);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_record__doc__,
|
||||
"record($self, script, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_RECORD_METHODDEF \
|
||||
{"record", (PyCFunction)_tkinter_tkapp_record, METH_O, _tkinter_tkapp_record__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_record_impl(TkappObject *self, const char *script);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_record(TkappObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *script;
|
||||
|
||||
if (!PyArg_Parse(arg, "s:record", &script)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _tkinter_tkapp_record_impl(self, script);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_adderrorinfo__doc__,
|
||||
"adderrorinfo($self, msg, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_ADDERRORINFO_METHODDEF \
|
||||
{"adderrorinfo", (PyCFunction)_tkinter_tkapp_adderrorinfo, METH_O, _tkinter_tkapp_adderrorinfo__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_adderrorinfo_impl(TkappObject *self, const char *msg);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_adderrorinfo(TkappObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *msg;
|
||||
|
||||
if (!PyArg_Parse(arg, "s:adderrorinfo", &msg)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _tkinter_tkapp_adderrorinfo_impl(self, msg);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_getint__doc__,
|
||||
"getint($self, arg, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_GETINT_METHODDEF \
|
||||
{"getint", (PyCFunction)_tkinter_tkapp_getint, METH_O, _tkinter_tkapp_getint__doc__},
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_getdouble__doc__,
|
||||
"getdouble($self, arg, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_GETDOUBLE_METHODDEF \
|
||||
{"getdouble", (PyCFunction)_tkinter_tkapp_getdouble, METH_O, _tkinter_tkapp_getdouble__doc__},
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_getboolean__doc__,
|
||||
"getboolean($self, arg, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_GETBOOLEAN_METHODDEF \
|
||||
{"getboolean", (PyCFunction)_tkinter_tkapp_getboolean, METH_O, _tkinter_tkapp_getboolean__doc__},
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_exprstring__doc__,
|
||||
"exprstring($self, s, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_EXPRSTRING_METHODDEF \
|
||||
{"exprstring", (PyCFunction)_tkinter_tkapp_exprstring, METH_O, _tkinter_tkapp_exprstring__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_exprstring_impl(TkappObject *self, const char *s);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_exprstring(TkappObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *s;
|
||||
|
||||
if (!PyArg_Parse(arg, "s:exprstring", &s)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _tkinter_tkapp_exprstring_impl(self, s);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_exprlong__doc__,
|
||||
"exprlong($self, s, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_EXPRLONG_METHODDEF \
|
||||
{"exprlong", (PyCFunction)_tkinter_tkapp_exprlong, METH_O, _tkinter_tkapp_exprlong__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_exprlong_impl(TkappObject *self, const char *s);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_exprlong(TkappObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *s;
|
||||
|
||||
if (!PyArg_Parse(arg, "s:exprlong", &s)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _tkinter_tkapp_exprlong_impl(self, s);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_exprdouble__doc__,
|
||||
"exprdouble($self, s, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_EXPRDOUBLE_METHODDEF \
|
||||
{"exprdouble", (PyCFunction)_tkinter_tkapp_exprdouble, METH_O, _tkinter_tkapp_exprdouble__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_exprdouble_impl(TkappObject *self, const char *s);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_exprdouble(TkappObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *s;
|
||||
|
||||
if (!PyArg_Parse(arg, "s:exprdouble", &s)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _tkinter_tkapp_exprdouble_impl(self, s);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_exprboolean__doc__,
|
||||
"exprboolean($self, s, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_EXPRBOOLEAN_METHODDEF \
|
||||
{"exprboolean", (PyCFunction)_tkinter_tkapp_exprboolean, METH_O, _tkinter_tkapp_exprboolean__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_exprboolean_impl(TkappObject *self, const char *s);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_exprboolean(TkappObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *s;
|
||||
|
||||
if (!PyArg_Parse(arg, "s:exprboolean", &s)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _tkinter_tkapp_exprboolean_impl(self, s);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_splitlist__doc__,
|
||||
"splitlist($self, arg, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_SPLITLIST_METHODDEF \
|
||||
{"splitlist", (PyCFunction)_tkinter_tkapp_splitlist, METH_O, _tkinter_tkapp_splitlist__doc__},
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_split__doc__,
|
||||
"split($self, arg, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_SPLIT_METHODDEF \
|
||||
{"split", (PyCFunction)_tkinter_tkapp_split, METH_O, _tkinter_tkapp_split__doc__},
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_createcommand__doc__,
|
||||
"createcommand($self, name, func, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_CREATECOMMAND_METHODDEF \
|
||||
{"createcommand", (PyCFunction)_tkinter_tkapp_createcommand, METH_VARARGS, _tkinter_tkapp_createcommand__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_createcommand_impl(TkappObject *self, const char *name,
|
||||
PyObject *func);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_createcommand(TkappObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *name;
|
||||
PyObject *func;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "sO:createcommand",
|
||||
&name, &func)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _tkinter_tkapp_createcommand_impl(self, name, func);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_deletecommand__doc__,
|
||||
"deletecommand($self, name, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_DELETECOMMAND_METHODDEF \
|
||||
{"deletecommand", (PyCFunction)_tkinter_tkapp_deletecommand, METH_O, _tkinter_tkapp_deletecommand__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_deletecommand_impl(TkappObject *self, const char *name);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_deletecommand(TkappObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *name;
|
||||
|
||||
if (!PyArg_Parse(arg, "s:deletecommand", &name)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _tkinter_tkapp_deletecommand_impl(self, name);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#if defined(HAVE_CREATEFILEHANDLER)
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_createfilehandler__doc__,
|
||||
"createfilehandler($self, file, mask, func, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_CREATEFILEHANDLER_METHODDEF \
|
||||
{"createfilehandler", (PyCFunction)_tkinter_tkapp_createfilehandler, METH_VARARGS, _tkinter_tkapp_createfilehandler__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_createfilehandler_impl(TkappObject *self, PyObject *file,
|
||||
int mask, PyObject *func);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_createfilehandler(TkappObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *file;
|
||||
int mask;
|
||||
PyObject *func;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "OiO:createfilehandler",
|
||||
&file, &mask, &func)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _tkinter_tkapp_createfilehandler_impl(self, file, mask, func);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* defined(HAVE_CREATEFILEHANDLER) */
|
||||
|
||||
#if defined(HAVE_CREATEFILEHANDLER)
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_deletefilehandler__doc__,
|
||||
"deletefilehandler($self, file, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF \
|
||||
{"deletefilehandler", (PyCFunction)_tkinter_tkapp_deletefilehandler, METH_O, _tkinter_tkapp_deletefilehandler__doc__},
|
||||
|
||||
#endif /* defined(HAVE_CREATEFILEHANDLER) */
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tktimertoken_deletetimerhandler__doc__,
|
||||
"deletetimerhandler($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKTIMERTOKEN_DELETETIMERHANDLER_METHODDEF \
|
||||
{"deletetimerhandler", (PyCFunction)_tkinter_tktimertoken_deletetimerhandler, METH_NOARGS, _tkinter_tktimertoken_deletetimerhandler__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tktimertoken_deletetimerhandler_impl(TkttObject *self);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tktimertoken_deletetimerhandler(TkttObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _tkinter_tktimertoken_deletetimerhandler_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_createtimerhandler__doc__,
|
||||
"createtimerhandler($self, milliseconds, func, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_CREATETIMERHANDLER_METHODDEF \
|
||||
{"createtimerhandler", (PyCFunction)_tkinter_tkapp_createtimerhandler, METH_VARARGS, _tkinter_tkapp_createtimerhandler__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_createtimerhandler_impl(TkappObject *self, int milliseconds,
|
||||
PyObject *func);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_createtimerhandler(TkappObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int milliseconds;
|
||||
PyObject *func;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "iO:createtimerhandler",
|
||||
&milliseconds, &func)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _tkinter_tkapp_createtimerhandler_impl(self, milliseconds, func);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_mainloop__doc__,
|
||||
"mainloop($self, threshold=0, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_MAINLOOP_METHODDEF \
|
||||
{"mainloop", (PyCFunction)_tkinter_tkapp_mainloop, METH_VARARGS, _tkinter_tkapp_mainloop__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_mainloop_impl(TkappObject *self, int threshold);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_mainloop(TkappObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int threshold = 0;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|i:mainloop",
|
||||
&threshold)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _tkinter_tkapp_mainloop_impl(self, threshold);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_dooneevent__doc__,
|
||||
"dooneevent($self, flags=0, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_DOONEEVENT_METHODDEF \
|
||||
{"dooneevent", (PyCFunction)_tkinter_tkapp_dooneevent, METH_VARARGS, _tkinter_tkapp_dooneevent__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_dooneevent_impl(TkappObject *self, int flags);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_dooneevent(TkappObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int flags = 0;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|i:dooneevent",
|
||||
&flags)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _tkinter_tkapp_dooneevent_impl(self, flags);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_quit__doc__,
|
||||
"quit($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_QUIT_METHODDEF \
|
||||
{"quit", (PyCFunction)_tkinter_tkapp_quit, METH_NOARGS, _tkinter_tkapp_quit__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_quit_impl(TkappObject *self);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_quit(TkappObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _tkinter_tkapp_quit_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_interpaddr__doc__,
|
||||
"interpaddr($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_INTERPADDR_METHODDEF \
|
||||
{"interpaddr", (PyCFunction)_tkinter_tkapp_interpaddr, METH_NOARGS, _tkinter_tkapp_interpaddr__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_interpaddr_impl(TkappObject *self);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_interpaddr(TkappObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _tkinter_tkapp_interpaddr_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_loadtk__doc__,
|
||||
"loadtk($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_LOADTK_METHODDEF \
|
||||
{"loadtk", (PyCFunction)_tkinter_tkapp_loadtk, METH_NOARGS, _tkinter_tkapp_loadtk__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_loadtk_impl(TkappObject *self);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_loadtk(TkappObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _tkinter_tkapp_loadtk_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_tkinter_tkapp_willdispatch__doc__,
|
||||
"willdispatch($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER_TKAPP_WILLDISPATCH_METHODDEF \
|
||||
{"willdispatch", (PyCFunction)_tkinter_tkapp_willdispatch, METH_NOARGS, _tkinter_tkapp_willdispatch__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_willdispatch_impl(TkappObject *self);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_tkapp_willdispatch(TkappObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _tkinter_tkapp_willdispatch_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_tkinter__flatten__doc__,
|
||||
"_flatten($module, item, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _TKINTER__FLATTEN_METHODDEF \
|
||||
{"_flatten", (PyCFunction)_tkinter__flatten, METH_O, _tkinter__flatten__doc__},
|
||||
|
||||
PyDoc_STRVAR(_tkinter_create__doc__,
|
||||
"create($module, screenName=None, baseName=None, className=\'Tk\',\n"
|
||||
" interactive=False, wantobjects=False, wantTk=True, sync=False,\n"
|
||||
" use=None, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"\n"
|
||||
" wantTk\n"
|
||||
" if false, then Tk_Init() doesn\'t get called\n"
|
||||
" sync\n"
|
||||
" if true, then pass -sync to wish\n"
|
||||
" use\n"
|
||||
" if not None, then pass -use to wish");
|
||||
|
||||
#define _TKINTER_CREATE_METHODDEF \
|
||||
{"create", (PyCFunction)_tkinter_create, METH_VARARGS, _tkinter_create__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_create_impl(PyObject *module, const char *screenName,
|
||||
const char *baseName, const char *className,
|
||||
int interactive, int wantobjects, int wantTk, int sync,
|
||||
const char *use);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_create(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *screenName = NULL;
|
||||
const char *baseName = NULL;
|
||||
const char *className = "Tk";
|
||||
int interactive = 0;
|
||||
int wantobjects = 0;
|
||||
int wantTk = 1;
|
||||
int sync = 0;
|
||||
const char *use = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|zssiiiiz:create",
|
||||
&screenName, &baseName, &className, &interactive, &wantobjects, &wantTk, &sync, &use)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _tkinter_create_impl(module, screenName, baseName, className, interactive, wantobjects, wantTk, sync, use);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_tkinter_setbusywaitinterval__doc__,
|
||||
"setbusywaitinterval($module, new_val, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Set the busy-wait interval in milliseconds between successive calls to Tcl_DoOneEvent in a threaded Python interpreter.\n"
|
||||
"\n"
|
||||
"It should be set to a divisor of the maximum time between frames in an animation.");
|
||||
|
||||
#define _TKINTER_SETBUSYWAITINTERVAL_METHODDEF \
|
||||
{"setbusywaitinterval", (PyCFunction)_tkinter_setbusywaitinterval, METH_O, _tkinter_setbusywaitinterval__doc__},
|
||||
|
||||
static PyObject *
|
||||
_tkinter_setbusywaitinterval_impl(PyObject *module, int new_val);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_setbusywaitinterval(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int new_val;
|
||||
|
||||
if (!PyArg_Parse(arg, "i:setbusywaitinterval", &new_val)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _tkinter_setbusywaitinterval_impl(module, new_val);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_tkinter_getbusywaitinterval__doc__,
|
||||
"getbusywaitinterval($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the current busy-wait interval between successive calls to Tcl_DoOneEvent in a threaded Python interpreter.");
|
||||
|
||||
#define _TKINTER_GETBUSYWAITINTERVAL_METHODDEF \
|
||||
{"getbusywaitinterval", (PyCFunction)_tkinter_getbusywaitinterval, METH_NOARGS, _tkinter_getbusywaitinterval__doc__},
|
||||
|
||||
static int
|
||||
_tkinter_getbusywaitinterval_impl(PyObject *module);
|
||||
|
||||
static PyObject *
|
||||
_tkinter_getbusywaitinterval(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int _return_value;
|
||||
|
||||
_return_value = _tkinter_getbusywaitinterval_impl(module);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromLong((long)_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#ifndef _TKINTER_TKAPP_CREATEFILEHANDLER_METHODDEF
|
||||
#define _TKINTER_TKAPP_CREATEFILEHANDLER_METHODDEF
|
||||
#endif /* !defined(_TKINTER_TKAPP_CREATEFILEHANDLER_METHODDEF) */
|
||||
|
||||
#ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF
|
||||
#define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF
|
||||
#endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */
|
||||
/*[clinic end generated code: output=b0be55aacff2be9b input=a9049054013a1b77]*/
|
62
third_party/python/Modules/clinic/_weakref.c.h
generated
vendored
Normal file
62
third_party/python/Modules/clinic/_weakref.c.h
generated
vendored
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(_weakref_getweakrefcount__doc__,
|
||||
"getweakrefcount($module, object, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the number of weak references to \'object\'.");
|
||||
|
||||
#define _WEAKREF_GETWEAKREFCOUNT_METHODDEF \
|
||||
{"getweakrefcount", (PyCFunction)_weakref_getweakrefcount, METH_O, _weakref_getweakrefcount__doc__},
|
||||
|
||||
static Py_ssize_t
|
||||
_weakref_getweakrefcount_impl(PyObject *module, PyObject *object);
|
||||
|
||||
static PyObject *
|
||||
_weakref_getweakrefcount(PyObject *module, PyObject *object)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t _return_value;
|
||||
|
||||
_return_value = _weakref_getweakrefcount_impl(module, object);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromSsize_t(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_weakref__remove_dead_weakref__doc__,
|
||||
"_remove_dead_weakref($module, dct, key, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Atomically remove key from dict if it points to a dead weakref.");
|
||||
|
||||
#define _WEAKREF__REMOVE_DEAD_WEAKREF_METHODDEF \
|
||||
{"_remove_dead_weakref", (PyCFunction)_weakref__remove_dead_weakref, METH_VARARGS, _weakref__remove_dead_weakref__doc__},
|
||||
|
||||
static PyObject *
|
||||
_weakref__remove_dead_weakref_impl(PyObject *module, PyObject *dct,
|
||||
PyObject *key);
|
||||
|
||||
static PyObject *
|
||||
_weakref__remove_dead_weakref(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *dct;
|
||||
PyObject *key;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O!O:_remove_dead_weakref",
|
||||
&PyDict_Type, &dct, &key)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _weakref__remove_dead_weakref_impl(module, dct, key);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=e860dd818a44bc9b input=a9049054013a1b77]*/
|
892
third_party/python/Modules/clinic/_winapi.c.h
generated
vendored
Normal file
892
third_party/python/Modules/clinic/_winapi.c.h
generated
vendored
Normal file
|
@ -0,0 +1,892 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(_winapi_Overlapped_GetOverlappedResult__doc__,
|
||||
"GetOverlappedResult($self, wait, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _WINAPI_OVERLAPPED_GETOVERLAPPEDRESULT_METHODDEF \
|
||||
{"GetOverlappedResult", (PyCFunction)_winapi_Overlapped_GetOverlappedResult, METH_O, _winapi_Overlapped_GetOverlappedResult__doc__},
|
||||
|
||||
static PyObject *
|
||||
_winapi_Overlapped_GetOverlappedResult_impl(OverlappedObject *self, int wait);
|
||||
|
||||
static PyObject *
|
||||
_winapi_Overlapped_GetOverlappedResult(OverlappedObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int wait;
|
||||
|
||||
if (!PyArg_Parse(arg, "p:GetOverlappedResult", &wait)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _winapi_Overlapped_GetOverlappedResult_impl(self, wait);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_Overlapped_getbuffer__doc__,
|
||||
"getbuffer($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _WINAPI_OVERLAPPED_GETBUFFER_METHODDEF \
|
||||
{"getbuffer", (PyCFunction)_winapi_Overlapped_getbuffer, METH_NOARGS, _winapi_Overlapped_getbuffer__doc__},
|
||||
|
||||
static PyObject *
|
||||
_winapi_Overlapped_getbuffer_impl(OverlappedObject *self);
|
||||
|
||||
static PyObject *
|
||||
_winapi_Overlapped_getbuffer(OverlappedObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _winapi_Overlapped_getbuffer_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_Overlapped_cancel__doc__,
|
||||
"cancel($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _WINAPI_OVERLAPPED_CANCEL_METHODDEF \
|
||||
{"cancel", (PyCFunction)_winapi_Overlapped_cancel, METH_NOARGS, _winapi_Overlapped_cancel__doc__},
|
||||
|
||||
static PyObject *
|
||||
_winapi_Overlapped_cancel_impl(OverlappedObject *self);
|
||||
|
||||
static PyObject *
|
||||
_winapi_Overlapped_cancel(OverlappedObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _winapi_Overlapped_cancel_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_CloseHandle__doc__,
|
||||
"CloseHandle($module, handle, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Close handle.");
|
||||
|
||||
#define _WINAPI_CLOSEHANDLE_METHODDEF \
|
||||
{"CloseHandle", (PyCFunction)_winapi_CloseHandle, METH_O, _winapi_CloseHandle__doc__},
|
||||
|
||||
static PyObject *
|
||||
_winapi_CloseHandle_impl(PyObject *module, HANDLE handle);
|
||||
|
||||
static PyObject *
|
||||
_winapi_CloseHandle(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
HANDLE handle;
|
||||
|
||||
if (!PyArg_Parse(arg, "" F_HANDLE ":CloseHandle", &handle)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _winapi_CloseHandle_impl(module, handle);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_ConnectNamedPipe__doc__,
|
||||
"ConnectNamedPipe($module, /, handle, overlapped=False)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _WINAPI_CONNECTNAMEDPIPE_METHODDEF \
|
||||
{"ConnectNamedPipe", (PyCFunction)_winapi_ConnectNamedPipe, METH_FASTCALL, _winapi_ConnectNamedPipe__doc__},
|
||||
|
||||
static PyObject *
|
||||
_winapi_ConnectNamedPipe_impl(PyObject *module, HANDLE handle,
|
||||
int use_overlapped);
|
||||
|
||||
static PyObject *
|
||||
_winapi_ConnectNamedPipe(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"handle", "overlapped", NULL};
|
||||
static _PyArg_Parser _parser = {"" F_HANDLE "|i:ConnectNamedPipe", _keywords, 0};
|
||||
HANDLE handle;
|
||||
int use_overlapped = 0;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&handle, &use_overlapped)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _winapi_ConnectNamedPipe_impl(module, handle, use_overlapped);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_CreateFile__doc__,
|
||||
"CreateFile($module, file_name, desired_access, share_mode,\n"
|
||||
" security_attributes, creation_disposition,\n"
|
||||
" flags_and_attributes, template_file, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _WINAPI_CREATEFILE_METHODDEF \
|
||||
{"CreateFile", (PyCFunction)_winapi_CreateFile, METH_VARARGS, _winapi_CreateFile__doc__},
|
||||
|
||||
static HANDLE
|
||||
_winapi_CreateFile_impl(PyObject *module, LPCTSTR file_name,
|
||||
DWORD desired_access, DWORD share_mode,
|
||||
LPSECURITY_ATTRIBUTES security_attributes,
|
||||
DWORD creation_disposition,
|
||||
DWORD flags_and_attributes, HANDLE template_file);
|
||||
|
||||
static PyObject *
|
||||
_winapi_CreateFile(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
LPCTSTR file_name;
|
||||
DWORD desired_access;
|
||||
DWORD share_mode;
|
||||
LPSECURITY_ATTRIBUTES security_attributes;
|
||||
DWORD creation_disposition;
|
||||
DWORD flags_and_attributes;
|
||||
HANDLE template_file;
|
||||
HANDLE _return_value;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "skk" F_POINTER "kk" F_HANDLE ":CreateFile",
|
||||
&file_name, &desired_access, &share_mode, &security_attributes, &creation_disposition, &flags_and_attributes, &template_file)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = _winapi_CreateFile_impl(module, file_name, desired_access, share_mode, security_attributes, creation_disposition, flags_and_attributes, template_file);
|
||||
if ((_return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
if (_return_value == NULL) {
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return_value = HANDLE_TO_PYNUM(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_CreateJunction__doc__,
|
||||
"CreateJunction($module, src_path, dst_path, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _WINAPI_CREATEJUNCTION_METHODDEF \
|
||||
{"CreateJunction", (PyCFunction)_winapi_CreateJunction, METH_VARARGS, _winapi_CreateJunction__doc__},
|
||||
|
||||
static PyObject *
|
||||
_winapi_CreateJunction_impl(PyObject *module, LPWSTR src_path,
|
||||
LPWSTR dst_path);
|
||||
|
||||
static PyObject *
|
||||
_winapi_CreateJunction(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
LPWSTR src_path;
|
||||
LPWSTR dst_path;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "uu:CreateJunction",
|
||||
&src_path, &dst_path)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _winapi_CreateJunction_impl(module, src_path, dst_path);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_CreateNamedPipe__doc__,
|
||||
"CreateNamedPipe($module, name, open_mode, pipe_mode, max_instances,\n"
|
||||
" out_buffer_size, in_buffer_size, default_timeout,\n"
|
||||
" security_attributes, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _WINAPI_CREATENAMEDPIPE_METHODDEF \
|
||||
{"CreateNamedPipe", (PyCFunction)_winapi_CreateNamedPipe, METH_VARARGS, _winapi_CreateNamedPipe__doc__},
|
||||
|
||||
static HANDLE
|
||||
_winapi_CreateNamedPipe_impl(PyObject *module, LPCTSTR name, DWORD open_mode,
|
||||
DWORD pipe_mode, DWORD max_instances,
|
||||
DWORD out_buffer_size, DWORD in_buffer_size,
|
||||
DWORD default_timeout,
|
||||
LPSECURITY_ATTRIBUTES security_attributes);
|
||||
|
||||
static PyObject *
|
||||
_winapi_CreateNamedPipe(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
LPCTSTR name;
|
||||
DWORD open_mode;
|
||||
DWORD pipe_mode;
|
||||
DWORD max_instances;
|
||||
DWORD out_buffer_size;
|
||||
DWORD in_buffer_size;
|
||||
DWORD default_timeout;
|
||||
LPSECURITY_ATTRIBUTES security_attributes;
|
||||
HANDLE _return_value;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "skkkkkk" F_POINTER ":CreateNamedPipe",
|
||||
&name, &open_mode, &pipe_mode, &max_instances, &out_buffer_size, &in_buffer_size, &default_timeout, &security_attributes)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = _winapi_CreateNamedPipe_impl(module, name, open_mode, pipe_mode, max_instances, out_buffer_size, in_buffer_size, default_timeout, security_attributes);
|
||||
if ((_return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
if (_return_value == NULL) {
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return_value = HANDLE_TO_PYNUM(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_CreatePipe__doc__,
|
||||
"CreatePipe($module, pipe_attrs, size, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Create an anonymous pipe.\n"
|
||||
"\n"
|
||||
" pipe_attrs\n"
|
||||
" Ignored internally, can be None.\n"
|
||||
"\n"
|
||||
"Returns a 2-tuple of handles, to the read and write ends of the pipe.");
|
||||
|
||||
#define _WINAPI_CREATEPIPE_METHODDEF \
|
||||
{"CreatePipe", (PyCFunction)_winapi_CreatePipe, METH_VARARGS, _winapi_CreatePipe__doc__},
|
||||
|
||||
static PyObject *
|
||||
_winapi_CreatePipe_impl(PyObject *module, PyObject *pipe_attrs, DWORD size);
|
||||
|
||||
static PyObject *
|
||||
_winapi_CreatePipe(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *pipe_attrs;
|
||||
DWORD size;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "Ok:CreatePipe",
|
||||
&pipe_attrs, &size)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _winapi_CreatePipe_impl(module, pipe_attrs, size);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_CreateProcess__doc__,
|
||||
"CreateProcess($module, application_name, command_line, proc_attrs,\n"
|
||||
" thread_attrs, inherit_handles, creation_flags,\n"
|
||||
" env_mapping, current_directory, startup_info, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Create a new process and its primary thread.\n"
|
||||
"\n"
|
||||
" proc_attrs\n"
|
||||
" Ignored internally, can be None.\n"
|
||||
" thread_attrs\n"
|
||||
" Ignored internally, can be None.\n"
|
||||
"\n"
|
||||
"The return value is a tuple of the process handle, thread handle,\n"
|
||||
"process ID, and thread ID.");
|
||||
|
||||
#define _WINAPI_CREATEPROCESS_METHODDEF \
|
||||
{"CreateProcess", (PyCFunction)_winapi_CreateProcess, METH_VARARGS, _winapi_CreateProcess__doc__},
|
||||
|
||||
static PyObject *
|
||||
_winapi_CreateProcess_impl(PyObject *module, Py_UNICODE *application_name,
|
||||
Py_UNICODE *command_line, PyObject *proc_attrs,
|
||||
PyObject *thread_attrs, BOOL inherit_handles,
|
||||
DWORD creation_flags, PyObject *env_mapping,
|
||||
Py_UNICODE *current_directory,
|
||||
PyObject *startup_info);
|
||||
|
||||
static PyObject *
|
||||
_winapi_CreateProcess(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_UNICODE *application_name;
|
||||
Py_UNICODE *command_line;
|
||||
PyObject *proc_attrs;
|
||||
PyObject *thread_attrs;
|
||||
BOOL inherit_handles;
|
||||
DWORD creation_flags;
|
||||
PyObject *env_mapping;
|
||||
Py_UNICODE *current_directory;
|
||||
PyObject *startup_info;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "ZZOOikOZO:CreateProcess",
|
||||
&application_name, &command_line, &proc_attrs, &thread_attrs, &inherit_handles, &creation_flags, &env_mapping, ¤t_directory, &startup_info)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _winapi_CreateProcess_impl(module, application_name, command_line, proc_attrs, thread_attrs, inherit_handles, creation_flags, env_mapping, current_directory, startup_info);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_DuplicateHandle__doc__,
|
||||
"DuplicateHandle($module, source_process_handle, source_handle,\n"
|
||||
" target_process_handle, desired_access, inherit_handle,\n"
|
||||
" options=0, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a duplicate handle object.\n"
|
||||
"\n"
|
||||
"The duplicate handle refers to the same object as the original\n"
|
||||
"handle. Therefore, any changes to the object are reflected\n"
|
||||
"through both handles.");
|
||||
|
||||
#define _WINAPI_DUPLICATEHANDLE_METHODDEF \
|
||||
{"DuplicateHandle", (PyCFunction)_winapi_DuplicateHandle, METH_VARARGS, _winapi_DuplicateHandle__doc__},
|
||||
|
||||
static HANDLE
|
||||
_winapi_DuplicateHandle_impl(PyObject *module, HANDLE source_process_handle,
|
||||
HANDLE source_handle,
|
||||
HANDLE target_process_handle,
|
||||
DWORD desired_access, BOOL inherit_handle,
|
||||
DWORD options);
|
||||
|
||||
static PyObject *
|
||||
_winapi_DuplicateHandle(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
HANDLE source_process_handle;
|
||||
HANDLE source_handle;
|
||||
HANDLE target_process_handle;
|
||||
DWORD desired_access;
|
||||
BOOL inherit_handle;
|
||||
DWORD options = 0;
|
||||
HANDLE _return_value;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "" F_HANDLE "" F_HANDLE "" F_HANDLE "ki|k:DuplicateHandle",
|
||||
&source_process_handle, &source_handle, &target_process_handle, &desired_access, &inherit_handle, &options)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = _winapi_DuplicateHandle_impl(module, source_process_handle, source_handle, target_process_handle, desired_access, inherit_handle, options);
|
||||
if ((_return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
if (_return_value == NULL) {
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return_value = HANDLE_TO_PYNUM(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_ExitProcess__doc__,
|
||||
"ExitProcess($module, ExitCode, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _WINAPI_EXITPROCESS_METHODDEF \
|
||||
{"ExitProcess", (PyCFunction)_winapi_ExitProcess, METH_O, _winapi_ExitProcess__doc__},
|
||||
|
||||
static PyObject *
|
||||
_winapi_ExitProcess_impl(PyObject *module, UINT ExitCode);
|
||||
|
||||
static PyObject *
|
||||
_winapi_ExitProcess(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
UINT ExitCode;
|
||||
|
||||
if (!PyArg_Parse(arg, "I:ExitProcess", &ExitCode)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _winapi_ExitProcess_impl(module, ExitCode);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_GetCurrentProcess__doc__,
|
||||
"GetCurrentProcess($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a handle object for the current process.");
|
||||
|
||||
#define _WINAPI_GETCURRENTPROCESS_METHODDEF \
|
||||
{"GetCurrentProcess", (PyCFunction)_winapi_GetCurrentProcess, METH_NOARGS, _winapi_GetCurrentProcess__doc__},
|
||||
|
||||
static HANDLE
|
||||
_winapi_GetCurrentProcess_impl(PyObject *module);
|
||||
|
||||
static PyObject *
|
||||
_winapi_GetCurrentProcess(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
HANDLE _return_value;
|
||||
|
||||
_return_value = _winapi_GetCurrentProcess_impl(module);
|
||||
if ((_return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
if (_return_value == NULL) {
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return_value = HANDLE_TO_PYNUM(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_GetExitCodeProcess__doc__,
|
||||
"GetExitCodeProcess($module, process, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the termination status of the specified process.");
|
||||
|
||||
#define _WINAPI_GETEXITCODEPROCESS_METHODDEF \
|
||||
{"GetExitCodeProcess", (PyCFunction)_winapi_GetExitCodeProcess, METH_O, _winapi_GetExitCodeProcess__doc__},
|
||||
|
||||
static DWORD
|
||||
_winapi_GetExitCodeProcess_impl(PyObject *module, HANDLE process);
|
||||
|
||||
static PyObject *
|
||||
_winapi_GetExitCodeProcess(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
HANDLE process;
|
||||
DWORD _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "" F_HANDLE ":GetExitCodeProcess", &process)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = _winapi_GetExitCodeProcess_impl(module, process);
|
||||
if ((_return_value == DWORD_MAX) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = Py_BuildValue("k", _return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_GetLastError__doc__,
|
||||
"GetLastError($module, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _WINAPI_GETLASTERROR_METHODDEF \
|
||||
{"GetLastError", (PyCFunction)_winapi_GetLastError, METH_NOARGS, _winapi_GetLastError__doc__},
|
||||
|
||||
static DWORD
|
||||
_winapi_GetLastError_impl(PyObject *module);
|
||||
|
||||
static PyObject *
|
||||
_winapi_GetLastError(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
DWORD _return_value;
|
||||
|
||||
_return_value = _winapi_GetLastError_impl(module);
|
||||
if ((_return_value == DWORD_MAX) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = Py_BuildValue("k", _return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_GetModuleFileName__doc__,
|
||||
"GetModuleFileName($module, module_handle, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the fully-qualified path for the file that contains module.\n"
|
||||
"\n"
|
||||
"The module must have been loaded by the current process.\n"
|
||||
"\n"
|
||||
"The module parameter should be a handle to the loaded module\n"
|
||||
"whose path is being requested. If this parameter is 0,\n"
|
||||
"GetModuleFileName retrieves the path of the executable file\n"
|
||||
"of the current process.");
|
||||
|
||||
#define _WINAPI_GETMODULEFILENAME_METHODDEF \
|
||||
{"GetModuleFileName", (PyCFunction)_winapi_GetModuleFileName, METH_O, _winapi_GetModuleFileName__doc__},
|
||||
|
||||
static PyObject *
|
||||
_winapi_GetModuleFileName_impl(PyObject *module, HMODULE module_handle);
|
||||
|
||||
static PyObject *
|
||||
_winapi_GetModuleFileName(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
HMODULE module_handle;
|
||||
|
||||
if (!PyArg_Parse(arg, "" F_HANDLE ":GetModuleFileName", &module_handle)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _winapi_GetModuleFileName_impl(module, module_handle);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_GetStdHandle__doc__,
|
||||
"GetStdHandle($module, std_handle, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a handle to the specified standard device.\n"
|
||||
"\n"
|
||||
" std_handle\n"
|
||||
" One of STD_INPUT_HANDLE, STD_OUTPUT_HANDLE, or STD_ERROR_HANDLE.\n"
|
||||
"\n"
|
||||
"The integer associated with the handle object is returned.");
|
||||
|
||||
#define _WINAPI_GETSTDHANDLE_METHODDEF \
|
||||
{"GetStdHandle", (PyCFunction)_winapi_GetStdHandle, METH_O, _winapi_GetStdHandle__doc__},
|
||||
|
||||
static HANDLE
|
||||
_winapi_GetStdHandle_impl(PyObject *module, DWORD std_handle);
|
||||
|
||||
static PyObject *
|
||||
_winapi_GetStdHandle(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
DWORD std_handle;
|
||||
HANDLE _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "k:GetStdHandle", &std_handle)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = _winapi_GetStdHandle_impl(module, std_handle);
|
||||
if ((_return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
if (_return_value == NULL) {
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return_value = HANDLE_TO_PYNUM(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_GetVersion__doc__,
|
||||
"GetVersion($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the version number of the current operating system.");
|
||||
|
||||
#define _WINAPI_GETVERSION_METHODDEF \
|
||||
{"GetVersion", (PyCFunction)_winapi_GetVersion, METH_NOARGS, _winapi_GetVersion__doc__},
|
||||
|
||||
static long
|
||||
_winapi_GetVersion_impl(PyObject *module);
|
||||
|
||||
static PyObject *
|
||||
_winapi_GetVersion(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
long _return_value;
|
||||
|
||||
_return_value = _winapi_GetVersion_impl(module);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromLong(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_OpenProcess__doc__,
|
||||
"OpenProcess($module, desired_access, inherit_handle, process_id, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _WINAPI_OPENPROCESS_METHODDEF \
|
||||
{"OpenProcess", (PyCFunction)_winapi_OpenProcess, METH_VARARGS, _winapi_OpenProcess__doc__},
|
||||
|
||||
static HANDLE
|
||||
_winapi_OpenProcess_impl(PyObject *module, DWORD desired_access,
|
||||
BOOL inherit_handle, DWORD process_id);
|
||||
|
||||
static PyObject *
|
||||
_winapi_OpenProcess(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
DWORD desired_access;
|
||||
BOOL inherit_handle;
|
||||
DWORD process_id;
|
||||
HANDLE _return_value;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "kik:OpenProcess",
|
||||
&desired_access, &inherit_handle, &process_id)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = _winapi_OpenProcess_impl(module, desired_access, inherit_handle, process_id);
|
||||
if ((_return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
if (_return_value == NULL) {
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return_value = HANDLE_TO_PYNUM(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_PeekNamedPipe__doc__,
|
||||
"PeekNamedPipe($module, handle, size=0, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _WINAPI_PEEKNAMEDPIPE_METHODDEF \
|
||||
{"PeekNamedPipe", (PyCFunction)_winapi_PeekNamedPipe, METH_VARARGS, _winapi_PeekNamedPipe__doc__},
|
||||
|
||||
static PyObject *
|
||||
_winapi_PeekNamedPipe_impl(PyObject *module, HANDLE handle, int size);
|
||||
|
||||
static PyObject *
|
||||
_winapi_PeekNamedPipe(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
HANDLE handle;
|
||||
int size = 0;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "" F_HANDLE "|i:PeekNamedPipe",
|
||||
&handle, &size)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _winapi_PeekNamedPipe_impl(module, handle, size);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_ReadFile__doc__,
|
||||
"ReadFile($module, /, handle, size, overlapped=False)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _WINAPI_READFILE_METHODDEF \
|
||||
{"ReadFile", (PyCFunction)_winapi_ReadFile, METH_FASTCALL, _winapi_ReadFile__doc__},
|
||||
|
||||
static PyObject *
|
||||
_winapi_ReadFile_impl(PyObject *module, HANDLE handle, DWORD size,
|
||||
int use_overlapped);
|
||||
|
||||
static PyObject *
|
||||
_winapi_ReadFile(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"handle", "size", "overlapped", NULL};
|
||||
static _PyArg_Parser _parser = {"" F_HANDLE "k|i:ReadFile", _keywords, 0};
|
||||
HANDLE handle;
|
||||
DWORD size;
|
||||
int use_overlapped = 0;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&handle, &size, &use_overlapped)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _winapi_ReadFile_impl(module, handle, size, use_overlapped);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_SetNamedPipeHandleState__doc__,
|
||||
"SetNamedPipeHandleState($module, named_pipe, mode,\n"
|
||||
" max_collection_count, collect_data_timeout, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _WINAPI_SETNAMEDPIPEHANDLESTATE_METHODDEF \
|
||||
{"SetNamedPipeHandleState", (PyCFunction)_winapi_SetNamedPipeHandleState, METH_VARARGS, _winapi_SetNamedPipeHandleState__doc__},
|
||||
|
||||
static PyObject *
|
||||
_winapi_SetNamedPipeHandleState_impl(PyObject *module, HANDLE named_pipe,
|
||||
PyObject *mode,
|
||||
PyObject *max_collection_count,
|
||||
PyObject *collect_data_timeout);
|
||||
|
||||
static PyObject *
|
||||
_winapi_SetNamedPipeHandleState(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
HANDLE named_pipe;
|
||||
PyObject *mode;
|
||||
PyObject *max_collection_count;
|
||||
PyObject *collect_data_timeout;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "" F_HANDLE "OOO:SetNamedPipeHandleState",
|
||||
&named_pipe, &mode, &max_collection_count, &collect_data_timeout)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _winapi_SetNamedPipeHandleState_impl(module, named_pipe, mode, max_collection_count, collect_data_timeout);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_TerminateProcess__doc__,
|
||||
"TerminateProcess($module, handle, exit_code, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Terminate the specified process and all of its threads.");
|
||||
|
||||
#define _WINAPI_TERMINATEPROCESS_METHODDEF \
|
||||
{"TerminateProcess", (PyCFunction)_winapi_TerminateProcess, METH_VARARGS, _winapi_TerminateProcess__doc__},
|
||||
|
||||
static PyObject *
|
||||
_winapi_TerminateProcess_impl(PyObject *module, HANDLE handle,
|
||||
UINT exit_code);
|
||||
|
||||
static PyObject *
|
||||
_winapi_TerminateProcess(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
HANDLE handle;
|
||||
UINT exit_code;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "" F_HANDLE "I:TerminateProcess",
|
||||
&handle, &exit_code)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _winapi_TerminateProcess_impl(module, handle, exit_code);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_WaitNamedPipe__doc__,
|
||||
"WaitNamedPipe($module, name, timeout, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _WINAPI_WAITNAMEDPIPE_METHODDEF \
|
||||
{"WaitNamedPipe", (PyCFunction)_winapi_WaitNamedPipe, METH_VARARGS, _winapi_WaitNamedPipe__doc__},
|
||||
|
||||
static PyObject *
|
||||
_winapi_WaitNamedPipe_impl(PyObject *module, LPCTSTR name, DWORD timeout);
|
||||
|
||||
static PyObject *
|
||||
_winapi_WaitNamedPipe(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
LPCTSTR name;
|
||||
DWORD timeout;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "sk:WaitNamedPipe",
|
||||
&name, &timeout)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _winapi_WaitNamedPipe_impl(module, name, timeout);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_WaitForMultipleObjects__doc__,
|
||||
"WaitForMultipleObjects($module, handle_seq, wait_flag,\n"
|
||||
" milliseconds=_winapi.INFINITE, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _WINAPI_WAITFORMULTIPLEOBJECTS_METHODDEF \
|
||||
{"WaitForMultipleObjects", (PyCFunction)_winapi_WaitForMultipleObjects, METH_VARARGS, _winapi_WaitForMultipleObjects__doc__},
|
||||
|
||||
static PyObject *
|
||||
_winapi_WaitForMultipleObjects_impl(PyObject *module, PyObject *handle_seq,
|
||||
BOOL wait_flag, DWORD milliseconds);
|
||||
|
||||
static PyObject *
|
||||
_winapi_WaitForMultipleObjects(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *handle_seq;
|
||||
BOOL wait_flag;
|
||||
DWORD milliseconds = INFINITE;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "Oi|k:WaitForMultipleObjects",
|
||||
&handle_seq, &wait_flag, &milliseconds)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _winapi_WaitForMultipleObjects_impl(module, handle_seq, wait_flag, milliseconds);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_WaitForSingleObject__doc__,
|
||||
"WaitForSingleObject($module, handle, milliseconds, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Wait for a single object.\n"
|
||||
"\n"
|
||||
"Wait until the specified object is in the signaled state or\n"
|
||||
"the time-out interval elapses. The timeout value is specified\n"
|
||||
"in milliseconds.");
|
||||
|
||||
#define _WINAPI_WAITFORSINGLEOBJECT_METHODDEF \
|
||||
{"WaitForSingleObject", (PyCFunction)_winapi_WaitForSingleObject, METH_VARARGS, _winapi_WaitForSingleObject__doc__},
|
||||
|
||||
static long
|
||||
_winapi_WaitForSingleObject_impl(PyObject *module, HANDLE handle,
|
||||
DWORD milliseconds);
|
||||
|
||||
static PyObject *
|
||||
_winapi_WaitForSingleObject(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
HANDLE handle;
|
||||
DWORD milliseconds;
|
||||
long _return_value;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "" F_HANDLE "k:WaitForSingleObject",
|
||||
&handle, &milliseconds)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = _winapi_WaitForSingleObject_impl(module, handle, milliseconds);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromLong(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_winapi_WriteFile__doc__,
|
||||
"WriteFile($module, /, handle, buffer, overlapped=False)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define _WINAPI_WRITEFILE_METHODDEF \
|
||||
{"WriteFile", (PyCFunction)_winapi_WriteFile, METH_FASTCALL, _winapi_WriteFile__doc__},
|
||||
|
||||
static PyObject *
|
||||
_winapi_WriteFile_impl(PyObject *module, HANDLE handle, PyObject *buffer,
|
||||
int use_overlapped);
|
||||
|
||||
static PyObject *
|
||||
_winapi_WriteFile(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"handle", "buffer", "overlapped", NULL};
|
||||
static _PyArg_Parser _parser = {"" F_HANDLE "O|i:WriteFile", _keywords, 0};
|
||||
HANDLE handle;
|
||||
PyObject *buffer;
|
||||
int use_overlapped = 0;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&handle, &buffer, &use_overlapped)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _winapi_WriteFile_impl(module, handle, buffer, use_overlapped);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=6c5cf8865d381c70 input=a9049054013a1b77]*/
|
508
third_party/python/Modules/clinic/arraymodule.c.h
generated
vendored
Normal file
508
third_party/python/Modules/clinic/arraymodule.c.h
generated
vendored
Normal file
|
@ -0,0 +1,508 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(array_array___copy____doc__,
|
||||
"__copy__($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a copy of the array.");
|
||||
|
||||
#define ARRAY_ARRAY___COPY___METHODDEF \
|
||||
{"__copy__", (PyCFunction)array_array___copy__, METH_NOARGS, array_array___copy____doc__},
|
||||
|
||||
static PyObject *
|
||||
array_array___copy___impl(arrayobject *self);
|
||||
|
||||
static PyObject *
|
||||
array_array___copy__(arrayobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return array_array___copy___impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(array_array___deepcopy____doc__,
|
||||
"__deepcopy__($self, unused, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a copy of the array.");
|
||||
|
||||
#define ARRAY_ARRAY___DEEPCOPY___METHODDEF \
|
||||
{"__deepcopy__", (PyCFunction)array_array___deepcopy__, METH_O, array_array___deepcopy____doc__},
|
||||
|
||||
PyDoc_STRVAR(array_array_count__doc__,
|
||||
"count($self, v, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return number of occurrences of v in the array.");
|
||||
|
||||
#define ARRAY_ARRAY_COUNT_METHODDEF \
|
||||
{"count", (PyCFunction)array_array_count, METH_O, array_array_count__doc__},
|
||||
|
||||
PyDoc_STRVAR(array_array_index__doc__,
|
||||
"index($self, v, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return index of first occurrence of v in the array.");
|
||||
|
||||
#define ARRAY_ARRAY_INDEX_METHODDEF \
|
||||
{"index", (PyCFunction)array_array_index, METH_O, array_array_index__doc__},
|
||||
|
||||
PyDoc_STRVAR(array_array_remove__doc__,
|
||||
"remove($self, v, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Remove the first occurrence of v in the array.");
|
||||
|
||||
#define ARRAY_ARRAY_REMOVE_METHODDEF \
|
||||
{"remove", (PyCFunction)array_array_remove, METH_O, array_array_remove__doc__},
|
||||
|
||||
PyDoc_STRVAR(array_array_pop__doc__,
|
||||
"pop($self, i=-1, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the i-th element and delete it from the array.\n"
|
||||
"\n"
|
||||
"i defaults to -1.");
|
||||
|
||||
#define ARRAY_ARRAY_POP_METHODDEF \
|
||||
{"pop", (PyCFunction)array_array_pop, METH_VARARGS, array_array_pop__doc__},
|
||||
|
||||
static PyObject *
|
||||
array_array_pop_impl(arrayobject *self, Py_ssize_t i);
|
||||
|
||||
static PyObject *
|
||||
array_array_pop(arrayobject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t i = -1;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|n:pop",
|
||||
&i)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = array_array_pop_impl(self, i);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(array_array_extend__doc__,
|
||||
"extend($self, bb, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Append items to the end of the array.");
|
||||
|
||||
#define ARRAY_ARRAY_EXTEND_METHODDEF \
|
||||
{"extend", (PyCFunction)array_array_extend, METH_O, array_array_extend__doc__},
|
||||
|
||||
PyDoc_STRVAR(array_array_insert__doc__,
|
||||
"insert($self, i, v, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Insert a new item v into the array before position i.");
|
||||
|
||||
#define ARRAY_ARRAY_INSERT_METHODDEF \
|
||||
{"insert", (PyCFunction)array_array_insert, METH_VARARGS, array_array_insert__doc__},
|
||||
|
||||
static PyObject *
|
||||
array_array_insert_impl(arrayobject *self, Py_ssize_t i, PyObject *v);
|
||||
|
||||
static PyObject *
|
||||
array_array_insert(arrayobject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t i;
|
||||
PyObject *v;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "nO:insert",
|
||||
&i, &v)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = array_array_insert_impl(self, i, v);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(array_array_buffer_info__doc__,
|
||||
"buffer_info($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a tuple (address, length) giving the current memory address and the length in items of the buffer used to hold array\'s contents.\n"
|
||||
"\n"
|
||||
"The length should be multiplied by the itemsize attribute to calculate\n"
|
||||
"the buffer length in bytes.");
|
||||
|
||||
#define ARRAY_ARRAY_BUFFER_INFO_METHODDEF \
|
||||
{"buffer_info", (PyCFunction)array_array_buffer_info, METH_NOARGS, array_array_buffer_info__doc__},
|
||||
|
||||
static PyObject *
|
||||
array_array_buffer_info_impl(arrayobject *self);
|
||||
|
||||
static PyObject *
|
||||
array_array_buffer_info(arrayobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return array_array_buffer_info_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(array_array_append__doc__,
|
||||
"append($self, v, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Append new value v to the end of the array.");
|
||||
|
||||
#define ARRAY_ARRAY_APPEND_METHODDEF \
|
||||
{"append", (PyCFunction)array_array_append, METH_O, array_array_append__doc__},
|
||||
|
||||
PyDoc_STRVAR(array_array_byteswap__doc__,
|
||||
"byteswap($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Byteswap all items of the array.\n"
|
||||
"\n"
|
||||
"If the items in the array are not 1, 2, 4, or 8 bytes in size, RuntimeError is\n"
|
||||
"raised.");
|
||||
|
||||
#define ARRAY_ARRAY_BYTESWAP_METHODDEF \
|
||||
{"byteswap", (PyCFunction)array_array_byteswap, METH_NOARGS, array_array_byteswap__doc__},
|
||||
|
||||
static PyObject *
|
||||
array_array_byteswap_impl(arrayobject *self);
|
||||
|
||||
static PyObject *
|
||||
array_array_byteswap(arrayobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return array_array_byteswap_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(array_array_reverse__doc__,
|
||||
"reverse($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Reverse the order of the items in the array.");
|
||||
|
||||
#define ARRAY_ARRAY_REVERSE_METHODDEF \
|
||||
{"reverse", (PyCFunction)array_array_reverse, METH_NOARGS, array_array_reverse__doc__},
|
||||
|
||||
static PyObject *
|
||||
array_array_reverse_impl(arrayobject *self);
|
||||
|
||||
static PyObject *
|
||||
array_array_reverse(arrayobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return array_array_reverse_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(array_array_fromfile__doc__,
|
||||
"fromfile($self, f, n, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Read n objects from the file object f and append them to the end of the array.");
|
||||
|
||||
#define ARRAY_ARRAY_FROMFILE_METHODDEF \
|
||||
{"fromfile", (PyCFunction)array_array_fromfile, METH_VARARGS, array_array_fromfile__doc__},
|
||||
|
||||
static PyObject *
|
||||
array_array_fromfile_impl(arrayobject *self, PyObject *f, Py_ssize_t n);
|
||||
|
||||
static PyObject *
|
||||
array_array_fromfile(arrayobject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *f;
|
||||
Py_ssize_t n;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "On:fromfile",
|
||||
&f, &n)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = array_array_fromfile_impl(self, f, n);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(array_array_tofile__doc__,
|
||||
"tofile($self, f, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Write all items (as machine values) to the file object f.");
|
||||
|
||||
#define ARRAY_ARRAY_TOFILE_METHODDEF \
|
||||
{"tofile", (PyCFunction)array_array_tofile, METH_O, array_array_tofile__doc__},
|
||||
|
||||
PyDoc_STRVAR(array_array_fromlist__doc__,
|
||||
"fromlist($self, list, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Append items to array from list.");
|
||||
|
||||
#define ARRAY_ARRAY_FROMLIST_METHODDEF \
|
||||
{"fromlist", (PyCFunction)array_array_fromlist, METH_O, array_array_fromlist__doc__},
|
||||
|
||||
PyDoc_STRVAR(array_array_tolist__doc__,
|
||||
"tolist($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Convert array to an ordinary list with the same items.");
|
||||
|
||||
#define ARRAY_ARRAY_TOLIST_METHODDEF \
|
||||
{"tolist", (PyCFunction)array_array_tolist, METH_NOARGS, array_array_tolist__doc__},
|
||||
|
||||
static PyObject *
|
||||
array_array_tolist_impl(arrayobject *self);
|
||||
|
||||
static PyObject *
|
||||
array_array_tolist(arrayobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return array_array_tolist_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(array_array_fromstring__doc__,
|
||||
"fromstring($self, buffer, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Appends items from the string, interpreting it as an array of machine values, as if it had been read from a file using the fromfile() method).\n"
|
||||
"\n"
|
||||
"This method is deprecated. Use frombytes instead.");
|
||||
|
||||
#define ARRAY_ARRAY_FROMSTRING_METHODDEF \
|
||||
{"fromstring", (PyCFunction)array_array_fromstring, METH_O, array_array_fromstring__doc__},
|
||||
|
||||
static PyObject *
|
||||
array_array_fromstring_impl(arrayobject *self, Py_buffer *buffer);
|
||||
|
||||
static PyObject *
|
||||
array_array_fromstring(arrayobject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer buffer = {NULL, NULL};
|
||||
|
||||
if (!PyArg_Parse(arg, "s*:fromstring", &buffer)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = array_array_fromstring_impl(self, &buffer);
|
||||
|
||||
exit:
|
||||
/* Cleanup for buffer */
|
||||
if (buffer.obj) {
|
||||
PyBuffer_Release(&buffer);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(array_array_frombytes__doc__,
|
||||
"frombytes($self, buffer, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Appends items from the string, interpreting it as an array of machine values, as if it had been read from a file using the fromfile() method).");
|
||||
|
||||
#define ARRAY_ARRAY_FROMBYTES_METHODDEF \
|
||||
{"frombytes", (PyCFunction)array_array_frombytes, METH_O, array_array_frombytes__doc__},
|
||||
|
||||
static PyObject *
|
||||
array_array_frombytes_impl(arrayobject *self, Py_buffer *buffer);
|
||||
|
||||
static PyObject *
|
||||
array_array_frombytes(arrayobject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer buffer = {NULL, NULL};
|
||||
|
||||
if (!PyArg_Parse(arg, "y*:frombytes", &buffer)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = array_array_frombytes_impl(self, &buffer);
|
||||
|
||||
exit:
|
||||
/* Cleanup for buffer */
|
||||
if (buffer.obj) {
|
||||
PyBuffer_Release(&buffer);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(array_array_tobytes__doc__,
|
||||
"tobytes($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Convert the array to an array of machine values and return the bytes representation.");
|
||||
|
||||
#define ARRAY_ARRAY_TOBYTES_METHODDEF \
|
||||
{"tobytes", (PyCFunction)array_array_tobytes, METH_NOARGS, array_array_tobytes__doc__},
|
||||
|
||||
static PyObject *
|
||||
array_array_tobytes_impl(arrayobject *self);
|
||||
|
||||
static PyObject *
|
||||
array_array_tobytes(arrayobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return array_array_tobytes_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(array_array_tostring__doc__,
|
||||
"tostring($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Convert the array to an array of machine values and return the bytes representation.\n"
|
||||
"\n"
|
||||
"This method is deprecated. Use tobytes instead.");
|
||||
|
||||
#define ARRAY_ARRAY_TOSTRING_METHODDEF \
|
||||
{"tostring", (PyCFunction)array_array_tostring, METH_NOARGS, array_array_tostring__doc__},
|
||||
|
||||
static PyObject *
|
||||
array_array_tostring_impl(arrayobject *self);
|
||||
|
||||
static PyObject *
|
||||
array_array_tostring(arrayobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return array_array_tostring_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(array_array_fromunicode__doc__,
|
||||
"fromunicode($self, ustr, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Extends this array with data from the unicode string ustr.\n"
|
||||
"\n"
|
||||
"The array must be a unicode type array; otherwise a ValueError is raised.\n"
|
||||
"Use array.frombytes(ustr.encode(...)) to append Unicode data to an array of\n"
|
||||
"some other type.");
|
||||
|
||||
#define ARRAY_ARRAY_FROMUNICODE_METHODDEF \
|
||||
{"fromunicode", (PyCFunction)array_array_fromunicode, METH_O, array_array_fromunicode__doc__},
|
||||
|
||||
static PyObject *
|
||||
array_array_fromunicode_impl(arrayobject *self, Py_UNICODE *ustr,
|
||||
Py_ssize_clean_t ustr_length);
|
||||
|
||||
static PyObject *
|
||||
array_array_fromunicode(arrayobject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_UNICODE *ustr;
|
||||
Py_ssize_clean_t ustr_length;
|
||||
|
||||
if (!PyArg_Parse(arg, "u#:fromunicode", &ustr, &ustr_length)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = array_array_fromunicode_impl(self, ustr, ustr_length);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(array_array_tounicode__doc__,
|
||||
"tounicode($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Extends this array with data from the unicode string ustr.\n"
|
||||
"\n"
|
||||
"Convert the array to a unicode string. The array must be a unicode type array;\n"
|
||||
"otherwise a ValueError is raised. Use array.tobytes().decode() to obtain a\n"
|
||||
"unicode string from an array of some other type.");
|
||||
|
||||
#define ARRAY_ARRAY_TOUNICODE_METHODDEF \
|
||||
{"tounicode", (PyCFunction)array_array_tounicode, METH_NOARGS, array_array_tounicode__doc__},
|
||||
|
||||
static PyObject *
|
||||
array_array_tounicode_impl(arrayobject *self);
|
||||
|
||||
static PyObject *
|
||||
array_array_tounicode(arrayobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return array_array_tounicode_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(array_array___sizeof____doc__,
|
||||
"__sizeof__($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Size of the array in memory, in bytes.");
|
||||
|
||||
#define ARRAY_ARRAY___SIZEOF___METHODDEF \
|
||||
{"__sizeof__", (PyCFunction)array_array___sizeof__, METH_NOARGS, array_array___sizeof____doc__},
|
||||
|
||||
static PyObject *
|
||||
array_array___sizeof___impl(arrayobject *self);
|
||||
|
||||
static PyObject *
|
||||
array_array___sizeof__(arrayobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return array_array___sizeof___impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(array__array_reconstructor__doc__,
|
||||
"_array_reconstructor($module, arraytype, typecode, mformat_code, items,\n"
|
||||
" /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Internal. Used for pickling support.");
|
||||
|
||||
#define ARRAY__ARRAY_RECONSTRUCTOR_METHODDEF \
|
||||
{"_array_reconstructor", (PyCFunction)array__array_reconstructor, METH_VARARGS, array__array_reconstructor__doc__},
|
||||
|
||||
static PyObject *
|
||||
array__array_reconstructor_impl(PyObject *module, PyTypeObject *arraytype,
|
||||
int typecode,
|
||||
enum machine_format_code mformat_code,
|
||||
PyObject *items);
|
||||
|
||||
static PyObject *
|
||||
array__array_reconstructor(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyTypeObject *arraytype;
|
||||
int typecode;
|
||||
enum machine_format_code mformat_code;
|
||||
PyObject *items;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "OCiO:_array_reconstructor",
|
||||
&arraytype, &typecode, &mformat_code, &items)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = array__array_reconstructor_impl(module, arraytype, typecode, mformat_code, items);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(array_array___reduce_ex____doc__,
|
||||
"__reduce_ex__($self, value, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return state information for pickling.");
|
||||
|
||||
#define ARRAY_ARRAY___REDUCE_EX___METHODDEF \
|
||||
{"__reduce_ex__", (PyCFunction)array_array___reduce_ex__, METH_O, array_array___reduce_ex____doc__},
|
||||
|
||||
PyDoc_STRVAR(array_arrayiterator___reduce____doc__,
|
||||
"__reduce__($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return state information for pickling.");
|
||||
|
||||
#define ARRAY_ARRAYITERATOR___REDUCE___METHODDEF \
|
||||
{"__reduce__", (PyCFunction)array_arrayiterator___reduce__, METH_NOARGS, array_arrayiterator___reduce____doc__},
|
||||
|
||||
static PyObject *
|
||||
array_arrayiterator___reduce___impl(arrayiterobject *self);
|
||||
|
||||
static PyObject *
|
||||
array_arrayiterator___reduce__(arrayiterobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return array_arrayiterator___reduce___impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(array_arrayiterator___setstate____doc__,
|
||||
"__setstate__($self, state, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Set state information for unpickling.");
|
||||
|
||||
#define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \
|
||||
{"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__},
|
||||
/*[clinic end generated code: output=b2054fb764c8cc64 input=a9049054013a1b77]*/
|
931
third_party/python/Modules/clinic/audioop.c.h
generated
vendored
Normal file
931
third_party/python/Modules/clinic/audioop.c.h
generated
vendored
Normal file
|
@ -0,0 +1,931 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(audioop_getsample__doc__,
|
||||
"getsample($module, fragment, width, index, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the value of sample index from the fragment.");
|
||||
|
||||
#define AUDIOOP_GETSAMPLE_METHODDEF \
|
||||
{"getsample", (PyCFunction)audioop_getsample, METH_VARARGS, audioop_getsample__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_getsample_impl(PyObject *module, Py_buffer *fragment, int width,
|
||||
Py_ssize_t index);
|
||||
|
||||
static PyObject *
|
||||
audioop_getsample(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
Py_ssize_t index;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*in:getsample",
|
||||
&fragment, &width, &index)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_getsample_impl(module, &fragment, width, index);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_max__doc__,
|
||||
"max($module, fragment, width, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the maximum of the absolute value of all samples in a fragment.");
|
||||
|
||||
#define AUDIOOP_MAX_METHODDEF \
|
||||
{"max", (PyCFunction)audioop_max, METH_VARARGS, audioop_max__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_max_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_max(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:max",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_max_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_minmax__doc__,
|
||||
"minmax($module, fragment, width, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the minimum and maximum values of all samples in the sound fragment.");
|
||||
|
||||
#define AUDIOOP_MINMAX_METHODDEF \
|
||||
{"minmax", (PyCFunction)audioop_minmax, METH_VARARGS, audioop_minmax__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_minmax_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_minmax(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:minmax",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_minmax_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_avg__doc__,
|
||||
"avg($module, fragment, width, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the average over all samples in the fragment.");
|
||||
|
||||
#define AUDIOOP_AVG_METHODDEF \
|
||||
{"avg", (PyCFunction)audioop_avg, METH_VARARGS, audioop_avg__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_avg_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_avg(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:avg",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_avg_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_rms__doc__,
|
||||
"rms($module, fragment, width, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the root-mean-square of the fragment, i.e. sqrt(sum(S_i^2)/n).");
|
||||
|
||||
#define AUDIOOP_RMS_METHODDEF \
|
||||
{"rms", (PyCFunction)audioop_rms, METH_VARARGS, audioop_rms__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_rms_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_rms(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:rms",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_rms_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_findfit__doc__,
|
||||
"findfit($module, fragment, reference, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Try to match reference as well as possible to a portion of fragment.");
|
||||
|
||||
#define AUDIOOP_FINDFIT_METHODDEF \
|
||||
{"findfit", (PyCFunction)audioop_findfit, METH_VARARGS, audioop_findfit__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_findfit_impl(PyObject *module, Py_buffer *fragment,
|
||||
Py_buffer *reference);
|
||||
|
||||
static PyObject *
|
||||
audioop_findfit(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
Py_buffer reference = {NULL, NULL};
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*y*:findfit",
|
||||
&fragment, &reference)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_findfit_impl(module, &fragment, &reference);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
/* Cleanup for reference */
|
||||
if (reference.obj) {
|
||||
PyBuffer_Release(&reference);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_findfactor__doc__,
|
||||
"findfactor($module, fragment, reference, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a factor F such that rms(add(fragment, mul(reference, -F))) is minimal.");
|
||||
|
||||
#define AUDIOOP_FINDFACTOR_METHODDEF \
|
||||
{"findfactor", (PyCFunction)audioop_findfactor, METH_VARARGS, audioop_findfactor__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_findfactor_impl(PyObject *module, Py_buffer *fragment,
|
||||
Py_buffer *reference);
|
||||
|
||||
static PyObject *
|
||||
audioop_findfactor(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
Py_buffer reference = {NULL, NULL};
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*y*:findfactor",
|
||||
&fragment, &reference)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_findfactor_impl(module, &fragment, &reference);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
/* Cleanup for reference */
|
||||
if (reference.obj) {
|
||||
PyBuffer_Release(&reference);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_findmax__doc__,
|
||||
"findmax($module, fragment, length, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Search fragment for a slice of specified number of samples with maximum energy.");
|
||||
|
||||
#define AUDIOOP_FINDMAX_METHODDEF \
|
||||
{"findmax", (PyCFunction)audioop_findmax, METH_VARARGS, audioop_findmax__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_findmax_impl(PyObject *module, Py_buffer *fragment,
|
||||
Py_ssize_t length);
|
||||
|
||||
static PyObject *
|
||||
audioop_findmax(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
Py_ssize_t length;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*n:findmax",
|
||||
&fragment, &length)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_findmax_impl(module, &fragment, length);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_avgpp__doc__,
|
||||
"avgpp($module, fragment, width, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the average peak-peak value over all samples in the fragment.");
|
||||
|
||||
#define AUDIOOP_AVGPP_METHODDEF \
|
||||
{"avgpp", (PyCFunction)audioop_avgpp, METH_VARARGS, audioop_avgpp__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_avgpp_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_avgpp(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:avgpp",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_avgpp_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_maxpp__doc__,
|
||||
"maxpp($module, fragment, width, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the maximum peak-peak value in the sound fragment.");
|
||||
|
||||
#define AUDIOOP_MAXPP_METHODDEF \
|
||||
{"maxpp", (PyCFunction)audioop_maxpp, METH_VARARGS, audioop_maxpp__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_maxpp_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_maxpp(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:maxpp",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_maxpp_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_cross__doc__,
|
||||
"cross($module, fragment, width, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the number of zero crossings in the fragment passed as an argument.");
|
||||
|
||||
#define AUDIOOP_CROSS_METHODDEF \
|
||||
{"cross", (PyCFunction)audioop_cross, METH_VARARGS, audioop_cross__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_cross_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_cross(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:cross",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_cross_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_mul__doc__,
|
||||
"mul($module, fragment, width, factor, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a fragment that has all samples in the original fragment multiplied by the floating-point value factor.");
|
||||
|
||||
#define AUDIOOP_MUL_METHODDEF \
|
||||
{"mul", (PyCFunction)audioop_mul, METH_VARARGS, audioop_mul__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_mul_impl(PyObject *module, Py_buffer *fragment, int width,
|
||||
double factor);
|
||||
|
||||
static PyObject *
|
||||
audioop_mul(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
double factor;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*id:mul",
|
||||
&fragment, &width, &factor)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_mul_impl(module, &fragment, width, factor);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_tomono__doc__,
|
||||
"tomono($module, fragment, width, lfactor, rfactor, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Convert a stereo fragment to a mono fragment.");
|
||||
|
||||
#define AUDIOOP_TOMONO_METHODDEF \
|
||||
{"tomono", (PyCFunction)audioop_tomono, METH_VARARGS, audioop_tomono__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_tomono_impl(PyObject *module, Py_buffer *fragment, int width,
|
||||
double lfactor, double rfactor);
|
||||
|
||||
static PyObject *
|
||||
audioop_tomono(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
double lfactor;
|
||||
double rfactor;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*idd:tomono",
|
||||
&fragment, &width, &lfactor, &rfactor)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_tomono_impl(module, &fragment, width, lfactor, rfactor);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_tostereo__doc__,
|
||||
"tostereo($module, fragment, width, lfactor, rfactor, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Generate a stereo fragment from a mono fragment.");
|
||||
|
||||
#define AUDIOOP_TOSTEREO_METHODDEF \
|
||||
{"tostereo", (PyCFunction)audioop_tostereo, METH_VARARGS, audioop_tostereo__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_tostereo_impl(PyObject *module, Py_buffer *fragment, int width,
|
||||
double lfactor, double rfactor);
|
||||
|
||||
static PyObject *
|
||||
audioop_tostereo(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
double lfactor;
|
||||
double rfactor;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*idd:tostereo",
|
||||
&fragment, &width, &lfactor, &rfactor)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_tostereo_impl(module, &fragment, width, lfactor, rfactor);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_add__doc__,
|
||||
"add($module, fragment1, fragment2, width, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a fragment which is the addition of the two samples passed as parameters.");
|
||||
|
||||
#define AUDIOOP_ADD_METHODDEF \
|
||||
{"add", (PyCFunction)audioop_add, METH_VARARGS, audioop_add__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_add_impl(PyObject *module, Py_buffer *fragment1,
|
||||
Py_buffer *fragment2, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_add(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment1 = {NULL, NULL};
|
||||
Py_buffer fragment2 = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*y*i:add",
|
||||
&fragment1, &fragment2, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_add_impl(module, &fragment1, &fragment2, width);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment1 */
|
||||
if (fragment1.obj) {
|
||||
PyBuffer_Release(&fragment1);
|
||||
}
|
||||
/* Cleanup for fragment2 */
|
||||
if (fragment2.obj) {
|
||||
PyBuffer_Release(&fragment2);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_bias__doc__,
|
||||
"bias($module, fragment, width, bias, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a fragment that is the original fragment with a bias added to each sample.");
|
||||
|
||||
#define AUDIOOP_BIAS_METHODDEF \
|
||||
{"bias", (PyCFunction)audioop_bias, METH_VARARGS, audioop_bias__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_bias_impl(PyObject *module, Py_buffer *fragment, int width, int bias);
|
||||
|
||||
static PyObject *
|
||||
audioop_bias(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
int bias;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*ii:bias",
|
||||
&fragment, &width, &bias)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_bias_impl(module, &fragment, width, bias);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_reverse__doc__,
|
||||
"reverse($module, fragment, width, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Reverse the samples in a fragment and returns the modified fragment.");
|
||||
|
||||
#define AUDIOOP_REVERSE_METHODDEF \
|
||||
{"reverse", (PyCFunction)audioop_reverse, METH_VARARGS, audioop_reverse__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_reverse_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_reverse(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:reverse",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_reverse_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_byteswap__doc__,
|
||||
"byteswap($module, fragment, width, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Convert big-endian samples to little-endian and vice versa.");
|
||||
|
||||
#define AUDIOOP_BYTESWAP_METHODDEF \
|
||||
{"byteswap", (PyCFunction)audioop_byteswap, METH_VARARGS, audioop_byteswap__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_byteswap_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_byteswap(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:byteswap",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_byteswap_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_lin2lin__doc__,
|
||||
"lin2lin($module, fragment, width, newwidth, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Convert samples between 1-, 2-, 3- and 4-byte formats.");
|
||||
|
||||
#define AUDIOOP_LIN2LIN_METHODDEF \
|
||||
{"lin2lin", (PyCFunction)audioop_lin2lin, METH_VARARGS, audioop_lin2lin__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_lin2lin_impl(PyObject *module, Py_buffer *fragment, int width,
|
||||
int newwidth);
|
||||
|
||||
static PyObject *
|
||||
audioop_lin2lin(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
int newwidth;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*ii:lin2lin",
|
||||
&fragment, &width, &newwidth)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_lin2lin_impl(module, &fragment, width, newwidth);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_ratecv__doc__,
|
||||
"ratecv($module, fragment, width, nchannels, inrate, outrate, state,\n"
|
||||
" weightA=1, weightB=0, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Convert the frame rate of the input fragment.");
|
||||
|
||||
#define AUDIOOP_RATECV_METHODDEF \
|
||||
{"ratecv", (PyCFunction)audioop_ratecv, METH_VARARGS, audioop_ratecv__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_ratecv_impl(PyObject *module, Py_buffer *fragment, int width,
|
||||
int nchannels, int inrate, int outrate, PyObject *state,
|
||||
int weightA, int weightB);
|
||||
|
||||
static PyObject *
|
||||
audioop_ratecv(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
int nchannels;
|
||||
int inrate;
|
||||
int outrate;
|
||||
PyObject *state;
|
||||
int weightA = 1;
|
||||
int weightB = 0;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*iiiiO|ii:ratecv",
|
||||
&fragment, &width, &nchannels, &inrate, &outrate, &state, &weightA, &weightB)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_ratecv_impl(module, &fragment, width, nchannels, inrate, outrate, state, weightA, weightB);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_lin2ulaw__doc__,
|
||||
"lin2ulaw($module, fragment, width, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Convert samples in the audio fragment to u-LAW encoding.");
|
||||
|
||||
#define AUDIOOP_LIN2ULAW_METHODDEF \
|
||||
{"lin2ulaw", (PyCFunction)audioop_lin2ulaw, METH_VARARGS, audioop_lin2ulaw__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_lin2ulaw_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_lin2ulaw(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:lin2ulaw",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_lin2ulaw_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_ulaw2lin__doc__,
|
||||
"ulaw2lin($module, fragment, width, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Convert sound fragments in u-LAW encoding to linearly encoded sound fragments.");
|
||||
|
||||
#define AUDIOOP_ULAW2LIN_METHODDEF \
|
||||
{"ulaw2lin", (PyCFunction)audioop_ulaw2lin, METH_VARARGS, audioop_ulaw2lin__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_ulaw2lin_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_ulaw2lin(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:ulaw2lin",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_ulaw2lin_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_lin2alaw__doc__,
|
||||
"lin2alaw($module, fragment, width, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Convert samples in the audio fragment to a-LAW encoding.");
|
||||
|
||||
#define AUDIOOP_LIN2ALAW_METHODDEF \
|
||||
{"lin2alaw", (PyCFunction)audioop_lin2alaw, METH_VARARGS, audioop_lin2alaw__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_lin2alaw_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_lin2alaw(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:lin2alaw",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_lin2alaw_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_alaw2lin__doc__,
|
||||
"alaw2lin($module, fragment, width, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Convert sound fragments in a-LAW encoding to linearly encoded sound fragments.");
|
||||
|
||||
#define AUDIOOP_ALAW2LIN_METHODDEF \
|
||||
{"alaw2lin", (PyCFunction)audioop_alaw2lin, METH_VARARGS, audioop_alaw2lin__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_alaw2lin_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_alaw2lin(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:alaw2lin",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_alaw2lin_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_lin2adpcm__doc__,
|
||||
"lin2adpcm($module, fragment, width, state, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Convert samples to 4 bit Intel/DVI ADPCM encoding.");
|
||||
|
||||
#define AUDIOOP_LIN2ADPCM_METHODDEF \
|
||||
{"lin2adpcm", (PyCFunction)audioop_lin2adpcm, METH_VARARGS, audioop_lin2adpcm__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_lin2adpcm_impl(PyObject *module, Py_buffer *fragment, int width,
|
||||
PyObject *state);
|
||||
|
||||
static PyObject *
|
||||
audioop_lin2adpcm(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
PyObject *state;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*iO:lin2adpcm",
|
||||
&fragment, &width, &state)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_lin2adpcm_impl(module, &fragment, width, state);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(audioop_adpcm2lin__doc__,
|
||||
"adpcm2lin($module, fragment, width, state, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Decode an Intel/DVI ADPCM coded fragment to a linear fragment.");
|
||||
|
||||
#define AUDIOOP_ADPCM2LIN_METHODDEF \
|
||||
{"adpcm2lin", (PyCFunction)audioop_adpcm2lin, METH_VARARGS, audioop_adpcm2lin__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_adpcm2lin_impl(PyObject *module, Py_buffer *fragment, int width,
|
||||
PyObject *state);
|
||||
|
||||
static PyObject *
|
||||
audioop_adpcm2lin(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
PyObject *state;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*iO:adpcm2lin",
|
||||
&fragment, &width, &state)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_adpcm2lin_impl(module, &fragment, width, state);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=e0ab74c3fa57c39c input=a9049054013a1b77]*/
|
553
third_party/python/Modules/clinic/binascii.c.h
generated
vendored
Normal file
553
third_party/python/Modules/clinic/binascii.c.h
generated
vendored
Normal file
|
@ -0,0 +1,553 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(binascii_a2b_uu__doc__,
|
||||
"a2b_uu($module, data, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Decode a line of uuencoded data.");
|
||||
|
||||
#define BINASCII_A2B_UU_METHODDEF \
|
||||
{"a2b_uu", (PyCFunction)binascii_a2b_uu, METH_O, binascii_a2b_uu__doc__},
|
||||
|
||||
static PyObject *
|
||||
binascii_a2b_uu_impl(PyObject *module, Py_buffer *data);
|
||||
|
||||
static PyObject *
|
||||
binascii_a2b_uu(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
|
||||
if (!PyArg_Parse(arg, "O&:a2b_uu", ascii_buffer_converter, &data)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = binascii_a2b_uu_impl(module, &data);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj)
|
||||
PyBuffer_Release(&data);
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(binascii_b2a_uu__doc__,
|
||||
"b2a_uu($module, data, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Uuencode line of data.");
|
||||
|
||||
#define BINASCII_B2A_UU_METHODDEF \
|
||||
{"b2a_uu", (PyCFunction)binascii_b2a_uu, METH_O, binascii_b2a_uu__doc__},
|
||||
|
||||
static PyObject *
|
||||
binascii_b2a_uu_impl(PyObject *module, Py_buffer *data);
|
||||
|
||||
static PyObject *
|
||||
binascii_b2a_uu(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
|
||||
if (!PyArg_Parse(arg, "y*:b2a_uu", &data)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = binascii_b2a_uu_impl(module, &data);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(binascii_a2b_base64__doc__,
|
||||
"a2b_base64($module, data, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Decode a line of base64 data.");
|
||||
|
||||
#define BINASCII_A2B_BASE64_METHODDEF \
|
||||
{"a2b_base64", (PyCFunction)binascii_a2b_base64, METH_O, binascii_a2b_base64__doc__},
|
||||
|
||||
static PyObject *
|
||||
binascii_a2b_base64_impl(PyObject *module, Py_buffer *data);
|
||||
|
||||
static PyObject *
|
||||
binascii_a2b_base64(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
|
||||
if (!PyArg_Parse(arg, "O&:a2b_base64", ascii_buffer_converter, &data)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = binascii_a2b_base64_impl(module, &data);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj)
|
||||
PyBuffer_Release(&data);
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(binascii_b2a_base64__doc__,
|
||||
"b2a_base64($module, /, data, *, newline=True)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Base64-code line of data.");
|
||||
|
||||
#define BINASCII_B2A_BASE64_METHODDEF \
|
||||
{"b2a_base64", (PyCFunction)binascii_b2a_base64, METH_FASTCALL, binascii_b2a_base64__doc__},
|
||||
|
||||
static PyObject *
|
||||
binascii_b2a_base64_impl(PyObject *module, Py_buffer *data, int newline);
|
||||
|
||||
static PyObject *
|
||||
binascii_b2a_base64(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"data", "newline", NULL};
|
||||
static _PyArg_Parser _parser = {"y*|$i:b2a_base64", _keywords, 0};
|
||||
Py_buffer data = {NULL, NULL};
|
||||
int newline = 1;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&data, &newline)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = binascii_b2a_base64_impl(module, &data, newline);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(binascii_a2b_hqx__doc__,
|
||||
"a2b_hqx($module, data, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Decode .hqx coding.");
|
||||
|
||||
#define BINASCII_A2B_HQX_METHODDEF \
|
||||
{"a2b_hqx", (PyCFunction)binascii_a2b_hqx, METH_O, binascii_a2b_hqx__doc__},
|
||||
|
||||
static PyObject *
|
||||
binascii_a2b_hqx_impl(PyObject *module, Py_buffer *data);
|
||||
|
||||
static PyObject *
|
||||
binascii_a2b_hqx(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
|
||||
if (!PyArg_Parse(arg, "O&:a2b_hqx", ascii_buffer_converter, &data)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = binascii_a2b_hqx_impl(module, &data);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj)
|
||||
PyBuffer_Release(&data);
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(binascii_rlecode_hqx__doc__,
|
||||
"rlecode_hqx($module, data, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Binhex RLE-code binary data.");
|
||||
|
||||
#define BINASCII_RLECODE_HQX_METHODDEF \
|
||||
{"rlecode_hqx", (PyCFunction)binascii_rlecode_hqx, METH_O, binascii_rlecode_hqx__doc__},
|
||||
|
||||
static PyObject *
|
||||
binascii_rlecode_hqx_impl(PyObject *module, Py_buffer *data);
|
||||
|
||||
static PyObject *
|
||||
binascii_rlecode_hqx(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
|
||||
if (!PyArg_Parse(arg, "y*:rlecode_hqx", &data)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = binascii_rlecode_hqx_impl(module, &data);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(binascii_b2a_hqx__doc__,
|
||||
"b2a_hqx($module, data, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Encode .hqx data.");
|
||||
|
||||
#define BINASCII_B2A_HQX_METHODDEF \
|
||||
{"b2a_hqx", (PyCFunction)binascii_b2a_hqx, METH_O, binascii_b2a_hqx__doc__},
|
||||
|
||||
static PyObject *
|
||||
binascii_b2a_hqx_impl(PyObject *module, Py_buffer *data);
|
||||
|
||||
static PyObject *
|
||||
binascii_b2a_hqx(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
|
||||
if (!PyArg_Parse(arg, "y*:b2a_hqx", &data)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = binascii_b2a_hqx_impl(module, &data);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(binascii_rledecode_hqx__doc__,
|
||||
"rledecode_hqx($module, data, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Decode hexbin RLE-coded string.");
|
||||
|
||||
#define BINASCII_RLEDECODE_HQX_METHODDEF \
|
||||
{"rledecode_hqx", (PyCFunction)binascii_rledecode_hqx, METH_O, binascii_rledecode_hqx__doc__},
|
||||
|
||||
static PyObject *
|
||||
binascii_rledecode_hqx_impl(PyObject *module, Py_buffer *data);
|
||||
|
||||
static PyObject *
|
||||
binascii_rledecode_hqx(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
|
||||
if (!PyArg_Parse(arg, "y*:rledecode_hqx", &data)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = binascii_rledecode_hqx_impl(module, &data);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(binascii_crc_hqx__doc__,
|
||||
"crc_hqx($module, data, crc, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Compute CRC-CCITT incrementally.");
|
||||
|
||||
#define BINASCII_CRC_HQX_METHODDEF \
|
||||
{"crc_hqx", (PyCFunction)binascii_crc_hqx, METH_VARARGS, binascii_crc_hqx__doc__},
|
||||
|
||||
static unsigned int
|
||||
binascii_crc_hqx_impl(PyObject *module, Py_buffer *data, unsigned int crc);
|
||||
|
||||
static PyObject *
|
||||
binascii_crc_hqx(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
unsigned int crc;
|
||||
unsigned int _return_value;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*I:crc_hqx",
|
||||
&data, &crc)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = binascii_crc_hqx_impl(module, &data, crc);
|
||||
if ((_return_value == (unsigned int)-1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromUnsignedLong((unsigned long)_return_value);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(binascii_crc32__doc__,
|
||||
"crc32($module, data, crc=0, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Compute CRC-32 incrementally.");
|
||||
|
||||
#define BINASCII_CRC32_METHODDEF \
|
||||
{"crc32", (PyCFunction)binascii_crc32, METH_VARARGS, binascii_crc32__doc__},
|
||||
|
||||
static unsigned int
|
||||
binascii_crc32_impl(PyObject *module, Py_buffer *data, unsigned int crc);
|
||||
|
||||
static PyObject *
|
||||
binascii_crc32(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
unsigned int crc = 0;
|
||||
unsigned int _return_value;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*|I:crc32",
|
||||
&data, &crc)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = binascii_crc32_impl(module, &data, crc);
|
||||
if ((_return_value == (unsigned int)-1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromUnsignedLong((unsigned long)_return_value);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(binascii_b2a_hex__doc__,
|
||||
"b2a_hex($module, data, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Hexadecimal representation of binary data.\n"
|
||||
"\n"
|
||||
"The return value is a bytes object. This function is also\n"
|
||||
"available as \"hexlify()\".");
|
||||
|
||||
#define BINASCII_B2A_HEX_METHODDEF \
|
||||
{"b2a_hex", (PyCFunction)binascii_b2a_hex, METH_O, binascii_b2a_hex__doc__},
|
||||
|
||||
static PyObject *
|
||||
binascii_b2a_hex_impl(PyObject *module, Py_buffer *data);
|
||||
|
||||
static PyObject *
|
||||
binascii_b2a_hex(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
|
||||
if (!PyArg_Parse(arg, "y*:b2a_hex", &data)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = binascii_b2a_hex_impl(module, &data);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(binascii_hexlify__doc__,
|
||||
"hexlify($module, data, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Hexadecimal representation of binary data.\n"
|
||||
"\n"
|
||||
"The return value is a bytes object.");
|
||||
|
||||
#define BINASCII_HEXLIFY_METHODDEF \
|
||||
{"hexlify", (PyCFunction)binascii_hexlify, METH_O, binascii_hexlify__doc__},
|
||||
|
||||
static PyObject *
|
||||
binascii_hexlify_impl(PyObject *module, Py_buffer *data);
|
||||
|
||||
static PyObject *
|
||||
binascii_hexlify(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
|
||||
if (!PyArg_Parse(arg, "y*:hexlify", &data)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = binascii_hexlify_impl(module, &data);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(binascii_a2b_hex__doc__,
|
||||
"a2b_hex($module, hexstr, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Binary data of hexadecimal representation.\n"
|
||||
"\n"
|
||||
"hexstr must contain an even number of hex digits (upper or lower case).\n"
|
||||
"This function is also available as \"unhexlify()\".");
|
||||
|
||||
#define BINASCII_A2B_HEX_METHODDEF \
|
||||
{"a2b_hex", (PyCFunction)binascii_a2b_hex, METH_O, binascii_a2b_hex__doc__},
|
||||
|
||||
static PyObject *
|
||||
binascii_a2b_hex_impl(PyObject *module, Py_buffer *hexstr);
|
||||
|
||||
static PyObject *
|
||||
binascii_a2b_hex(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer hexstr = {NULL, NULL};
|
||||
|
||||
if (!PyArg_Parse(arg, "O&:a2b_hex", ascii_buffer_converter, &hexstr)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = binascii_a2b_hex_impl(module, &hexstr);
|
||||
|
||||
exit:
|
||||
/* Cleanup for hexstr */
|
||||
if (hexstr.obj)
|
||||
PyBuffer_Release(&hexstr);
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(binascii_unhexlify__doc__,
|
||||
"unhexlify($module, hexstr, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Binary data of hexadecimal representation.\n"
|
||||
"\n"
|
||||
"hexstr must contain an even number of hex digits (upper or lower case).");
|
||||
|
||||
#define BINASCII_UNHEXLIFY_METHODDEF \
|
||||
{"unhexlify", (PyCFunction)binascii_unhexlify, METH_O, binascii_unhexlify__doc__},
|
||||
|
||||
static PyObject *
|
||||
binascii_unhexlify_impl(PyObject *module, Py_buffer *hexstr);
|
||||
|
||||
static PyObject *
|
||||
binascii_unhexlify(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer hexstr = {NULL, NULL};
|
||||
|
||||
if (!PyArg_Parse(arg, "O&:unhexlify", ascii_buffer_converter, &hexstr)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = binascii_unhexlify_impl(module, &hexstr);
|
||||
|
||||
exit:
|
||||
/* Cleanup for hexstr */
|
||||
if (hexstr.obj)
|
||||
PyBuffer_Release(&hexstr);
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(binascii_a2b_qp__doc__,
|
||||
"a2b_qp($module, /, data, header=False)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Decode a string of qp-encoded data.");
|
||||
|
||||
#define BINASCII_A2B_QP_METHODDEF \
|
||||
{"a2b_qp", (PyCFunction)binascii_a2b_qp, METH_FASTCALL, binascii_a2b_qp__doc__},
|
||||
|
||||
static PyObject *
|
||||
binascii_a2b_qp_impl(PyObject *module, Py_buffer *data, int header);
|
||||
|
||||
static PyObject *
|
||||
binascii_a2b_qp(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"data", "header", NULL};
|
||||
static _PyArg_Parser _parser = {"O&|i:a2b_qp", _keywords, 0};
|
||||
Py_buffer data = {NULL, NULL};
|
||||
int header = 0;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
ascii_buffer_converter, &data, &header)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = binascii_a2b_qp_impl(module, &data, header);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj)
|
||||
PyBuffer_Release(&data);
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(binascii_b2a_qp__doc__,
|
||||
"b2a_qp($module, /, data, quotetabs=False, istext=True, header=False)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Encode a string using quoted-printable encoding.\n"
|
||||
"\n"
|
||||
"On encoding, when istext is set, newlines are not encoded, and white\n"
|
||||
"space at end of lines is. When istext is not set, \\r and \\n (CR/LF)\n"
|
||||
"are both encoded. When quotetabs is set, space and tabs are encoded.");
|
||||
|
||||
#define BINASCII_B2A_QP_METHODDEF \
|
||||
{"b2a_qp", (PyCFunction)binascii_b2a_qp, METH_FASTCALL, binascii_b2a_qp__doc__},
|
||||
|
||||
static PyObject *
|
||||
binascii_b2a_qp_impl(PyObject *module, Py_buffer *data, int quotetabs,
|
||||
int istext, int header);
|
||||
|
||||
static PyObject *
|
||||
binascii_b2a_qp(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"data", "quotetabs", "istext", "header", NULL};
|
||||
static _PyArg_Parser _parser = {"y*|iii:b2a_qp", _keywords, 0};
|
||||
Py_buffer data = {NULL, NULL};
|
||||
int quotetabs = 0;
|
||||
int istext = 1;
|
||||
int header = 0;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&data, "etabs, &istext, &header)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = binascii_b2a_qp_impl(module, &data, quotetabs, istext, header);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=458eb09731cb7877 input=a9049054013a1b77]*/
|
885
third_party/python/Modules/clinic/cmathmodule.c.h
generated
vendored
Normal file
885
third_party/python/Modules/clinic/cmathmodule.c.h
generated
vendored
Normal file
|
@ -0,0 +1,885 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(cmath_acos__doc__,
|
||||
"acos($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the arc cosine of z.");
|
||||
|
||||
#define CMATH_ACOS_METHODDEF \
|
||||
{"acos", (PyCFunction)cmath_acos, METH_O, cmath_acos__doc__},
|
||||
|
||||
static Py_complex
|
||||
cmath_acos_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_acos(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
Py_complex _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:acos", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
/* modifications for z */
|
||||
errno = 0; PyFPE_START_PROTECT("complex function", goto exit);
|
||||
_return_value = cmath_acos_impl(module, z);
|
||||
PyFPE_END_PROTECT(_return_value);
|
||||
if (errno == EDOM) {
|
||||
PyErr_SetString(PyExc_ValueError, "math domain error");
|
||||
goto exit;
|
||||
}
|
||||
else if (errno == ERANGE) {
|
||||
PyErr_SetString(PyExc_OverflowError, "math range error");
|
||||
goto exit;
|
||||
}
|
||||
else {
|
||||
return_value = PyComplex_FromCComplex(_return_value);
|
||||
}
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_acosh__doc__,
|
||||
"acosh($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the inverse hyperbolic cosine of z.");
|
||||
|
||||
#define CMATH_ACOSH_METHODDEF \
|
||||
{"acosh", (PyCFunction)cmath_acosh, METH_O, cmath_acosh__doc__},
|
||||
|
||||
static Py_complex
|
||||
cmath_acosh_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_acosh(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
Py_complex _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:acosh", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
/* modifications for z */
|
||||
errno = 0; PyFPE_START_PROTECT("complex function", goto exit);
|
||||
_return_value = cmath_acosh_impl(module, z);
|
||||
PyFPE_END_PROTECT(_return_value);
|
||||
if (errno == EDOM) {
|
||||
PyErr_SetString(PyExc_ValueError, "math domain error");
|
||||
goto exit;
|
||||
}
|
||||
else if (errno == ERANGE) {
|
||||
PyErr_SetString(PyExc_OverflowError, "math range error");
|
||||
goto exit;
|
||||
}
|
||||
else {
|
||||
return_value = PyComplex_FromCComplex(_return_value);
|
||||
}
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_asin__doc__,
|
||||
"asin($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the arc sine of z.");
|
||||
|
||||
#define CMATH_ASIN_METHODDEF \
|
||||
{"asin", (PyCFunction)cmath_asin, METH_O, cmath_asin__doc__},
|
||||
|
||||
static Py_complex
|
||||
cmath_asin_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_asin(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
Py_complex _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:asin", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
/* modifications for z */
|
||||
errno = 0; PyFPE_START_PROTECT("complex function", goto exit);
|
||||
_return_value = cmath_asin_impl(module, z);
|
||||
PyFPE_END_PROTECT(_return_value);
|
||||
if (errno == EDOM) {
|
||||
PyErr_SetString(PyExc_ValueError, "math domain error");
|
||||
goto exit;
|
||||
}
|
||||
else if (errno == ERANGE) {
|
||||
PyErr_SetString(PyExc_OverflowError, "math range error");
|
||||
goto exit;
|
||||
}
|
||||
else {
|
||||
return_value = PyComplex_FromCComplex(_return_value);
|
||||
}
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_asinh__doc__,
|
||||
"asinh($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the inverse hyperbolic sine of z.");
|
||||
|
||||
#define CMATH_ASINH_METHODDEF \
|
||||
{"asinh", (PyCFunction)cmath_asinh, METH_O, cmath_asinh__doc__},
|
||||
|
||||
static Py_complex
|
||||
cmath_asinh_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_asinh(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
Py_complex _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:asinh", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
/* modifications for z */
|
||||
errno = 0; PyFPE_START_PROTECT("complex function", goto exit);
|
||||
_return_value = cmath_asinh_impl(module, z);
|
||||
PyFPE_END_PROTECT(_return_value);
|
||||
if (errno == EDOM) {
|
||||
PyErr_SetString(PyExc_ValueError, "math domain error");
|
||||
goto exit;
|
||||
}
|
||||
else if (errno == ERANGE) {
|
||||
PyErr_SetString(PyExc_OverflowError, "math range error");
|
||||
goto exit;
|
||||
}
|
||||
else {
|
||||
return_value = PyComplex_FromCComplex(_return_value);
|
||||
}
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_atan__doc__,
|
||||
"atan($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the arc tangent of z.");
|
||||
|
||||
#define CMATH_ATAN_METHODDEF \
|
||||
{"atan", (PyCFunction)cmath_atan, METH_O, cmath_atan__doc__},
|
||||
|
||||
static Py_complex
|
||||
cmath_atan_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_atan(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
Py_complex _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:atan", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
/* modifications for z */
|
||||
errno = 0; PyFPE_START_PROTECT("complex function", goto exit);
|
||||
_return_value = cmath_atan_impl(module, z);
|
||||
PyFPE_END_PROTECT(_return_value);
|
||||
if (errno == EDOM) {
|
||||
PyErr_SetString(PyExc_ValueError, "math domain error");
|
||||
goto exit;
|
||||
}
|
||||
else if (errno == ERANGE) {
|
||||
PyErr_SetString(PyExc_OverflowError, "math range error");
|
||||
goto exit;
|
||||
}
|
||||
else {
|
||||
return_value = PyComplex_FromCComplex(_return_value);
|
||||
}
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_atanh__doc__,
|
||||
"atanh($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the inverse hyperbolic tangent of z.");
|
||||
|
||||
#define CMATH_ATANH_METHODDEF \
|
||||
{"atanh", (PyCFunction)cmath_atanh, METH_O, cmath_atanh__doc__},
|
||||
|
||||
static Py_complex
|
||||
cmath_atanh_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_atanh(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
Py_complex _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:atanh", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
/* modifications for z */
|
||||
errno = 0; PyFPE_START_PROTECT("complex function", goto exit);
|
||||
_return_value = cmath_atanh_impl(module, z);
|
||||
PyFPE_END_PROTECT(_return_value);
|
||||
if (errno == EDOM) {
|
||||
PyErr_SetString(PyExc_ValueError, "math domain error");
|
||||
goto exit;
|
||||
}
|
||||
else if (errno == ERANGE) {
|
||||
PyErr_SetString(PyExc_OverflowError, "math range error");
|
||||
goto exit;
|
||||
}
|
||||
else {
|
||||
return_value = PyComplex_FromCComplex(_return_value);
|
||||
}
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_cos__doc__,
|
||||
"cos($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the cosine of z.");
|
||||
|
||||
#define CMATH_COS_METHODDEF \
|
||||
{"cos", (PyCFunction)cmath_cos, METH_O, cmath_cos__doc__},
|
||||
|
||||
static Py_complex
|
||||
cmath_cos_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_cos(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
Py_complex _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:cos", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
/* modifications for z */
|
||||
errno = 0; PyFPE_START_PROTECT("complex function", goto exit);
|
||||
_return_value = cmath_cos_impl(module, z);
|
||||
PyFPE_END_PROTECT(_return_value);
|
||||
if (errno == EDOM) {
|
||||
PyErr_SetString(PyExc_ValueError, "math domain error");
|
||||
goto exit;
|
||||
}
|
||||
else if (errno == ERANGE) {
|
||||
PyErr_SetString(PyExc_OverflowError, "math range error");
|
||||
goto exit;
|
||||
}
|
||||
else {
|
||||
return_value = PyComplex_FromCComplex(_return_value);
|
||||
}
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_cosh__doc__,
|
||||
"cosh($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the hyperbolic cosine of z.");
|
||||
|
||||
#define CMATH_COSH_METHODDEF \
|
||||
{"cosh", (PyCFunction)cmath_cosh, METH_O, cmath_cosh__doc__},
|
||||
|
||||
static Py_complex
|
||||
cmath_cosh_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_cosh(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
Py_complex _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:cosh", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
/* modifications for z */
|
||||
errno = 0; PyFPE_START_PROTECT("complex function", goto exit);
|
||||
_return_value = cmath_cosh_impl(module, z);
|
||||
PyFPE_END_PROTECT(_return_value);
|
||||
if (errno == EDOM) {
|
||||
PyErr_SetString(PyExc_ValueError, "math domain error");
|
||||
goto exit;
|
||||
}
|
||||
else if (errno == ERANGE) {
|
||||
PyErr_SetString(PyExc_OverflowError, "math range error");
|
||||
goto exit;
|
||||
}
|
||||
else {
|
||||
return_value = PyComplex_FromCComplex(_return_value);
|
||||
}
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_exp__doc__,
|
||||
"exp($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the exponential value e**z.");
|
||||
|
||||
#define CMATH_EXP_METHODDEF \
|
||||
{"exp", (PyCFunction)cmath_exp, METH_O, cmath_exp__doc__},
|
||||
|
||||
static Py_complex
|
||||
cmath_exp_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_exp(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
Py_complex _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:exp", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
/* modifications for z */
|
||||
errno = 0; PyFPE_START_PROTECT("complex function", goto exit);
|
||||
_return_value = cmath_exp_impl(module, z);
|
||||
PyFPE_END_PROTECT(_return_value);
|
||||
if (errno == EDOM) {
|
||||
PyErr_SetString(PyExc_ValueError, "math domain error");
|
||||
goto exit;
|
||||
}
|
||||
else if (errno == ERANGE) {
|
||||
PyErr_SetString(PyExc_OverflowError, "math range error");
|
||||
goto exit;
|
||||
}
|
||||
else {
|
||||
return_value = PyComplex_FromCComplex(_return_value);
|
||||
}
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_log10__doc__,
|
||||
"log10($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the base-10 logarithm of z.");
|
||||
|
||||
#define CMATH_LOG10_METHODDEF \
|
||||
{"log10", (PyCFunction)cmath_log10, METH_O, cmath_log10__doc__},
|
||||
|
||||
static Py_complex
|
||||
cmath_log10_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_log10(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
Py_complex _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:log10", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
/* modifications for z */
|
||||
errno = 0; PyFPE_START_PROTECT("complex function", goto exit);
|
||||
_return_value = cmath_log10_impl(module, z);
|
||||
PyFPE_END_PROTECT(_return_value);
|
||||
if (errno == EDOM) {
|
||||
PyErr_SetString(PyExc_ValueError, "math domain error");
|
||||
goto exit;
|
||||
}
|
||||
else if (errno == ERANGE) {
|
||||
PyErr_SetString(PyExc_OverflowError, "math range error");
|
||||
goto exit;
|
||||
}
|
||||
else {
|
||||
return_value = PyComplex_FromCComplex(_return_value);
|
||||
}
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_sin__doc__,
|
||||
"sin($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the sine of z.");
|
||||
|
||||
#define CMATH_SIN_METHODDEF \
|
||||
{"sin", (PyCFunction)cmath_sin, METH_O, cmath_sin__doc__},
|
||||
|
||||
static Py_complex
|
||||
cmath_sin_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_sin(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
Py_complex _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:sin", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
/* modifications for z */
|
||||
errno = 0; PyFPE_START_PROTECT("complex function", goto exit);
|
||||
_return_value = cmath_sin_impl(module, z);
|
||||
PyFPE_END_PROTECT(_return_value);
|
||||
if (errno == EDOM) {
|
||||
PyErr_SetString(PyExc_ValueError, "math domain error");
|
||||
goto exit;
|
||||
}
|
||||
else if (errno == ERANGE) {
|
||||
PyErr_SetString(PyExc_OverflowError, "math range error");
|
||||
goto exit;
|
||||
}
|
||||
else {
|
||||
return_value = PyComplex_FromCComplex(_return_value);
|
||||
}
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_sinh__doc__,
|
||||
"sinh($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the hyperbolic sine of z.");
|
||||
|
||||
#define CMATH_SINH_METHODDEF \
|
||||
{"sinh", (PyCFunction)cmath_sinh, METH_O, cmath_sinh__doc__},
|
||||
|
||||
static Py_complex
|
||||
cmath_sinh_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_sinh(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
Py_complex _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:sinh", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
/* modifications for z */
|
||||
errno = 0; PyFPE_START_PROTECT("complex function", goto exit);
|
||||
_return_value = cmath_sinh_impl(module, z);
|
||||
PyFPE_END_PROTECT(_return_value);
|
||||
if (errno == EDOM) {
|
||||
PyErr_SetString(PyExc_ValueError, "math domain error");
|
||||
goto exit;
|
||||
}
|
||||
else if (errno == ERANGE) {
|
||||
PyErr_SetString(PyExc_OverflowError, "math range error");
|
||||
goto exit;
|
||||
}
|
||||
else {
|
||||
return_value = PyComplex_FromCComplex(_return_value);
|
||||
}
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_sqrt__doc__,
|
||||
"sqrt($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the square root of z.");
|
||||
|
||||
#define CMATH_SQRT_METHODDEF \
|
||||
{"sqrt", (PyCFunction)cmath_sqrt, METH_O, cmath_sqrt__doc__},
|
||||
|
||||
static Py_complex
|
||||
cmath_sqrt_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_sqrt(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
Py_complex _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:sqrt", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
/* modifications for z */
|
||||
errno = 0; PyFPE_START_PROTECT("complex function", goto exit);
|
||||
_return_value = cmath_sqrt_impl(module, z);
|
||||
PyFPE_END_PROTECT(_return_value);
|
||||
if (errno == EDOM) {
|
||||
PyErr_SetString(PyExc_ValueError, "math domain error");
|
||||
goto exit;
|
||||
}
|
||||
else if (errno == ERANGE) {
|
||||
PyErr_SetString(PyExc_OverflowError, "math range error");
|
||||
goto exit;
|
||||
}
|
||||
else {
|
||||
return_value = PyComplex_FromCComplex(_return_value);
|
||||
}
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_tan__doc__,
|
||||
"tan($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the tangent of z.");
|
||||
|
||||
#define CMATH_TAN_METHODDEF \
|
||||
{"tan", (PyCFunction)cmath_tan, METH_O, cmath_tan__doc__},
|
||||
|
||||
static Py_complex
|
||||
cmath_tan_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_tan(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
Py_complex _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:tan", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
/* modifications for z */
|
||||
errno = 0; PyFPE_START_PROTECT("complex function", goto exit);
|
||||
_return_value = cmath_tan_impl(module, z);
|
||||
PyFPE_END_PROTECT(_return_value);
|
||||
if (errno == EDOM) {
|
||||
PyErr_SetString(PyExc_ValueError, "math domain error");
|
||||
goto exit;
|
||||
}
|
||||
else if (errno == ERANGE) {
|
||||
PyErr_SetString(PyExc_OverflowError, "math range error");
|
||||
goto exit;
|
||||
}
|
||||
else {
|
||||
return_value = PyComplex_FromCComplex(_return_value);
|
||||
}
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_tanh__doc__,
|
||||
"tanh($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the hyperbolic tangent of z.");
|
||||
|
||||
#define CMATH_TANH_METHODDEF \
|
||||
{"tanh", (PyCFunction)cmath_tanh, METH_O, cmath_tanh__doc__},
|
||||
|
||||
static Py_complex
|
||||
cmath_tanh_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_tanh(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
Py_complex _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:tanh", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
/* modifications for z */
|
||||
errno = 0; PyFPE_START_PROTECT("complex function", goto exit);
|
||||
_return_value = cmath_tanh_impl(module, z);
|
||||
PyFPE_END_PROTECT(_return_value);
|
||||
if (errno == EDOM) {
|
||||
PyErr_SetString(PyExc_ValueError, "math domain error");
|
||||
goto exit;
|
||||
}
|
||||
else if (errno == ERANGE) {
|
||||
PyErr_SetString(PyExc_OverflowError, "math range error");
|
||||
goto exit;
|
||||
}
|
||||
else {
|
||||
return_value = PyComplex_FromCComplex(_return_value);
|
||||
}
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_log__doc__,
|
||||
"log($module, x, y_obj=None, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"The logarithm of z to the given base.\n"
|
||||
"\n"
|
||||
"If the base not specified, returns the natural logarithm (base e) of z.");
|
||||
|
||||
#define CMATH_LOG_METHODDEF \
|
||||
{"log", (PyCFunction)cmath_log, METH_VARARGS, cmath_log__doc__},
|
||||
|
||||
static PyObject *
|
||||
cmath_log_impl(PyObject *module, Py_complex x, PyObject *y_obj);
|
||||
|
||||
static PyObject *
|
||||
cmath_log(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex x;
|
||||
PyObject *y_obj = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "D|O:log",
|
||||
&x, &y_obj)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = cmath_log_impl(module, x, y_obj);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_phase__doc__,
|
||||
"phase($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return argument, also known as the phase angle, of a complex.");
|
||||
|
||||
#define CMATH_PHASE_METHODDEF \
|
||||
{"phase", (PyCFunction)cmath_phase, METH_O, cmath_phase__doc__},
|
||||
|
||||
static PyObject *
|
||||
cmath_phase_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_phase(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:phase", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = cmath_phase_impl(module, z);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_polar__doc__,
|
||||
"polar($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Convert a complex from rectangular coordinates to polar coordinates.\n"
|
||||
"\n"
|
||||
"r is the distance from 0 and phi the phase angle.");
|
||||
|
||||
#define CMATH_POLAR_METHODDEF \
|
||||
{"polar", (PyCFunction)cmath_polar, METH_O, cmath_polar__doc__},
|
||||
|
||||
static PyObject *
|
||||
cmath_polar_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_polar(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:polar", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = cmath_polar_impl(module, z);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_rect__doc__,
|
||||
"rect($module, r, phi, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Convert from polar coordinates to rectangular coordinates.");
|
||||
|
||||
#define CMATH_RECT_METHODDEF \
|
||||
{"rect", (PyCFunction)cmath_rect, METH_VARARGS, cmath_rect__doc__},
|
||||
|
||||
static PyObject *
|
||||
cmath_rect_impl(PyObject *module, double r, double phi);
|
||||
|
||||
static PyObject *
|
||||
cmath_rect(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
double r;
|
||||
double phi;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "dd:rect",
|
||||
&r, &phi)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = cmath_rect_impl(module, r, phi);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_isfinite__doc__,
|
||||
"isfinite($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return True if both the real and imaginary parts of z are finite, else False.");
|
||||
|
||||
#define CMATH_ISFINITE_METHODDEF \
|
||||
{"isfinite", (PyCFunction)cmath_isfinite, METH_O, cmath_isfinite__doc__},
|
||||
|
||||
static PyObject *
|
||||
cmath_isfinite_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_isfinite(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:isfinite", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = cmath_isfinite_impl(module, z);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_isnan__doc__,
|
||||
"isnan($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Checks if the real or imaginary part of z not a number (NaN).");
|
||||
|
||||
#define CMATH_ISNAN_METHODDEF \
|
||||
{"isnan", (PyCFunction)cmath_isnan, METH_O, cmath_isnan__doc__},
|
||||
|
||||
static PyObject *
|
||||
cmath_isnan_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_isnan(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:isnan", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = cmath_isnan_impl(module, z);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_isinf__doc__,
|
||||
"isinf($module, z, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Checks if the real or imaginary part of z is infinite.");
|
||||
|
||||
#define CMATH_ISINF_METHODDEF \
|
||||
{"isinf", (PyCFunction)cmath_isinf, METH_O, cmath_isinf__doc__},
|
||||
|
||||
static PyObject *
|
||||
cmath_isinf_impl(PyObject *module, Py_complex z);
|
||||
|
||||
static PyObject *
|
||||
cmath_isinf(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex z;
|
||||
|
||||
if (!PyArg_Parse(arg, "D:isinf", &z)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = cmath_isinf_impl(module, z);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(cmath_isclose__doc__,
|
||||
"isclose($module, /, a, b, *, rel_tol=1e-09, abs_tol=0.0)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Determine whether two complex numbers are close in value.\n"
|
||||
"\n"
|
||||
" rel_tol\n"
|
||||
" maximum difference for being considered \"close\", relative to the\n"
|
||||
" magnitude of the input values\n"
|
||||
" abs_tol\n"
|
||||
" maximum difference for being considered \"close\", regardless of the\n"
|
||||
" magnitude of the input values\n"
|
||||
"\n"
|
||||
"Return True if a is close in value to b, and False otherwise.\n"
|
||||
"\n"
|
||||
"For the values to be considered close, the difference between them must be\n"
|
||||
"smaller than at least one of the tolerances.\n"
|
||||
"\n"
|
||||
"-inf, inf and NaN behave similarly to the IEEE 754 Standard. That is, NaN is\n"
|
||||
"not close to anything, even itself. inf and -inf are only close to themselves.");
|
||||
|
||||
#define CMATH_ISCLOSE_METHODDEF \
|
||||
{"isclose", (PyCFunction)cmath_isclose, METH_FASTCALL, cmath_isclose__doc__},
|
||||
|
||||
static int
|
||||
cmath_isclose_impl(PyObject *module, Py_complex a, Py_complex b,
|
||||
double rel_tol, double abs_tol);
|
||||
|
||||
static PyObject *
|
||||
cmath_isclose(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"a", "b", "rel_tol", "abs_tol", NULL};
|
||||
static _PyArg_Parser _parser = {"DD|$dd:isclose", _keywords, 0};
|
||||
Py_complex a;
|
||||
Py_complex b;
|
||||
double rel_tol = 1e-09;
|
||||
double abs_tol = 0.0;
|
||||
int _return_value;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&a, &b, &rel_tol, &abs_tol)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = cmath_isclose_impl(module, a, b, rel_tol, abs_tol);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyBool_FromLong((long)_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=978f59702b41655f input=a9049054013a1b77]*/
|
189
third_party/python/Modules/clinic/fcntlmodule.c.h
generated
vendored
Normal file
189
third_party/python/Modules/clinic/fcntlmodule.c.h
generated
vendored
Normal file
|
@ -0,0 +1,189 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(fcntl_fcntl__doc__,
|
||||
"fcntl($module, fd, cmd, arg=0, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Perform the operation `cmd` on file descriptor fd.\n"
|
||||
"\n"
|
||||
"The values used for `cmd` are operating system dependent, and are available\n"
|
||||
"as constants in the fcntl module, using the same names as used in\n"
|
||||
"the relevant C header files. The argument arg is optional, and\n"
|
||||
"defaults to 0; it may be an int or a string. If arg is given as a string,\n"
|
||||
"the return value of fcntl is a string of that length, containing the\n"
|
||||
"resulting value put in the arg buffer by the operating system. The length\n"
|
||||
"of the arg string is not allowed to exceed 1024 bytes. If the arg given\n"
|
||||
"is an integer or if none is specified, the result value is an integer\n"
|
||||
"corresponding to the return value of the fcntl call in the C code.");
|
||||
|
||||
#define FCNTL_FCNTL_METHODDEF \
|
||||
{"fcntl", (PyCFunction)fcntl_fcntl, METH_VARARGS, fcntl_fcntl__doc__},
|
||||
|
||||
static PyObject *
|
||||
fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg);
|
||||
|
||||
static PyObject *
|
||||
fcntl_fcntl(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int fd;
|
||||
int code;
|
||||
PyObject *arg = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O&i|O:fcntl",
|
||||
conv_descriptor, &fd, &code, &arg)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = fcntl_fcntl_impl(module, fd, code, arg);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(fcntl_ioctl__doc__,
|
||||
"ioctl($module, fd, request, arg=0, mutate_flag=True, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Perform the operation `request` on file descriptor `fd`.\n"
|
||||
"\n"
|
||||
"The values used for `request` are operating system dependent, and are available\n"
|
||||
"as constants in the fcntl or termios library modules, using the same names as\n"
|
||||
"used in the relevant C header files.\n"
|
||||
"\n"
|
||||
"The argument `arg` is optional, and defaults to 0; it may be an int or a\n"
|
||||
"buffer containing character data (most likely a string or an array).\n"
|
||||
"\n"
|
||||
"If the argument is a mutable buffer (such as an array) and if the\n"
|
||||
"mutate_flag argument (which is only allowed in this case) is true then the\n"
|
||||
"buffer is (in effect) passed to the operating system and changes made by\n"
|
||||
"the OS will be reflected in the contents of the buffer after the call has\n"
|
||||
"returned. The return value is the integer returned by the ioctl system\n"
|
||||
"call.\n"
|
||||
"\n"
|
||||
"If the argument is a mutable buffer and the mutable_flag argument is false,\n"
|
||||
"the behavior is as if a string had been passed.\n"
|
||||
"\n"
|
||||
"If the argument is an immutable buffer (most likely a string) then a copy\n"
|
||||
"of the buffer is passed to the operating system and the return value is a\n"
|
||||
"string of the same length containing whatever the operating system put in\n"
|
||||
"the buffer. The length of the arg buffer in this case is not allowed to\n"
|
||||
"exceed 1024 bytes.\n"
|
||||
"\n"
|
||||
"If the arg given is an integer or if none is specified, the result value is\n"
|
||||
"an integer corresponding to the return value of the ioctl call in the C\n"
|
||||
"code.");
|
||||
|
||||
#define FCNTL_IOCTL_METHODDEF \
|
||||
{"ioctl", (PyCFunction)fcntl_ioctl, METH_VARARGS, fcntl_ioctl__doc__},
|
||||
|
||||
static PyObject *
|
||||
fcntl_ioctl_impl(PyObject *module, int fd, unsigned int code,
|
||||
PyObject *ob_arg, int mutate_arg);
|
||||
|
||||
static PyObject *
|
||||
fcntl_ioctl(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int fd;
|
||||
unsigned int code;
|
||||
PyObject *ob_arg = NULL;
|
||||
int mutate_arg = 1;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O&I|Op:ioctl",
|
||||
conv_descriptor, &fd, &code, &ob_arg, &mutate_arg)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = fcntl_ioctl_impl(module, fd, code, ob_arg, mutate_arg);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(fcntl_flock__doc__,
|
||||
"flock($module, fd, operation, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Perform the lock operation `operation` on file descriptor `fd`.\n"
|
||||
"\n"
|
||||
"See the Unix manual page for flock(2) for details (On some systems, this\n"
|
||||
"function is emulated using fcntl()).");
|
||||
|
||||
#define FCNTL_FLOCK_METHODDEF \
|
||||
{"flock", (PyCFunction)fcntl_flock, METH_VARARGS, fcntl_flock__doc__},
|
||||
|
||||
static PyObject *
|
||||
fcntl_flock_impl(PyObject *module, int fd, int code);
|
||||
|
||||
static PyObject *
|
||||
fcntl_flock(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int fd;
|
||||
int code;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O&i:flock",
|
||||
conv_descriptor, &fd, &code)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = fcntl_flock_impl(module, fd, code);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(fcntl_lockf__doc__,
|
||||
"lockf($module, fd, cmd, len=0, start=0, whence=0, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"A wrapper around the fcntl() locking calls.\n"
|
||||
"\n"
|
||||
"`fd` is the file descriptor of the file to lock or unlock, and operation is one\n"
|
||||
"of the following values:\n"
|
||||
"\n"
|
||||
" LOCK_UN - unlock\n"
|
||||
" LOCK_SH - acquire a shared lock\n"
|
||||
" LOCK_EX - acquire an exclusive lock\n"
|
||||
"\n"
|
||||
"When operation is LOCK_SH or LOCK_EX, it can also be bitwise ORed with\n"
|
||||
"LOCK_NB to avoid blocking on lock acquisition. If LOCK_NB is used and the\n"
|
||||
"lock cannot be acquired, an OSError will be raised and the exception will\n"
|
||||
"have an errno attribute set to EACCES or EAGAIN (depending on the operating\n"
|
||||
"system -- for portability, check for either value).\n"
|
||||
"\n"
|
||||
"`len` is the number of bytes to lock, with the default meaning to lock to\n"
|
||||
"EOF. `start` is the byte offset, relative to `whence`, to that the lock\n"
|
||||
"starts. `whence` is as with fileobj.seek(), specifically:\n"
|
||||
"\n"
|
||||
" 0 - relative to the start of the file (SEEK_SET)\n"
|
||||
" 1 - relative to the current buffer position (SEEK_CUR)\n"
|
||||
" 2 - relative to the end of the file (SEEK_END)");
|
||||
|
||||
#define FCNTL_LOCKF_METHODDEF \
|
||||
{"lockf", (PyCFunction)fcntl_lockf, METH_VARARGS, fcntl_lockf__doc__},
|
||||
|
||||
static PyObject *
|
||||
fcntl_lockf_impl(PyObject *module, int fd, int code, PyObject *lenobj,
|
||||
PyObject *startobj, int whence);
|
||||
|
||||
static PyObject *
|
||||
fcntl_lockf(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int fd;
|
||||
int code;
|
||||
PyObject *lenobj = NULL;
|
||||
PyObject *startobj = NULL;
|
||||
int whence = 0;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O&i|OOi:lockf",
|
||||
conv_descriptor, &fd, &code, &lenobj, &startobj, &whence)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = fcntl_lockf_impl(module, fd, code, lenobj, startobj, whence);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=36cff76a8fb2c9a6 input=a9049054013a1b77]*/
|
89
third_party/python/Modules/clinic/grpmodule.c.h
generated
vendored
Normal file
89
third_party/python/Modules/clinic/grpmodule.c.h
generated
vendored
Normal file
|
@ -0,0 +1,89 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(grp_getgrgid__doc__,
|
||||
"getgrgid($module, /, id)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the group database entry for the given numeric group ID.\n"
|
||||
"\n"
|
||||
"If id is not valid, raise KeyError.");
|
||||
|
||||
#define GRP_GETGRGID_METHODDEF \
|
||||
{"getgrgid", (PyCFunction)grp_getgrgid, METH_FASTCALL, grp_getgrgid__doc__},
|
||||
|
||||
static PyObject *
|
||||
grp_getgrgid_impl(PyObject *module, PyObject *id);
|
||||
|
||||
static PyObject *
|
||||
grp_getgrgid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"id", NULL};
|
||||
static _PyArg_Parser _parser = {"O:getgrgid", _keywords, 0};
|
||||
PyObject *id;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&id)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = grp_getgrgid_impl(module, id);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(grp_getgrnam__doc__,
|
||||
"getgrnam($module, /, name)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the group database entry for the given group name.\n"
|
||||
"\n"
|
||||
"If name is not valid, raise KeyError.");
|
||||
|
||||
#define GRP_GETGRNAM_METHODDEF \
|
||||
{"getgrnam", (PyCFunction)grp_getgrnam, METH_FASTCALL, grp_getgrnam__doc__},
|
||||
|
||||
static PyObject *
|
||||
grp_getgrnam_impl(PyObject *module, PyObject *name);
|
||||
|
||||
static PyObject *
|
||||
grp_getgrnam(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"name", NULL};
|
||||
static _PyArg_Parser _parser = {"U:getgrnam", _keywords, 0};
|
||||
PyObject *name;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&name)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = grp_getgrnam_impl(module, name);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(grp_getgrall__doc__,
|
||||
"getgrall($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a list of all available group entries, in arbitrary order.\n"
|
||||
"\n"
|
||||
"An entry whose name starts with \'+\' or \'-\' represents an instruction\n"
|
||||
"to use YP/NIS and may not be accessible via getgrnam or getgrgid.");
|
||||
|
||||
#define GRP_GETGRALL_METHODDEF \
|
||||
{"getgrall", (PyCFunction)grp_getgrall, METH_NOARGS, grp_getgrall__doc__},
|
||||
|
||||
static PyObject *
|
||||
grp_getgrall_impl(PyObject *module);
|
||||
|
||||
static PyObject *
|
||||
grp_getgrall(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return grp_getgrall_impl(module);
|
||||
}
|
||||
/*[clinic end generated code: output=d6417ae0a7298e0e input=a9049054013a1b77]*/
|
97
third_party/python/Modules/clinic/md5module.c.h
generated
vendored
Normal file
97
third_party/python/Modules/clinic/md5module.c.h
generated
vendored
Normal file
|
@ -0,0 +1,97 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(MD5Type_copy__doc__,
|
||||
"copy($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a copy of the hash object.");
|
||||
|
||||
#define MD5TYPE_COPY_METHODDEF \
|
||||
{"copy", (PyCFunction)MD5Type_copy, METH_NOARGS, MD5Type_copy__doc__},
|
||||
|
||||
static PyObject *
|
||||
MD5Type_copy_impl(MD5object *self);
|
||||
|
||||
static PyObject *
|
||||
MD5Type_copy(MD5object *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return MD5Type_copy_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(MD5Type_digest__doc__,
|
||||
"digest($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the digest value as a bytes object.");
|
||||
|
||||
#define MD5TYPE_DIGEST_METHODDEF \
|
||||
{"digest", (PyCFunction)MD5Type_digest, METH_NOARGS, MD5Type_digest__doc__},
|
||||
|
||||
static PyObject *
|
||||
MD5Type_digest_impl(MD5object *self);
|
||||
|
||||
static PyObject *
|
||||
MD5Type_digest(MD5object *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return MD5Type_digest_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(MD5Type_hexdigest__doc__,
|
||||
"hexdigest($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the digest value as a string of hexadecimal digits.");
|
||||
|
||||
#define MD5TYPE_HEXDIGEST_METHODDEF \
|
||||
{"hexdigest", (PyCFunction)MD5Type_hexdigest, METH_NOARGS, MD5Type_hexdigest__doc__},
|
||||
|
||||
static PyObject *
|
||||
MD5Type_hexdigest_impl(MD5object *self);
|
||||
|
||||
static PyObject *
|
||||
MD5Type_hexdigest(MD5object *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return MD5Type_hexdigest_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(MD5Type_update__doc__,
|
||||
"update($self, obj, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Update this hash object\'s state with the provided string.");
|
||||
|
||||
#define MD5TYPE_UPDATE_METHODDEF \
|
||||
{"update", (PyCFunction)MD5Type_update, METH_O, MD5Type_update__doc__},
|
||||
|
||||
PyDoc_STRVAR(_md5_md5__doc__,
|
||||
"md5($module, /, string=b\'\')\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a new MD5 hash object; optionally initialized with a string.");
|
||||
|
||||
#define _MD5_MD5_METHODDEF \
|
||||
{"md5", (PyCFunction)_md5_md5, METH_FASTCALL, _md5_md5__doc__},
|
||||
|
||||
static PyObject *
|
||||
_md5_md5_impl(PyObject *module, PyObject *string);
|
||||
|
||||
static PyObject *
|
||||
_md5_md5(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"string", NULL};
|
||||
static _PyArg_Parser _parser = {"|O:md5", _keywords, 0};
|
||||
PyObject *string = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&string)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _md5_md5_impl(module, string);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=1761d10cec19a4c2 input=a9049054013a1b77]*/
|
6153
third_party/python/Modules/clinic/posixmodule.c.h
generated
vendored
Normal file
6153
third_party/python/Modules/clinic/posixmodule.c.h
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
72
third_party/python/Modules/clinic/pwdmodule.c.h
generated
vendored
Normal file
72
third_party/python/Modules/clinic/pwdmodule.c.h
generated
vendored
Normal file
|
@ -0,0 +1,72 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(pwd_getpwuid__doc__,
|
||||
"getpwuid($module, uidobj, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the password database entry for the given numeric user ID.\n"
|
||||
"\n"
|
||||
"See `help(pwd)` for more on password database entries.");
|
||||
|
||||
#define PWD_GETPWUID_METHODDEF \
|
||||
{"getpwuid", (PyCFunction)pwd_getpwuid, METH_O, pwd_getpwuid__doc__},
|
||||
|
||||
PyDoc_STRVAR(pwd_getpwnam__doc__,
|
||||
"getpwnam($module, arg, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the password database entry for the given user name.\n"
|
||||
"\n"
|
||||
"See `help(pwd)` for more on password database entries.");
|
||||
|
||||
#define PWD_GETPWNAM_METHODDEF \
|
||||
{"getpwnam", (PyCFunction)pwd_getpwnam, METH_O, pwd_getpwnam__doc__},
|
||||
|
||||
static PyObject *
|
||||
pwd_getpwnam_impl(PyObject *module, PyObject *arg);
|
||||
|
||||
static PyObject *
|
||||
pwd_getpwnam(PyObject *module, PyObject *arg_)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *arg;
|
||||
|
||||
if (!PyArg_Parse(arg_, "U:getpwnam", &arg)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = pwd_getpwnam_impl(module, arg);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#if defined(HAVE_GETPWENT)
|
||||
|
||||
PyDoc_STRVAR(pwd_getpwall__doc__,
|
||||
"getpwall($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a list of all available password database entries, in arbitrary order.\n"
|
||||
"\n"
|
||||
"See help(pwd) for more on password database entries.");
|
||||
|
||||
#define PWD_GETPWALL_METHODDEF \
|
||||
{"getpwall", (PyCFunction)pwd_getpwall, METH_NOARGS, pwd_getpwall__doc__},
|
||||
|
||||
static PyObject *
|
||||
pwd_getpwall_impl(PyObject *module);
|
||||
|
||||
static PyObject *
|
||||
pwd_getpwall(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return pwd_getpwall_impl(module);
|
||||
}
|
||||
|
||||
#endif /* defined(HAVE_GETPWENT) */
|
||||
|
||||
#ifndef PWD_GETPWALL_METHODDEF
|
||||
#define PWD_GETPWALL_METHODDEF
|
||||
#endif /* !defined(PWD_GETPWALL_METHODDEF) */
|
||||
/*[clinic end generated code: output=fc41d8d88ec206d8 input=a9049054013a1b77]*/
|
292
third_party/python/Modules/clinic/pyexpat.c.h
generated
vendored
Normal file
292
third_party/python/Modules/clinic/pyexpat.c.h
generated
vendored
Normal file
|
@ -0,0 +1,292 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(pyexpat_xmlparser_Parse__doc__,
|
||||
"Parse($self, data, isfinal=False, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Parse XML data.\n"
|
||||
"\n"
|
||||
"`isfinal\' should be true at end of input.");
|
||||
|
||||
#define PYEXPAT_XMLPARSER_PARSE_METHODDEF \
|
||||
{"Parse", (PyCFunction)pyexpat_xmlparser_Parse, METH_VARARGS, pyexpat_xmlparser_Parse__doc__},
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_Parse_impl(xmlparseobject *self, PyObject *data,
|
||||
int isfinal);
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_Parse(xmlparseobject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *data;
|
||||
int isfinal = 0;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O|i:Parse",
|
||||
&data, &isfinal)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = pyexpat_xmlparser_Parse_impl(self, data, isfinal);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(pyexpat_xmlparser_ParseFile__doc__,
|
||||
"ParseFile($self, file, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Parse XML data from file-like object.");
|
||||
|
||||
#define PYEXPAT_XMLPARSER_PARSEFILE_METHODDEF \
|
||||
{"ParseFile", (PyCFunction)pyexpat_xmlparser_ParseFile, METH_O, pyexpat_xmlparser_ParseFile__doc__},
|
||||
|
||||
PyDoc_STRVAR(pyexpat_xmlparser_SetBase__doc__,
|
||||
"SetBase($self, base, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Set the base URL for the parser.");
|
||||
|
||||
#define PYEXPAT_XMLPARSER_SETBASE_METHODDEF \
|
||||
{"SetBase", (PyCFunction)pyexpat_xmlparser_SetBase, METH_O, pyexpat_xmlparser_SetBase__doc__},
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_SetBase_impl(xmlparseobject *self, const char *base);
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_SetBase(xmlparseobject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *base;
|
||||
|
||||
if (!PyArg_Parse(arg, "s:SetBase", &base)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = pyexpat_xmlparser_SetBase_impl(self, base);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(pyexpat_xmlparser_GetBase__doc__,
|
||||
"GetBase($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return base URL string for the parser.");
|
||||
|
||||
#define PYEXPAT_XMLPARSER_GETBASE_METHODDEF \
|
||||
{"GetBase", (PyCFunction)pyexpat_xmlparser_GetBase, METH_NOARGS, pyexpat_xmlparser_GetBase__doc__},
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_GetBase_impl(xmlparseobject *self);
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_GetBase(xmlparseobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return pyexpat_xmlparser_GetBase_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(pyexpat_xmlparser_GetInputContext__doc__,
|
||||
"GetInputContext($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the untranslated text of the input that caused the current event.\n"
|
||||
"\n"
|
||||
"If the event was generated by a large amount of text (such as a start tag\n"
|
||||
"for an element with many attributes), not all of the text may be available.");
|
||||
|
||||
#define PYEXPAT_XMLPARSER_GETINPUTCONTEXT_METHODDEF \
|
||||
{"GetInputContext", (PyCFunction)pyexpat_xmlparser_GetInputContext, METH_NOARGS, pyexpat_xmlparser_GetInputContext__doc__},
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_GetInputContext_impl(xmlparseobject *self);
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_GetInputContext(xmlparseobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return pyexpat_xmlparser_GetInputContext_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(pyexpat_xmlparser_ExternalEntityParserCreate__doc__,
|
||||
"ExternalEntityParserCreate($self, context, encoding=None, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Create a parser for parsing an external entity based on the information passed to the ExternalEntityRefHandler.");
|
||||
|
||||
#define PYEXPAT_XMLPARSER_EXTERNALENTITYPARSERCREATE_METHODDEF \
|
||||
{"ExternalEntityParserCreate", (PyCFunction)pyexpat_xmlparser_ExternalEntityParserCreate, METH_VARARGS, pyexpat_xmlparser_ExternalEntityParserCreate__doc__},
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_ExternalEntityParserCreate_impl(xmlparseobject *self,
|
||||
const char *context,
|
||||
const char *encoding);
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *context;
|
||||
const char *encoding = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "z|s:ExternalEntityParserCreate",
|
||||
&context, &encoding)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = pyexpat_xmlparser_ExternalEntityParserCreate_impl(self, context, encoding);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(pyexpat_xmlparser_SetParamEntityParsing__doc__,
|
||||
"SetParamEntityParsing($self, flag, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Controls parsing of parameter entities (including the external DTD subset).\n"
|
||||
"\n"
|
||||
"Possible flag values are XML_PARAM_ENTITY_PARSING_NEVER,\n"
|
||||
"XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE and\n"
|
||||
"XML_PARAM_ENTITY_PARSING_ALWAYS. Returns true if setting the flag\n"
|
||||
"was successful.");
|
||||
|
||||
#define PYEXPAT_XMLPARSER_SETPARAMENTITYPARSING_METHODDEF \
|
||||
{"SetParamEntityParsing", (PyCFunction)pyexpat_xmlparser_SetParamEntityParsing, METH_O, pyexpat_xmlparser_SetParamEntityParsing__doc__},
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_SetParamEntityParsing_impl(xmlparseobject *self, int flag);
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_SetParamEntityParsing(xmlparseobject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int flag;
|
||||
|
||||
if (!PyArg_Parse(arg, "i:SetParamEntityParsing", &flag)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = pyexpat_xmlparser_SetParamEntityParsing_impl(self, flag);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#if (XML_COMBINED_VERSION >= 19505)
|
||||
|
||||
PyDoc_STRVAR(pyexpat_xmlparser_UseForeignDTD__doc__,
|
||||
"UseForeignDTD($self, flag=True, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Allows the application to provide an artificial external subset if one is not specified as part of the document instance.\n"
|
||||
"\n"
|
||||
"This readily allows the use of a \'default\' document type controlled by the\n"
|
||||
"application, while still getting the advantage of providing document type\n"
|
||||
"information to the parser. \'flag\' defaults to True if not provided.");
|
||||
|
||||
#define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF \
|
||||
{"UseForeignDTD", (PyCFunction)pyexpat_xmlparser_UseForeignDTD, METH_VARARGS, pyexpat_xmlparser_UseForeignDTD__doc__},
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_UseForeignDTD_impl(xmlparseobject *self, int flag);
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_UseForeignDTD(xmlparseobject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int flag = 1;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|p:UseForeignDTD",
|
||||
&flag)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = pyexpat_xmlparser_UseForeignDTD_impl(self, flag);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* (XML_COMBINED_VERSION >= 19505) */
|
||||
|
||||
PyDoc_STRVAR(pyexpat_xmlparser___dir____doc__,
|
||||
"__dir__($self, /)\n"
|
||||
"--\n"
|
||||
"\n");
|
||||
|
||||
#define PYEXPAT_XMLPARSER___DIR___METHODDEF \
|
||||
{"__dir__", (PyCFunction)pyexpat_xmlparser___dir__, METH_NOARGS, pyexpat_xmlparser___dir____doc__},
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser___dir___impl(xmlparseobject *self);
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser___dir__(xmlparseobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return pyexpat_xmlparser___dir___impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(pyexpat_ParserCreate__doc__,
|
||||
"ParserCreate($module, /, encoding=None, namespace_separator=None,\n"
|
||||
" intern=None)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a new XML parser object.");
|
||||
|
||||
#define PYEXPAT_PARSERCREATE_METHODDEF \
|
||||
{"ParserCreate", (PyCFunction)pyexpat_ParserCreate, METH_FASTCALL, pyexpat_ParserCreate__doc__},
|
||||
|
||||
static PyObject *
|
||||
pyexpat_ParserCreate_impl(PyObject *module, const char *encoding,
|
||||
const char *namespace_separator, PyObject *intern);
|
||||
|
||||
static PyObject *
|
||||
pyexpat_ParserCreate(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"encoding", "namespace_separator", "intern", NULL};
|
||||
static _PyArg_Parser _parser = {"|zzO:ParserCreate", _keywords, 0};
|
||||
const char *encoding = NULL;
|
||||
const char *namespace_separator = NULL;
|
||||
PyObject *intern = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&encoding, &namespace_separator, &intern)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = pyexpat_ParserCreate_impl(module, encoding, namespace_separator, intern);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(pyexpat_ErrorString__doc__,
|
||||
"ErrorString($module, code, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns string error for given number.");
|
||||
|
||||
#define PYEXPAT_ERRORSTRING_METHODDEF \
|
||||
{"ErrorString", (PyCFunction)pyexpat_ErrorString, METH_O, pyexpat_ErrorString__doc__},
|
||||
|
||||
static PyObject *
|
||||
pyexpat_ErrorString_impl(PyObject *module, long code);
|
||||
|
||||
static PyObject *
|
||||
pyexpat_ErrorString(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
long code;
|
||||
|
||||
if (!PyArg_Parse(arg, "l:ErrorString", &code)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = pyexpat_ErrorString_impl(module, code);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
|
||||
#define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
|
||||
#endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */
|
||||
/*[clinic end generated code: output=e889f7c6af6cc42f input=a9049054013a1b77]*/
|
97
third_party/python/Modules/clinic/sha1module.c.h
generated
vendored
Normal file
97
third_party/python/Modules/clinic/sha1module.c.h
generated
vendored
Normal file
|
@ -0,0 +1,97 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(SHA1Type_copy__doc__,
|
||||
"copy($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a copy of the hash object.");
|
||||
|
||||
#define SHA1TYPE_COPY_METHODDEF \
|
||||
{"copy", (PyCFunction)SHA1Type_copy, METH_NOARGS, SHA1Type_copy__doc__},
|
||||
|
||||
static PyObject *
|
||||
SHA1Type_copy_impl(SHA1object *self);
|
||||
|
||||
static PyObject *
|
||||
SHA1Type_copy(SHA1object *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return SHA1Type_copy_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(SHA1Type_digest__doc__,
|
||||
"digest($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the digest value as a bytes object.");
|
||||
|
||||
#define SHA1TYPE_DIGEST_METHODDEF \
|
||||
{"digest", (PyCFunction)SHA1Type_digest, METH_NOARGS, SHA1Type_digest__doc__},
|
||||
|
||||
static PyObject *
|
||||
SHA1Type_digest_impl(SHA1object *self);
|
||||
|
||||
static PyObject *
|
||||
SHA1Type_digest(SHA1object *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return SHA1Type_digest_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(SHA1Type_hexdigest__doc__,
|
||||
"hexdigest($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the digest value as a string of hexadecimal digits.");
|
||||
|
||||
#define SHA1TYPE_HEXDIGEST_METHODDEF \
|
||||
{"hexdigest", (PyCFunction)SHA1Type_hexdigest, METH_NOARGS, SHA1Type_hexdigest__doc__},
|
||||
|
||||
static PyObject *
|
||||
SHA1Type_hexdigest_impl(SHA1object *self);
|
||||
|
||||
static PyObject *
|
||||
SHA1Type_hexdigest(SHA1object *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return SHA1Type_hexdigest_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(SHA1Type_update__doc__,
|
||||
"update($self, obj, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Update this hash object\'s state with the provided string.");
|
||||
|
||||
#define SHA1TYPE_UPDATE_METHODDEF \
|
||||
{"update", (PyCFunction)SHA1Type_update, METH_O, SHA1Type_update__doc__},
|
||||
|
||||
PyDoc_STRVAR(_sha1_sha1__doc__,
|
||||
"sha1($module, /, string=b\'\')\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a new SHA1 hash object; optionally initialized with a string.");
|
||||
|
||||
#define _SHA1_SHA1_METHODDEF \
|
||||
{"sha1", (PyCFunction)_sha1_sha1, METH_FASTCALL, _sha1_sha1__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sha1_sha1_impl(PyObject *module, PyObject *string);
|
||||
|
||||
static PyObject *
|
||||
_sha1_sha1(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"string", NULL};
|
||||
static _PyArg_Parser _parser = {"|O:sha1", _keywords, 0};
|
||||
PyObject *string = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&string)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sha1_sha1_impl(module, string);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=34e9cee5761f2a36 input=a9049054013a1b77]*/
|
127
third_party/python/Modules/clinic/sha256module.c.h
generated
vendored
Normal file
127
third_party/python/Modules/clinic/sha256module.c.h
generated
vendored
Normal file
|
@ -0,0 +1,127 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(SHA256Type_copy__doc__,
|
||||
"copy($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a copy of the hash object.");
|
||||
|
||||
#define SHA256TYPE_COPY_METHODDEF \
|
||||
{"copy", (PyCFunction)SHA256Type_copy, METH_NOARGS, SHA256Type_copy__doc__},
|
||||
|
||||
static PyObject *
|
||||
SHA256Type_copy_impl(SHAobject *self);
|
||||
|
||||
static PyObject *
|
||||
SHA256Type_copy(SHAobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return SHA256Type_copy_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(SHA256Type_digest__doc__,
|
||||
"digest($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the digest value as a bytes object.");
|
||||
|
||||
#define SHA256TYPE_DIGEST_METHODDEF \
|
||||
{"digest", (PyCFunction)SHA256Type_digest, METH_NOARGS, SHA256Type_digest__doc__},
|
||||
|
||||
static PyObject *
|
||||
SHA256Type_digest_impl(SHAobject *self);
|
||||
|
||||
static PyObject *
|
||||
SHA256Type_digest(SHAobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return SHA256Type_digest_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(SHA256Type_hexdigest__doc__,
|
||||
"hexdigest($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the digest value as a string of hexadecimal digits.");
|
||||
|
||||
#define SHA256TYPE_HEXDIGEST_METHODDEF \
|
||||
{"hexdigest", (PyCFunction)SHA256Type_hexdigest, METH_NOARGS, SHA256Type_hexdigest__doc__},
|
||||
|
||||
static PyObject *
|
||||
SHA256Type_hexdigest_impl(SHAobject *self);
|
||||
|
||||
static PyObject *
|
||||
SHA256Type_hexdigest(SHAobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return SHA256Type_hexdigest_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(SHA256Type_update__doc__,
|
||||
"update($self, obj, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Update this hash object\'s state with the provided string.");
|
||||
|
||||
#define SHA256TYPE_UPDATE_METHODDEF \
|
||||
{"update", (PyCFunction)SHA256Type_update, METH_O, SHA256Type_update__doc__},
|
||||
|
||||
PyDoc_STRVAR(_sha256_sha256__doc__,
|
||||
"sha256($module, /, string=b\'\')\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a new SHA-256 hash object; optionally initialized with a string.");
|
||||
|
||||
#define _SHA256_SHA256_METHODDEF \
|
||||
{"sha256", (PyCFunction)_sha256_sha256, METH_FASTCALL, _sha256_sha256__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sha256_sha256_impl(PyObject *module, PyObject *string);
|
||||
|
||||
static PyObject *
|
||||
_sha256_sha256(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"string", NULL};
|
||||
static _PyArg_Parser _parser = {"|O:sha256", _keywords, 0};
|
||||
PyObject *string = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&string)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sha256_sha256_impl(module, string);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sha256_sha224__doc__,
|
||||
"sha224($module, /, string=b\'\')\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a new SHA-224 hash object; optionally initialized with a string.");
|
||||
|
||||
#define _SHA256_SHA224_METHODDEF \
|
||||
{"sha224", (PyCFunction)_sha256_sha224, METH_FASTCALL, _sha256_sha224__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sha256_sha224_impl(PyObject *module, PyObject *string);
|
||||
|
||||
static PyObject *
|
||||
_sha256_sha224(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"string", NULL};
|
||||
static _PyArg_Parser _parser = {"|O:sha224", _keywords, 0};
|
||||
PyObject *string = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&string)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sha256_sha224_impl(module, string);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=3babbe1e753c1a38 input=a9049054013a1b77]*/
|
127
third_party/python/Modules/clinic/sha512module.c.h
generated
vendored
Normal file
127
third_party/python/Modules/clinic/sha512module.c.h
generated
vendored
Normal file
|
@ -0,0 +1,127 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(SHA512Type_copy__doc__,
|
||||
"copy($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a copy of the hash object.");
|
||||
|
||||
#define SHA512TYPE_COPY_METHODDEF \
|
||||
{"copy", (PyCFunction)SHA512Type_copy, METH_NOARGS, SHA512Type_copy__doc__},
|
||||
|
||||
static PyObject *
|
||||
SHA512Type_copy_impl(SHAobject *self);
|
||||
|
||||
static PyObject *
|
||||
SHA512Type_copy(SHAobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return SHA512Type_copy_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(SHA512Type_digest__doc__,
|
||||
"digest($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the digest value as a bytes object.");
|
||||
|
||||
#define SHA512TYPE_DIGEST_METHODDEF \
|
||||
{"digest", (PyCFunction)SHA512Type_digest, METH_NOARGS, SHA512Type_digest__doc__},
|
||||
|
||||
static PyObject *
|
||||
SHA512Type_digest_impl(SHAobject *self);
|
||||
|
||||
static PyObject *
|
||||
SHA512Type_digest(SHAobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return SHA512Type_digest_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(SHA512Type_hexdigest__doc__,
|
||||
"hexdigest($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the digest value as a string of hexadecimal digits.");
|
||||
|
||||
#define SHA512TYPE_HEXDIGEST_METHODDEF \
|
||||
{"hexdigest", (PyCFunction)SHA512Type_hexdigest, METH_NOARGS, SHA512Type_hexdigest__doc__},
|
||||
|
||||
static PyObject *
|
||||
SHA512Type_hexdigest_impl(SHAobject *self);
|
||||
|
||||
static PyObject *
|
||||
SHA512Type_hexdigest(SHAobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return SHA512Type_hexdigest_impl(self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(SHA512Type_update__doc__,
|
||||
"update($self, obj, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Update this hash object\'s state with the provided string.");
|
||||
|
||||
#define SHA512TYPE_UPDATE_METHODDEF \
|
||||
{"update", (PyCFunction)SHA512Type_update, METH_O, SHA512Type_update__doc__},
|
||||
|
||||
PyDoc_STRVAR(_sha512_sha512__doc__,
|
||||
"sha512($module, /, string=b\'\')\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a new SHA-512 hash object; optionally initialized with a string.");
|
||||
|
||||
#define _SHA512_SHA512_METHODDEF \
|
||||
{"sha512", (PyCFunction)_sha512_sha512, METH_FASTCALL, _sha512_sha512__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sha512_sha512_impl(PyObject *module, PyObject *string);
|
||||
|
||||
static PyObject *
|
||||
_sha512_sha512(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"string", NULL};
|
||||
static _PyArg_Parser _parser = {"|O:sha512", _keywords, 0};
|
||||
PyObject *string = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&string)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sha512_sha512_impl(module, string);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_sha512_sha384__doc__,
|
||||
"sha384($module, /, string=b\'\')\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a new SHA-384 hash object; optionally initialized with a string.");
|
||||
|
||||
#define _SHA512_SHA384_METHODDEF \
|
||||
{"sha384", (PyCFunction)_sha512_sha384, METH_FASTCALL, _sha512_sha384__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sha512_sha384_impl(PyObject *module, PyObject *string);
|
||||
|
||||
static PyObject *
|
||||
_sha512_sha384(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"string", NULL};
|
||||
static _PyArg_Parser _parser = {"|O:sha384", _keywords, 0};
|
||||
PyObject *string = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&string)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sha512_sha384_impl(module, string);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=59a43fa6eb3b5f4f input=a9049054013a1b77]*/
|
442
third_party/python/Modules/clinic/signalmodule.c.h
generated
vendored
Normal file
442
third_party/python/Modules/clinic/signalmodule.c.h
generated
vendored
Normal file
|
@ -0,0 +1,442 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
#if defined(HAVE_ALARM)
|
||||
|
||||
PyDoc_STRVAR(signal_alarm__doc__,
|
||||
"alarm($module, seconds, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Arrange for SIGALRM to arrive after the given number of seconds.");
|
||||
|
||||
#define SIGNAL_ALARM_METHODDEF \
|
||||
{"alarm", (PyCFunction)signal_alarm, METH_O, signal_alarm__doc__},
|
||||
|
||||
static long
|
||||
signal_alarm_impl(PyObject *module, int seconds);
|
||||
|
||||
static PyObject *
|
||||
signal_alarm(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int seconds;
|
||||
long _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "i:alarm", &seconds)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = signal_alarm_impl(module, seconds);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromLong(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* defined(HAVE_ALARM) */
|
||||
|
||||
#if defined(HAVE_PAUSE)
|
||||
|
||||
PyDoc_STRVAR(signal_pause__doc__,
|
||||
"pause($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Wait until a signal arrives.");
|
||||
|
||||
#define SIGNAL_PAUSE_METHODDEF \
|
||||
{"pause", (PyCFunction)signal_pause, METH_NOARGS, signal_pause__doc__},
|
||||
|
||||
static PyObject *
|
||||
signal_pause_impl(PyObject *module);
|
||||
|
||||
static PyObject *
|
||||
signal_pause(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return signal_pause_impl(module);
|
||||
}
|
||||
|
||||
#endif /* defined(HAVE_PAUSE) */
|
||||
|
||||
PyDoc_STRVAR(signal_signal__doc__,
|
||||
"signal($module, signalnum, handler, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Set the action for the given signal.\n"
|
||||
"\n"
|
||||
"The action can be SIG_DFL, SIG_IGN, or a callable Python object.\n"
|
||||
"The previous action is returned. See getsignal() for possible return values.\n"
|
||||
"\n"
|
||||
"*** IMPORTANT NOTICE ***\n"
|
||||
"A signal handler function is called with two arguments:\n"
|
||||
"the first is the signal number, the second is the interrupted stack frame.");
|
||||
|
||||
#define SIGNAL_SIGNAL_METHODDEF \
|
||||
{"signal", (PyCFunction)signal_signal, METH_VARARGS, signal_signal__doc__},
|
||||
|
||||
static PyObject *
|
||||
signal_signal_impl(PyObject *module, int signalnum, PyObject *handler);
|
||||
|
||||
static PyObject *
|
||||
signal_signal(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int signalnum;
|
||||
PyObject *handler;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "iO:signal",
|
||||
&signalnum, &handler)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = signal_signal_impl(module, signalnum, handler);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(signal_getsignal__doc__,
|
||||
"getsignal($module, signalnum, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the current action for the given signal.\n"
|
||||
"\n"
|
||||
"The return value can be:\n"
|
||||
" SIG_IGN -- if the signal is being ignored\n"
|
||||
" SIG_DFL -- if the default action for the signal is in effect\n"
|
||||
" None -- if an unknown handler is in effect\n"
|
||||
" anything else -- the callable Python object used as a handler");
|
||||
|
||||
#define SIGNAL_GETSIGNAL_METHODDEF \
|
||||
{"getsignal", (PyCFunction)signal_getsignal, METH_O, signal_getsignal__doc__},
|
||||
|
||||
static PyObject *
|
||||
signal_getsignal_impl(PyObject *module, int signalnum);
|
||||
|
||||
static PyObject *
|
||||
signal_getsignal(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int signalnum;
|
||||
|
||||
if (!PyArg_Parse(arg, "i:getsignal", &signalnum)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = signal_getsignal_impl(module, signalnum);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#if defined(HAVE_SIGINTERRUPT)
|
||||
|
||||
PyDoc_STRVAR(signal_siginterrupt__doc__,
|
||||
"siginterrupt($module, signalnum, flag, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Change system call restart behaviour.\n"
|
||||
"\n"
|
||||
"If flag is False, system calls will be restarted when interrupted by\n"
|
||||
"signal sig, else system calls will be interrupted.");
|
||||
|
||||
#define SIGNAL_SIGINTERRUPT_METHODDEF \
|
||||
{"siginterrupt", (PyCFunction)signal_siginterrupt, METH_VARARGS, signal_siginterrupt__doc__},
|
||||
|
||||
static PyObject *
|
||||
signal_siginterrupt_impl(PyObject *module, int signalnum, int flag);
|
||||
|
||||
static PyObject *
|
||||
signal_siginterrupt(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int signalnum;
|
||||
int flag;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "ii:siginterrupt",
|
||||
&signalnum, &flag)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = signal_siginterrupt_impl(module, signalnum, flag);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* defined(HAVE_SIGINTERRUPT) */
|
||||
|
||||
#if defined(HAVE_SETITIMER)
|
||||
|
||||
PyDoc_STRVAR(signal_setitimer__doc__,
|
||||
"setitimer($module, which, seconds, interval=0.0, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Sets given itimer (one of ITIMER_REAL, ITIMER_VIRTUAL or ITIMER_PROF).\n"
|
||||
"\n"
|
||||
"The timer will fire after value seconds and after that every interval seconds.\n"
|
||||
"The itimer can be cleared by setting seconds to zero.\n"
|
||||
"\n"
|
||||
"Returns old values as a tuple: (delay, interval).");
|
||||
|
||||
#define SIGNAL_SETITIMER_METHODDEF \
|
||||
{"setitimer", (PyCFunction)signal_setitimer, METH_VARARGS, signal_setitimer__doc__},
|
||||
|
||||
static PyObject *
|
||||
signal_setitimer_impl(PyObject *module, int which, double seconds,
|
||||
double interval);
|
||||
|
||||
static PyObject *
|
||||
signal_setitimer(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int which;
|
||||
double seconds;
|
||||
double interval = 0.0;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "id|d:setitimer",
|
||||
&which, &seconds, &interval)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = signal_setitimer_impl(module, which, seconds, interval);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* defined(HAVE_SETITIMER) */
|
||||
|
||||
#if defined(HAVE_GETITIMER)
|
||||
|
||||
PyDoc_STRVAR(signal_getitimer__doc__,
|
||||
"getitimer($module, which, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns current value of given itimer.");
|
||||
|
||||
#define SIGNAL_GETITIMER_METHODDEF \
|
||||
{"getitimer", (PyCFunction)signal_getitimer, METH_O, signal_getitimer__doc__},
|
||||
|
||||
static PyObject *
|
||||
signal_getitimer_impl(PyObject *module, int which);
|
||||
|
||||
static PyObject *
|
||||
signal_getitimer(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int which;
|
||||
|
||||
if (!PyArg_Parse(arg, "i:getitimer", &which)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = signal_getitimer_impl(module, which);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* defined(HAVE_GETITIMER) */
|
||||
|
||||
#if defined(PYPTHREAD_SIGMASK)
|
||||
|
||||
PyDoc_STRVAR(signal_pthread_sigmask__doc__,
|
||||
"pthread_sigmask($module, how, mask, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Fetch and/or change the signal mask of the calling thread.");
|
||||
|
||||
#define SIGNAL_PTHREAD_SIGMASK_METHODDEF \
|
||||
{"pthread_sigmask", (PyCFunction)signal_pthread_sigmask, METH_VARARGS, signal_pthread_sigmask__doc__},
|
||||
|
||||
static PyObject *
|
||||
signal_pthread_sigmask_impl(PyObject *module, int how, PyObject *mask);
|
||||
|
||||
static PyObject *
|
||||
signal_pthread_sigmask(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int how;
|
||||
PyObject *mask;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "iO:pthread_sigmask",
|
||||
&how, &mask)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = signal_pthread_sigmask_impl(module, how, mask);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* defined(PYPTHREAD_SIGMASK) */
|
||||
|
||||
#if defined(HAVE_SIGPENDING)
|
||||
|
||||
PyDoc_STRVAR(signal_sigpending__doc__,
|
||||
"sigpending($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Examine pending signals.\n"
|
||||
"\n"
|
||||
"Returns a set of signal numbers that are pending for delivery to\n"
|
||||
"the calling thread.");
|
||||
|
||||
#define SIGNAL_SIGPENDING_METHODDEF \
|
||||
{"sigpending", (PyCFunction)signal_sigpending, METH_NOARGS, signal_sigpending__doc__},
|
||||
|
||||
static PyObject *
|
||||
signal_sigpending_impl(PyObject *module);
|
||||
|
||||
static PyObject *
|
||||
signal_sigpending(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return signal_sigpending_impl(module);
|
||||
}
|
||||
|
||||
#endif /* defined(HAVE_SIGPENDING) */
|
||||
|
||||
#if defined(HAVE_SIGWAIT)
|
||||
|
||||
PyDoc_STRVAR(signal_sigwait__doc__,
|
||||
"sigwait($module, sigset, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Wait for a signal.\n"
|
||||
"\n"
|
||||
"Suspend execution of the calling thread until the delivery of one of the\n"
|
||||
"signals specified in the signal set sigset. The function accepts the signal\n"
|
||||
"and returns the signal number.");
|
||||
|
||||
#define SIGNAL_SIGWAIT_METHODDEF \
|
||||
{"sigwait", (PyCFunction)signal_sigwait, METH_O, signal_sigwait__doc__},
|
||||
|
||||
#endif /* defined(HAVE_SIGWAIT) */
|
||||
|
||||
#if defined(HAVE_SIGWAITINFO)
|
||||
|
||||
PyDoc_STRVAR(signal_sigwaitinfo__doc__,
|
||||
"sigwaitinfo($module, sigset, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Wait synchronously until one of the signals in *sigset* is delivered.\n"
|
||||
"\n"
|
||||
"Returns a struct_siginfo containing information about the signal.");
|
||||
|
||||
#define SIGNAL_SIGWAITINFO_METHODDEF \
|
||||
{"sigwaitinfo", (PyCFunction)signal_sigwaitinfo, METH_O, signal_sigwaitinfo__doc__},
|
||||
|
||||
#endif /* defined(HAVE_SIGWAITINFO) */
|
||||
|
||||
#if defined(HAVE_SIGTIMEDWAIT)
|
||||
|
||||
PyDoc_STRVAR(signal_sigtimedwait__doc__,
|
||||
"sigtimedwait($module, sigset, timeout, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Like sigwaitinfo(), but with a timeout.\n"
|
||||
"\n"
|
||||
"The timeout is specified in seconds, with floating point numbers allowed.");
|
||||
|
||||
#define SIGNAL_SIGTIMEDWAIT_METHODDEF \
|
||||
{"sigtimedwait", (PyCFunction)signal_sigtimedwait, METH_VARARGS, signal_sigtimedwait__doc__},
|
||||
|
||||
static PyObject *
|
||||
signal_sigtimedwait_impl(PyObject *module, PyObject *sigset,
|
||||
PyObject *timeout_obj);
|
||||
|
||||
static PyObject *
|
||||
signal_sigtimedwait(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *sigset;
|
||||
PyObject *timeout_obj;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "sigtimedwait",
|
||||
2, 2,
|
||||
&sigset, &timeout_obj)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = signal_sigtimedwait_impl(module, sigset, timeout_obj);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* defined(HAVE_SIGTIMEDWAIT) */
|
||||
|
||||
#if (defined(HAVE_PTHREAD_KILL) && defined(WITH_THREAD))
|
||||
|
||||
PyDoc_STRVAR(signal_pthread_kill__doc__,
|
||||
"pthread_kill($module, thread_id, signalnum, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Send a signal to a thread.");
|
||||
|
||||
#define SIGNAL_PTHREAD_KILL_METHODDEF \
|
||||
{"pthread_kill", (PyCFunction)signal_pthread_kill, METH_VARARGS, signal_pthread_kill__doc__},
|
||||
|
||||
static PyObject *
|
||||
signal_pthread_kill_impl(PyObject *module, long thread_id, int signalnum);
|
||||
|
||||
static PyObject *
|
||||
signal_pthread_kill(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
long thread_id;
|
||||
int signalnum;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "li:pthread_kill",
|
||||
&thread_id, &signalnum)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = signal_pthread_kill_impl(module, thread_id, signalnum);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* (defined(HAVE_PTHREAD_KILL) && defined(WITH_THREAD)) */
|
||||
|
||||
#ifndef SIGNAL_ALARM_METHODDEF
|
||||
#define SIGNAL_ALARM_METHODDEF
|
||||
#endif /* !defined(SIGNAL_ALARM_METHODDEF) */
|
||||
|
||||
#ifndef SIGNAL_PAUSE_METHODDEF
|
||||
#define SIGNAL_PAUSE_METHODDEF
|
||||
#endif /* !defined(SIGNAL_PAUSE_METHODDEF) */
|
||||
|
||||
#ifndef SIGNAL_SIGINTERRUPT_METHODDEF
|
||||
#define SIGNAL_SIGINTERRUPT_METHODDEF
|
||||
#endif /* !defined(SIGNAL_SIGINTERRUPT_METHODDEF) */
|
||||
|
||||
#ifndef SIGNAL_SETITIMER_METHODDEF
|
||||
#define SIGNAL_SETITIMER_METHODDEF
|
||||
#endif /* !defined(SIGNAL_SETITIMER_METHODDEF) */
|
||||
|
||||
#ifndef SIGNAL_GETITIMER_METHODDEF
|
||||
#define SIGNAL_GETITIMER_METHODDEF
|
||||
#endif /* !defined(SIGNAL_GETITIMER_METHODDEF) */
|
||||
|
||||
#ifndef SIGNAL_PTHREAD_SIGMASK_METHODDEF
|
||||
#define SIGNAL_PTHREAD_SIGMASK_METHODDEF
|
||||
#endif /* !defined(SIGNAL_PTHREAD_SIGMASK_METHODDEF) */
|
||||
|
||||
#ifndef SIGNAL_SIGPENDING_METHODDEF
|
||||
#define SIGNAL_SIGPENDING_METHODDEF
|
||||
#endif /* !defined(SIGNAL_SIGPENDING_METHODDEF) */
|
||||
|
||||
#ifndef SIGNAL_SIGWAIT_METHODDEF
|
||||
#define SIGNAL_SIGWAIT_METHODDEF
|
||||
#endif /* !defined(SIGNAL_SIGWAIT_METHODDEF) */
|
||||
|
||||
#ifndef SIGNAL_SIGWAITINFO_METHODDEF
|
||||
#define SIGNAL_SIGWAITINFO_METHODDEF
|
||||
#endif /* !defined(SIGNAL_SIGWAITINFO_METHODDEF) */
|
||||
|
||||
#ifndef SIGNAL_SIGTIMEDWAIT_METHODDEF
|
||||
#define SIGNAL_SIGTIMEDWAIT_METHODDEF
|
||||
#endif /* !defined(SIGNAL_SIGTIMEDWAIT_METHODDEF) */
|
||||
|
||||
#ifndef SIGNAL_PTHREAD_KILL_METHODDEF
|
||||
#define SIGNAL_PTHREAD_KILL_METHODDEF
|
||||
#endif /* !defined(SIGNAL_PTHREAD_KILL_METHODDEF) */
|
||||
/*[clinic end generated code: output=c6990ef0d0ba72b6 input=a9049054013a1b77]*/
|
69
third_party/python/Modules/clinic/spwdmodule.c.h
generated
vendored
Normal file
69
third_party/python/Modules/clinic/spwdmodule.c.h
generated
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
#if defined(HAVE_GETSPNAM)
|
||||
|
||||
PyDoc_STRVAR(spwd_getspnam__doc__,
|
||||
"getspnam($module, arg, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the shadow password database entry for the given user name.\n"
|
||||
"\n"
|
||||
"See `help(spwd)` for more on shadow password database entries.");
|
||||
|
||||
#define SPWD_GETSPNAM_METHODDEF \
|
||||
{"getspnam", (PyCFunction)spwd_getspnam, METH_O, spwd_getspnam__doc__},
|
||||
|
||||
static PyObject *
|
||||
spwd_getspnam_impl(PyObject *module, PyObject *arg);
|
||||
|
||||
static PyObject *
|
||||
spwd_getspnam(PyObject *module, PyObject *arg_)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *arg;
|
||||
|
||||
if (!PyArg_Parse(arg_, "U:getspnam", &arg)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = spwd_getspnam_impl(module, arg);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* defined(HAVE_GETSPNAM) */
|
||||
|
||||
#if defined(HAVE_GETSPENT)
|
||||
|
||||
PyDoc_STRVAR(spwd_getspall__doc__,
|
||||
"getspall($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a list of all available shadow password database entries, in arbitrary order.\n"
|
||||
"\n"
|
||||
"See `help(spwd)` for more on shadow password database entries.");
|
||||
|
||||
#define SPWD_GETSPALL_METHODDEF \
|
||||
{"getspall", (PyCFunction)spwd_getspall, METH_NOARGS, spwd_getspall__doc__},
|
||||
|
||||
static PyObject *
|
||||
spwd_getspall_impl(PyObject *module);
|
||||
|
||||
static PyObject *
|
||||
spwd_getspall(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return spwd_getspall_impl(module);
|
||||
}
|
||||
|
||||
#endif /* defined(HAVE_GETSPENT) */
|
||||
|
||||
#ifndef SPWD_GETSPNAM_METHODDEF
|
||||
#define SPWD_GETSPNAM_METHODDEF
|
||||
#endif /* !defined(SPWD_GETSPNAM_METHODDEF) */
|
||||
|
||||
#ifndef SPWD_GETSPALL_METHODDEF
|
||||
#define SPWD_GETSPALL_METHODDEF
|
||||
#endif /* !defined(SPWD_GETSPALL_METHODDEF) */
|
||||
/*[clinic end generated code: output=07cd8af0afd77fe7 input=a9049054013a1b77]*/
|
382
third_party/python/Modules/clinic/unicodedata.c.h
generated
vendored
Normal file
382
third_party/python/Modules/clinic/unicodedata.c.h
generated
vendored
Normal file
|
@ -0,0 +1,382 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(unicodedata_UCD_decimal__doc__,
|
||||
"decimal($self, chr, default=None, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Converts a Unicode character into its equivalent decimal value.\n"
|
||||
"\n"
|
||||
"Returns the decimal value assigned to the character chr as integer.\n"
|
||||
"If no such value is defined, default is returned, or, if not given,\n"
|
||||
"ValueError is raised.");
|
||||
|
||||
#define UNICODEDATA_UCD_DECIMAL_METHODDEF \
|
||||
{"decimal", (PyCFunction)unicodedata_UCD_decimal, METH_VARARGS, unicodedata_UCD_decimal__doc__},
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_decimal_impl(PyObject *self, int chr,
|
||||
PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_decimal(PyObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int chr;
|
||||
PyObject *default_value = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "C|O:decimal",
|
||||
&chr, &default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = unicodedata_UCD_decimal_impl(self, chr, default_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(unicodedata_UCD_digit__doc__,
|
||||
"digit($self, chr, default=None, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Converts a Unicode character into its equivalent digit value.\n"
|
||||
"\n"
|
||||
"Returns the digit value assigned to the character chr as integer.\n"
|
||||
"If no such value is defined, default is returned, or, if not given,\n"
|
||||
"ValueError is raised.");
|
||||
|
||||
#define UNICODEDATA_UCD_DIGIT_METHODDEF \
|
||||
{"digit", (PyCFunction)unicodedata_UCD_digit, METH_VARARGS, unicodedata_UCD_digit__doc__},
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_digit_impl(PyObject *self, int chr, PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_digit(PyObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int chr;
|
||||
PyObject *default_value = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "C|O:digit",
|
||||
&chr, &default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = unicodedata_UCD_digit_impl(self, chr, default_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(unicodedata_UCD_numeric__doc__,
|
||||
"numeric($self, chr, default=None, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Converts a Unicode character into its equivalent numeric value.\n"
|
||||
"\n"
|
||||
"Returns the numeric value assigned to the character chr as float.\n"
|
||||
"If no such value is defined, default is returned, or, if not given,\n"
|
||||
"ValueError is raised.");
|
||||
|
||||
#define UNICODEDATA_UCD_NUMERIC_METHODDEF \
|
||||
{"numeric", (PyCFunction)unicodedata_UCD_numeric, METH_VARARGS, unicodedata_UCD_numeric__doc__},
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_numeric_impl(PyObject *self, int chr,
|
||||
PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_numeric(PyObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int chr;
|
||||
PyObject *default_value = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "C|O:numeric",
|
||||
&chr, &default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = unicodedata_UCD_numeric_impl(self, chr, default_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(unicodedata_UCD_category__doc__,
|
||||
"category($self, chr, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns the general category assigned to the character chr as string.");
|
||||
|
||||
#define UNICODEDATA_UCD_CATEGORY_METHODDEF \
|
||||
{"category", (PyCFunction)unicodedata_UCD_category, METH_O, unicodedata_UCD_category__doc__},
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_category_impl(PyObject *self, int chr);
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_category(PyObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int chr;
|
||||
|
||||
if (!PyArg_Parse(arg, "C:category", &chr)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = unicodedata_UCD_category_impl(self, chr);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(unicodedata_UCD_bidirectional__doc__,
|
||||
"bidirectional($self, chr, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns the bidirectional class assigned to the character chr as string.\n"
|
||||
"\n"
|
||||
"If no such value is defined, an empty string is returned.");
|
||||
|
||||
#define UNICODEDATA_UCD_BIDIRECTIONAL_METHODDEF \
|
||||
{"bidirectional", (PyCFunction)unicodedata_UCD_bidirectional, METH_O, unicodedata_UCD_bidirectional__doc__},
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_bidirectional_impl(PyObject *self, int chr);
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_bidirectional(PyObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int chr;
|
||||
|
||||
if (!PyArg_Parse(arg, "C:bidirectional", &chr)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = unicodedata_UCD_bidirectional_impl(self, chr);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(unicodedata_UCD_combining__doc__,
|
||||
"combining($self, chr, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns the canonical combining class assigned to the character chr as integer.\n"
|
||||
"\n"
|
||||
"Returns 0 if no combining class is defined.");
|
||||
|
||||
#define UNICODEDATA_UCD_COMBINING_METHODDEF \
|
||||
{"combining", (PyCFunction)unicodedata_UCD_combining, METH_O, unicodedata_UCD_combining__doc__},
|
||||
|
||||
static int
|
||||
unicodedata_UCD_combining_impl(PyObject *self, int chr);
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_combining(PyObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int chr;
|
||||
int _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "C:combining", &chr)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = unicodedata_UCD_combining_impl(self, chr);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromLong((long)_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(unicodedata_UCD_mirrored__doc__,
|
||||
"mirrored($self, chr, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns the mirrored property assigned to the character chr as integer.\n"
|
||||
"\n"
|
||||
"Returns 1 if the character has been identified as a \"mirrored\"\n"
|
||||
"character in bidirectional text, 0 otherwise.");
|
||||
|
||||
#define UNICODEDATA_UCD_MIRRORED_METHODDEF \
|
||||
{"mirrored", (PyCFunction)unicodedata_UCD_mirrored, METH_O, unicodedata_UCD_mirrored__doc__},
|
||||
|
||||
static int
|
||||
unicodedata_UCD_mirrored_impl(PyObject *self, int chr);
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_mirrored(PyObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int chr;
|
||||
int _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "C:mirrored", &chr)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = unicodedata_UCD_mirrored_impl(self, chr);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromLong((long)_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(unicodedata_UCD_east_asian_width__doc__,
|
||||
"east_asian_width($self, chr, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns the east asian width assigned to the character chr as string.");
|
||||
|
||||
#define UNICODEDATA_UCD_EAST_ASIAN_WIDTH_METHODDEF \
|
||||
{"east_asian_width", (PyCFunction)unicodedata_UCD_east_asian_width, METH_O, unicodedata_UCD_east_asian_width__doc__},
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_east_asian_width_impl(PyObject *self, int chr);
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_east_asian_width(PyObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int chr;
|
||||
|
||||
if (!PyArg_Parse(arg, "C:east_asian_width", &chr)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = unicodedata_UCD_east_asian_width_impl(self, chr);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(unicodedata_UCD_decomposition__doc__,
|
||||
"decomposition($self, chr, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns the character decomposition mapping assigned to the character chr as string.\n"
|
||||
"\n"
|
||||
"An empty string is returned in case no such mapping is defined.");
|
||||
|
||||
#define UNICODEDATA_UCD_DECOMPOSITION_METHODDEF \
|
||||
{"decomposition", (PyCFunction)unicodedata_UCD_decomposition, METH_O, unicodedata_UCD_decomposition__doc__},
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_decomposition_impl(PyObject *self, int chr);
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_decomposition(PyObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int chr;
|
||||
|
||||
if (!PyArg_Parse(arg, "C:decomposition", &chr)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = unicodedata_UCD_decomposition_impl(self, chr);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(unicodedata_UCD_normalize__doc__,
|
||||
"normalize($self, form, unistr, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the normal form \'form\' for the Unicode string unistr.\n"
|
||||
"\n"
|
||||
"Valid values for form are \'NFC\', \'NFKC\', \'NFD\', and \'NFKD\'.");
|
||||
|
||||
#define UNICODEDATA_UCD_NORMALIZE_METHODDEF \
|
||||
{"normalize", (PyCFunction)unicodedata_UCD_normalize, METH_VARARGS, unicodedata_UCD_normalize__doc__},
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_normalize_impl(PyObject *self, const char *form,
|
||||
PyObject *input);
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_normalize(PyObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *form;
|
||||
PyObject *input;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "sO!:normalize",
|
||||
&form, &PyUnicode_Type, &input)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = unicodedata_UCD_normalize_impl(self, form, input);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(unicodedata_UCD_name__doc__,
|
||||
"name($self, chr, default=None, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns the name assigned to the character chr as a string.\n"
|
||||
"\n"
|
||||
"If no name is defined, default is returned, or, if not given,\n"
|
||||
"ValueError is raised.");
|
||||
|
||||
#define UNICODEDATA_UCD_NAME_METHODDEF \
|
||||
{"name", (PyCFunction)unicodedata_UCD_name, METH_VARARGS, unicodedata_UCD_name__doc__},
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_name_impl(PyObject *self, int chr, PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_name(PyObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int chr;
|
||||
PyObject *default_value = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "C|O:name",
|
||||
&chr, &default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = unicodedata_UCD_name_impl(self, chr, default_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(unicodedata_UCD_lookup__doc__,
|
||||
"lookup($self, name, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Look up character by name.\n"
|
||||
"\n"
|
||||
"If a character with the given name is found, return the\n"
|
||||
"corresponding character. If not found, KeyError is raised.");
|
||||
|
||||
#define UNICODEDATA_UCD_LOOKUP_METHODDEF \
|
||||
{"lookup", (PyCFunction)unicodedata_UCD_lookup, METH_O, unicodedata_UCD_lookup__doc__},
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_lookup_impl(PyObject *self, const char *name,
|
||||
Py_ssize_clean_t name_length);
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_lookup(PyObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *name;
|
||||
Py_ssize_clean_t name_length;
|
||||
|
||||
if (!PyArg_Parse(arg, "s#:lookup", &name, &name_length)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = unicodedata_UCD_lookup_impl(self, name, name_length);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=5313ce129da87b2f input=a9049054013a1b77]*/
|
474
third_party/python/Modules/clinic/zlibmodule.c.h
generated
vendored
Normal file
474
third_party/python/Modules/clinic/zlibmodule.c.h
generated
vendored
Normal file
|
@ -0,0 +1,474 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(zlib_compress__doc__,
|
||||
"compress($module, data, /, level=Z_DEFAULT_COMPRESSION)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns a bytes object containing compressed data.\n"
|
||||
"\n"
|
||||
" data\n"
|
||||
" Binary data to be compressed.\n"
|
||||
" level\n"
|
||||
" Compression level, in 0-9 or -1.");
|
||||
|
||||
#define ZLIB_COMPRESS_METHODDEF \
|
||||
{"compress", (PyCFunction)zlib_compress, METH_FASTCALL, zlib_compress__doc__},
|
||||
|
||||
static PyObject *
|
||||
zlib_compress_impl(PyObject *module, Py_buffer *data, int level);
|
||||
|
||||
static PyObject *
|
||||
zlib_compress(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"", "level", NULL};
|
||||
static _PyArg_Parser _parser = {"y*|i:compress", _keywords, 0};
|
||||
Py_buffer data = {NULL, NULL};
|
||||
int level = Z_DEFAULT_COMPRESSION;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&data, &level)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = zlib_compress_impl(module, &data, level);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(zlib_decompress__doc__,
|
||||
"decompress($module, data, /, wbits=MAX_WBITS, bufsize=DEF_BUF_SIZE)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns a bytes object containing the uncompressed data.\n"
|
||||
"\n"
|
||||
" data\n"
|
||||
" Compressed data.\n"
|
||||
" wbits\n"
|
||||
" The window buffer size and container format.\n"
|
||||
" bufsize\n"
|
||||
" The initial output buffer size.");
|
||||
|
||||
#define ZLIB_DECOMPRESS_METHODDEF \
|
||||
{"decompress", (PyCFunction)zlib_decompress, METH_FASTCALL, zlib_decompress__doc__},
|
||||
|
||||
static PyObject *
|
||||
zlib_decompress_impl(PyObject *module, Py_buffer *data, int wbits,
|
||||
Py_ssize_t bufsize);
|
||||
|
||||
static PyObject *
|
||||
zlib_decompress(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"", "wbits", "bufsize", NULL};
|
||||
static _PyArg_Parser _parser = {"y*|iO&:decompress", _keywords, 0};
|
||||
Py_buffer data = {NULL, NULL};
|
||||
int wbits = MAX_WBITS;
|
||||
Py_ssize_t bufsize = DEF_BUF_SIZE;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&data, &wbits, ssize_t_converter, &bufsize)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = zlib_decompress_impl(module, &data, wbits, bufsize);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(zlib_compressobj__doc__,
|
||||
"compressobj($module, /, level=Z_DEFAULT_COMPRESSION, method=DEFLATED,\n"
|
||||
" wbits=MAX_WBITS, memLevel=DEF_MEM_LEVEL,\n"
|
||||
" strategy=Z_DEFAULT_STRATEGY, zdict=None)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a compressor object.\n"
|
||||
"\n"
|
||||
" level\n"
|
||||
" The compression level (an integer in the range 0-9 or -1; default is\n"
|
||||
" currently equivalent to 6). Higher compression levels are slower,\n"
|
||||
" but produce smaller results.\n"
|
||||
" method\n"
|
||||
" The compression algorithm. If given, this must be DEFLATED.\n"
|
||||
" wbits\n"
|
||||
" +9 to +15: The base-two logarithm of the window size. Include a zlib\n"
|
||||
" container.\n"
|
||||
" -9 to -15: Generate a raw stream.\n"
|
||||
" +25 to +31: Include a gzip container.\n"
|
||||
" memLevel\n"
|
||||
" Controls the amount of memory used for internal compression state.\n"
|
||||
" Valid values range from 1 to 9. Higher values result in higher memory\n"
|
||||
" usage, faster compression, and smaller output.\n"
|
||||
" strategy\n"
|
||||
" Used to tune the compression algorithm. Possible values are\n"
|
||||
" Z_DEFAULT_STRATEGY, Z_FILTERED, and Z_HUFFMAN_ONLY.\n"
|
||||
" zdict\n"
|
||||
" The predefined compression dictionary - a sequence of bytes\n"
|
||||
" containing subsequences that are likely to occur in the input data.");
|
||||
|
||||
#define ZLIB_COMPRESSOBJ_METHODDEF \
|
||||
{"compressobj", (PyCFunction)zlib_compressobj, METH_FASTCALL, zlib_compressobj__doc__},
|
||||
|
||||
static PyObject *
|
||||
zlib_compressobj_impl(PyObject *module, int level, int method, int wbits,
|
||||
int memLevel, int strategy, Py_buffer *zdict);
|
||||
|
||||
static PyObject *
|
||||
zlib_compressobj(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"level", "method", "wbits", "memLevel", "strategy", "zdict", NULL};
|
||||
static _PyArg_Parser _parser = {"|iiiiiy*:compressobj", _keywords, 0};
|
||||
int level = Z_DEFAULT_COMPRESSION;
|
||||
int method = DEFLATED;
|
||||
int wbits = MAX_WBITS;
|
||||
int memLevel = DEF_MEM_LEVEL;
|
||||
int strategy = Z_DEFAULT_STRATEGY;
|
||||
Py_buffer zdict = {NULL, NULL};
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&level, &method, &wbits, &memLevel, &strategy, &zdict)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = zlib_compressobj_impl(module, level, method, wbits, memLevel, strategy, &zdict);
|
||||
|
||||
exit:
|
||||
/* Cleanup for zdict */
|
||||
if (zdict.obj) {
|
||||
PyBuffer_Release(&zdict);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(zlib_decompressobj__doc__,
|
||||
"decompressobj($module, /, wbits=MAX_WBITS, zdict=b\'\')\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a decompressor object.\n"
|
||||
"\n"
|
||||
" wbits\n"
|
||||
" The window buffer size and container format.\n"
|
||||
" zdict\n"
|
||||
" The predefined compression dictionary. This must be the same\n"
|
||||
" dictionary as used by the compressor that produced the input data.");
|
||||
|
||||
#define ZLIB_DECOMPRESSOBJ_METHODDEF \
|
||||
{"decompressobj", (PyCFunction)zlib_decompressobj, METH_FASTCALL, zlib_decompressobj__doc__},
|
||||
|
||||
static PyObject *
|
||||
zlib_decompressobj_impl(PyObject *module, int wbits, PyObject *zdict);
|
||||
|
||||
static PyObject *
|
||||
zlib_decompressobj(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"wbits", "zdict", NULL};
|
||||
static _PyArg_Parser _parser = {"|iO:decompressobj", _keywords, 0};
|
||||
int wbits = MAX_WBITS;
|
||||
PyObject *zdict = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&wbits, &zdict)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = zlib_decompressobj_impl(module, wbits, zdict);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(zlib_Compress_compress__doc__,
|
||||
"compress($self, data, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns a bytes object containing compressed data.\n"
|
||||
"\n"
|
||||
" data\n"
|
||||
" Binary data to be compressed.\n"
|
||||
"\n"
|
||||
"After calling this function, some of the input data may still\n"
|
||||
"be stored in internal buffers for later processing.\n"
|
||||
"Call the flush() method to clear these buffers.");
|
||||
|
||||
#define ZLIB_COMPRESS_COMPRESS_METHODDEF \
|
||||
{"compress", (PyCFunction)zlib_Compress_compress, METH_O, zlib_Compress_compress__doc__},
|
||||
|
||||
static PyObject *
|
||||
zlib_Compress_compress_impl(compobject *self, Py_buffer *data);
|
||||
|
||||
static PyObject *
|
||||
zlib_Compress_compress(compobject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
|
||||
if (!PyArg_Parse(arg, "y*:compress", &data)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = zlib_Compress_compress_impl(self, &data);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(zlib_Decompress_decompress__doc__,
|
||||
"decompress($self, data, /, max_length=0)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a bytes object containing the decompressed version of the data.\n"
|
||||
"\n"
|
||||
" data\n"
|
||||
" The binary data to decompress.\n"
|
||||
" max_length\n"
|
||||
" The maximum allowable length of the decompressed data.\n"
|
||||
" Unconsumed input data will be stored in\n"
|
||||
" the unconsumed_tail attribute.\n"
|
||||
"\n"
|
||||
"After calling this function, some of the input data may still be stored in\n"
|
||||
"internal buffers for later processing.\n"
|
||||
"Call the flush() method to clear these buffers.");
|
||||
|
||||
#define ZLIB_DECOMPRESS_DECOMPRESS_METHODDEF \
|
||||
{"decompress", (PyCFunction)zlib_Decompress_decompress, METH_FASTCALL, zlib_Decompress_decompress__doc__},
|
||||
|
||||
static PyObject *
|
||||
zlib_Decompress_decompress_impl(compobject *self, Py_buffer *data,
|
||||
Py_ssize_t max_length);
|
||||
|
||||
static PyObject *
|
||||
zlib_Decompress_decompress(compobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"", "max_length", NULL};
|
||||
static _PyArg_Parser _parser = {"y*|O&:decompress", _keywords, 0};
|
||||
Py_buffer data = {NULL, NULL};
|
||||
Py_ssize_t max_length = 0;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&data, ssize_t_converter, &max_length)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = zlib_Decompress_decompress_impl(self, &data, max_length);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(zlib_Compress_flush__doc__,
|
||||
"flush($self, mode=zlib.Z_FINISH, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a bytes object containing any remaining compressed data.\n"
|
||||
"\n"
|
||||
" mode\n"
|
||||
" One of the constants Z_SYNC_FLUSH, Z_FULL_FLUSH, Z_FINISH.\n"
|
||||
" If mode == Z_FINISH, the compressor object can no longer be\n"
|
||||
" used after calling the flush() method. Otherwise, more data\n"
|
||||
" can still be compressed.");
|
||||
|
||||
#define ZLIB_COMPRESS_FLUSH_METHODDEF \
|
||||
{"flush", (PyCFunction)zlib_Compress_flush, METH_VARARGS, zlib_Compress_flush__doc__},
|
||||
|
||||
static PyObject *
|
||||
zlib_Compress_flush_impl(compobject *self, int mode);
|
||||
|
||||
static PyObject *
|
||||
zlib_Compress_flush(compobject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int mode = Z_FINISH;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|i:flush",
|
||||
&mode)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = zlib_Compress_flush_impl(self, mode);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#if defined(HAVE_ZLIB_COPY)
|
||||
|
||||
PyDoc_STRVAR(zlib_Compress_copy__doc__,
|
||||
"copy($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a copy of the compression object.");
|
||||
|
||||
#define ZLIB_COMPRESS_COPY_METHODDEF \
|
||||
{"copy", (PyCFunction)zlib_Compress_copy, METH_NOARGS, zlib_Compress_copy__doc__},
|
||||
|
||||
static PyObject *
|
||||
zlib_Compress_copy_impl(compobject *self);
|
||||
|
||||
static PyObject *
|
||||
zlib_Compress_copy(compobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return zlib_Compress_copy_impl(self);
|
||||
}
|
||||
|
||||
#endif /* defined(HAVE_ZLIB_COPY) */
|
||||
|
||||
#if defined(HAVE_ZLIB_COPY)
|
||||
|
||||
PyDoc_STRVAR(zlib_Decompress_copy__doc__,
|
||||
"copy($self, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a copy of the decompression object.");
|
||||
|
||||
#define ZLIB_DECOMPRESS_COPY_METHODDEF \
|
||||
{"copy", (PyCFunction)zlib_Decompress_copy, METH_NOARGS, zlib_Decompress_copy__doc__},
|
||||
|
||||
static PyObject *
|
||||
zlib_Decompress_copy_impl(compobject *self);
|
||||
|
||||
static PyObject *
|
||||
zlib_Decompress_copy(compobject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return zlib_Decompress_copy_impl(self);
|
||||
}
|
||||
|
||||
#endif /* defined(HAVE_ZLIB_COPY) */
|
||||
|
||||
PyDoc_STRVAR(zlib_Decompress_flush__doc__,
|
||||
"flush($self, length=zlib.DEF_BUF_SIZE, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a bytes object containing any remaining decompressed data.\n"
|
||||
"\n"
|
||||
" length\n"
|
||||
" the initial size of the output buffer.");
|
||||
|
||||
#define ZLIB_DECOMPRESS_FLUSH_METHODDEF \
|
||||
{"flush", (PyCFunction)zlib_Decompress_flush, METH_VARARGS, zlib_Decompress_flush__doc__},
|
||||
|
||||
static PyObject *
|
||||
zlib_Decompress_flush_impl(compobject *self, Py_ssize_t length);
|
||||
|
||||
static PyObject *
|
||||
zlib_Decompress_flush(compobject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t length = DEF_BUF_SIZE;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|O&:flush",
|
||||
ssize_t_converter, &length)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = zlib_Decompress_flush_impl(self, length);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(zlib_adler32__doc__,
|
||||
"adler32($module, data, value=1, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Compute an Adler-32 checksum of data.\n"
|
||||
"\n"
|
||||
" value\n"
|
||||
" Starting value of the checksum.\n"
|
||||
"\n"
|
||||
"The returned checksum is an integer.");
|
||||
|
||||
#define ZLIB_ADLER32_METHODDEF \
|
||||
{"adler32", (PyCFunction)zlib_adler32, METH_VARARGS, zlib_adler32__doc__},
|
||||
|
||||
static PyObject *
|
||||
zlib_adler32_impl(PyObject *module, Py_buffer *data, unsigned int value);
|
||||
|
||||
static PyObject *
|
||||
zlib_adler32(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
unsigned int value = 1;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*|I:adler32",
|
||||
&data, &value)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = zlib_adler32_impl(module, &data, value);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(zlib_crc32__doc__,
|
||||
"crc32($module, data, value=0, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Compute a CRC-32 checksum of data.\n"
|
||||
"\n"
|
||||
" value\n"
|
||||
" Starting value of the checksum.\n"
|
||||
"\n"
|
||||
"The returned checksum is an integer.");
|
||||
|
||||
#define ZLIB_CRC32_METHODDEF \
|
||||
{"crc32", (PyCFunction)zlib_crc32, METH_VARARGS, zlib_crc32__doc__},
|
||||
|
||||
static PyObject *
|
||||
zlib_crc32_impl(PyObject *module, Py_buffer *data, unsigned int value);
|
||||
|
||||
static PyObject *
|
||||
zlib_crc32(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
unsigned int value = 0;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*|I:crc32",
|
||||
&data, &value)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = zlib_crc32_impl(module, &data, value);
|
||||
|
||||
exit:
|
||||
/* Cleanup for data */
|
||||
if (data.obj) {
|
||||
PyBuffer_Release(&data);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#ifndef ZLIB_COMPRESS_COPY_METHODDEF
|
||||
#define ZLIB_COMPRESS_COPY_METHODDEF
|
||||
#endif /* !defined(ZLIB_COMPRESS_COPY_METHODDEF) */
|
||||
|
||||
#ifndef ZLIB_DECOMPRESS_COPY_METHODDEF
|
||||
#define ZLIB_DECOMPRESS_COPY_METHODDEF
|
||||
#endif /* !defined(ZLIB_DECOMPRESS_COPY_METHODDEF) */
|
||||
/*[clinic end generated code: output=497dad1132c962e2 input=a9049054013a1b77]*/
|
Loading…
Add table
Add a link
Reference in a new issue