Add support for > and >> prompts with new readline

This commit is contained in:
2023-05-18 22:09:54 -04:00
parent eb43c99f47
commit d3c4c0801d
9 changed files with 47 additions and 9 deletions

View File

@@ -126,6 +126,10 @@ SharedChannel DrivenEngine::get_stdio_channel() {
return stdio_channel_;
}
void DrivenEngine::set_console_prompt(const eng::string &prompt) {
console_prompt_ = prompt;
}
util::LuaSourcePtr DrivenEngine::get_lua_source() {
return std::move(lua_source_);
}
@@ -382,6 +386,11 @@ bool DrivenEngine::drv_get_outgoing_empty(uint32_t chid) const {
return (v.size() == 0);
}
void DrivenEngine::drv_get_console_prompt(uint32_t *len, const char **data) const {
*len = console_prompt_.size();
*data = console_prompt_.c_str();
}
double DrivenEngine::drv_get_clock() const {
return clock_;
}
@@ -497,6 +506,10 @@ static bool drv_get_outgoing_empty(EngineWrapper *w, uint32_t chid) {
return w->engine->drv_get_outgoing_empty(chid);
}
static void drv_get_console_prompt(EngineWrapper *w, uint32_t *len, const char **data) {
return w->engine->drv_get_console_prompt(len, data);
}
static double drv_get_clock(EngineWrapper *w) {
return w->engine->drv_get_clock();
}
@@ -906,6 +919,7 @@ static void init_engine_wrapper_helper(EngineWrapper *w) {
w->get_channel_released = drv_get_channel_released;
w->get_outgoing = drv_get_outgoing;
w->get_outgoing_empty = drv_get_outgoing_empty;
w->get_console_prompt = drv_get_console_prompt;
w->get_clock = drv_get_clock;
w->get_rescan_lua_source = drv_get_rescan_lua_source;
w->get_stop_driver = drv_get_stop_driver;