mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 19:40:18 +00:00
Update pocketpy.h
Update pocketpy.h
This commit is contained in:
parent
43f99dde5d
commit
d143564d82
@ -586,7 +586,6 @@ void __addModuleSys(VM* vm){
|
|||||||
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
__EXPORT
|
|
||||||
struct PyObjectDump: public PkExportedResource{
|
struct PyObjectDump: public PkExportedResource{
|
||||||
const char* type; // "int", "str", "float" ...
|
const char* type; // "int", "str", "float" ...
|
||||||
const char* json; // json representation
|
const char* json; // json representation
|
||||||
@ -602,7 +601,6 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
__EXPORT
|
|
||||||
struct PyOutputDump: public PkExportedResource{
|
struct PyOutputDump: public PkExportedResource{
|
||||||
const char* _stdout;
|
const char* _stdout;
|
||||||
const char* _stderr;
|
const char* _stderr;
|
||||||
@ -717,10 +715,10 @@ extern "C" {
|
|||||||
|
|
||||||
__EXPORT
|
__EXPORT
|
||||||
PyOutputDump* pkpy_vm_read_output(VM* vm){
|
PyOutputDump* pkpy_vm_read_output(VM* vm){
|
||||||
if(vm->use_stdio) UNREACHABLE();
|
if(vm->use_stdio) return nullptr;
|
||||||
_StrStream* s_out = dynamic_cast<_StrStream*>(vm->_stdout);
|
_StrStream* s_out = dynamic_cast<_StrStream*>(vm->_stdout);
|
||||||
_StrStream* s_err = dynamic_cast<_StrStream*>(vm->_stderr);
|
_StrStream* s_err = dynamic_cast<_StrStream*>(vm->_stderr);
|
||||||
if(s_out == nullptr || s_err == nullptr) UNREACHABLE();
|
if(s_out == nullptr || s_err == nullptr) return nullptr;
|
||||||
PyOutputDump* dump = new PyOutputDump(s_out->str(), s_err->str());
|
PyOutputDump* dump = new PyOutputDump(s_out->str(), s_err->str());
|
||||||
s_out->str("");
|
s_out->str("");
|
||||||
s_err->str("");
|
s_err->str("");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user