Issue #23501: Argumen Clinic now generates code into separate files by default.

This commit is contained in:
Serhiy Storchaka 2015-04-03 23:53:51 +03:00
parent 0759f84d62
commit 1009bf18b3
54 changed files with 9262 additions and 8731 deletions

View file

@ -211,12 +211,11 @@ error:
}
/*[clinic input]
output preset file
module _bz2
class _bz2.BZ2Compressor "BZ2Compressor *" "&BZ2Compressor_Type"
class _bz2.BZ2Decompressor "BZ2Decompressor *" "&BZ2Decompressor_Type"
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=e3b139924f5e18cc]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=dc7d7992a79f9cb7]*/
#include "clinic/_bz2module.c.h"

View file

@ -47,6 +47,7 @@ module _codecs
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=e1390e3da3cb9deb]*/
#include "clinic/_codecsmodule.c.h"
/* --- Registry ----------------------------------------------------------- */
@ -153,37 +154,9 @@ _codecs._forget_codec
Purge the named codec from the internal codec lookup cache
[clinic start generated code]*/
PyDoc_STRVAR(_codecs__forget_codec__doc__,
"_forget_codec($module, encoding, /)\n"
"--\n"
"\n"
"Purge the named codec from the internal codec lookup cache");
#define _CODECS__FORGET_CODEC_METHODDEF \
{"_forget_codec", (PyCFunction)_codecs__forget_codec, METH_VARARGS, _codecs__forget_codec__doc__},
static PyObject *
_codecs__forget_codec_impl(PyModuleDef *module, const char *encoding);
static PyObject *
_codecs__forget_codec(PyModuleDef *module, PyObject *args)
{
PyObject *return_value = NULL;
const char *encoding;
if (!PyArg_ParseTuple(args,
"s:_forget_codec",
&encoding))
goto exit;
return_value = _codecs__forget_codec_impl(module, encoding);
exit:
return return_value;
}
static PyObject *
_codecs__forget_codec_impl(PyModuleDef *module, const char *encoding)
/*[clinic end generated code: output=a75e631591702a5c input=18d5d92d0e386c38]*/
/*[clinic end generated code: output=b56a9b99d2d28080 input=18d5d92d0e386c38]*/
{
if (_PyCodec_Forget(encoding) < 0) {
return NULL;

View file

@ -12,6 +12,7 @@ module crypt
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=c6252cf4f2f2ae81]*/
#include "clinic/_cryptmodule.c.h"
/*[clinic input]
crypt.crypt
@ -29,43 +30,9 @@ results for a given *word*.
[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(PyModuleDef *module, const char *word, const char *salt);
static PyObject *
crypt_crypt(PyModuleDef *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;
}
static PyObject *
crypt_crypt_impl(PyModuleDef *module, const char *word, const char *salt)
/*[clinic end generated code: output=3eaacdf994a6ff23 input=4d93b6d0f41fbf58]*/
/*[clinic end generated code: output=995ad1e854d83069 input=4d93b6d0f41fbf58]*/
{
/* On some platforms (AtheOS) crypt returns NULL for an invalid
salt. Return None in that case. XXX Maybe raise an exception? */

View file

@ -140,6 +140,8 @@ class curses.window "PyCursesWindowObject *" "&PyCursesWindow_Type"
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=88c860abdbb50e0c]*/
#include "clinic/_cursesmodule.c.h"
/* Definition of exception curses.error */
static PyObject *PyCursesError;
@ -583,75 +585,9 @@ By default, the character position and attributes are the
current settings for the window object.
[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;
}
static PyObject *
curses_window_addch_impl(PyCursesWindowObject *self, int group_left_1, int y, int x, PyObject *ch, int group_right_1, long attr)
/*[clinic end generated code: output=d4b97cc287010c54 input=5a41efb34a2de338]*/
/*[clinic end generated code: output=9fa34a5d80151f1a input=5a41efb34a2de338]*/
{
PyCursesWindowObject *cwself = (PyCursesWindowObject *)self;
int coordinates_group = group_left_1;

View file

@ -26,6 +26,8 @@ class datetime.datetime "PyDateTime_DateTime *" "&PyDateTime_DateTimeType"
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=78142cb64b9e98bc]*/
#include "clinic/_datetimemodule.c.h"
/* We require that C int be at least 32 bits, and use int virtually
* everywhere. In just a few cases we use a temp long, where a Python
* API returns a C long. In such cases, we have to ensure that the
@ -4133,43 +4135,9 @@ Returns new datetime object representing current time local to tz.
If no tz is specified, uses local timezone.
[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_VARARGS|METH_KEYWORDS|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, PyObject *kwargs)
{
PyObject *return_value = NULL;
static char *_keywords[] = {"tz", NULL};
PyObject *tz = Py_None;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|O:now", _keywords,
&tz))
goto exit;
return_value = datetime_datetime_now_impl(type, tz);
exit:
return return_value;
}
static PyObject *
datetime_datetime_now_impl(PyTypeObject *type, PyObject *tz)
/*[clinic end generated code: output=583c5637e3c843fa input=80d09869c5267d00]*/
/*[clinic end generated code: output=b3386e5345e2b47a input=80d09869c5267d00]*/
{
PyObject *self;

View file

@ -40,6 +40,8 @@ typedef struct {
DBM *di_dbm;
} dbmobject;
#include "clinic/_dbmmodule.c.h"
static PyTypeObject Dbmtype;
#define is_dbmobject(v) (Py_TYPE(v) == &Dbmtype)
@ -277,39 +279,9 @@ dbm.dbm.get
Return the value for key if present, otherwise default.
[clinic start generated code]*/
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 *dp, const char *key, Py_ssize_clean_t key_length, PyObject *default_value);
static PyObject *
dbm_dbm_get(dbmobject *dp, 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(dp, key, key_length, default_value);
exit:
return return_value;
}
static PyObject *
dbm_dbm_get_impl(dbmobject *dp, const char *key, Py_ssize_clean_t key_length, PyObject *default_value)
/*[clinic end generated code: output=452ea11394e7e92d input=aecf5efd2f2b1a3b]*/
/*[clinic end generated code: output=c2bdccaa734ad349 input=aecf5efd2f2b1a3b]*/
{
datum dbm_key, val;
@ -449,47 +421,9 @@ Return a database object.
[clinic start generated code]*/
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(PyModuleDef *module, const char *filename, const char *flags, int mode);
static PyObject *
dbmopen(PyModuleDef *module, PyObject *args)
{
PyObject *return_value = NULL;
const char *filename;
const char *flags = "r";
int mode = 438;
if (!PyArg_ParseTuple(args,
"s|si:open",
&filename, &flags, &mode))
goto exit;
return_value = dbmopen_impl(module, filename, flags, mode);
exit:
return return_value;
}
static PyObject *
dbmopen_impl(PyModuleDef *module, const char *filename, const char *flags, int mode)
/*[clinic end generated code: output=9a7b725f9c4dcec2 input=6499ab0fab1333ac]*/
/*[clinic end generated code: output=8b618fe06b92bf86 input=6499ab0fab1333ac]*/
{
int iflags;

View file

@ -478,12 +478,11 @@ error:
/*[clinic input]
output preset file
module _lzma
class _lzma.LZMACompressor "Compressor *" "&Compressor_type"
class _lzma.LZMADecompressor "Decompressor *" "&Decompressor_type"
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=f17afc786525d6c2]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=2c14bbe05ff0c147]*/
#include "clinic/_lzmamodule.c.h"

View file

@ -6,6 +6,8 @@ module _opcode
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=117442e66eb376e6]*/
#include "clinic/_opcode.c.h"
/*[clinic input]
_opcode.stack_effect -> int
@ -17,42 +19,9 @@ _opcode.stack_effect -> int
Compute the stack effect of the opcode.
[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(PyModuleDef *module, int opcode, PyObject *oparg);
static PyObject *
_opcode_stack_effect(PyModuleDef *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;
}
static int
_opcode_stack_effect_impl(PyModuleDef *module, int opcode, PyObject *oparg)
/*[clinic end generated code: output=9e1133f8d587bc67 input=2d0a9ee53c0418f5]*/
/*[clinic end generated code: output=1fcafd5596c6b050 input=2d0a9ee53c0418f5]*/
{
int effect;
int oparg_int = 0;

View file

@ -5,14 +5,13 @@ PyDoc_STRVAR(pickle_module_doc,
"Optimized C implementation for the Python pickle module.");
/*[clinic input]
output preset file
module _pickle
class _pickle.Pickler "PicklerObject *" "&Pickler_Type"
class _pickle.PicklerMemoProxy "PicklerMemoProxyObject *" "&PicklerMemoProxyType"
class _pickle.Unpickler "UnpicklerObject *" "&Unpickler_Type"
class _pickle.UnpicklerMemoProxy "UnpicklerMemoProxyObject *" "&UnpicklerMemoProxyType"
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=11c45248a41dd3fc]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=4b3e113468a58e6c]*/
/* Bump this when new opcodes are added to the pickle protocol. */
enum {

View file

@ -9,6 +9,8 @@ module _weakref
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=ffec73b85846596d]*/
#include "clinic/_weakref.c.h"
/*[clinic input]
_weakref.getweakrefcount -> Py_ssize_t
@ -19,36 +21,9 @@ _weakref.getweakrefcount -> Py_ssize_t
Return the number of weak references to 'object'.
[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(PyModuleDef *module, PyObject *object);
static PyObject *
_weakref_getweakrefcount(PyModuleDef *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;
}
static Py_ssize_t
_weakref_getweakrefcount_impl(PyModuleDef *module, PyObject *object)
/*[clinic end generated code: output=032eedbfd7d69e10 input=cedb69711b6a2507]*/
/*[clinic end generated code: output=6a6ad0b98285e468 input=cedb69711b6a2507]*/
{
PyWeakReference **list;

View file

@ -16,10 +16,9 @@
#endif /* !STDC_HEADERS */
/*[clinic input]
output preset file
module array
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=0909c1a148c69931]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=7d1b8d7f5958fd83]*/
struct arrayobject; /* Forward */

View file

@ -391,10 +391,9 @@ audioop_check_parameters(Py_ssize_t len, int size)
}
/*[clinic input]
output preset file
module audioop
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=5619f935f269199a]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=8fa8f6611be3591a]*/
/*[clinic input]
audioop.getsample

View file

@ -184,10 +184,9 @@ static unsigned short crctab_hqx[256] = {
};
/*[clinic input]
output preset file
module binascii
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=44c6f840ce708f0c]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=de89fb46bcaf3fec]*/
/*[python input]

View file

@ -11,15 +11,10 @@
#include "clinic/multibytecodec.c.h"
/*[clinic input]
output preset file
module _multibytecodec
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=e0cf1b7f3c472d17]*/
/*[clinic input]
class _multibytecodec.MultibyteCodec "MultibyteCodecObject *" "&MultibyteCodec_Type"
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=d5b1fc1fec8eb003]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=6ad689546cbb5450]*/
typedef struct {
PyObject *inobj;

View file

@ -0,0 +1,32 @@
/*[clinic input]
preserve
[clinic start generated code]*/
PyDoc_STRVAR(_codecs__forget_codec__doc__,
"_forget_codec($module, encoding, /)\n"
"--\n"
"\n"
"Purge the named codec from the internal codec lookup cache");
#define _CODECS__FORGET_CODEC_METHODDEF \
{"_forget_codec", (PyCFunction)_codecs__forget_codec, METH_VARARGS, _codecs__forget_codec__doc__},
static PyObject *
_codecs__forget_codec_impl(PyModuleDef *module, const char *encoding);
static PyObject *
_codecs__forget_codec(PyModuleDef *module, PyObject *args)
{
PyObject *return_value = NULL;
const char *encoding;
if (!PyArg_ParseTuple(args,
"s:_forget_codec",
&encoding))
goto exit;
return_value = _codecs__forget_codec_impl(module, encoding);
exit:
return return_value;
}
/*[clinic end generated code: output=cdea83e21d76a900 input=a9049054013a1b77]*/

View 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(PyModuleDef *module, const char *word, const char *salt);
static PyObject *
crypt_crypt(PyModuleDef *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=b5b8d977189d19ea input=a9049054013a1b77]*/

View file

@ -0,0 +1,70 @@
/*[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=660ab0ae6d8fbdda input=a9049054013a1b77]*/

View file

@ -0,0 +1,38 @@
/*[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_VARARGS|METH_KEYWORDS|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, PyObject *kwargs)
{
PyObject *return_value = NULL;
static char *_keywords[] = {"tz", NULL};
PyObject *tz = Py_None;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|O:now", _keywords,
&tz))
goto exit;
return_value = datetime_datetime_now_impl(type, tz);
exit:
return return_value;
}
/*[clinic end generated code: output=a5c51b96f10c462c input=a9049054013a1b77]*/

View file

@ -0,0 +1,72 @@
/*[clinic input]
preserve
[clinic start generated code]*/
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 *dp, const char *key, Py_ssize_clean_t key_length, PyObject *default_value);
static PyObject *
dbm_dbm_get(dbmobject *dp, 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(dp, 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(PyModuleDef *module, const char *filename, const char *flags, int mode);
static PyObject *
dbmopen(PyModuleDef *module, PyObject *args)
{
PyObject *return_value = NULL;
const char *filename;
const char *flags = "r";
int mode = 438;
if (!PyArg_ParseTuple(args,
"s|si:open",
&filename, &flags, &mode))
goto exit;
return_value = dbmopen_impl(module, filename, flags, mode);
exit:
return return_value;
}
/*[clinic end generated code: output=78d62d1aa3ddd13c input=a9049054013a1b77]*/

View file

@ -0,0 +1,37 @@
/*[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(PyModuleDef *module, int opcode, PyObject *oparg);
static PyObject *
_opcode_stack_effect(PyModuleDef *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=dbe45148bc21ecdf input=a9049054013a1b77]*/

View file

@ -0,0 +1,31 @@
/*[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(PyModuleDef *module, PyObject *object);
static PyObject *
_weakref_getweakrefcount(PyModuleDef *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;
}
/*[clinic end generated code: output=4da9aade63eed77f input=a9049054013a1b77]*/

View file

@ -0,0 +1,96 @@
/*[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 string of binary data.");
#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_VARARGS|METH_KEYWORDS, _md5_md5__doc__},
static PyObject *
_md5_md5_impl(PyModuleDef *module, PyObject *string);
static PyObject *
_md5_md5(PyModuleDef *module, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
static char *_keywords[] = {"string", NULL};
PyObject *string = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|O:md5", _keywords,
&string))
goto exit;
return_value = _md5_md5_impl(module, string);
exit:
return return_value;
}
/*[clinic end generated code: output=f72618edfd35d984 input=a9049054013a1b77]*/

File diff suppressed because it is too large Load diff

289
Modules/clinic/pyexpat.c.h Normal file
View file

@ -0,0 +1,289 @@
/*[clinic input]
preserve
[clinic start generated code]*/
PyDoc_STRVAR(pyexpat_xmlparser_Parse__doc__,
"Parse($self, data, isFinal=0, /)\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_VARARGS, pyexpat_xmlparser_SetBase__doc__},
static PyObject *
pyexpat_xmlparser_SetBase_impl(xmlparseobject *self, const char *base);
static PyObject *
pyexpat_xmlparser_SetBase(xmlparseobject *self, PyObject *args)
{
PyObject *return_value = NULL;
const char *base;
if (!PyArg_ParseTuple(args,
"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_VARARGS, pyexpat_xmlparser_SetParamEntityParsing__doc__},
static PyObject *
pyexpat_xmlparser_SetParamEntityParsing_impl(xmlparseobject *self, int flag);
static PyObject *
pyexpat_xmlparser_SetParamEntityParsing(xmlparseobject *self, PyObject *args)
{
PyObject *return_value = NULL;
int flag;
if (!PyArg_ParseTuple(args,
"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"
"--");
#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_VARARGS|METH_KEYWORDS, pyexpat_ParserCreate__doc__},
static PyObject *
pyexpat_ParserCreate_impl(PyModuleDef *module, const char *encoding, const char *namespace_separator, PyObject *intern);
static PyObject *
pyexpat_ParserCreate(PyModuleDef *module, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
static char *_keywords[] = {"encoding", "namespace_separator", "intern", NULL};
const char *encoding = NULL;
const char *namespace_separator = NULL;
PyObject *intern = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|zzO:ParserCreate", _keywords,
&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_VARARGS, pyexpat_ErrorString__doc__},
static PyObject *
pyexpat_ErrorString_impl(PyModuleDef *module, long code);
static PyObject *
pyexpat_ErrorString(PyModuleDef *module, PyObject *args)
{
PyObject *return_value = NULL;
long code;
if (!PyArg_ParseTuple(args,
"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=0198390005e40e1c input=a9049054013a1b77]*/

View file

@ -0,0 +1,96 @@
/*[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 string of binary data.");
#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_VARARGS|METH_KEYWORDS, _sha1_sha1__doc__},
static PyObject *
_sha1_sha1_impl(PyModuleDef *module, PyObject *string);
static PyObject *
_sha1_sha1(PyModuleDef *module, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
static char *_keywords[] = {"string", NULL};
PyObject *string = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|O:sha1", _keywords,
&string))
goto exit;
return_value = _sha1_sha1_impl(module, string);
exit:
return return_value;
}
/*[clinic end generated code: output=b2890b9ca964b217 input=a9049054013a1b77]*/

View file

@ -0,0 +1,125 @@
/*[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 string of binary data.");
#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_VARARGS|METH_KEYWORDS, _sha256_sha256__doc__},
static PyObject *
_sha256_sha256_impl(PyModuleDef *module, PyObject *string);
static PyObject *
_sha256_sha256(PyModuleDef *module, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
static char *_keywords[] = {"string", NULL};
PyObject *string = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|O:sha256", _keywords,
&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_VARARGS|METH_KEYWORDS, _sha256_sha224__doc__},
static PyObject *
_sha256_sha224_impl(PyModuleDef *module, PyObject *string);
static PyObject *
_sha256_sha224(PyModuleDef *module, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
static char *_keywords[] = {"string", NULL};
PyObject *string = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|O:sha224", _keywords,
&string))
goto exit;
return_value = _sha256_sha224_impl(module, string);
exit:
return return_value;
}
/*[clinic end generated code: output=8a0520371b097358 input=a9049054013a1b77]*/

View file

@ -0,0 +1,173 @@
/*[clinic input]
preserve
[clinic start generated code]*/
#if defined(PY_LONG_LONG)
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);
}
#endif /* defined(PY_LONG_LONG) */
#if defined(PY_LONG_LONG)
PyDoc_STRVAR(SHA512Type_digest__doc__,
"digest($self, /)\n"
"--\n"
"\n"
"Return the digest value as a string of binary data.");
#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);
}
#endif /* defined(PY_LONG_LONG) */
#if defined(PY_LONG_LONG)
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);
}
#endif /* defined(PY_LONG_LONG) */
#if defined(PY_LONG_LONG)
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__},
#endif /* defined(PY_LONG_LONG) */
#if defined(PY_LONG_LONG)
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_VARARGS|METH_KEYWORDS, _sha512_sha512__doc__},
static PyObject *
_sha512_sha512_impl(PyModuleDef *module, PyObject *string);
static PyObject *
_sha512_sha512(PyModuleDef *module, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
static char *_keywords[] = {"string", NULL};
PyObject *string = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|O:sha512", _keywords,
&string))
goto exit;
return_value = _sha512_sha512_impl(module, string);
exit:
return return_value;
}
#endif /* defined(PY_LONG_LONG) */
#if defined(PY_LONG_LONG)
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_VARARGS|METH_KEYWORDS, _sha512_sha384__doc__},
static PyObject *
_sha512_sha384_impl(PyModuleDef *module, PyObject *string);
static PyObject *
_sha512_sha384(PyModuleDef *module, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
static char *_keywords[] = {"string", NULL};
PyObject *string = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|O:sha384", _keywords,
&string))
goto exit;
return_value = _sha512_sha384_impl(module, string);
exit:
return return_value;
}
#endif /* defined(PY_LONG_LONG) */
#ifndef SHA512TYPE_COPY_METHODDEF
#define SHA512TYPE_COPY_METHODDEF
#endif /* !defined(SHA512TYPE_COPY_METHODDEF) */
#ifndef SHA512TYPE_DIGEST_METHODDEF
#define SHA512TYPE_DIGEST_METHODDEF
#endif /* !defined(SHA512TYPE_DIGEST_METHODDEF) */
#ifndef SHA512TYPE_HEXDIGEST_METHODDEF
#define SHA512TYPE_HEXDIGEST_METHODDEF
#endif /* !defined(SHA512TYPE_HEXDIGEST_METHODDEF) */
#ifndef SHA512TYPE_UPDATE_METHODDEF
#define SHA512TYPE_UPDATE_METHODDEF
#endif /* !defined(SHA512TYPE_UPDATE_METHODDEF) */
#ifndef _SHA512_SHA512_METHODDEF
#define _SHA512_SHA512_METHODDEF
#endif /* !defined(_SHA512_SHA512_METHODDEF) */
#ifndef _SHA512_SHA384_METHODDEF
#define _SHA512_SHA384_METHODDEF
#endif /* !defined(_SHA512_SHA384_METHODDEF) */
/*[clinic end generated code: output=de7bda19fde49310 input=a9049054013a1b77]*/

View file

@ -0,0 +1,37 @@
/*[clinic input]
preserve
[clinic start generated code]*/
PyDoc_STRVAR(unicodedata_UCD_decimal__doc__,
"decimal($self, unichr, default=None, /)\n"
"--\n"
"\n"
"Converts a Unicode character into its equivalent decimal value.\n"
"\n"
"Returns the decimal value assigned to the Unicode character unichr\n"
"as integer. If no such value is defined, default is returned, or, if\n"
"not given, 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(PreviousDBVersion *self, PyUnicodeObject *unichr, PyObject *default_value);
static PyObject *
unicodedata_UCD_decimal(PreviousDBVersion *self, PyObject *args)
{
PyObject *return_value = NULL;
PyUnicodeObject *unichr;
PyObject *default_value = NULL;
if (!PyArg_ParseTuple(args,
"O!|O:decimal",
&PyUnicode_Type, &unichr, &default_value))
goto exit;
return_value = unicodedata_UCD_decimal_impl(self, unichr, default_value);
exit:
return return_value;
}
/*[clinic end generated code: output=15b82651419cc823 input=a9049054013a1b77]*/

View file

@ -10,10 +10,9 @@
#include "clinic/cmathmodule.c.h"
/*[clinic input]
output preset file
module cmath
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=ef7e0fdd8a143c03]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=308d6839f4a46333]*/
/*[python input]
class Py_complex_protected_converter(Py_complex_converter):

View file

@ -16,10 +16,9 @@
#endif
/*[clinic input]
output preset file
module fcntl
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=c7356fdb126a904a]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=124b58387c158179]*/
static int
conv_descriptor(PyObject *object, int *target)

View file

@ -8,10 +8,9 @@
#include "clinic/grpmodule.c.h"
/*[clinic input]
output preset file
module grp
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=68180a9a9efb8506]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=cade63f2ed1bd9f8]*/
static PyStructSequence_Field struct_group_type_fields[] = {
{"gr_name", "group name"},

View file

@ -53,6 +53,7 @@ typedef struct {
struct md5_state hash_state;
} MD5object;
#include "clinic/md5module.c.h"
/* ------------------------------------------------------------------------
*
@ -343,27 +344,9 @@ MD5Type.copy
Return a copy of the hash object.
[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);
}
static PyObject *
MD5Type_copy_impl(MD5object *self)
/*[clinic end generated code: output=3b3a88920b3dc7f4 input=2c09e6d2493f3079]*/
/*[clinic end generated code: output=596eb36852f02071 input=2c09e6d2493f3079]*/
{
MD5object *newobj;
@ -385,27 +368,9 @@ MD5Type.digest
Return the digest value as a string of binary data.
[clinic start generated code]*/
PyDoc_STRVAR(MD5Type_digest__doc__,
"digest($self, /)\n"
"--\n"
"\n"
"Return the digest value as a string of binary data.");
#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);
}
static PyObject *
MD5Type_digest_impl(MD5object *self)
/*[clinic end generated code: output=7a796b28fa89485f input=7b96e65389412a34]*/
/*[clinic end generated code: output=eb691dc4190a07ec input=7b96e65389412a34]*/
{
unsigned char digest[MD5_DIGESTSIZE];
struct md5_state temp;
@ -421,27 +386,9 @@ MD5Type.hexdigest
Return the digest value as a string of hexadecimal digits.
[clinic start generated code]*/
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);
}
static PyObject *
MD5Type_hexdigest_impl(MD5object *self)
/*[clinic end generated code: output=daa73609f94f92e1 input=b60b19de644798dd]*/
/*[clinic end generated code: output=17badced1f3ac932 input=b60b19de644798dd]*/
{
unsigned char digest[MD5_DIGESTSIZE];
struct md5_state temp;
@ -482,18 +429,9 @@ MD5Type.update
Update this hash object's state with the provided string.
[clinic start generated code]*/
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__},
static PyObject *
MD5Type_update(MD5object *self, PyObject *obj)
/*[clinic end generated code: output=9d09b6c6cdc6cac3 input=6e1efcd9ecf17032]*/
/*[clinic end generated code: output=f6ad168416338423 input=6e1efcd9ecf17032]*/
{
Py_buffer buf;
@ -594,38 +532,9 @@ _md5.md5
Return a new MD5 hash object; optionally initialized with a string.
[clinic start generated code]*/
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_VARARGS|METH_KEYWORDS, _md5_md5__doc__},
static PyObject *
_md5_md5_impl(PyModuleDef *module, PyObject *string);
static PyObject *
_md5_md5(PyModuleDef *module, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
static char *_keywords[] = {"string", NULL};
PyObject *string = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|O:md5", _keywords,
&string))
goto exit;
return_value = _md5_md5_impl(module, string);
exit:
return return_value;
}
static PyObject *
_md5_md5_impl(PyModuleDef *module, PyObject *string)
/*[clinic end generated code: output=1039e912d919880e input=d12ef8f72d684f7b]*/
/*[clinic end generated code: output=3527436a2090b956 input=d12ef8f72d684f7b]*/
{
MD5object *new;
Py_buffer buf;

File diff suppressed because it is too large Load diff

View file

@ -8,10 +8,9 @@
#include "clinic/pwdmodule.c.h"
/*[clinic input]
output preset file
module pwd
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=bbcf68b1f549f917]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=60f628ef356b97b6]*/
static PyStructSequence_Field struct_pwd_type_fields[] = {
{"pw_name", "user name"},

View file

@ -68,6 +68,8 @@ typedef struct {
PyObject **handlers;
} xmlparseobject;
#include "clinic/pyexpat.c.h"
#define CHARACTER_DATA_BUFFER_SIZE 8192
static PyTypeObject Xmlparsetype;
@ -713,40 +715,9 @@ Parse XML data.
`isfinal' should be true at end of input.
[clinic start generated code]*/
PyDoc_STRVAR(pyexpat_xmlparser_Parse__doc__,
"Parse($self, data, isFinal=0, /)\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;
}
static PyObject *
pyexpat_xmlparser_Parse_impl(xmlparseobject *self, PyObject *data, int isFinal)
/*[clinic end generated code: output=65b1652b01f20856 input=e37b81b8948ca7e0]*/
/*[clinic end generated code: output=2d4dc77f4d434854 input=e37b81b8948ca7e0]*/
{
const char *s;
Py_ssize_t slen;
@ -836,18 +807,9 @@ pyexpat.xmlparser.ParseFile
Parse XML data from file-like object.
[clinic start generated code]*/
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__},
static PyObject *
pyexpat_xmlparser_ParseFile(xmlparseobject *self, PyObject *file)
/*[clinic end generated code: output=2e13803c3d8c22b2 input=fbb5a12b6038d735]*/
/*[clinic end generated code: output=2adc6a13100cc42b input=fbb5a12b6038d735]*/
{
int rv = 1;
PyObject *readmethod = NULL;
@ -894,37 +856,9 @@ pyexpat.xmlparser.SetBase
Set the base URL for the parser.
[clinic start generated code]*/
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_VARARGS, pyexpat_xmlparser_SetBase__doc__},
static PyObject *
pyexpat_xmlparser_SetBase_impl(xmlparseobject *self, const char *base);
static PyObject *
pyexpat_xmlparser_SetBase(xmlparseobject *self, PyObject *args)
{
PyObject *return_value = NULL;
const char *base;
if (!PyArg_ParseTuple(args,
"s:SetBase",
&base))
goto exit;
return_value = pyexpat_xmlparser_SetBase_impl(self, base);
exit:
return return_value;
}
static PyObject *
pyexpat_xmlparser_SetBase_impl(xmlparseobject *self, const char *base)
/*[clinic end generated code: output=5bdb49f6689a5f93 input=c684e5de895ee1a8]*/
/*[clinic end generated code: output=c212ddceb607b539 input=c684e5de895ee1a8]*/
{
if (!XML_SetBase(self->itself, base)) {
return PyErr_NoMemory();
@ -938,27 +872,9 @@ pyexpat.xmlparser.GetBase
Return base URL string for the parser.
[clinic start generated code]*/
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);
}
static PyObject *
pyexpat_xmlparser_GetBase_impl(xmlparseobject *self)
/*[clinic end generated code: output=ef6046ee28f2b8ee input=918d71c38009620e]*/
/*[clinic end generated code: output=2886cb21f9a8739a input=918d71c38009620e]*/
{
return Py_BuildValue("z", XML_GetBase(self->itself));
}
@ -972,30 +888,9 @@ If the event was generated by a large amount of text (such as a start tag
for an element with many attributes), not all of the text may be available.
[clinic start generated code]*/
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);
}
static PyObject *
pyexpat_xmlparser_GetInputContext_impl(xmlparseobject *self)
/*[clinic end generated code: output=62ff03390f074cd2 input=034df8712db68379]*/
/*[clinic end generated code: output=a88026d683fc22cc input=034df8712db68379]*/
{
if (self->in_callback) {
int offset, size;
@ -1022,38 +917,9 @@ pyexpat.xmlparser.ExternalEntityParserCreate
Create a parser for parsing an external entity based on the information passed to the ExternalEntityRefHandler.
[clinic start generated code]*/
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;
}
static PyObject *
pyexpat_xmlparser_ExternalEntityParserCreate_impl(xmlparseobject *self, const char *context, const char *encoding)
/*[clinic end generated code: output=4948c35f3dd01133 input=283206575d960272]*/
/*[clinic end generated code: output=942f300ed0e56054 input=283206575d960272]*/
{
xmlparseobject *new_parser;
int i;
@ -1127,42 +993,9 @@ XML_PARAM_ENTITY_PARSING_ALWAYS. Returns true if setting the flag
was successful.
[clinic start generated code]*/
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_VARARGS, pyexpat_xmlparser_SetParamEntityParsing__doc__},
static PyObject *
pyexpat_xmlparser_SetParamEntityParsing_impl(xmlparseobject *self, int flag);
static PyObject *
pyexpat_xmlparser_SetParamEntityParsing(xmlparseobject *self, PyObject *args)
{
PyObject *return_value = NULL;
int flag;
if (!PyArg_ParseTuple(args,
"i:SetParamEntityParsing",
&flag))
goto exit;
return_value = pyexpat_xmlparser_SetParamEntityParsing_impl(self, flag);
exit:
return return_value;
}
static PyObject *
pyexpat_xmlparser_SetParamEntityParsing_impl(xmlparseobject *self, int flag)
/*[clinic end generated code: output=0f820882bc7768cc input=8aea19b4b15e9af1]*/
/*[clinic end generated code: output=18668ee8e760d64c input=8aea19b4b15e9af1]*/
{
flag = XML_SetParamEntityParsing(self->itself, flag);
return PyLong_FromLong(flag);
@ -1183,41 +1016,9 @@ application, while still getting the advantage of providing document type
information to the parser. 'flag' defaults to True if not provided.
[clinic start generated code]*/
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;
}
static PyObject *
pyexpat_xmlparser_UseForeignDTD_impl(xmlparseobject *self, int flag)
/*[clinic end generated code: output=22e924ae6cad67d6 input=78144c519d116a6e]*/
/*[clinic end generated code: output=cfaa9aa50bb0f65c input=78144c519d116a6e]*/
{
enum XML_Error rc;
@ -1234,25 +1035,9 @@ pyexpat_xmlparser_UseForeignDTD_impl(xmlparseobject *self, int flag)
pyexpat.xmlparser.__dir__
[clinic start generated code]*/
PyDoc_STRVAR(pyexpat_xmlparser___dir____doc__,
"__dir__($self, /)\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);
}
static PyObject *
pyexpat_xmlparser___dir___impl(xmlparseobject *self)
/*[clinic end generated code: output=1ed6efe83bc304cc input=76aa455f2a661384]*/
/*[clinic end generated code: output=bc22451efb9e4d17 input=76aa455f2a661384]*/
{
#define APPEND(list, str) \
do { \
@ -1765,41 +1550,9 @@ pyexpat.ParserCreate
Return a new XML parser object.
[clinic start generated code]*/
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_VARARGS|METH_KEYWORDS, pyexpat_ParserCreate__doc__},
static PyObject *
pyexpat_ParserCreate_impl(PyModuleDef *module, const char *encoding, const char *namespace_separator, PyObject *intern);
static PyObject *
pyexpat_ParserCreate(PyModuleDef *module, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
static char *_keywords[] = {"encoding", "namespace_separator", "intern", NULL};
const char *encoding = NULL;
const char *namespace_separator = NULL;
PyObject *intern = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|zzO:ParserCreate", _keywords,
&encoding, &namespace_separator, &intern))
goto exit;
return_value = pyexpat_ParserCreate_impl(module, encoding, namespace_separator, intern);
exit:
return return_value;
}
static PyObject *
pyexpat_ParserCreate_impl(PyModuleDef *module, const char *encoding, const char *namespace_separator, PyObject *intern)
/*[clinic end generated code: output=4fc027dd33b7a2ac input=71b9f471aa6f8f86]*/
/*[clinic end generated code: output=b839b60992d8ce71 input=71b9f471aa6f8f86]*/
{
PyObject *result;
int intern_decref = 0;
@ -1842,37 +1595,9 @@ pyexpat.ErrorString
Returns string error for given number.
[clinic start generated code]*/
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_VARARGS, pyexpat_ErrorString__doc__},
static PyObject *
pyexpat_ErrorString_impl(PyModuleDef *module, long code);
static PyObject *
pyexpat_ErrorString(PyModuleDef *module, PyObject *args)
{
PyObject *return_value = NULL;
long code;
if (!PyArg_ParseTuple(args,
"l:ErrorString",
&code))
goto exit;
return_value = pyexpat_ErrorString_impl(module, code);
exit:
return return_value;
}
static PyObject *
pyexpat_ErrorString_impl(PyModuleDef *module, long code)
/*[clinic end generated code: output=c70f3cd82bfaf067 input=cc67de010d9e62b3]*/
/*[clinic end generated code: output=d87668108b6868e5 input=cc67de010d9e62b3]*/
{
return Py_BuildValue("z", XML_ErrorString((int)code));
}
@ -2252,8 +1977,4 @@ static struct HandlerInfo handler_info[] = {
/*[clinic input]
dump buffer
[clinic start generated code]*/
#ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
#define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
#endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */
/*[clinic end generated code: output=a7880cb78bbd58ce input=524ce2e021e4eba6]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=524ce2e021e4eba6]*/

View file

@ -53,6 +53,7 @@ typedef struct {
struct sha1_state hash_state;
} SHA1object;
#include "clinic/sha1module.c.h"
/* ------------------------------------------------------------------------
*
@ -320,27 +321,9 @@ SHA1Type.copy
Return a copy of the hash object.
[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);
}
static PyObject *
SHA1Type_copy_impl(SHA1object *self)
/*[clinic end generated code: output=1a320e75a7444098 input=b7eae10df6f89b36]*/
/*[clinic end generated code: output=b4e001264620f02a input=b7eae10df6f89b36]*/
{
SHA1object *newobj;
@ -357,27 +340,9 @@ SHA1Type.digest
Return the digest value as a string of binary data.
[clinic start generated code]*/
PyDoc_STRVAR(SHA1Type_digest__doc__,
"digest($self, /)\n"
"--\n"
"\n"
"Return the digest value as a string of binary data.");
#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);
}
static PyObject *
SHA1Type_digest_impl(SHA1object *self)
/*[clinic end generated code: output=c4920f75228bfbfd input=205d47e1927fd009]*/
/*[clinic end generated code: output=2f05302a7aa2b5cb input=205d47e1927fd009]*/
{
unsigned char digest[SHA1_DIGESTSIZE];
struct sha1_state temp;
@ -393,27 +358,9 @@ SHA1Type.hexdigest
Return the digest value as a string of hexadecimal digits.
[clinic start generated code]*/
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);
}
static PyObject *
SHA1Type_hexdigest_impl(SHA1object *self)
/*[clinic end generated code: output=6e345aac201887b2 input=97691055c0c74ab0]*/
/*[clinic end generated code: output=4161fd71e68c6659 input=97691055c0c74ab0]*/
{
unsigned char digest[SHA1_DIGESTSIZE];
struct sha1_state temp;
@ -454,18 +401,9 @@ SHA1Type.update
Update this hash object's state with the provided string.
[clinic start generated code]*/
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__},
static PyObject *
SHA1Type_update(SHA1object *self, PyObject *obj)
/*[clinic end generated code: output=ab20a86a25e7d255 input=aad8e07812edbba3]*/
/*[clinic end generated code: output=d9902f0e5015e9ae input=aad8e07812edbba3]*/
{
Py_buffer buf;
@ -566,38 +504,9 @@ _sha1.sha1
Return a new SHA1 hash object; optionally initialized with a string.
[clinic start generated code]*/
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_VARARGS|METH_KEYWORDS, _sha1_sha1__doc__},
static PyObject *
_sha1_sha1_impl(PyModuleDef *module, PyObject *string);
static PyObject *
_sha1_sha1(PyModuleDef *module, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
static char *_keywords[] = {"string", NULL};
PyObject *string = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|O:sha1", _keywords,
&string))
goto exit;
return_value = _sha1_sha1_impl(module, string);
exit:
return return_value;
}
static PyObject *
_sha1_sha1_impl(PyModuleDef *module, PyObject *string)
/*[clinic end generated code: output=c9068552f07b8954 input=27ea54281d995ec2]*/
/*[clinic end generated code: output=3e4e841386b9e8db input=27ea54281d995ec2]*/
{
SHA1object *new;
Py_buffer buf;

View file

@ -52,6 +52,8 @@ typedef struct {
int digestsize;
} SHAobject;
#include "clinic/sha256module.c.h"
/* When run on a little-endian CPU we need to perform byte reversal on an
array of longwords. */
@ -404,27 +406,9 @@ SHA256Type.copy
Return a copy of the hash object.
[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);
}
static PyObject *
SHA256Type_copy_impl(SHAobject *self)
/*[clinic end generated code: output=f716c39d3f81c27c input=f58840a618d4f2a7]*/
/*[clinic end generated code: output=1a8bbd66a0c9c168 input=f58840a618d4f2a7]*/
{
SHAobject *newobj;
@ -446,27 +430,9 @@ SHA256Type.digest
Return the digest value as a string of binary data.
[clinic start generated code]*/
PyDoc_STRVAR(SHA256Type_digest__doc__,
"digest($self, /)\n"
"--\n"
"\n"
"Return the digest value as a string of binary data.");
#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);
}
static PyObject *
SHA256Type_digest_impl(SHAobject *self)
/*[clinic end generated code: output=72d34723d7bb694c input=1fb752e58954157d]*/
/*[clinic end generated code: output=46616a5e909fbc3d input=1fb752e58954157d]*/
{
unsigned char digest[SHA_DIGESTSIZE];
SHAobject temp;
@ -482,27 +448,9 @@ SHA256Type.hexdigest
Return the digest value as a string of hexadecimal digits.
[clinic start generated code]*/
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);
}
static PyObject *
SHA256Type_hexdigest_impl(SHAobject *self)
/*[clinic end generated code: output=3687aa6183c7d27f input=0cc4c714693010d1]*/
/*[clinic end generated code: output=725f8a7041ae97f3 input=0cc4c714693010d1]*/
{
unsigned char digest[SHA_DIGESTSIZE];
SHAobject temp;
@ -543,18 +491,9 @@ SHA256Type.update
Update this hash object's state with the provided string.
[clinic start generated code]*/
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__},
static PyObject *
SHA256Type_update(SHAobject *self, PyObject *obj)
/*[clinic end generated code: output=b47f53d7cbeabee4 input=b2d449d5b30f0f5a]*/
/*[clinic end generated code: output=0967fb2860c66af7 input=b2d449d5b30f0f5a]*/
{
Py_buffer buf;
@ -686,38 +625,9 @@ _sha256.sha256
Return a new SHA-256 hash object; optionally initialized with a string.
[clinic start generated code]*/
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_VARARGS|METH_KEYWORDS, _sha256_sha256__doc__},
static PyObject *
_sha256_sha256_impl(PyModuleDef *module, PyObject *string);
static PyObject *
_sha256_sha256(PyModuleDef *module, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
static char *_keywords[] = {"string", NULL};
PyObject *string = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|O:sha256", _keywords,
&string))
goto exit;
return_value = _sha256_sha256_impl(module, string);
exit:
return return_value;
}
static PyObject *
_sha256_sha256_impl(PyModuleDef *module, PyObject *string)
/*[clinic end generated code: output=4b1263d1e2fcdb98 input=09cce3fb855056b2]*/
/*[clinic end generated code: output=d70e6e2d97112844 input=09cce3fb855056b2]*/
{
SHAobject *new;
Py_buffer buf;
@ -755,38 +665,9 @@ _sha256.sha224
Return a new SHA-224 hash object; optionally initialized with a string.
[clinic start generated code]*/
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_VARARGS|METH_KEYWORDS, _sha256_sha224__doc__},
static PyObject *
_sha256_sha224_impl(PyModuleDef *module, PyObject *string);
static PyObject *
_sha256_sha224(PyModuleDef *module, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
static char *_keywords[] = {"string", NULL};
PyObject *string = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|O:sha224", _keywords,
&string))
goto exit;
return_value = _sha256_sha224_impl(module, string);
exit:
return return_value;
}
static PyObject *
_sha256_sha224_impl(PyModuleDef *module, PyObject *string)
/*[clinic end generated code: output=4dde0eb1cdaebc06 input=27a04ba24c353a73]*/
/*[clinic end generated code: output=f2822bf28416b42a input=27a04ba24c353a73]*/
{
SHAobject *new;
Py_buffer buf;

View file

@ -55,6 +55,8 @@ typedef struct {
int digestsize;
} SHAobject;
#include "clinic/sha512module.c.h"
/* When run on a little-endian CPU we need to perform byte reversal on an
array of longwords. */
@ -471,27 +473,9 @@ SHA512Type.copy
Return a copy of the hash object.
[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);
}
static PyObject *
SHA512Type_copy_impl(SHAobject *self)
/*[clinic end generated code: output=14f8e6ce9c61ece0 input=9f5f31e6c457776a]*/
/*[clinic end generated code: output=adea896ed3164821 input=9f5f31e6c457776a]*/
{
SHAobject *newobj;
@ -513,27 +497,9 @@ SHA512Type.digest
Return the digest value as a string of binary data.
[clinic start generated code]*/
PyDoc_STRVAR(SHA512Type_digest__doc__,
"digest($self, /)\n"
"--\n"
"\n"
"Return the digest value as a string of binary data.");
#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);
}
static PyObject *
SHA512Type_digest_impl(SHAobject *self)
/*[clinic end generated code: output=be8de024b232977e input=60c2cede9e023018]*/
/*[clinic end generated code: output=1080bbeeef7dde1b input=60c2cede9e023018]*/
{
unsigned char digest[SHA_DIGESTSIZE];
SHAobject temp;
@ -549,27 +515,9 @@ SHA512Type.hexdigest
Return the digest value as a string of hexadecimal digits.
[clinic start generated code]*/
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);
}
static PyObject *
SHA512Type_hexdigest_impl(SHAobject *self)
/*[clinic end generated code: output=28a4ab2f9a1781b8 input=498b877b25cbe0a2]*/
/*[clinic end generated code: output=7373305b8601e18b input=498b877b25cbe0a2]*/
{
unsigned char digest[SHA_DIGESTSIZE];
SHAobject temp;
@ -610,18 +558,9 @@ SHA512Type.update
Update this hash object's state with the provided string.
[clinic start generated code]*/
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__},
static PyObject *
SHA512Type_update(SHAobject *self, PyObject *obj)
/*[clinic end generated code: output=6be574cdc3a9c52d input=ded2b46656566283]*/
/*[clinic end generated code: output=1cf333e73995a79e input=ded2b46656566283]*/
{
Py_buffer buf;
@ -636,23 +575,7 @@ SHA512Type_update(SHAobject *self, PyObject *obj)
/*[clinic input]
dump buffer
[clinic start generated code]*/
#ifndef SHA512TYPE_COPY_METHODDEF
#define SHA512TYPE_COPY_METHODDEF
#endif /* !defined(SHA512TYPE_COPY_METHODDEF) */
#ifndef SHA512TYPE_DIGEST_METHODDEF
#define SHA512TYPE_DIGEST_METHODDEF
#endif /* !defined(SHA512TYPE_DIGEST_METHODDEF) */
#ifndef SHA512TYPE_HEXDIGEST_METHODDEF
#define SHA512TYPE_HEXDIGEST_METHODDEF
#endif /* !defined(SHA512TYPE_HEXDIGEST_METHODDEF) */
#ifndef SHA512TYPE_UPDATE_METHODDEF
#define SHA512TYPE_UPDATE_METHODDEF
#endif /* !defined(SHA512TYPE_UPDATE_METHODDEF) */
/*[clinic end generated code: output=de713947d31130e9 input=524ce2e021e4eba6]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=524ce2e021e4eba6]*/
static PyMethodDef SHA_methods[] = {
SHA512TYPE_COPY_METHODDEF
@ -773,38 +696,9 @@ _sha512.sha512
Return a new SHA-512 hash object; optionally initialized with a string.
[clinic start generated code]*/
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_VARARGS|METH_KEYWORDS, _sha512_sha512__doc__},
static PyObject *
_sha512_sha512_impl(PyModuleDef *module, PyObject *string);
static PyObject *
_sha512_sha512(PyModuleDef *module, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
static char *_keywords[] = {"string", NULL};
PyObject *string = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|O:sha512", _keywords,
&string))
goto exit;
return_value = _sha512_sha512_impl(module, string);
exit:
return return_value;
}
static PyObject *
_sha512_sha512_impl(PyModuleDef *module, PyObject *string)
/*[clinic end generated code: output=9e39b11115f36878 input=e69bad9ae9b6a308]*/
/*[clinic end generated code: output=da13bc0a94da6de3 input=e69bad9ae9b6a308]*/
{
SHAobject *new;
Py_buffer buf;
@ -842,38 +736,9 @@ _sha512.sha384
Return a new SHA-384 hash object; optionally initialized with a string.
[clinic start generated code]*/
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_VARARGS|METH_KEYWORDS, _sha512_sha384__doc__},
static PyObject *
_sha512_sha384_impl(PyModuleDef *module, PyObject *string);
static PyObject *
_sha512_sha384(PyModuleDef *module, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
static char *_keywords[] = {"string", NULL};
PyObject *string = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|O:sha384", _keywords,
&string))
goto exit;
return_value = _sha512_sha384_impl(module, string);
exit:
return return_value;
}
static PyObject *
_sha512_sha384_impl(PyModuleDef *module, PyObject *string)
/*[clinic end generated code: output=397c6fba3525b93a input=c9327788d4ea4545]*/
/*[clinic end generated code: output=ac731aea5509174d input=c9327788d4ea4545]*/
{
SHAobject *new;
Py_buffer buf;
@ -907,15 +772,7 @@ _sha512_sha384_impl(PyModuleDef *module, PyObject *string)
/*[clinic input]
dump buffer
[clinic start generated code]*/
#ifndef _SHA512_SHA512_METHODDEF
#define _SHA512_SHA512_METHODDEF
#endif /* !defined(_SHA512_SHA512_METHODDEF) */
#ifndef _SHA512_SHA384_METHODDEF
#define _SHA512_SHA384_METHODDEF
#endif /* !defined(_SHA512_SHA384_METHODDEF) */
/*[clinic end generated code: output=69d84aa9445b01d8 input=524ce2e021e4eba6]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=524ce2e021e4eba6]*/
/* List of functions exported by this module */

View file

@ -13,10 +13,9 @@
#include "clinic/spwdmodule.c.h"
/*[clinic input]
output preset file
module spwd
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=b3464a3667278fae]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=c0b841b90a6a07ce]*/
PyDoc_STRVAR(spwd__doc__,
"This module provides access to the Unix shadow password database.\n\

View file

@ -73,6 +73,8 @@ typedef struct previous_version {
Py_UCS4 (*normalization)(Py_UCS4);
} PreviousDBVersion;
#include "clinic/unicodedata.c.h"
#define get_old_record(self, v) ((((PreviousDBVersion*)self)->getrecord)(v))
static PyMemberDef DB_members[] = {
@ -130,42 +132,9 @@ as integer. If no such value is defined, default is returned, or, if
not given, ValueError is raised.
[clinic start generated code]*/
PyDoc_STRVAR(unicodedata_UCD_decimal__doc__,
"decimal($self, unichr, default=None, /)\n"
"--\n"
"\n"
"Converts a Unicode character into its equivalent decimal value.\n"
"\n"
"Returns the decimal value assigned to the Unicode character unichr\n"
"as integer. If no such value is defined, default is returned, or, if\n"
"not given, 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(PreviousDBVersion *self, PyUnicodeObject *unichr, PyObject *default_value);
static PyObject *
unicodedata_UCD_decimal(PreviousDBVersion *self, PyObject *args)
{
PyObject *return_value = NULL;
PyUnicodeObject *unichr;
PyObject *default_value = NULL;
if (!PyArg_ParseTuple(args,
"O!|O:decimal",
&PyUnicode_Type, &unichr, &default_value))
goto exit;
return_value = unicodedata_UCD_decimal_impl(self, unichr, default_value);
exit:
return return_value;
}
static PyObject *
unicodedata_UCD_decimal_impl(PreviousDBVersion *self, PyUnicodeObject *unichr, PyObject *default_value)
/*[clinic end generated code: output=8689669896d293df input=c25c9d2b4de076b1]*/
/*[clinic end generated code: output=d285215533b58b28 input=c25c9d2b4de076b1]*/
{
int have_old = 0;
long rc;

View file

@ -82,12 +82,11 @@ zlib_error(z_stream zst, int err, char *msg)
}
/*[clinic input]
output preset file
module zlib
class zlib.Compress "compobject *" "&Comptype"
class zlib.Decompress "compobject *" "&Decomptype"
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=bfd4c340573ba91d]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=093935115c3e3158]*/
static compobject *
newcompobject(PyTypeObject *type)