annotate Include/import.h @ 58925:eecf1bef052d 2.6

Merged revisions 78207 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78207 | ezio.melotti | 2010-02-17 01:26:09 +0200 (Wed, 17 Feb 2010) | 1 line #7930: fix stripid ........
author Ezio Melotti <ezio.melotti@gmail.com>
date Tue, 16 Feb 2010 23:29:44 +0000
parents 1ad9f2bda20a
children b36cb4602e21
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
853b736a6a9e Added copyright notice.
Guido van Rossum <guido@python.org>
parents: 86
diff changeset
1
6
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
2 /* Module definition and import interface */
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
3
13443
7e58c060d534 ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
4 #ifndef Py_IMPORT_H
7e58c060d534 ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
5 #define Py_IMPORT_H
7e58c060d534 ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
6 #ifdef __cplusplus
7e58c060d534 ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
7 extern "C" {
7e58c060d534 ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
8 #endif
1198
2937897a7d8b * Added Fixcprt.py: script to fix copyright message.
Guido van Rossum <guido@python.org>
parents: 790
diff changeset
9
24315
a8df0c0be242 Land Patch [ 566100 ] Rationalize DL_IMPORT and DL_EXPORT.
Mark Hammond <mhammond@skippinet.com.au>
parents: 14375
diff changeset
10 PyAPI_FUNC(long) PyImport_GetMagicNumber(void);
a8df0c0be242 Land Patch [ 566100 ] Rationalize DL_IMPORT and DL_EXPORT.
Mark Hammond <mhammond@skippinet.com.au>
parents: 14375
diff changeset
11 PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule(char *name, PyObject *co);
a8df0c0be242 Land Patch [ 566100 ] Rationalize DL_IMPORT and DL_EXPORT.
Mark Hammond <mhammond@skippinet.com.au>
parents: 14375
diff changeset
12 PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleEx(
13443
7e58c060d534 ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
13 char *name, PyObject *co, char *pathname);
24315
a8df0c0be242 Land Patch [ 566100 ] Rationalize DL_IMPORT and DL_EXPORT.
Mark Hammond <mhammond@skippinet.com.au>
parents: 14375
diff changeset
14 PyAPI_FUNC(PyObject *) PyImport_GetModuleDict(void);
35999
9541369b0dca Add const to several API functions that take char *.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 35551
diff changeset
15 PyAPI_FUNC(PyObject *) PyImport_AddModule(const char *name);
9541369b0dca Add const to several API functions that take char *.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 35551
diff changeset
16 PyAPI_FUNC(PyObject *) PyImport_ImportModule(const char *name);
44441
b91ca87e6f32 Merged revisions 59666-59679 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 43897
diff changeset
17 PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock(const char *);
36712
5c36c222e7ca SF patch #1438387, PEP 328: relative and absolute imports.
Thomas Wouters <thomas@python.org>
parents: 35999
diff changeset
18 PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel(char *name,
5c36c222e7ca SF patch #1438387, PEP 328: relative and absolute imports.
Thomas Wouters <thomas@python.org>
parents: 35999
diff changeset
19 PyObject *globals, PyObject *locals, PyObject *fromlist, int level);
5c36c222e7ca SF patch #1438387, PEP 328: relative and absolute imports.
Thomas Wouters <thomas@python.org>
parents: 35999
diff changeset
20
5c36c222e7ca SF patch #1438387, PEP 328: relative and absolute imports.
Thomas Wouters <thomas@python.org>
parents: 35999
diff changeset
21 #define PyImport_ImportModuleEx(n, g, l, f) \
39584
87d153ffbb98 SF #1542693: Remove semi-colon at end of PyImport_ImportModuleEx macro
Neal Norwitz <nnorwitz@gmail.com>
parents: 36712
diff changeset
22 PyImport_ImportModuleLevel(n, g, l, f, -1)
36712
5c36c222e7ca SF patch #1438387, PEP 328: relative and absolute imports.
Thomas Wouters <thomas@python.org>
parents: 35999
diff changeset
23
43897
41f7c13ef161 Merged revisions 59005-59040 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 39584
diff changeset
24 PyAPI_FUNC(PyObject *) PyImport_GetImporter(PyObject *path);
24315
a8df0c0be242 Land Patch [ 566100 ] Rationalize DL_IMPORT and DL_EXPORT.
Mark Hammond <mhammond@skippinet.com.au>
parents: 14375
diff changeset
25 PyAPI_FUNC(PyObject *) PyImport_Import(PyObject *name);
a8df0c0be242 Land Patch [ 566100 ] Rationalize DL_IMPORT and DL_EXPORT.
Mark Hammond <mhammond@skippinet.com.au>
parents: 14375
diff changeset
26 PyAPI_FUNC(PyObject *) PyImport_ReloadModule(PyObject *m);
a8df0c0be242 Land Patch [ 566100 ] Rationalize DL_IMPORT and DL_EXPORT.
Mark Hammond <mhammond@skippinet.com.au>
parents: 14375
diff changeset
27 PyAPI_FUNC(void) PyImport_Cleanup(void);
a8df0c0be242 Land Patch [ 566100 ] Rationalize DL_IMPORT and DL_EXPORT.
Mark Hammond <mhammond@skippinet.com.au>
parents: 14375
diff changeset
28 PyAPI_FUNC(int) PyImport_ImportFrozenModule(char *);
13443
7e58c060d534 ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
29
56008
1ad9f2bda20a Merged revisions 74841 via svnmerge from
Thomas Wouters <thomas@python.org>
parents: 44441
diff changeset
30 #ifdef WITH_THREAD
1ad9f2bda20a Merged revisions 74841 via svnmerge from
Thomas Wouters <thomas@python.org>
parents: 44441
diff changeset
31 PyAPI_FUNC(void) _PyImport_AcquireLock(void);
1ad9f2bda20a Merged revisions 74841 via svnmerge from
Thomas Wouters <thomas@python.org>
parents: 44441
diff changeset
32 PyAPI_FUNC(int) _PyImport_ReleaseLock(void);
1ad9f2bda20a Merged revisions 74841 via svnmerge from
Thomas Wouters <thomas@python.org>
parents: 44441
diff changeset
33 #else
1ad9f2bda20a Merged revisions 74841 via svnmerge from
Thomas Wouters <thomas@python.org>
parents: 44441
diff changeset
34 #define _PyImport_AcquireLock()
1ad9f2bda20a Merged revisions 74841 via svnmerge from
Thomas Wouters <thomas@python.org>
parents: 44441
diff changeset
35 #define _PyImport_ReleaseLock() 1
1ad9f2bda20a Merged revisions 74841 via svnmerge from
Thomas Wouters <thomas@python.org>
parents: 44441
diff changeset
36 #endif
1ad9f2bda20a Merged revisions 74841 via svnmerge from
Thomas Wouters <thomas@python.org>
parents: 44441
diff changeset
37
33680
bcafb68ad985 SF patch #1035498: -m option to run a module as a script
Raymond Hettinger <python@rcn.com>
parents: 24420
diff changeset
38 PyAPI_FUNC(struct filedescr *) _PyImport_FindModule(
bcafb68ad985 SF patch #1035498: -m option to run a module as a script
Raymond Hettinger <python@rcn.com>
parents: 24420
diff changeset
39 const char *, PyObject *, char *, size_t, FILE **, PyObject **);
bcafb68ad985 SF patch #1035498: -m option to run a module as a script
Raymond Hettinger <python@rcn.com>
parents: 24420
diff changeset
40 PyAPI_FUNC(int) _PyImport_IsScript(struct filedescr *);
35551
57f630a9de26 - Changes donated by Elemental Security to make it work on AIX 5.3
Guido van Rossum <guido@python.org>
parents: 33680
diff changeset
41 PyAPI_FUNC(void) _PyImport_ReInitLock(void);
33680
bcafb68ad985 SF patch #1035498: -m option to run a module as a script
Raymond Hettinger <python@rcn.com>
parents: 24420
diff changeset
42
24420
36e2fd3f08f7 Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents: 24315
diff changeset
43 PyAPI_FUNC(PyObject *)_PyImport_FindExtension(char *, char *);
36e2fd3f08f7 Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents: 24315
diff changeset
44 PyAPI_FUNC(PyObject *)_PyImport_FixupExtension(char *, char *);
5919
5da18e002b1a Mass checkin (more to follow for other directories).
Guido van Rossum <guido@python.org>
parents: 5376
diff changeset
45
3580
8e663945e174 Added decl for PyImport_Init.
Guido van Rossum <guido@python.org>
parents: 2348
diff changeset
46 struct _inittab {
13443
7e58c060d534 ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
47 char *name;
13661
ef25f32c4523 ANSIfications: fix empty arglists, and remove the checks for
Thomas Wouters <thomas@python.org>
parents: 13443
diff changeset
48 void (*initfunc)(void);
3580
8e663945e174 Added decl for PyImport_Init.
Guido van Rossum <guido@python.org>
parents: 2348
diff changeset
49 };
8e663945e174 Added decl for PyImport_Init.
Guido van Rossum <guido@python.org>
parents: 2348
diff changeset
50
43897
41f7c13ef161 Merged revisions 59005-59040 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 39584
diff changeset
51 PyAPI_DATA(PyTypeObject) PyNullImporter_Type;
24420
36e2fd3f08f7 Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents: 24315
diff changeset
52 PyAPI_DATA(struct _inittab *) PyImport_Inittab;
1329
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1198
diff changeset
53
24420
36e2fd3f08f7 Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents: 24315
diff changeset
54 PyAPI_FUNC(int) PyImport_AppendInittab(char *name, void (*initfunc)(void));
36e2fd3f08f7 Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents: 24315
diff changeset
55 PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab);
8588
74a100cb7a64 Add PyImport_AppendInittab() an PyImport_ExtendInittab().
Guido van Rossum <guido@python.org>
parents: 7231
diff changeset
56
3681
a527f449ca26 Add defs for struct _frozen and struct _frozen *PyImport_FrozenModules();
Guido van Rossum <guido@python.org>
parents: 3580
diff changeset
57 struct _frozen {
13443
7e58c060d534 ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
58 char *name;
7e58c060d534 ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
59 unsigned char *code;
7e58c060d534 ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
60 int size;
3681
a527f449ca26 Add defs for struct _frozen and struct _frozen *PyImport_FrozenModules();
Guido van Rossum <guido@python.org>
parents: 3580
diff changeset
61 };
a527f449ca26 Add defs for struct _frozen and struct _frozen *PyImport_FrozenModules();
Guido van Rossum <guido@python.org>
parents: 3580
diff changeset
62
a527f449ca26 Add defs for struct _frozen and struct _frozen *PyImport_FrozenModules();
Guido van Rossum <guido@python.org>
parents: 3580
diff changeset
63 /* Embedding apps may change this pointer to point to their favorite
a527f449ca26 Add defs for struct _frozen and struct _frozen *PyImport_FrozenModules();
Guido van Rossum <guido@python.org>
parents: 3580
diff changeset
64 collection of frozen modules: */
a527f449ca26 Add defs for struct _frozen and struct _frozen *PyImport_FrozenModules();
Guido van Rossum <guido@python.org>
parents: 3580
diff changeset
65
24420
36e2fd3f08f7 Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents: 24315
diff changeset
66 PyAPI_DATA(struct _frozen *) PyImport_FrozenModules;
3681
a527f449ca26 Add defs for struct _frozen and struct _frozen *PyImport_FrozenModules();
Guido van Rossum <guido@python.org>
parents: 3580
diff changeset
67
1329
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1198
diff changeset
68 #ifdef __cplusplus
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1198
diff changeset
69 }
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1198
diff changeset
70 #endif
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1198
diff changeset
71 #endif /* !Py_IMPORT_H */