Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / src / nas,5.n2.os.2 / lib / python / include / python2.4 / frameobject.h
CommitLineData
86530b38
AT
1#ifndef Py_FRAMEOBJECT_H
2#define Py_FRAMEOBJECT_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7typedef struct {
8 int b_type; /* what kind of block this is */
9 int b_handler; /* where to jump to find handler */
10 int b_level; /* value stack level to pop to */
11} PyTryBlock;
12
13typedef struct _frame {
14 PyObject_VAR_HEAD
15 struct _frame *f_back; /* previous frame, or NULL */
16 PyCodeObject *f_code; /* code segment */
17 PyObject *f_builtins; /* builtin symbol table (PyDictObject) */
18 PyObject *f_globals; /* global symbol table (PyDictObject) */
19 PyObject *f_locals; /* local symbol table (any mapping) */
20 PyObject **f_valuestack; /* points after the last local */
21 /* Next free slot in f_valuestack. Frame creation sets to f_valuestack.
22 Frame evaluation usually NULLs it, but a frame that yields sets it
23 to the current stack top. */
24 PyObject **f_stacktop;
25 PyObject *f_trace; /* Trace function */
26 PyObject *f_exc_type, *f_exc_value, *f_exc_traceback;
27 PyThreadState *f_tstate;
28 int f_lasti; /* Last instruction if called */
29 /* As of 2.3 f_lineno is only valid when tracing is active (i.e. when
30 f_trace is set) -- at other times use PyCode_Addr2Line instead. */
31 int f_lineno; /* Current line number */
32 int f_restricted; /* Flag set if restricted operations
33 in this scope */
34 int f_iblock; /* index in f_blockstack */
35 PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */
36 int f_nlocals; /* number of locals */
37 int f_ncells;
38 int f_nfreevars;
39 int f_stacksize; /* size of value stack */
40 PyObject *f_localsplus[1]; /* locals+stack, dynamically sized */
41} PyFrameObject;
42
43
44/* Standard object interface */
45
46PyAPI_DATA(PyTypeObject) PyFrame_Type;
47
48#define PyFrame_Check(op) ((op)->ob_type == &PyFrame_Type)
49
50PyAPI_FUNC(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *,
51 PyObject *, PyObject *);
52
53
54/* The rest of the interface is specific for frame objects */
55
56/* Block management functions */
57
58PyAPI_FUNC(void) PyFrame_BlockSetup(PyFrameObject *, int, int, int);
59PyAPI_FUNC(PyTryBlock *) PyFrame_BlockPop(PyFrameObject *);
60
61/* Extend the value stack */
62
63PyAPI_FUNC(PyObject **) PyFrame_ExtendStack(PyFrameObject *, int, int);
64
65/* Conversions between "fast locals" and locals in dictionary */
66
67PyAPI_FUNC(void) PyFrame_LocalsToFast(PyFrameObject *, int);
68PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *);
69
70#ifdef __cplusplus
71}
72#endif
73#endif /* !Py_FRAMEOBJECT_H */