| Brett Cannon | 20cf6dd | 2014-08-22 13:59:24 -0400 | [diff] [blame] | 1 | /*[clinic input] |
| 2 | preserve |
| 3 | [clinic start generated code]*/ |
| 4 | |
| 5 | #if defined(HAVE_GETSPNAM) |
| 6 | |
| 7 | PyDoc_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 \ |
| Serhiy Storchaka | 92e8af6 | 2015-04-04 00:12:11 +0300 | [diff] [blame] | 16 | {"getspnam", (PyCFunction)spwd_getspnam, METH_O, spwd_getspnam__doc__}, |
| Brett Cannon | 20cf6dd | 2014-08-22 13:59:24 -0400 | [diff] [blame] | 17 | |
| 18 | static PyObject * |
| Serhiy Storchaka | 1a2b24f | 2016-07-07 17:35:15 +0300 | [diff] [blame] | 19 | spwd_getspnam_impl(PyObject *module, PyObject *arg); |
| Brett Cannon | 20cf6dd | 2014-08-22 13:59:24 -0400 | [diff] [blame] | 20 | |
| 21 | static PyObject * |
| Serhiy Storchaka | 1a2b24f | 2016-07-07 17:35:15 +0300 | [diff] [blame] | 22 | spwd_getspnam(PyObject *module, PyObject *arg_) |
| Brett Cannon | 20cf6dd | 2014-08-22 13:59:24 -0400 | [diff] [blame] | 23 | { |
| 24 | PyObject *return_value = NULL; |
| 25 | PyObject *arg; |
| 26 | |
| Serhiy Storchaka | 247789c | 2015-04-24 00:40:51 +0300 | [diff] [blame] | 27 | if (!PyArg_Parse(arg_, "U:getspnam", &arg)) |
| Brett Cannon | 20cf6dd | 2014-08-22 13:59:24 -0400 | [diff] [blame] | 28 | goto exit; |
| 29 | return_value = spwd_getspnam_impl(module, arg); |
| 30 | |
| 31 | exit: |
| 32 | return return_value; |
| 33 | } |
| 34 | |
| 35 | #endif /* defined(HAVE_GETSPNAM) */ |
| 36 | |
| Brett Cannon | 20cf6dd | 2014-08-22 13:59:24 -0400 | [diff] [blame] | 37 | #if defined(HAVE_GETSPENT) |
| 38 | |
| 39 | PyDoc_STRVAR(spwd_getspall__doc__, |
| 40 | "getspall($module, /)\n" |
| 41 | "--\n" |
| 42 | "\n" |
| 43 | "Return a list of all available shadow password database entries, in arbitrary order.\n" |
| 44 | "\n" |
| 45 | "See `help(spwd)` for more on shadow password database entries."); |
| 46 | |
| 47 | #define SPWD_GETSPALL_METHODDEF \ |
| 48 | {"getspall", (PyCFunction)spwd_getspall, METH_NOARGS, spwd_getspall__doc__}, |
| 49 | |
| 50 | static PyObject * |
| Serhiy Storchaka | 1a2b24f | 2016-07-07 17:35:15 +0300 | [diff] [blame] | 51 | spwd_getspall_impl(PyObject *module); |
| Brett Cannon | 20cf6dd | 2014-08-22 13:59:24 -0400 | [diff] [blame] | 52 | |
| 53 | static PyObject * |
| Serhiy Storchaka | 1a2b24f | 2016-07-07 17:35:15 +0300 | [diff] [blame] | 54 | spwd_getspall(PyObject *module, PyObject *Py_UNUSED(ignored)) |
| Brett Cannon | 20cf6dd | 2014-08-22 13:59:24 -0400 | [diff] [blame] | 55 | { |
| 56 | return spwd_getspall_impl(module); |
| 57 | } |
| 58 | |
| 59 | #endif /* defined(HAVE_GETSPENT) */ |
| 60 | |
| Larry Hastings | 0759f84 | 2015-04-03 13:09:02 -0700 | [diff] [blame] | 61 | #ifndef SPWD_GETSPNAM_METHODDEF |
| 62 | #define SPWD_GETSPNAM_METHODDEF |
| 63 | #endif /* !defined(SPWD_GETSPNAM_METHODDEF) */ |
| 64 | |
| Brett Cannon | 20cf6dd | 2014-08-22 13:59:24 -0400 | [diff] [blame] | 65 | #ifndef SPWD_GETSPALL_METHODDEF |
| 66 | #define SPWD_GETSPALL_METHODDEF |
| 67 | #endif /* !defined(SPWD_GETSPALL_METHODDEF) */ |
| Serhiy Storchaka | 1a2b24f | 2016-07-07 17:35:15 +0300 | [diff] [blame] | 68 | /*[clinic end generated code: output=510f681b36f54c30 input=a9049054013a1b77]*/ |