Brett Cannon | 9f49e31 | 2014-08-22 14:08:46 -0400 | [diff] [blame] | 1 | /*[clinic input] |
| 2 | preserve |
| 3 | [clinic start generated code]*/ |
| 4 | |
| 5 | PyDoc_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 | |
| 16 | PyDoc_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 \ |
Serhiy Storchaka | 92e8af6 | 2015-04-04 00:12:11 +0300 | [diff] [blame] | 25 | {"getpwnam", (PyCFunction)pwd_getpwnam, METH_O, pwd_getpwnam__doc__}, |
Brett Cannon | 9f49e31 | 2014-08-22 14:08:46 -0400 | [diff] [blame] | 26 | |
| 27 | static PyObject * |
Serhiy Storchaka | 1a2b24f | 2016-07-07 17:35:15 +0300 | [diff] [blame] | 28 | pwd_getpwnam_impl(PyObject *module, PyObject *arg); |
Brett Cannon | 9f49e31 | 2014-08-22 14:08:46 -0400 | [diff] [blame] | 29 | |
| 30 | static PyObject * |
Serhiy Storchaka | 1a2b24f | 2016-07-07 17:35:15 +0300 | [diff] [blame] | 31 | pwd_getpwnam(PyObject *module, PyObject *arg_) |
Brett Cannon | 9f49e31 | 2014-08-22 14:08:46 -0400 | [diff] [blame] | 32 | { |
| 33 | PyObject *return_value = NULL; |
| 34 | PyObject *arg; |
| 35 | |
Serhiy Storchaka | 247789c | 2015-04-24 00:40:51 +0300 | [diff] [blame] | 36 | if (!PyArg_Parse(arg_, "U:getpwnam", &arg)) |
Brett Cannon | 9f49e31 | 2014-08-22 14:08:46 -0400 | [diff] [blame] | 37 | goto exit; |
| 38 | return_value = pwd_getpwnam_impl(module, arg); |
| 39 | |
| 40 | exit: |
| 41 | return return_value; |
| 42 | } |
| 43 | |
| 44 | #if defined(HAVE_GETPWENT) |
| 45 | |
| 46 | PyDoc_STRVAR(pwd_getpwall__doc__, |
| 47 | "getpwall($module, /)\n" |
| 48 | "--\n" |
| 49 | "\n" |
| 50 | "Return a list of all available password database entries, in arbitrary order.\n" |
| 51 | "\n" |
| 52 | "See help(pwd) for more on password database entries."); |
| 53 | |
| 54 | #define PWD_GETPWALL_METHODDEF \ |
| 55 | {"getpwall", (PyCFunction)pwd_getpwall, METH_NOARGS, pwd_getpwall__doc__}, |
| 56 | |
| 57 | static PyObject * |
Serhiy Storchaka | 1a2b24f | 2016-07-07 17:35:15 +0300 | [diff] [blame] | 58 | pwd_getpwall_impl(PyObject *module); |
Brett Cannon | 9f49e31 | 2014-08-22 14:08:46 -0400 | [diff] [blame] | 59 | |
| 60 | static PyObject * |
Serhiy Storchaka | 1a2b24f | 2016-07-07 17:35:15 +0300 | [diff] [blame] | 61 | pwd_getpwall(PyObject *module, PyObject *Py_UNUSED(ignored)) |
Brett Cannon | 9f49e31 | 2014-08-22 14:08:46 -0400 | [diff] [blame] | 62 | { |
| 63 | return pwd_getpwall_impl(module); |
| 64 | } |
| 65 | |
| 66 | #endif /* defined(HAVE_GETPWENT) */ |
| 67 | |
| 68 | #ifndef PWD_GETPWALL_METHODDEF |
| 69 | #define PWD_GETPWALL_METHODDEF |
| 70 | #endif /* !defined(PWD_GETPWALL_METHODDEF) */ |
Serhiy Storchaka | 1a2b24f | 2016-07-07 17:35:15 +0300 | [diff] [blame] | 71 | /*[clinic end generated code: output=d0ea1c5c832f0c1a input=a9049054013a1b77]*/ |