1616#include < string>
1717#include < vector>
1818
19- #include < xtl /xsystem.hpp>
19+ #include " xeus /xsystem.hpp"
2020
2121#include < xeus/xhelper.hpp>
2222
@@ -127,27 +127,27 @@ __get_cxx_version ()
127127 restore_output ();
128128 }
129129
130- nl::json interpreter::execute_request_impl (
131- int /* execution_counter*/ ,
130+ void interpreter::execute_request_impl (
131+ send_reply_callback cb,
132+ int /* execution_count*/ ,
132133 const std::string& code,
133- bool silent,
134- bool /* store_history*/ ,
135- nl::json /* user_expressions*/ ,
136- bool allow_stdin
134+ xeus::execute_request_config config,
135+ nl::json /* user_expressions*/
137136 )
138137 {
139138 nl::json kernel_res;
140139
141140
142- auto input_guard = input_redirection (allow_stdin);
141+ auto input_guard = input_redirection (config. allow_stdin );
143142
144143 // Check for magics
145144 for (auto & pre : preamble_manager.preamble )
146145 {
147146 if (pre .second .is_match (code))
148147 {
149148 pre .second .apply (code, kernel_res);
150- return kernel_res;
149+ cb (kernel_res);
150+ return ;
151151 }
152152 }
153153
@@ -162,7 +162,7 @@ __get_cxx_version ()
162162 auto cout_strbuf = std::cout.rdbuf ();
163163 auto cerr_strbuf = std::cerr.rdbuf ();
164164
165- if (silent)
165+ if (config. silent )
166166 {
167167 auto null = xnull ();
168168 std::cout.rdbuf (&null);
@@ -202,7 +202,7 @@ __get_cxx_version ()
202202 std::cerr << std::flush;
203203
204204 // Reset non-silent output buffers
205- if (silent)
205+ if (config. silent )
206206 {
207207 std::cout.rdbuf (cout_strbuf);
208208 std::cerr.rdbuf (cerr_strbuf);
@@ -221,7 +221,7 @@ __get_cxx_version ()
221221 ename = " " ;
222222 }
223223 std::vector<std::string> traceback ({ename + evalue});
224- if (!silent)
224+ if (!config. silent )
225225 {
226226 publish_execution_error (ename, evalue, traceback);
227227 }
@@ -237,7 +237,7 @@ __get_cxx_version ()
237237 /*
238238 // Publish a mime bundle for the last return value if
239239 // the semicolon was omitted.
240- if (!silent && output.hasValue() && trim(code).back() != ';')
240+ if (!config. silent && output.hasValue() && trim(code).back() != ';')
241241 {
242242 nl::json pub_data = mime_repr(output);
243243 publish_execution_result(execution_counter, std::move(pub_data), nl::json::object());
@@ -248,7 +248,7 @@ __get_cxx_version ()
248248 kernel_res[" payload" ] = nl::json::array ();
249249 kernel_res[" user_expressions" ] = nl::json::object ();
250250 }
251- return kernel_res;
251+ cb ( kernel_res) ;
252252 }
253253
254254 nl::json interpreter::complete_request_impl (const std::string& code, int cursor_pos)
@@ -387,7 +387,7 @@ __get_cxx_version ()
387387
388388 void interpreter::init_includes ()
389389 {
390- Cpp::AddIncludePath ((xtl ::prefix_path () + " /include/" ).c_str ());
390+ Cpp::AddIncludePath ((xeus ::prefix_path () + " /include/" ).c_str ());
391391 }
392392
393393 void interpreter::init_preamble ()
0 commit comments