Mercurial > cpython-lru_cache-weakref
annotate Include/pythonrun.h @ 7208:ce271e5f9bc5 legacy-trunk
- Add Py_GetPythonHome() and Py_SetPythonHome(), intended to allow
embedders to force a different PYTHONHOME.
- Add new interface PyErr_PrintEx(flag); same as PyErr_Print() but
flag determines whether sys.last_* are set or not. PyErr_Print()
now simply calls PyErr_PrintEx(1).
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 06 Feb 1998 22:28:05 +0000 |
| parents | 12b8a43599d3 |
| children | 60fdb1db1175 |
| rev | line source |
|---|---|
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1 #ifndef Py_PYTHONRUN_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
2 #define Py_PYTHONRUN_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
3 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
4 extern "C" { |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
5 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
6 |
| 145 | 7 /*********************************************************** |
| 2058 | 8 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, |
| 9 The Netherlands. | |
| 145 | 10 |
| 11 All Rights Reserved | |
| 12 | |
|
4503
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3583
diff
changeset
|
13 Permission to use, copy, modify, and distribute this software and its |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3583
diff
changeset
|
14 documentation for any purpose and without fee is hereby granted, |
| 145 | 15 provided that the above copyright notice appear in all copies and that |
|
4503
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3583
diff
changeset
|
16 both that copyright notice and this permission notice appear in |
| 145 | 17 supporting documentation, and that the names of Stichting Mathematisch |
|
4503
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3583
diff
changeset
|
18 Centrum or CWI or Corporation for National Research Initiatives or |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3583
diff
changeset
|
19 CNRI not be used in advertising or publicity pertaining to |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3583
diff
changeset
|
20 distribution of the software without specific, written prior |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3583
diff
changeset
|
21 permission. |
| 145 | 22 |
|
4503
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3583
diff
changeset
|
23 While CWI is the initial source for this software, a modified version |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3583
diff
changeset
|
24 is made available by the Corporation for National Research Initiatives |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3583
diff
changeset
|
25 (CNRI) at the Internet address ftp://ftp.python.org. |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3583
diff
changeset
|
26 |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3583
diff
changeset
|
27 STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3583
diff
changeset
|
28 REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3583
diff
changeset
|
29 MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3583
diff
changeset
|
30 CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3583
diff
changeset
|
31 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3583
diff
changeset
|
32 PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3583
diff
changeset
|
33 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3583
diff
changeset
|
34 PERFORMANCE OF THIS SOFTWARE. |
| 145 | 35 |
| 36 ******************************************************************/ | |
| 37 | |
| 86 | 38 /* Interfaces to parse and execute pieces of python code */ |
| 39 | |
|
5862
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
40 void Py_SetProgramName Py_PROTO((char *)); |
|
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
41 char *Py_GetProgramName Py_PROTO((void)); |
|
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
42 |
|
7208
ce271e5f9bc5
- Add Py_GetPythonHome() and Py_SetPythonHome(), intended to allow
Guido van Rossum <guido@python.org>
parents:
6192
diff
changeset
|
43 void Py_SetPythonHome Py_PROTO((char *)); |
|
ce271e5f9bc5
- Add Py_GetPythonHome() and Py_SetPythonHome(), intended to allow
Guido van Rossum <guido@python.org>
parents:
6192
diff
changeset
|
44 char *Py_GetPythonHome Py_PROTO((void)); |
|
ce271e5f9bc5
- Add Py_GetPythonHome() and Py_SetPythonHome(), intended to allow
Guido van Rossum <guido@python.org>
parents:
6192
diff
changeset
|
45 |
|
2129
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2058
diff
changeset
|
46 void Py_Initialize Py_PROTO((void)); |
|
5984
b4bbba3af4e8
Added prototype for various finalizers.
Guido van Rossum <guido@python.org>
parents:
5919
diff
changeset
|
47 void Py_Finalize Py_PROTO((void)); |
|
6136
57045f51dd12
Added new Py_IsInitalized() API function to test the 'initialized' flag.
Guido van Rossum <guido@python.org>
parents:
5986
diff
changeset
|
48 int Py_IsInitialized Py_PROTO((void)); |
|
5919
5da18e002b1a
Mass checkin (more to follow for other directories).
Guido van Rossum <guido@python.org>
parents:
5862
diff
changeset
|
49 PyThreadState *Py_NewInterpreter Py_PROTO((void)); |
|
5da18e002b1a
Mass checkin (more to follow for other directories).
Guido van Rossum <guido@python.org>
parents:
5862
diff
changeset
|
50 void Py_EndInterpreter Py_PROTO((PyThreadState *)); |
| 86 | 51 |
|
2129
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2058
diff
changeset
|
52 int PyRun_AnyFile Py_PROTO((FILE *, char *)); |
| 86 | 53 |
|
2129
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2058
diff
changeset
|
54 int PyRun_SimpleString Py_PROTO((char *)); |
|
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2058
diff
changeset
|
55 int PyRun_SimpleFile Py_PROTO((FILE *, char *)); |
|
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2058
diff
changeset
|
56 int PyRun_InteractiveOne Py_PROTO((FILE *, char *)); |
|
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2058
diff
changeset
|
57 int PyRun_InteractiveLoop Py_PROTO((FILE *, char *)); |
| 86 | 58 |
|
2129
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2058
diff
changeset
|
59 struct _node *PyParser_SimpleParseString Py_PROTO((char *, int)); |
|
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2058
diff
changeset
|
60 struct _node *PyParser_SimpleParseFile Py_PROTO((FILE *, char *, int)); |
| 86 | 61 |
|
2129
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2058
diff
changeset
|
62 PyObject *PyRun_String Py_PROTO((char *, int, PyObject *, PyObject *)); |
|
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2058
diff
changeset
|
63 PyObject *PyRun_File Py_PROTO((FILE *, char *, int, PyObject *, PyObject *)); |
| 86 | 64 |
|
2129
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2058
diff
changeset
|
65 PyObject *Py_CompileString Py_PROTO((char *, char *, int)); |
|
1263
65a1e4e9cd54
* Fixed some subtleties with fastlocals. You can no longer access
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
66 |
|
2129
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2058
diff
changeset
|
67 void PyErr_Print Py_PROTO((void)); |
|
7208
ce271e5f9bc5
- Add Py_GetPythonHome() and Py_SetPythonHome(), intended to allow
Guido van Rossum <guido@python.org>
parents:
6192
diff
changeset
|
68 void PyErr_PrintEx Py_PROTO((int)); |
| 86 | 69 |
|
2129
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2058
diff
changeset
|
70 int Py_AtExit Py_PROTO((void (*func) Py_PROTO((void)))); |
|
1868
63ad28939781
pythgonrun.h: added Py_AtExit().
Guido van Rossum <guido@python.org>
parents:
1746
diff
changeset
|
71 |
|
2129
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2058
diff
changeset
|
72 void Py_Exit Py_PROTO((int)); |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
73 |
|
5111
21b871325c85
Added decl for Py_FdIsInteractive.
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
74 int Py_FdIsInteractive Py_PROTO((FILE *, char *)); |
|
21b871325c85
Added decl for Py_FdIsInteractive.
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
75 |
|
5862
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
76 /* In getpath.c */ |
|
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
77 char *Py_GetProgramFullPath Py_PROTO((void)); |
|
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
78 char *Py_GetPrefix Py_PROTO((void)); |
|
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
79 char *Py_GetExecPrefix Py_PROTO((void)); |
|
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
80 char *Py_GetPath Py_PROTO((void)); |
|
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
81 |
|
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
82 /* In their own files */ |
|
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
83 const char *Py_GetVersion Py_PROTO((void)); |
|
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
84 const char *Py_GetPlatform Py_PROTO((void)); |
|
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
85 const char *Py_GetCopyright Py_PROTO((void)); |
|
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
86 const char *Py_GetCompiler Py_PROTO((void)); |
|
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
87 const char *Py_GetBuildInfo Py_PROTO((void)); |
|
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
88 |
|
5919
5da18e002b1a
Mass checkin (more to follow for other directories).
Guido van Rossum <guido@python.org>
parents:
5862
diff
changeset
|
89 /* Internal -- various one-time initializations */ |
|
5da18e002b1a
Mass checkin (more to follow for other directories).
Guido van Rossum <guido@python.org>
parents:
5862
diff
changeset
|
90 |
|
6192
12b8a43599d3
Declarations for two phase initialization and finalization functions
Barry Warsaw <barry@python.org>
parents:
6136
diff
changeset
|
91 PyObject *_PyBuiltin_Init_1 Py_PROTO((void)); |
|
12b8a43599d3
Declarations for two phase initialization and finalization functions
Barry Warsaw <barry@python.org>
parents:
6136
diff
changeset
|
92 void _PyBuiltin_Init_2 Py_PROTO((PyObject *)); |
|
5919
5da18e002b1a
Mass checkin (more to follow for other directories).
Guido van Rossum <guido@python.org>
parents:
5862
diff
changeset
|
93 PyObject *_PySys_Init Py_PROTO((void)); |
|
5da18e002b1a
Mass checkin (more to follow for other directories).
Guido van Rossum <guido@python.org>
parents:
5862
diff
changeset
|
94 void _PyImport_Init Py_PROTO((void)); |
|
5da18e002b1a
Mass checkin (more to follow for other directories).
Guido van Rossum <guido@python.org>
parents:
5862
diff
changeset
|
95 |
|
5984
b4bbba3af4e8
Added prototype for various finalizers.
Guido van Rossum <guido@python.org>
parents:
5919
diff
changeset
|
96 /* Various internal finalizers */ |
|
b4bbba3af4e8
Added prototype for various finalizers.
Guido van Rossum <guido@python.org>
parents:
5919
diff
changeset
|
97 void _PyImport_Fini Py_PROTO((void)); |
|
6192
12b8a43599d3
Declarations for two phase initialization and finalization functions
Barry Warsaw <barry@python.org>
parents:
6136
diff
changeset
|
98 void _PyBuiltin_Fini_1 Py_PROTO((void)); |
|
12b8a43599d3
Declarations for two phase initialization and finalization functions
Barry Warsaw <barry@python.org>
parents:
6136
diff
changeset
|
99 void _PyBuiltin_Fini_2 Py_PROTO((void)); |
|
5984
b4bbba3af4e8
Added prototype for various finalizers.
Guido van Rossum <guido@python.org>
parents:
5919
diff
changeset
|
100 void PyMethod_Fini Py_PROTO((void)); |
|
b4bbba3af4e8
Added prototype for various finalizers.
Guido van Rossum <guido@python.org>
parents:
5919
diff
changeset
|
101 void PyFrame_Fini Py_PROTO((void)); |
|
b4bbba3af4e8
Added prototype for various finalizers.
Guido van Rossum <guido@python.org>
parents:
5919
diff
changeset
|
102 void PyCFunction_Fini Py_PROTO((void)); |
|
b4bbba3af4e8
Added prototype for various finalizers.
Guido van Rossum <guido@python.org>
parents:
5919
diff
changeset
|
103 void PyTuple_Fini Py_PROTO((void)); |
|
b4bbba3af4e8
Added prototype for various finalizers.
Guido van Rossum <guido@python.org>
parents:
5919
diff
changeset
|
104 void PyString_Fini Py_PROTO((void)); |
|
b4bbba3af4e8
Added prototype for various finalizers.
Guido van Rossum <guido@python.org>
parents:
5919
diff
changeset
|
105 void PyInt_Fini Py_PROTO((void)); |
|
b4bbba3af4e8
Added prototype for various finalizers.
Guido van Rossum <guido@python.org>
parents:
5919
diff
changeset
|
106 void PyFloat_Fini Py_PROTO((void)); |
|
b4bbba3af4e8
Added prototype for various finalizers.
Guido van Rossum <guido@python.org>
parents:
5919
diff
changeset
|
107 void PyOS_FiniInterrupts Py_PROTO((void)); |
|
b4bbba3af4e8
Added prototype for various finalizers.
Guido van Rossum <guido@python.org>
parents:
5919
diff
changeset
|
108 |
|
5986
32127593c134
Added decls for stuff from myreadline.
Guido van Rossum <guido@python.org>
parents:
5984
diff
changeset
|
109 /* Stuff with no proper home (yet) */ |
|
32127593c134
Added decls for stuff from myreadline.
Guido van Rossum <guido@python.org>
parents:
5984
diff
changeset
|
110 char *PyOS_Readline Py_PROTO((char *)); |
|
32127593c134
Added decls for stuff from myreadline.
Guido van Rossum <guido@python.org>
parents:
5984
diff
changeset
|
111 extern DL_IMPORT(int) (*PyOS_InputHook) Py_PROTO((void)); |
|
32127593c134
Added decls for stuff from myreadline.
Guido van Rossum <guido@python.org>
parents:
5984
diff
changeset
|
112 extern DL_IMPORT(char) *(*PyOS_ReadlineFunctionPointer) Py_PROTO((char *)); |
|
32127593c134
Added decls for stuff from myreadline.
Guido van Rossum <guido@python.org>
parents:
5984
diff
changeset
|
113 |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
114 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
115 } |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
116 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
117 #endif /* !Py_PYTHONRUN_H */ |
