Mercurial > cpython-lru_cache-weakref
annotate Include/import.h @ 78069:a8aa77458e12 3.2
Add c_size_t and c_ssize_t to the ctypes summary table.
| author | Antoine Pitrou <solipsis@pitrou.net> |
|---|---|
| date | Thu, 12 Jul 2012 20:31:50 +0200 |
| parents | ec3c06761856 |
| children | 44cc9ef43127 |
| rev | line source |
|---|---|
| 145 | 1 |
| 6 | 2 /* Module definition and import interface */ |
| 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); |
| 60648 | 11 PyAPI_FUNC(const char *) PyImport_GetMagicTag(void); |
|
68109
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
12 PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule( |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
13 char *name, /* UTF-8 encoded string */ |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
14 PyObject *co |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
15 ); |
|
24315
a8df0c0be242
Land Patch [ 566100 ] Rationalize DL_IMPORT and DL_EXPORT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
14375
diff
changeset
|
16 PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleEx( |
|
68109
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
17 char *name, /* UTF-8 encoded string */ |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
18 PyObject *co, |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
19 char *pathname /* decoded from the filesystem encoding */ |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
20 ); |
| 60648 | 21 PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleWithPathnames( |
|
68109
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
22 char *name, /* UTF-8 encoded string */ |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
23 PyObject *co, |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
24 char *pathname, /* decoded from the filesystem encoding */ |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
25 char *cpathname /* decoded from the filesystem encoding */ |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
26 ); |
|
24315
a8df0c0be242
Land Patch [ 566100 ] Rationalize DL_IMPORT and DL_EXPORT.
Mark Hammond <mhammond@skippinet.com.au>
parents:
14375
diff
changeset
|
27 PyAPI_FUNC(PyObject *) PyImport_GetModuleDict(void); |
|
68109
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
28 PyAPI_FUNC(PyObject *) PyImport_AddModule( |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
29 const char *name /* UTF-8 encoded string */ |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
30 ); |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
31 PyAPI_FUNC(PyObject *) PyImport_ImportModule( |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
32 const char *name /* UTF-8 encoded string */ |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
33 ); |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
34 PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock( |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
35 const char *name /* UTF-8 encoded string */ |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
36 ); |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
37 PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel( |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
38 char *name, /* UTF-8 encoded string */ |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
39 PyObject *globals, |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
40 PyObject *locals, |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
41 PyObject *fromlist, |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
42 int level |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
43 ); |
|
36712
5c36c222e7ca
SF patch #1438387, PEP 328: relative and absolute imports.
Thomas Wouters <thomas@python.org>
parents:
35999
diff
changeset
|
44 |
|
5c36c222e7ca
SF patch #1438387, PEP 328: relative and absolute imports.
Thomas Wouters <thomas@python.org>
parents:
35999
diff
changeset
|
45 #define PyImport_ImportModuleEx(n, g, l, f) \ |
|
68109
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
46 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
|
47 |
|
43897
41f7c13ef161
Merged revisions 59005-59040 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
39610
diff
changeset
|
48 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
|
49 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
|
50 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
|
51 PyAPI_FUNC(void) PyImport_Cleanup(void); |
|
68109
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
52 PyAPI_FUNC(int) PyImport_ImportFrozenModule( |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
53 char *name /* UTF-8 encoded string */ |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
54 ); |
|
13443
7e58c060d534
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
55 |
|
66664
62b61abd02b8
Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents:
65418
diff
changeset
|
56 #ifndef Py_LIMITED_API |
|
56382
2e4d7a40c2dd
Merged revisions 75246 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
52721
diff
changeset
|
57 #ifdef WITH_THREAD |
|
2e4d7a40c2dd
Merged revisions 75246 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
52721
diff
changeset
|
58 PyAPI_FUNC(void) _PyImport_AcquireLock(void); |
|
2e4d7a40c2dd
Merged revisions 75246 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
52721
diff
changeset
|
59 PyAPI_FUNC(int) _PyImport_ReleaseLock(void); |
|
2e4d7a40c2dd
Merged revisions 75246 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
52721
diff
changeset
|
60 #else |
|
2e4d7a40c2dd
Merged revisions 75246 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
52721
diff
changeset
|
61 #define _PyImport_AcquireLock() |
|
2e4d7a40c2dd
Merged revisions 75246 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
52721
diff
changeset
|
62 #define _PyImport_ReleaseLock() 1 |
|
2e4d7a40c2dd
Merged revisions 75246 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
52721
diff
changeset
|
63 #endif |
|
2e4d7a40c2dd
Merged revisions 75246 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
52721
diff
changeset
|
64 |
|
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
|
65 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
|
66 |
|
68109
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
67 PyAPI_FUNC(PyObject *)_PyImport_FindBuiltin( |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
68 char *name /* UTF-8 encoded string */ |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
69 ); |
|
65418
fd5135cbd928
_PyImport_FixupExtension() and _PyImport_FindExtension() uses FS encoding
Victor Stinner <victor.stinner@haypocalc.com>
parents:
64135
diff
changeset
|
70 PyAPI_FUNC(PyObject *)_PyImport_FindExtensionUnicode(char *, PyObject *); |
|
68109
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
71 PyAPI_FUNC(int)_PyImport_FixupBuiltin( |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
72 PyObject *mod, |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
73 char *name /* UTF-8 encoded string */ |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
74 ); |
|
65418
fd5135cbd928
_PyImport_FixupExtension() and _PyImport_FindExtension() uses FS encoding
Victor Stinner <victor.stinner@haypocalc.com>
parents:
64135
diff
changeset
|
75 PyAPI_FUNC(int)_PyImport_FixupExtensionUnicode(PyObject*, char *, PyObject *); |
|
5919
5da18e002b1a
Mass checkin (more to follow for other directories).
Guido van Rossum <guido@python.org>
parents:
5376
diff
changeset
|
76 |
|
3580
8e663945e174
Added decl for PyImport_Init.
Guido van Rossum <guido@python.org>
parents:
2348
diff
changeset
|
77 struct _inittab { |
|
13443
7e58c060d534
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
78 char *name; |
|
47580
94f64f11fdd0
Implement PEP 3121: new module initialization and finalization API.
Martin v. Löwis <martin@v.loewis.de>
parents:
44441
diff
changeset
|
79 PyObject* (*initfunc)(void); |
|
3580
8e663945e174
Added decl for PyImport_Init.
Guido van Rossum <guido@python.org>
parents:
2348
diff
changeset
|
80 }; |
|
66664
62b61abd02b8
Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents:
65418
diff
changeset
|
81 PyAPI_DATA(struct _inittab *) PyImport_Inittab; |
|
62b61abd02b8
Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents:
65418
diff
changeset
|
82 PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab); |
|
62b61abd02b8
Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents:
65418
diff
changeset
|
83 #endif /* Py_LIMITED_API */ |
|
3580
8e663945e174
Added decl for PyImport_Init.
Guido van Rossum <guido@python.org>
parents:
2348
diff
changeset
|
84 |
|
43897
41f7c13ef161
Merged revisions 59005-59040 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
39610
diff
changeset
|
85 PyAPI_DATA(PyTypeObject) PyNullImporter_Type; |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1198
diff
changeset
|
86 |
|
68109
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
87 PyAPI_FUNC(int) PyImport_AppendInittab( |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
88 const char *name, /* ASCII encoded string */ |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
89 PyObject* (*initfunc)(void) |
|
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
90 ); |
|
8588
74a100cb7a64
Add PyImport_AppendInittab() an PyImport_ExtendInittab().
Guido van Rossum <guido@python.org>
parents:
7231
diff
changeset
|
91 |
|
66664
62b61abd02b8
Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents:
65418
diff
changeset
|
92 #ifndef Py_LIMITED_API |
|
3681
a527f449ca26
Add defs for struct _frozen and struct _frozen *PyImport_FrozenModules();
Guido van Rossum <guido@python.org>
parents:
3580
diff
changeset
|
93 struct _frozen { |
|
68109
ec3c06761856
Issue #3080: document encoding used by import functions
Victor Stinner <victor.stinner@haypocalc.com>
parents:
66664
diff
changeset
|
94 char *name; /* ASCII encoded string */ |
|
13443
7e58c060d534
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
95 unsigned char *code; |
|
7e58c060d534
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
96 int size; |
|
3681
a527f449ca26
Add defs for struct _frozen and struct _frozen *PyImport_FrozenModules();
Guido van Rossum <guido@python.org>
parents:
3580
diff
changeset
|
97 }; |
|
a527f449ca26
Add defs for struct _frozen and struct _frozen *PyImport_FrozenModules();
Guido van Rossum <guido@python.org>
parents:
3580
diff
changeset
|
98 |
|
a527f449ca26
Add defs for struct _frozen and struct _frozen *PyImport_FrozenModules();
Guido van Rossum <guido@python.org>
parents:
3580
diff
changeset
|
99 /* 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
|
100 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
|
101 |
|
24420
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24315
diff
changeset
|
102 PyAPI_DATA(struct _frozen *) PyImport_FrozenModules; |
|
66664
62b61abd02b8
Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents:
65418
diff
changeset
|
103 #endif |
|
3681
a527f449ca26
Add defs for struct _frozen and struct _frozen *PyImport_FrozenModules();
Guido van Rossum <guido@python.org>
parents:
3580
diff
changeset
|
104 |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1198
diff
changeset
|
105 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1198
diff
changeset
|
106 } |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1198
diff
changeset
|
107 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1198
diff
changeset
|
108 #endif /* !Py_IMPORT_H */ |
