spwdmodule.c.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*[clinic input]
  2. preserve
  3. [clinic start generated code]*/
  4. #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
  5. # include "pycore_gc.h" // PyGC_Head
  6. # include "pycore_runtime.h" // _Py_ID()
  7. #endif
  8. #if defined(HAVE_GETSPNAM)
  9. PyDoc_STRVAR(spwd_getspnam__doc__,
  10. "getspnam($module, arg, /)\n"
  11. "--\n"
  12. "\n"
  13. "Return the shadow password database entry for the given user name.\n"
  14. "\n"
  15. "See `help(spwd)` for more on shadow password database entries.");
  16. #define SPWD_GETSPNAM_METHODDEF \
  17. {"getspnam", (PyCFunction)spwd_getspnam, METH_O, spwd_getspnam__doc__},
  18. static PyObject *
  19. spwd_getspnam_impl(PyObject *module, PyObject *arg);
  20. static PyObject *
  21. spwd_getspnam(PyObject *module, PyObject *arg_)
  22. {
  23. PyObject *return_value = NULL;
  24. PyObject *arg;
  25. if (!PyUnicode_Check(arg_)) {
  26. _PyArg_BadArgument("getspnam", "argument", "str", arg_);
  27. goto exit;
  28. }
  29. if (PyUnicode_READY(arg_) == -1) {
  30. goto exit;
  31. }
  32. arg = arg_;
  33. return_value = spwd_getspnam_impl(module, arg);
  34. exit:
  35. return return_value;
  36. }
  37. #endif /* defined(HAVE_GETSPNAM) */
  38. #if defined(HAVE_GETSPENT)
  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. #define SPWD_GETSPALL_METHODDEF \
  47. {"getspall", (PyCFunction)spwd_getspall, METH_NOARGS, spwd_getspall__doc__},
  48. static PyObject *
  49. spwd_getspall_impl(PyObject *module);
  50. static PyObject *
  51. spwd_getspall(PyObject *module, PyObject *Py_UNUSED(ignored))
  52. {
  53. return spwd_getspall_impl(module);
  54. }
  55. #endif /* defined(HAVE_GETSPENT) */
  56. #ifndef SPWD_GETSPNAM_METHODDEF
  57. #define SPWD_GETSPNAM_METHODDEF
  58. #endif /* !defined(SPWD_GETSPNAM_METHODDEF) */
  59. #ifndef SPWD_GETSPALL_METHODDEF
  60. #define SPWD_GETSPALL_METHODDEF
  61. #endif /* !defined(SPWD_GETSPALL_METHODDEF) */
  62. /*[clinic end generated code: output=dd61827a7b708e11 input=a9049054013a1b77]*/