17#pragma comment(lib, "Ws2_32.lib")
18#define pipe(fds) _pipe(fds, 1048575, _O_BINARY)
23#define STDOUT_FILENO 1
24#define STDERR_FILENO 2
59#ifndef F_LINUX_SPECIFIC_BASE
60#define F_LINUX_SPECIFIC_BASE 1024
63#define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7)
74 char buffer[60000] =
"";
183 gInterpreter->ProcessLine(
"cerr << \"Unbalanced braces. This cell was not processed.\" << endl;");
185 }
catch (std::exception &
e) {
188 ::Error(
"JupyROOTExecutor",
"Exception caught!");
201 }
catch (std::exception &
e) {
204 ::Error(
"JupyROOTDeclarer",
"Exception caught!");
242 gInterpreter->ProcessLine(
"SetErrorHandler((ErrorHandlerFunc_t)&DefaultErrorHandler);");
PyObject * JupyROOTExecutorHandler_Ctor(PyObject *, PyObject *)
static void ReportCaughtException(const char *location, const std::exception &e)
PyObject * JupyROOTDeclarer(PyObject *, PyObject *args)
static void InitCaptureImpl(int &savedStdStream, int *pipeHandle, int FILENO)
JupyROOTExecutorHandler * JupyROOTExecutorHandler_ptr
constexpr long MAX_PIPE_SIZE
PyObject * JupyROOTExecutorHandler_GetStdout(PyObject *, PyObject *)
bool JupyROOTDeclarerImpl(const char *code)
static void PollImpl(FILE *stdStream, int *pipeHandle, std::string &pipeContent)
bool JupyROOTExecutorImpl(const char *code)
PyObject * JupyROOTExecutor(PyObject *, PyObject *args)
PyObject * JupyROOTExecutorHandler_EndCapture(PyObject *, PyObject *)
PyObject * JupyROOTExecutorHandler_Poll(PyObject *, PyObject *)
PyObject * JupyROOTExecutorHandler_Clear(PyObject *, PyObject *)
PyObject * JupyROOTExecutorHandler_GetStderr(PyObject *, PyObject *)
PyObject * JupyROOTExecutorHandler_InitCapture(PyObject *, PyObject *)
PyObject * JupyROOTExecutorHandler_Dtor(PyObject *, PyObject *)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
JupyROOTExecutorHandler()
std::string & GetStderr()
std::string & GetStdout()
char * DemangleTypeIdName(const std::type_info &ti, int &errorCode)
Demangle in a portable way the type id name.