Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

moduleobject.h 2.2 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
  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. #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
  11. PyAPI_FUNC(PyObject *) PyModule_NewObject(
  12. PyObject *name
  13. );
  14. #endif
  15. PyAPI_FUNC(PyObject *) PyModule_New(
  16. const char *name /* UTF-8 encoded string */
  17. );
  18. PyAPI_FUNC(PyObject *) PyModule_GetDict(PyObject *);
  19. #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
  20. PyAPI_FUNC(PyObject *) PyModule_GetNameObject(PyObject *);
  21. #endif
  22. PyAPI_FUNC(const char *) PyModule_GetName(PyObject *);
  23. PyAPI_FUNC(const char *) PyModule_GetFilename(PyObject *) Py_DEPRECATED(3.2);
  24. PyAPI_FUNC(PyObject *) PyModule_GetFilenameObject(PyObject *);
  25. #ifndef Py_LIMITED_API
  26. PyAPI_FUNC(void) _PyModule_Clear(PyObject *);
  27. PyAPI_FUNC(void) _PyModule_ClearDict(PyObject *);
  28. #endif
  29. PyAPI_FUNC(struct PyModuleDef*) PyModule_GetDef(PyObject*);
  30. PyAPI_FUNC(void*) PyModule_GetState(PyObject*);
  31. #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
  32. /* New in 3.5 */
  33. PyAPI_FUNC(PyObject *) PyModuleDef_Init(struct PyModuleDef*);
  34. PyAPI_DATA(PyTypeObject) PyModuleDef_Type;
  35. #endif
  36. typedef struct PyModuleDef_Base {
  37. PyObject_HEAD
  38. PyObject* (*m_init)(void);
  39. Py_ssize_t m_index;
  40. PyObject* m_copy;
  41. } PyModuleDef_Base;
  42. #define PyModuleDef_HEAD_INIT { \
  43. PyObject_HEAD_INIT(NULL) \
  44. NULL, /* m_init */ \
  45. 0, /* m_index */ \
  46. NULL, /* m_copy */ \
  47. }
  48. struct PyModuleDef_Slot;
  49. #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
  50. /* New in 3.5 */
  51. typedef struct PyModuleDef_Slot{
  52. int slot;
  53. void *value;
  54. } PyModuleDef_Slot;
  55. #define Py_mod_create 1
  56. #define Py_mod_exec 2
  57. #ifndef Py_LIMITED_API
  58. #define _Py_mod_LAST_SLOT 2
  59. #endif
  60. #endif /* New in 3.5 */
  61. typedef struct PyModuleDef{
  62. PyModuleDef_Base m_base;
  63. const char* m_name;
  64. const char* m_doc;
  65. Py_ssize_t m_size;
  66. PyMethodDef *m_methods;
  67. struct PyModuleDef_Slot* m_slots;
  68. traverseproc m_traverse;
  69. inquiry m_clear;
  70. freefunc m_free;
  71. } PyModuleDef;
  72. #ifdef __cplusplus
  73. }
  74. #endif
  75. #endif /* !Py_MODULEOBJECT_H */
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...