1 /**
2   Mirror _moduleobject.h
3 
4   Module object interface 
5   */
6 module deimos.python.moduleobject;
7 
8 import deimos.python.pyport;
9 import deimos.python.object;
10 import deimos.python.methodobject;
11 
12 extern(C):
13 // Python-header-file: Include/moduleobject.h:
14 
15 /// _
16 mixin(PyAPI_DATA!"PyTypeObject PyModule_Type");
17 
18 // D translation of C macro:
19 /// _
20 int PyModule_Check()(PyObject *op) {
21     return PyObject_TypeCheck(op, &PyModule_Type);
22 }
23 // D translation of C macro:
24 /// _
25 int PyModule_CheckExact()(PyObject *op) {
26     return Py_TYPE(op) == &PyModule_Type;
27 }
28 
29 /// _
30 PyObject* PyModule_New(const(char)*);
31 /// _
32 PyObject_BorrowedRef* PyModule_GetDict(PyObject*);
33 /// _
34 const(char)* PyModule_GetName(PyObject*);
35 /// _
36 const(char)* PyModule_GetFilename(PyObject*);
37 version(Python_3_0_Or_Later) {
38     /// Availability: 3.*
39     PyObject* PyModule_GetFilenameObject(PyObject*);
40 }
41 /// _
42 void _PyModule_Clear(PyObject*);
43 
44 version(Python_3_0_Or_Later) {
45     /// Availability: 3.*
46     PyModuleDef* PyModule_GetDef(PyObject*);
47     /// Availability: 3.*
48     void* PyModule_GetState(PyObject*);
49 
50     /// subclass of PyObject
51     /// Availability: 3.*
52     struct PyModuleDef_Base {
53         mixin PyObject_HEAD;
54         /// _
55         PyObject* function() m_init;
56         /// _
57         Py_ssize_t m_index;
58         /// _
59         PyObject* m_copy;
60     } 
61 
62     /// Availability: 3.*
63     struct PyModuleDef{
64         /// _
65         PyModuleDef_Base m_base;
66         /// _
67         const(char)* m_name;
68         /// _
69         const(char)* m_doc;
70         /// _
71         Py_ssize_t m_size;
72         /// _
73         PyMethodDef* m_methods;
74         /// _
75         inquiry m_reload;
76         /// _
77         traverseproc m_traverse;
78         /// _
79         inquiry m_clear;
80         /// _
81         freefunc m_free;
82     }
83 }