LCOV - code coverage report
Current view: top level - Modules/clinic - spwdmodule.c.h (source / functions) Hit Total Coverage
Test: CPython lcov report Lines: 8 13 61.5 %
Date: 2022-07-07 18:19:46 Functions: 1 2 50.0 %

          Line data    Source code
       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    \
      16             :     {"getspnam", (PyCFunction)spwd_getspnam, METH_O, spwd_getspnam__doc__},
      17             : 
      18             : static PyObject *
      19             : spwd_getspnam_impl(PyObject *module, PyObject *arg);
      20             : 
      21             : static PyObject *
      22           1 : spwd_getspnam(PyObject *module, PyObject *arg_)
      23             : {
      24           1 :     PyObject *return_value = NULL;
      25             :     PyObject *arg;
      26             : 
      27           1 :     if (!PyUnicode_Check(arg_)) {
      28           0 :         _PyArg_BadArgument("getspnam", "argument", "str", arg_);
      29           0 :         goto exit;
      30             :     }
      31           1 :     if (PyUnicode_READY(arg_) == -1) {
      32           0 :         goto exit;
      33             :     }
      34           1 :     arg = arg_;
      35           1 :     return_value = spwd_getspnam_impl(module, arg);
      36             : 
      37           1 : exit:
      38           1 :     return return_value;
      39             : }
      40             : 
      41             : #endif /* defined(HAVE_GETSPNAM) */
      42             : 
      43             : #if defined(HAVE_GETSPENT)
      44             : 
      45             : PyDoc_STRVAR(spwd_getspall__doc__,
      46             : "getspall($module, /)\n"
      47             : "--\n"
      48             : "\n"
      49             : "Return a list of all available shadow password database entries, in arbitrary order.\n"
      50             : "\n"
      51             : "See `help(spwd)` for more on shadow password database entries.");
      52             : 
      53             : #define SPWD_GETSPALL_METHODDEF    \
      54             :     {"getspall", (PyCFunction)spwd_getspall, METH_NOARGS, spwd_getspall__doc__},
      55             : 
      56             : static PyObject *
      57             : spwd_getspall_impl(PyObject *module);
      58             : 
      59             : static PyObject *
      60           0 : spwd_getspall(PyObject *module, PyObject *Py_UNUSED(ignored))
      61             : {
      62           0 :     return spwd_getspall_impl(module);
      63             : }
      64             : 
      65             : #endif /* defined(HAVE_GETSPENT) */
      66             : 
      67             : #ifndef SPWD_GETSPNAM_METHODDEF
      68             :     #define SPWD_GETSPNAM_METHODDEF
      69             : #endif /* !defined(SPWD_GETSPNAM_METHODDEF) */
      70             : 
      71             : #ifndef SPWD_GETSPALL_METHODDEF
      72             :     #define SPWD_GETSPALL_METHODDEF
      73             : #endif /* !defined(SPWD_GETSPALL_METHODDEF) */
      74             : /*[clinic end generated code: output=eec8d0bedcd312e5 input=a9049054013a1b77]*/

Generated by: LCOV version 1.14