diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-04-03 20:53:51 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-04-03 20:53:51 (GMT) |
commit | 1009bf18b38a8d36298575191dd8fdf43f8f9097 (patch) | |
tree | 18860fdef30c931dc2ea177059e96b69a49fa04f /Modules/_cryptmodule.c | |
parent | 0759f84d6260bad1234b802212e73fdc5873d261 (diff) | |
download | cpython-1009bf18b38a8d36298575191dd8fdf43f8f9097.zip cpython-1009bf18b38a8d36298575191dd8fdf43f8f9097.tar.gz cpython-1009bf18b38a8d36298575191dd8fdf43f8f9097.tar.bz2 |
Issue #23501: Argumen Clinic now generates code into separate files by default.
Diffstat (limited to 'Modules/_cryptmodule.c')
-rw-r--r-- | Modules/_cryptmodule.c | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/Modules/_cryptmodule.c b/Modules/_cryptmodule.c index da44ef3..16cc4c2 100644 --- a/Modules/_cryptmodule.c +++ b/Modules/_cryptmodule.c @@ -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? */ |