1 /*[clinic input]
2 preserve
3 [clinic start generated code]*/
4
5 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
6 # include "pycore_gc.h" // PyGC_Head
7 # include "pycore_runtime.h" // _Py_ID()
8 #endif
9
10
11 #if defined(HAVE_GETSPNAM)
12
13 PyDoc_STRVAR(spwd_getspnam__doc__,
14 "getspnam($module, arg, /)\n"
15 "--\n"
16 "\n"
17 "Return the shadow password database entry for the given user name.\n"
18 "\n"
19 "See `help(spwd)` for more on shadow password database entries.");
20
21 #define SPWD_GETSPNAM_METHODDEF \
22 {"getspnam", (PyCFunction)spwd_getspnam, METH_O, spwd_getspnam__doc__},
23
24 static PyObject *
25 spwd_getspnam_impl(PyObject *module, PyObject *arg);
26
27 static PyObject *
28 spwd_getspnam(PyObject *module, PyObject *arg_)
29 {
30 PyObject *return_value = NULL;
31 PyObject *arg;
32
33 if (!PyUnicode_Check(arg_)) {
34 _PyArg_BadArgument("getspnam", "argument", "str", arg_);
35 goto exit;
36 }
37 if (PyUnicode_READY(arg_) == -1) {
38 goto exit;
39 }
40 arg = arg_;
41 return_value = spwd_getspnam_impl(module, arg);
42
43 exit:
44 return return_value;
45 }
46
47 #endif /* defined(HAVE_GETSPNAM) */
48
49 #if defined(HAVE_GETSPENT)
50
51 PyDoc_STRVAR(spwd_getspall__doc__,
52 "getspall($module, /)\n"
53 "--\n"
54 "\n"
55 "Return a list of all available shadow password database entries, in arbitrary order.\n"
56 "\n"
57 "See `help(spwd)` for more on shadow password database entries.");
58
59 #define SPWD_GETSPALL_METHODDEF \
60 {"getspall", (PyCFunction)spwd_getspall, METH_NOARGS, spwd_getspall__doc__},
61
62 static PyObject *
63 spwd_getspall_impl(PyObject *module);
64
65 static PyObject *
66 spwd_getspall(PyObject *module, PyObject *Py_UNUSED(ignored))
67 {
68 return spwd_getspall_impl(module);
69 }
70
71 #endif /* defined(HAVE_GETSPENT) */
72
73 #ifndef SPWD_GETSPNAM_METHODDEF
74 #define SPWD_GETSPNAM_METHODDEF
75 #endif /* !defined(SPWD_GETSPNAM_METHODDEF) */
76
77 #ifndef SPWD_GETSPALL_METHODDEF
78 #define SPWD_GETSPALL_METHODDEF
79 #endif /* !defined(SPWD_GETSPALL_METHODDEF) */
80 /*[clinic end generated code: output=dd61827a7b708e11 input=a9049054013a1b77]*/