2017-01-31 19:34:30 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <common/config_common.h>
|
|
|
|
|
|
|
|
/// 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>
|
|
|
|
#include <editline/history.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());
|
|
|
|
}
|
|
|
|
#define add_history(...) do {} while (0);
|
|
|
|
#define rl_bind_key(...) do {} while (0);
|
2017-01-31 19:34:30 +00:00
|
|
|
#endif
|