Commit b4069ea9 authored by Boxiang Sun's avatar Boxiang Sun

add some help function to frame object

parent 9db1f0cc
...@@ -149,6 +149,15 @@ Box* getFrame(int depth) { ...@@ -149,6 +149,15 @@ Box* getFrame(int depth) {
return BoxedFrame::boxFrame(std::move(it)); return BoxedFrame::boxFrame(std::move(it));
} }
extern "C" int PyFrame_GetLineNumber(Box* f) {
BoxedInt* lineno = (BoxedInt*)BoxedFrame::lineno(f, NULL);
return lineno->n;
}
extern "C" PyObject* PyFrame_GetGlobals(Box* f) {
return BoxedFrame::globals(f, NULL);
}
void setupFrame() { void setupFrame() {
frame_cls frame_cls
= BoxedClass::create(type_cls, object_cls, &BoxedFrame::gchandler, 0, 0, sizeof(BoxedFrame), false, "frame"); = BoxedClass::create(type_cls, object_cls, &BoxedFrame::gchandler, 0, 0, sizeof(BoxedFrame), false, "frame");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment