import.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef Py_CPYTHON_IMPORT_H
  2. # error "this header file must not be included directly"
  3. #endif
  4. PyMODINIT_FUNC PyInit__imp(void);
  5. PyAPI_FUNC(int) _PyImport_IsInitialized(PyInterpreterState *);
  6. PyAPI_FUNC(PyObject *) _PyImport_GetModuleId(_Py_Identifier *name);
  7. PyAPI_FUNC(int) _PyImport_SetModule(PyObject *name, PyObject *module);
  8. PyAPI_FUNC(int) _PyImport_SetModuleString(const char *name, PyObject* module);
  9. PyAPI_FUNC(void) _PyImport_AcquireLock(PyInterpreterState *interp);
  10. PyAPI_FUNC(int) _PyImport_ReleaseLock(PyInterpreterState *interp);
  11. PyAPI_FUNC(int) _PyImport_FixupBuiltin(
  12. PyObject *mod,
  13. const char *name, /* UTF-8 encoded string */
  14. PyObject *modules
  15. );
  16. PyAPI_FUNC(int) _PyImport_FixupExtensionObject(PyObject*, PyObject *,
  17. PyObject *, PyObject *);
  18. struct _inittab {
  19. const char *name; /* ASCII encoded string */
  20. PyObject* (*initfunc)(void);
  21. };
  22. // This is not used after Py_Initialize() is called.
  23. PyAPI_DATA(struct _inittab *) PyImport_Inittab;
  24. PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab);
  25. struct _frozen {
  26. const char *name; /* ASCII encoded string */
  27. const unsigned char *code;
  28. int size;
  29. int is_package;
  30. PyObject *(*get_code)(void);
  31. };
  32. /* Embedding apps may change this pointer to point to their favorite
  33. collection of frozen modules: */
  34. PyAPI_DATA(const struct _frozen *) PyImport_FrozenModules;
  35. PyAPI_DATA(PyObject *) _PyImport_GetModuleAttr(PyObject *, PyObject *);
  36. PyAPI_DATA(PyObject *) _PyImport_GetModuleAttrString(const char *, const char *);