pylifecycle.pxd 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Interfaces to configure, query, create & destroy the Python runtime
  2. from libc.stdio cimport FILE
  3. from .pystate cimport PyThreadState
  4. cdef extern from "Python.h":
  5. ctypedef int wchar_t
  6. void Py_SetProgramName(wchar_t *)
  7. wchar_t *Py_GetProgramName()
  8. void Py_SetPythonHome(wchar_t *)
  9. wchar_t *Py_GetPythonHome()
  10. # Only used by applications that embed the interpreter and need to
  11. # override the standard encoding determination mechanism
  12. int Py_SetStandardStreamEncoding(const char *encoding, const char *errors)
  13. void Py_Initialize()
  14. void Py_InitializeEx(int)
  15. void _Py_InitializeEx_Private(int, int)
  16. void Py_Finalize()
  17. int Py_FinalizeEx()
  18. int Py_IsInitialized()
  19. PyThreadState *Py_NewInterpreter()
  20. void Py_EndInterpreter(PyThreadState *)
  21. # _Py_PyAtExit is for the atexit module, Py_AtExit is for low-level
  22. # exit functions.
  23. void _Py_PyAtExit(void (*func)(object), object)
  24. int Py_AtExit(void (*func)())
  25. void Py_Exit(int)
  26. # Restore signals that the interpreter has called SIG_IGN on to SIG_DFL.
  27. void _Py_RestoreSignals()
  28. int Py_FdIsInteractive(FILE *, const char *)
  29. # Bootstrap __main__ (defined in Modules/main.c)
  30. int Py_Main(int argc, wchar_t **argv)
  31. # In getpath.c
  32. wchar_t *Py_GetProgramFullPath()
  33. wchar_t *Py_GetPrefix()
  34. wchar_t *Py_GetExecPrefix()
  35. wchar_t *Py_GetPath()
  36. void Py_SetPath(const wchar_t *)
  37. int _Py_CheckPython3()
  38. # In their own files
  39. const char *Py_GetVersion()
  40. const char *Py_GetPlatform()
  41. const char *Py_GetCopyright()
  42. const char *Py_GetCompiler()
  43. const char *Py_GetBuildInfo()
  44. const char *_Py_gitidentifier()
  45. const char *_Py_gitversion()
  46. ctypedef void (*PyOS_sighandler_t)(int)
  47. PyOS_sighandler_t PyOS_getsig(int)
  48. PyOS_sighandler_t PyOS_setsig(int, PyOS_sighandler_t)
  49. # Random
  50. int _PyOS_URandom(void *buffer, Py_ssize_t size)
  51. int _PyOS_URandomNonblock(void *buffer, Py_ssize_t size)