- Notifications
You must be signed in to change notification settings - Fork 31.7k
/
Copy pathimport.h
71 lines (56 loc) · 2.17 KB
/
import.h
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
/* Module definition and import interface */
#ifndefPy_IMPORT_H
#definePy_IMPORT_H
#ifdef__cplusplus
extern"C" {
#endif
PyAPI_FUNC(long) PyImport_GetMagicNumber(void);
PyAPI_FUNC(PyObject*) PyImport_ExecCodeModule(char*name, PyObject*co);
PyAPI_FUNC(PyObject*) PyImport_ExecCodeModuleEx(
char*name, PyObject*co, char*pathname);
PyAPI_FUNC(PyObject*) PyImport_GetModuleDict(void);
PyAPI_FUNC(PyObject*) PyImport_AddModule(constchar*name);
PyAPI_FUNC(PyObject*) PyImport_ImportModule(constchar*name);
PyAPI_FUNC(PyObject*) PyImport_ImportModuleNoBlock(constchar*);
PyAPI_FUNC(PyObject*) PyImport_ImportModuleLevel(char*name,
PyObject*globals, PyObject*locals, PyObject*fromlist, intlevel);
#definePyImport_ImportModuleEx(n, g, l, f) \
PyImport_ImportModuleLevel(n, g, l, f, -1)
PyAPI_FUNC(PyObject*) PyImport_GetImporter(PyObject*path);
PyAPI_FUNC(PyObject*) PyImport_Import(PyObject*name);
PyAPI_FUNC(PyObject*) PyImport_ReloadModule(PyObject*m);
PyAPI_FUNC(void) PyImport_Cleanup(void);
PyAPI_FUNC(int) PyImport_ImportFrozenModule(char*);
#ifdefWITH_THREAD
PyAPI_FUNC(void) _PyImport_AcquireLock(void);
PyAPI_FUNC(int) _PyImport_ReleaseLock(void);
#else
#define_PyImport_AcquireLock()
#define_PyImport_ReleaseLock() 1
#endif
PyAPI_FUNC(structfiledescr*) _PyImport_FindModule(
constchar*, PyObject*, char*, size_t, FILE**, PyObject**);
PyAPI_FUNC(int) _PyImport_IsScript(structfiledescr*);
PyAPI_FUNC(void) _PyImport_ReInitLock(void);
PyAPI_FUNC(PyObject*) _PyImport_FindExtension(char*, char*);
PyAPI_FUNC(PyObject*) _PyImport_FixupExtension(char*, char*);
struct_inittab {
char*name;
void (*initfunc)(void);
};
PyAPI_DATA(PyTypeObject) PyNullImporter_Type;
PyAPI_DATA(struct_inittab*) PyImport_Inittab;
PyAPI_FUNC(int) PyImport_AppendInittab(constchar*name, void (*initfunc)(void));
PyAPI_FUNC(int) PyImport_ExtendInittab(struct_inittab*newtab);
struct_frozen {
char*name;
unsigned char*code;
intsize;
};
/* Embedding apps may change this pointer to point to their favorite
collection of frozen modules: */
PyAPI_DATA(struct_frozen*) PyImport_FrozenModules;
#ifdef__cplusplus
}
#endif
#endif/* !Py_IMPORT_H */