blob: b091fc9ba72c6d21f9a236fed10fd12fe3dcda81 [file] [log] [blame]
Brett Cannon20cf6dd2014-08-22 13:59:24 -04001/*[clinic input]
2preserve
3[clinic start generated code]*/
4
5#if defined(HAVE_GETSPNAM)
6
7PyDoc_STRVAR(spwd_getspnam__doc__,
8"getspnam($module, arg, /)\n"
9"--\n"
10"\n"
11"Return the shadow password database entry for the given user name.\n"
12"\n"
13"See `help(spwd)` for more on shadow password database entries.");
14
15#define SPWD_GETSPNAM_METHODDEF \
16 {"getspnam", (PyCFunction)spwd_getspnam, METH_VARARGS, spwd_getspnam__doc__},
17
18static PyObject *
19spwd_getspnam_impl(PyModuleDef *module, PyObject *arg);
20
21static PyObject *
22spwd_getspnam(PyModuleDef *module, PyObject *args)
23{
24 PyObject *return_value = NULL;
25 PyObject *arg;
26
27 if (!PyArg_ParseTuple(args,
28 "U:getspnam",
29 &arg))
30 goto exit;
31 return_value = spwd_getspnam_impl(module, arg);
32
33exit:
34 return return_value;
35}
36
37#endif /* defined(HAVE_GETSPNAM) */
38
39#ifndef SPWD_GETSPNAM_METHODDEF
40 #define SPWD_GETSPNAM_METHODDEF
41#endif /* !defined(SPWD_GETSPNAM_METHODDEF) */
42
43#if defined(HAVE_GETSPENT)
44
45PyDoc_STRVAR(spwd_getspall__doc__,
46"getspall($module, /)\n"
47"--\n"
48"\n"
49"Return a list of all available shadow password database entries, in arbitrary order.\n"
50"\n"
51"See `help(spwd)` for more on shadow password database entries.");
52
53#define SPWD_GETSPALL_METHODDEF \
54 {"getspall", (PyCFunction)spwd_getspall, METH_NOARGS, spwd_getspall__doc__},
55
56static PyObject *
57spwd_getspall_impl(PyModuleDef *module);
58
59static PyObject *
60spwd_getspall(PyModuleDef *module, PyObject *Py_UNUSED(ignored))
61{
62 return spwd_getspall_impl(module);
63}
64
65#endif /* defined(HAVE_GETSPENT) */
66
67#ifndef SPWD_GETSPALL_METHODDEF
68 #define SPWD_GETSPALL_METHODDEF
69#endif /* !defined(SPWD_GETSPALL_METHODDEF) */
70/*[clinic end generated code: output=41fec4a15b0cd2a0 input=a9049054013a1b77]*/