import.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* Module definition and import interface */
  2. #ifndef Py_IMPORT_H
  3. #define Py_IMPORT_H
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. PyAPI_FUNC(long) PyImport_GetMagicNumber(void);
  8. PyAPI_FUNC(const char *) PyImport_GetMagicTag(void);
  9. PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule(
  10. const char *name, /* UTF-8 encoded string */
  11. PyObject *co
  12. );
  13. PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleEx(
  14. const char *name, /* UTF-8 encoded string */
  15. PyObject *co,
  16. const char *pathname /* decoded from the filesystem encoding */
  17. );
  18. PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleWithPathnames(
  19. const char *name, /* UTF-8 encoded string */
  20. PyObject *co,
  21. const char *pathname, /* decoded from the filesystem encoding */
  22. const char *cpathname /* decoded from the filesystem encoding */
  23. );
  24. #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
  25. PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleObject(
  26. PyObject *name,
  27. PyObject *co,
  28. PyObject *pathname,
  29. PyObject *cpathname
  30. );
  31. #endif
  32. PyAPI_FUNC(PyObject *) PyImport_GetModuleDict(void);
  33. #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
  34. PyAPI_FUNC(PyObject *) PyImport_GetModule(PyObject *name);
  35. #endif
  36. #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
  37. PyAPI_FUNC(PyObject *) PyImport_AddModuleObject(
  38. PyObject *name
  39. );
  40. #endif
  41. PyAPI_FUNC(PyObject *) PyImport_AddModule(
  42. const char *name /* UTF-8 encoded string */
  43. );
  44. PyAPI_FUNC(PyObject *) PyImport_ImportModule(
  45. const char *name /* UTF-8 encoded string */
  46. );
  47. PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock(
  48. const char *name /* UTF-8 encoded string */
  49. );
  50. PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel(
  51. const char *name, /* UTF-8 encoded string */
  52. PyObject *globals,
  53. PyObject *locals,
  54. PyObject *fromlist,
  55. int level
  56. );
  57. #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
  58. PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevelObject(
  59. PyObject *name,
  60. PyObject *globals,
  61. PyObject *locals,
  62. PyObject *fromlist,
  63. int level
  64. );
  65. #endif
  66. #define PyImport_ImportModuleEx(n, g, l, f) \
  67. PyImport_ImportModuleLevel((n), (g), (l), (f), 0)
  68. PyAPI_FUNC(PyObject *) PyImport_GetImporter(PyObject *path);
  69. PyAPI_FUNC(PyObject *) PyImport_Import(PyObject *name);
  70. PyAPI_FUNC(PyObject *) PyImport_ReloadModule(PyObject *m);
  71. #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
  72. PyAPI_FUNC(int) PyImport_ImportFrozenModuleObject(
  73. PyObject *name
  74. );
  75. #endif
  76. PyAPI_FUNC(int) PyImport_ImportFrozenModule(
  77. const char *name /* UTF-8 encoded string */
  78. );
  79. PyAPI_FUNC(int) PyImport_AppendInittab(
  80. const char *name, /* ASCII encoded string */
  81. PyObject* (*initfunc)(void)
  82. );
  83. #ifndef Py_LIMITED_API
  84. # define Py_CPYTHON_IMPORT_H
  85. # include "cpython/import.h"
  86. # undef Py_CPYTHON_IMPORT_H
  87. #endif
  88. #ifdef __cplusplus
  89. }
  90. #endif
  91. #endif /* !Py_IMPORT_H */