mirror of
https://github.com/johndoe6345789/typthon.git
synced 2026-04-24 13:45:05 +00:00
Massive automated renaming of all Py_/PyObject/etc. prefixes to Ty_/TyObject/etc. This includes: - All public API types (TyObject, TyTypeObject, etc.) - All public API functions (Ty_Initialize, Ty_BuildValue, etc.) - All internal API (_Ty_ prefixes) - Reference counting macros (Ty_INCREF, Ty_DECREF, etc.) - Type flags (Ty_TPFLAGS_*) - Debug flags (Ty_DEBUG, Ty_TRACE_REFS, etc.) - All object type APIs (TyList_, TyDict_, TyUnicode_, etc.) This changes over 60,000 occurrences across 1000+ files. Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
62 lines
2.0 KiB
C
62 lines
2.0 KiB
C
/* See InternalDocs/frames.md for an explanation of the frame stack
|
|
* including explanation of the PyFrameObject and _PyInterpreterFrame
|
|
* structs. */
|
|
|
|
#ifndef Ty_INTERNAL_FRAME_H
|
|
#define Ty_INTERNAL_FRAME_H
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#ifndef Ty_BUILD_CORE
|
|
# error "this header requires Ty_BUILD_CORE define"
|
|
#endif
|
|
|
|
#include "pycore_typedefs.h" // _PyInterpreterFrame
|
|
|
|
|
|
struct _frame {
|
|
PyObject_HEAD
|
|
PyFrameObject *f_back; /* previous frame, or NULL */
|
|
_PyInterpreterFrame *f_frame; /* points to the frame data */
|
|
TyObject *f_trace; /* Trace function */
|
|
int f_lineno; /* Current line number. Only valid if non-zero */
|
|
char f_trace_lines; /* Emit per-line trace events? */
|
|
char f_trace_opcodes; /* Emit per-opcode trace events? */
|
|
TyObject *f_extra_locals; /* Dict for locals set by users using f_locals, could be NULL */
|
|
/* This is purely for backwards compatibility for TyEval_GetLocals.
|
|
TyEval_GetLocals requires a borrowed reference so the actual reference
|
|
is stored here */
|
|
TyObject *f_locals_cache;
|
|
/* A tuple containing strong references to fast locals that were overwritten
|
|
* via f_locals. Borrowed references to these locals may exist in frames
|
|
* closer to the top of the stack. The references in this tuple act as
|
|
* "support" for the borrowed references, ensuring that they remain valid.
|
|
*/
|
|
TyObject *f_overwritten_fast_locals;
|
|
/* The frame data, if this frame object owns the frame */
|
|
TyObject *_f_frame_data[1];
|
|
};
|
|
|
|
extern PyFrameObject* _TyFrame_New_NoTrack(PyCodeObject *code);
|
|
|
|
|
|
/* other API */
|
|
|
|
typedef enum _framestate {
|
|
FRAME_CREATED = -3,
|
|
FRAME_SUSPENDED = -2,
|
|
FRAME_SUSPENDED_YIELD_FROM = -1,
|
|
FRAME_EXECUTING = 0,
|
|
FRAME_COMPLETED = 1,
|
|
FRAME_CLEARED = 4
|
|
} PyFrameState;
|
|
|
|
#define FRAME_STATE_SUSPENDED(S) ((S) == FRAME_SUSPENDED || (S) == FRAME_SUSPENDED_YIELD_FROM)
|
|
#define FRAME_STATE_FINISHED(S) ((S) >= FRAME_COMPLETED)
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* !Ty_INTERNAL_FRAME_H */
|