diff options
Diffstat (limited to 'Modules/md5module.c')
-rw-r--r-- | Modules/md5module.c | 103 |
1 files changed, 6 insertions, 97 deletions
diff --git a/Modules/md5module.c b/Modules/md5module.c index 65f5c35..25b163c 100644 --- a/Modules/md5module.c +++ b/Modules/md5module.c @@ -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; |