Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
moduleobject.h123 linesDownload Raw Back to include
1 2/* Module object interface */3 4#ifndef Py_MODULEOBJECT_H5#define Py_MODULEOBJECT_H6#ifdef __cplusplus7extern "C" {8#endif9 10PyAPI_DATA(PyTypeObject) PyModule_Type;11 12#define PyModule_Check(op) PyObject_TypeCheck((op), &PyModule_Type)13#define PyModule_CheckExact(op) Py_IS_TYPE((op), &PyModule_Type)14 15#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x0303000016PyAPI_FUNC(PyObject *) PyModule_NewObject(17    PyObject *name18    );19#endif20PyAPI_FUNC(PyObject *) PyModule_New(21    const char *name            /* UTF-8 encoded string */22    );23PyAPI_FUNC(PyObject *) PyModule_GetDict(PyObject *);24#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x0303000025PyAPI_FUNC(PyObject *) PyModule_GetNameObject(PyObject *);26#endif27PyAPI_FUNC(const char *) PyModule_GetName(PyObject *);28Py_DEPRECATED(3.2) PyAPI_FUNC(const char *) PyModule_GetFilename(PyObject *);29PyAPI_FUNC(PyObject *) PyModule_GetFilenameObject(PyObject *);30PyAPI_FUNC(PyModuleDef*) PyModule_GetDef(PyObject*);31PyAPI_FUNC(void*) PyModule_GetState(PyObject*);32 33#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x0305000034/* New in 3.5 */35PyAPI_FUNC(PyObject *) PyModuleDef_Init(PyModuleDef*);36PyAPI_DATA(PyTypeObject) PyModuleDef_Type;37#endif38 39typedef struct PyModuleDef_Base {40  PyObject_HEAD41  /* The function used to re-initialize the module.42     This is only set for legacy (single-phase init) extension modules43     and only used for those that support multiple initializations44     (m_size >= 0).45     It is set by _PyImport_LoadDynamicModuleWithSpec()46     and _imp.create_builtin(). */47  PyObject* (*m_init)(void);48  /* The module's index into its interpreter's modules_by_index cache.49     This is set for all extension modules but only used for legacy ones.50     (See PyInterpreterState.modules_by_index for more info.)51     It is set by PyModuleDef_Init(). */52  Py_ssize_t m_index;53  /* A copy of the module's __dict__ after the first time it was loaded.54     This is only set/used for legacy modules that do not support55     multiple initializations.56     It is set by fix_up_extension() in import.c. */57  PyObject* m_copy;58} PyModuleDef_Base;59 60#define PyModuleDef_HEAD_INIT {  \61    PyObject_HEAD_INIT(_Py_NULL) \62    _Py_NULL, /* m_init */       \63    0,        /* m_index */      \64    _Py_NULL, /* m_copy */       \65  }66 67#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x0305000068/* New in 3.5 */69struct PyModuleDef_Slot {70    int slot;71    void *value;72};73 74#define Py_mod_create 175#define Py_mod_exec 276#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030c000077#  define Py_mod_multiple_interpreters 378#endif79#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d000080#  define Py_mod_gil 481#endif82 83 84#ifndef Py_LIMITED_API85#define _Py_mod_LAST_SLOT 486#endif87 88#endif /* New in 3.5 */89 90/* for Py_mod_multiple_interpreters: */91#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030c000092#  define Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED ((void *)0)93#  define Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED ((void *)1)94#  define Py_MOD_PER_INTERPRETER_GIL_SUPPORTED ((void *)2)95#endif96 97/* for Py_mod_gil: */98#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d000099#  define Py_MOD_GIL_USED ((void *)0)100#  define Py_MOD_GIL_NOT_USED ((void *)1)101#endif102 103#if !defined(Py_LIMITED_API) && defined(Py_GIL_DISABLED)104PyAPI_FUNC(int) PyUnstable_Module_SetGIL(PyObject *module, void *gil);105#endif106 107struct PyModuleDef {108  PyModuleDef_Base m_base;109  const char* m_name;110  const char* m_doc;111  Py_ssize_t m_size;112  PyMethodDef *m_methods;113  PyModuleDef_Slot *m_slots;114  traverseproc m_traverse;115  inquiry m_clear;116  freefunc m_free;117};118 119#ifdef __cplusplus120}121#endif122#endif /* !Py_MODULEOBJECT_H */123 
codekingpro/portable-devtools · Team Ai