You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.5 KiB

36 years ago
36 years ago
36 years ago
  1. /* Module object interface */
  2. #ifndef Py_MODULEOBJECT_H
  3. #define Py_MODULEOBJECT_H
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. PyAPI_DATA(PyTypeObject) PyModule_Type;
  8. #define PyModule_Check(op) PyObject_TypeCheck(op, &PyModule_Type)
  9. #define PyModule_CheckExact(op) (Py_TYPE(op) == &PyModule_Type)
  10. PyAPI_FUNC(PyObject *) PyModule_NewObject(
  11. PyObject *name
  12. );
  13. PyAPI_FUNC(PyObject *) PyModule_New(
  14. const char *name /* UTF-8 encoded string */
  15. );
  16. PyAPI_FUNC(PyObject *) PyModule_GetDict(PyObject *);
  17. PyAPI_FUNC(PyObject *) PyModule_GetNameObject(PyObject *);
  18. PyAPI_FUNC(const char *) PyModule_GetName(PyObject *);
  19. PyAPI_FUNC(const char *) PyModule_GetFilename(PyObject *);
  20. PyAPI_FUNC(PyObject *) PyModule_GetFilenameObject(PyObject *);
  21. #ifndef Py_LIMITED_API
  22. PyAPI_FUNC(void) _PyModule_Clear(PyObject *);
  23. #endif
  24. PyAPI_FUNC(struct PyModuleDef*) PyModule_GetDef(PyObject*);
  25. PyAPI_FUNC(void*) PyModule_GetState(PyObject*);
  26. typedef struct PyModuleDef_Base {
  27. PyObject_HEAD
  28. PyObject* (*m_init)(void);
  29. Py_ssize_t m_index;
  30. PyObject* m_copy;
  31. } PyModuleDef_Base;
  32. #define PyModuleDef_HEAD_INIT { \
  33. PyObject_HEAD_INIT(NULL) \
  34. NULL, /* m_init */ \
  35. 0, /* m_index */ \
  36. NULL, /* m_copy */ \
  37. }
  38. typedef struct PyModuleDef{
  39. PyModuleDef_Base m_base;
  40. const char* m_name;
  41. const char* m_doc;
  42. Py_ssize_t m_size;
  43. PyMethodDef *m_methods;
  44. inquiry m_reload;
  45. traverseproc m_traverse;
  46. inquiry m_clear;
  47. freefunc m_free;
  48. }PyModuleDef;
  49. #ifdef __cplusplus
  50. }
  51. #endif
  52. #endif /* !Py_MODULEOBJECT_H */