Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.8 KiB

  1. /* Frame object interface */
  2. #ifndef Py_FRAMEOBJECT_H
  3. #define Py_FRAMEOBJECT_H
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. typedef 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. typedef struct _frame {
  13. PyObject_VAR_HEAD
  14. struct _frame *f_back; /* previous frame, or NULL */
  15. PyCodeObject *f_code; /* code segment */
  16. PyObject *f_builtins; /* builtin symbol table (PyDictObject) */
  17. PyObject *f_globals; /* global symbol table (PyDictObject) */
  18. PyObject *f_locals; /* local symbol table (any mapping) */
  19. PyObject **f_valuestack; /* points after the last local */
  20. /* Next free slot in f_valuestack. Frame creation sets to f_valuestack.
  21. Frame evaluation usually NULLs it, but a frame that yields sets it
  22. to the current stack top. */
  23. PyObject **f_stacktop;
  24. PyObject *f_trace; /* Trace function */
  25. /* If an exception is raised in this frame, the next three are used to
  26. * record the exception info (if any) originally in the thread state. See
  27. * comments before set_exc_info() -- it's not obvious.
  28. * Invariant: if _type is NULL, then so are _value and _traceback.
  29. * Desired invariant: all three are NULL, or all three are non-NULL. That
  30. * one isn't currently true, but "should be".
  31. */
  32. PyObject *f_exc_type, *f_exc_value, *f_exc_traceback;
  33. PyThreadState *f_tstate;
  34. int f_lasti; /* Last instruction if called */
  35. /* As of 2.3 f_lineno is only valid when tracing is active (i.e. when
  36. f_trace is set) -- at other times use PyCode_Addr2Line instead. */
  37. int f_lineno; /* Current line number */
  38. int f_iblock; /* index in f_blockstack */
  39. PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */
  40. PyObject *f_localsplus[1]; /* locals+stack, dynamically sized */
  41. } PyFrameObject;
  42. /* Standard object interface */
  43. PyAPI_DATA(PyTypeObject) PyFrame_Type;
  44. #define PyFrame_Check(op) ((op)->ob_type == &PyFrame_Type)
  45. #define PyFrame_IsRestricted(f) \
  46. ((f)->f_builtins != (f)->f_tstate->interp->builtins)
  47. PyAPI_FUNC(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *,
  48. PyObject *, PyObject *);
  49. /* The rest of the interface is specific for frame objects */
  50. /* Block management functions */
  51. PyAPI_FUNC(void) PyFrame_BlockSetup(PyFrameObject *, int, int, int);
  52. PyAPI_FUNC(PyTryBlock *) PyFrame_BlockPop(PyFrameObject *);
  53. /* Extend the value stack */
  54. PyAPI_FUNC(PyObject **) PyFrame_ExtendStack(PyFrameObject *, int, int);
  55. /* Conversions between "fast locals" and locals in dictionary */
  56. PyAPI_FUNC(void) PyFrame_LocalsToFast(PyFrameObject *, int);
  57. PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *);
  58. #ifdef __cplusplus
  59. }
  60. #endif
  61. #endif /* !Py_FRAMEOBJECT_H */