2016-09-01 16:42:28 +00:00
|
|
|
#ifndef CS_REPL_HAS_EDIT
|
|
|
|
/* use nothing (no line editing support) */
|
|
|
|
|
2017-01-30 18:38:11 +00:00
|
|
|
#include <optional>
|
2021-03-20 07:22:15 +00:00
|
|
|
#include <string>
|
2016-09-01 16:42:28 +00:00
|
|
|
|
2021-03-23 22:29:32 +00:00
|
|
|
inline void init_lineedit(cs::state &, std::string_view) {
|
2016-09-01 16:42:28 +00:00
|
|
|
}
|
|
|
|
|
2021-04-05 17:52:13 +00:00
|
|
|
inline std::optional<std::string> read_line(cs::state &, cs::string_var &pr) {
|
2021-03-20 07:22:15 +00:00
|
|
|
std::string lbuf;
|
|
|
|
char buf[512];
|
2021-05-05 01:16:32 +00:00
|
|
|
printf("%s", pr.value().data());
|
2021-03-20 07:22:15 +00:00
|
|
|
std::fflush(stdout);
|
|
|
|
while (fgets(buf, sizeof(buf), stdin)) {
|
|
|
|
lbuf += static_cast<char const *>(buf);
|
|
|
|
if (strchr(buf, '\n')) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return std::move(lbuf);
|
2016-09-01 16:42:28 +00:00
|
|
|
}
|
|
|
|
|
2021-03-23 22:29:32 +00:00
|
|
|
inline void add_history(cs::state &, std::string_view) {
|
2016-09-01 16:42:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|