7 /***********************************************************
8 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
13 Permission to use, copy, modify, and distribute this software and its
14 documentation for any purpose and without fee is hereby granted,
15 provided that the above copyright notice appear in all copies and that
16 both that copyright notice and this permission notice appear in
17 supporting documentation, and that the names of Stichting Mathematisch
18 Centrum or CWI or Corporation for National Research Initiatives or
19 CNRI not be used in advertising or publicity pertaining to
20 distribution of the software without specific, written prior
23 While CWI is the initial source for this software, a modified version
24 is made available by the Corporation for National Research Initiatives
25 (CNRI) at the Internet address ftp://ftp.python.org.
27 STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
28 REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
29 MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
30 CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
31 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
32 PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
33 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
34 PERFORMANCE OF THIS SOFTWARE.
36 ******************************************************************/
38 /* Thread and interpreter state structures and their interfaces */
41 /* State shared between threads */
43 struct _ts
; /* Forward */
44 struct _is
; /* Forward */
49 struct _ts
*tstate_head
;
60 /* State unique per thread */
62 struct _frame
; /* Avoid including frameobject.h */
67 PyInterpreterState
*interp
;
74 PyObject
*sys_profilefunc
;
75 PyObject
*sys_tracefunc
;
77 PyObject
*curexc_type
;
78 PyObject
*curexc_value
;
79 PyObject
*curexc_traceback
;
83 PyObject
*exc_traceback
;
87 /* XXX signal handlers should also be here */
92 DL_IMPORT(PyInterpreterState
*) PyInterpreterState_New
Py_PROTO((void));
93 DL_IMPORT(void) PyInterpreterState_Clear
Py_PROTO((PyInterpreterState
*));
94 DL_IMPORT(void) PyInterpreterState_Delete
Py_PROTO((PyInterpreterState
*));
96 DL_IMPORT(PyThreadState
*) PyThreadState_New
Py_PROTO((PyInterpreterState
*));
97 DL_IMPORT(void) PyThreadState_Clear
Py_PROTO((PyThreadState
*));
98 DL_IMPORT(void) PyThreadState_Delete
Py_PROTO((PyThreadState
*));
100 DL_IMPORT(PyThreadState
*) PyThreadState_Get
Py_PROTO((void));
101 DL_IMPORT(PyThreadState
*) PyThreadState_Swap
Py_PROTO((PyThreadState
*));
102 DL_IMPORT(PyObject
*) PyThreadState_GetDict
Py_PROTO((void));
105 /* Variable and macro for in-line access to current thread state */
107 extern DL_IMPORT(PyThreadState
*) _PyThreadState_Current
;
110 #define PyThreadState_GET() PyThreadState_Get()
112 #define PyThreadState_GET() (_PyThreadState_Current)
118 #endif /* !Py_PYSTATE_H */