cpython: b3aa30f474c4 (original) (raw)

Mercurial > cpython

changeset 92190:b3aa30f474c4

Issue #20152: Port the spwd module to Argument Clinic. [#20152]

Brett Cannon brett@python.org
date Fri, 22 Aug 2014 13:59:24 -0400
parents 78fff5310206
children 5ece757e413e
files Modules/clinic/spwdmodule.c.h Modules/spwdmodule.c
diffstat 2 files changed, 100 insertions(+), 17 deletions(-)[+] [-] Modules/clinic/spwdmodule.c.h 70 Modules/spwdmodule.c 47

line wrap: on

line diff

new file mode 100644 --- /dev/null +++ b/Modules/clinic/spwdmodule.c.h @@ -0,0 +1,70 @@ +/[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 [](#l1.19)

+ +static PyObject * +spwd_getspnam_impl(PyModuleDef *module, PyObject *arg); + +static PyObject * +spwd_getspnam(PyModuleDef *module, PyObject *args) +{

+

+ +exit:

+} + +#endif /* defined(HAVE_GETSPNAM) */ + +#ifndef SPWD_GETSPNAM_METHODDEF

+#endif /* !defined(SPWD_GETSPNAM_METHODDEF) */ + +#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 [](#l1.57)

+ +static PyObject * +spwd_getspall_impl(PyModuleDef *module); + +static PyObject * +spwd_getspall(PyModuleDef *module, PyObject *Py_UNUSED(ignored)) +{

+} + +#endif /* defined(HAVE_GETSPENT) */ + +#ifndef SPWD_GETSPALL_METHODDEF

+#endif /* !defined(SPWD_GETSPALL_METHODDEF) / +/[clinic end generated code: output=41fec4a15b0cd2a0 input=a9049054013a1b77]*/

--- a/Modules/spwdmodule.c +++ b/Modules/spwdmodule.c @@ -10,6 +10,11 @@ #include <shadow.h> #endif +/[clinic input] +output preset file +module spwd +[clinic start generated code]/ +/[clinic end generated code: output=da39a3ee5e6b4b0d input=b3464a3667278fae]/ PyDoc_STRVAR(spwd__doc__, "This module provides access to the Unix shadow password database.\n[](#l2.14) @@ -107,20 +112,25 @@ static PyObject *mkspent(struct spwd *p) #ifdef HAVE_GETSPNAM -PyDoc_STRVAR(spwd_getspnam__doc__, -"getspnam(name) -> (sp_namp, sp_pwdp, sp_lstchg, sp_min, sp_max,\n[](#l2.20)

-Return the shadow password database entry for the given user name.\n[](#l2.22) -See spwd.doc for more on shadow password database entries."); +/*[clinic input] +spwd.getspnam +

-static PyObject* spwd_getspnam(PyObject *self, PyObject args) +Return the shadow password database entry for the given user name. + +See help(spwd) for more on shadow password database entries. +[clinic start generated code]/ + +static PyObject * +spwd_getspnam_impl(PyModuleDef module, PyObject arg) +/[clinic end generated code: output=9f6bbe51a4eb3b21 input=dd89429e6167a00f]/ { char *name; struct spwd *p;

#ifdef HAVE_GETSPENT -PyDoc_STRVAR(spwd_getspall__doc__, -"getspall() -> list_of_entries\n[](#l2.55) -Return a list of all available shadow password database entries, [](#l2.56) -in arbitrary order.\n[](#l2.57) -See spwd.doc for more on shadow password database entries."); +/[clinic input] +spwd.getspall + +Return a list of all available shadow password database entries, in arbitrary order. + +See help(spwd) for more on shadow password database entries. +[clinic start generated code]/ static PyObject * -spwd_getspall(PyObject *self, PyObject args) +spwd_getspall_impl(PyModuleDef module) +/[clinic end generated code: output=b12d8ec7bdb29612 input=b2c84b7857d622bd]/ { PyObject *d; struct spwd *p; @@ -171,10 +184,10 @@ spwd_getspall(PyObject *self, PyObject * static PyMethodDef spwd_methods[] = { #ifdef HAVE_GETSPNAM

#endif #ifdef HAVE_GETSPENT

#endif {NULL, NULL} /* sentinel */ };