2017-01-31 19:34:30 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-06-19 18:09:09 +00:00
|
|
|
#if __has_include(<common/config_common.h>)
|
2017-01-31 19:34:30 +00:00
|
|
|
#include <common/config_common.h>
|
2018-06-19 18:09:09 +00:00
|
|
|
#endif
|
2017-01-31 19:34:30 +00:00
|
|
|
|
|
|
|
/// Different line editing libraries can be used depending on the environment.
|
|
|
|
#if USE_READLINE
|
2017-04-01 07:20:54 +00:00
|
|
|
#include <readline/readline.h>
|
|
|
|
#include <readline/history.h>
|
2017-01-31 19:34:30 +00:00
|
|
|
#elif USE_LIBEDIT
|
2017-04-01 07:20:54 +00:00
|
|
|
#include <editline/readline.h>
|
2017-01-31 19:34:30 +00:00
|
|
|
#else
|
2017-04-01 07:20:54 +00:00
|
|
|
#include <string>
|
|
|
|
#include <cstring>
|
|
|
|
#include <iostream>
|
|
|
|
inline char * readline(const char * prompt)
|
|
|
|
{
|
|
|
|
std::string s;
|
|
|
|
std::cout << prompt;
|
|
|
|
std::getline(std::cin, s);
|
2017-01-31 19:34:30 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
if (!std::cin.good())
|
|
|
|
return nullptr;
|
|
|
|
return strdup(s.data());
|
|
|
|
}
|
2019-06-24 15:02:25 +00:00
|
|
|
#define add_history(...) do {} while (0)
|
|
|
|
#define rl_bind_key(...) do {} while (0)
|
2017-01-31 19:34:30 +00:00
|
|
|
#endif
|