blob: 6a40042c5ecb8b611b47f4a51d0279cafb51a2fb [file] [log] [blame]
Brett Cannon9f49e312014-08-22 14:08:46 -04001/*[clinic input]
2preserve
3[clinic start generated code]*/
4
5PyDoc_STRVAR(pwd_getpwuid__doc__,
6"getpwuid($module, uidobj, /)\n"
7"--\n"
8"\n"
9"Return the password database entry for the given numeric user ID.\n"
10"\n"
11"See `help(pwd)` for more on password database entries.");
12
13#define PWD_GETPWUID_METHODDEF \
14 {"getpwuid", (PyCFunction)pwd_getpwuid, METH_O, pwd_getpwuid__doc__},
15
16PyDoc_STRVAR(pwd_getpwnam__doc__,
17"getpwnam($module, arg, /)\n"
18"--\n"
19"\n"
20"Return the password database entry for the given user name.\n"
21"\n"
22"See `help(pwd)` for more on password database entries.");
23
24#define PWD_GETPWNAM_METHODDEF \
25 {"getpwnam", (PyCFunction)pwd_getpwnam, METH_VARARGS, pwd_getpwnam__doc__},
26
27static PyObject *
28pwd_getpwnam_impl(PyModuleDef *module, PyObject *arg);
29
30static PyObject *
31pwd_getpwnam(PyModuleDef *module, PyObject *args)
32{
33 PyObject *return_value = NULL;
34 PyObject *arg;
35
36 if (!PyArg_ParseTuple(args,
37 "U:getpwnam",
38 &arg))
39 goto exit;
40 return_value = pwd_getpwnam_impl(module, arg);
41
42exit:
43 return return_value;
44}
45
46#if defined(HAVE_GETPWENT)
47
48PyDoc_STRVAR(pwd_getpwall__doc__,
49"getpwall($module, /)\n"
50"--\n"
51"\n"
52"Return a list of all available password database entries, in arbitrary order.\n"
53"\n"
54"See help(pwd) for more on password database entries.");
55
56#define PWD_GETPWALL_METHODDEF \
57 {"getpwall", (PyCFunction)pwd_getpwall, METH_NOARGS, pwd_getpwall__doc__},
58
59static PyObject *
60pwd_getpwall_impl(PyModuleDef *module);
61
62static PyObject *
63pwd_getpwall(PyModuleDef *module, PyObject *Py_UNUSED(ignored))
64{
65 return pwd_getpwall_impl(module);
66}
67
68#endif /* defined(HAVE_GETPWENT) */
69
70#ifndef PWD_GETPWALL_METHODDEF
71 #define PWD_GETPWALL_METHODDEF
72#endif /* !defined(PWD_GETPWALL_METHODDEF) */
73/*[clinic end generated code: output=2e23f920020a750a input=a9049054013a1b77]*/