/src/cpython/Modules/clinic/pwdmodule.c.h
Line | Count | Source (jump to first uncovered line) |
1 | | /*[clinic input] |
2 | | preserve |
3 | | [clinic start generated code]*/ |
4 | | |
5 | | #include "pycore_modsupport.h" // _PyArg_BadArgument() |
6 | | |
7 | | PyDoc_STRVAR(pwd_getpwuid__doc__, |
8 | | "getpwuid($module, uidobj, /)\n" |
9 | | "--\n" |
10 | | "\n" |
11 | | "Return the password database entry for the given numeric user ID.\n" |
12 | | "\n" |
13 | | "See `help(pwd)` for more on password database entries."); |
14 | | |
15 | | #define PWD_GETPWUID_METHODDEF \ |
16 | | {"getpwuid", (PyCFunction)pwd_getpwuid, METH_O, pwd_getpwuid__doc__}, |
17 | | |
18 | | PyDoc_STRVAR(pwd_getpwnam__doc__, |
19 | | "getpwnam($module, name, /)\n" |
20 | | "--\n" |
21 | | "\n" |
22 | | "Return the password database entry for the given user name.\n" |
23 | | "\n" |
24 | | "See `help(pwd)` for more on password database entries."); |
25 | | |
26 | | #define PWD_GETPWNAM_METHODDEF \ |
27 | | {"getpwnam", (PyCFunction)pwd_getpwnam, METH_O, pwd_getpwnam__doc__}, |
28 | | |
29 | | static PyObject * |
30 | | pwd_getpwnam_impl(PyObject *module, PyObject *name); |
31 | | |
32 | | static PyObject * |
33 | | pwd_getpwnam(PyObject *module, PyObject *arg) |
34 | 0 | { |
35 | 0 | PyObject *return_value = NULL; |
36 | 0 | PyObject *name; |
37 | |
|
38 | 0 | if (!PyUnicode_Check(arg)) { |
39 | 0 | _PyArg_BadArgument("getpwnam", "argument", "str", arg); |
40 | 0 | goto exit; |
41 | 0 | } |
42 | 0 | name = arg; |
43 | 0 | return_value = pwd_getpwnam_impl(module, name); |
44 | |
|
45 | 0 | exit: |
46 | 0 | return return_value; |
47 | 0 | } |
48 | | |
49 | | #if defined(HAVE_GETPWENT) |
50 | | |
51 | | PyDoc_STRVAR(pwd_getpwall__doc__, |
52 | | "getpwall($module, /)\n" |
53 | | "--\n" |
54 | | "\n" |
55 | | "Return a list of all available password database entries, in arbitrary order.\n" |
56 | | "\n" |
57 | | "See help(pwd) for more on password database entries."); |
58 | | |
59 | | #define PWD_GETPWALL_METHODDEF \ |
60 | | {"getpwall", (PyCFunction)pwd_getpwall, METH_NOARGS, pwd_getpwall__doc__}, |
61 | | |
62 | | static PyObject * |
63 | | pwd_getpwall_impl(PyObject *module); |
64 | | |
65 | | static PyObject * |
66 | | pwd_getpwall(PyObject *module, PyObject *Py_UNUSED(ignored)) |
67 | 0 | { |
68 | 0 | return pwd_getpwall_impl(module); |
69 | 0 | } |
70 | | |
71 | | #endif /* defined(HAVE_GETPWENT) */ |
72 | | |
73 | | #ifndef PWD_GETPWALL_METHODDEF |
74 | | #define PWD_GETPWALL_METHODDEF |
75 | | #endif /* !defined(PWD_GETPWALL_METHODDEF) */ |
76 | | /*[clinic end generated code: output=5a8fb12939ff4ea3 input=a9049054013a1b77]*/ |