Merged revisions 75090 via svnmerge from
[python/dscho.git] / Include / moduleobject.h
blob42eac82e9502ea2b44f1520eefc029e46ad3252a
2 /* Module object interface */
4 #ifndef Py_MODULEOBJECT_H
5 #define Py_MODULEOBJECT_H
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
10 PyAPI_DATA(PyTypeObject) PyModule_Type;
12 #define PyModule_Check(op) PyObject_TypeCheck(op, &PyModule_Type)
13 #define PyModule_CheckExact(op) (Py_TYPE(op) == &PyModule_Type)
15 PyAPI_FUNC(PyObject *) PyModule_New(const char *);
16 PyAPI_FUNC(PyObject *) PyModule_GetDict(PyObject *);
17 PyAPI_FUNC(const char *) PyModule_GetName(PyObject *);
18 PyAPI_FUNC(const char *) PyModule_GetFilename(PyObject *);
19 PyAPI_FUNC(void) _PyModule_Clear(PyObject *);
20 PyAPI_FUNC(struct PyModuleDef*) PyModule_GetDef(PyObject*);
21 PyAPI_FUNC(void*) PyModule_GetState(PyObject*);
23 typedef struct PyModuleDef_Base {
24 PyObject_HEAD
25 PyObject* (*m_init)(void);
26 Py_ssize_t m_index;
27 PyObject* m_copy;
28 } PyModuleDef_Base;
30 #define PyModuleDef_HEAD_INIT {PyObject_HEAD_INIT(NULL)}
32 typedef struct PyModuleDef{
33 PyModuleDef_Base m_base;
34 const char* m_name;
35 const char* m_doc;
36 Py_ssize_t m_size;
37 PyMethodDef *m_methods;
38 inquiry m_reload;
39 traverseproc m_traverse;
40 inquiry m_clear;
41 freefunc m_free;
42 }PyModuleDef;
45 #ifdef __cplusplus
47 #endif
48 #endif /* !Py_MODULEOBJECT_H */