Guido van Rossum | f70e43a | 1991-02-19 12:39:46 +0000 | [diff] [blame] | 1 | |
Fred Drake | 5eb6d4e | 2000-07-08 23:37:28 +0000 | [diff] [blame] | 2 | #ifndef Py_TRACEBACK_H |
| 3 | #define Py_TRACEBACK_H |
| 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
Nicholas Bastin | a7604bf | 2004-03-21 18:37:23 +0000 | [diff] [blame] | 8 | struct _frame; |
| 9 | |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 10 | /* Traceback interface */ |
| 11 | |
Nicholas Bastin | a7604bf | 2004-03-21 18:37:23 +0000 | [diff] [blame] | 12 | typedef struct _traceback { |
Victor Stinner | 25bb0fd | 2010-06-17 23:23:37 +0000 | [diff] [blame] | 13 | PyObject_HEAD |
| 14 | struct _traceback *tb_next; |
| 15 | struct _frame *tb_frame; |
| 16 | int tb_lasti; |
| 17 | int tb_lineno; |
Nicholas Bastin | a7604bf | 2004-03-21 18:37:23 +0000 | [diff] [blame] | 18 | } PyTracebackObject; |
Guido van Rossum | 66cb311 | 1994-12-30 15:33:50 +0000 | [diff] [blame] | 19 | |
Mark Hammond | 91a681d | 2002-08-12 07:21:58 +0000 | [diff] [blame] | 20 | PyAPI_FUNC(int) PyTraceBack_Here(struct _frame *); |
| 21 | PyAPI_FUNC(int) PyTraceBack_Print(PyObject *, PyObject *); |
Victor Stinner | 25bb0fd | 2010-06-17 23:23:37 +0000 | [diff] [blame] | 22 | PyAPI_FUNC(int) _Py_DisplaySourceLine(PyObject *, PyObject *, int, int); |
Guido van Rossum | a330996 | 1993-07-28 09:05:47 +0000 | [diff] [blame] | 23 | |
Andrew M. Kuchling | 913b907 | 2002-03-19 16:02:35 +0000 | [diff] [blame] | 24 | /* Reveal traceback type so we can typecheck traceback objects */ |
Mark Hammond | 91a681d | 2002-08-12 07:21:58 +0000 | [diff] [blame] | 25 | PyAPI_DATA(PyTypeObject) PyTraceBack_Type; |
Christian Heimes | 90aa764 | 2007-12-19 02:45:37 +0000 | [diff] [blame] | 26 | #define PyTraceBack_Check(v) (Py_TYPE(v) == &PyTraceBack_Type) |
Guido van Rossum | 884afd6 | 1995-07-18 14:21:06 +0000 | [diff] [blame] | 27 | |
Guido van Rossum | a330996 | 1993-07-28 09:05:47 +0000 | [diff] [blame] | 28 | #ifdef __cplusplus |
| 29 | } |
| 30 | #endif |
| 31 | #endif /* !Py_TRACEBACK_H */ |