mirror of https://github.com/djcb/mu.git
server: reinstate readline support (when available)
This commit is contained in:
parent
17f38dc4c2
commit
f0a0c3ad46
|
@ -30,20 +30,31 @@
|
||||||
#include <glib/gprintf.h>
|
#include <glib/gprintf.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBREADLINE
|
#ifdef HAVE_LIBREADLINE
|
||||||
#if defined(HAVE_READLINE_READLINE_H)
|
# if defined(HAVE_READLINE_READLINE_H)
|
||||||
#include <readline/readline.h>
|
# include <readline/readline.h>
|
||||||
#elif defined(HAVE_READLINE_H)
|
# elif defined(HAVE_READLINE_H)
|
||||||
#include <readline.h>
|
# include <readline.h>
|
||||||
# endif /* !defined(HAVE_READLINE_H) */
|
# else /* !defined(HAVE_READLINE_H) */
|
||||||
|
extern char *readline ();
|
||||||
|
# endif /* !defined(HAVE_READLINE_H) */
|
||||||
|
char *cmdline = NULL;
|
||||||
|
#else /* !defined(HAVE_READLINE_READLINE_H) */
|
||||||
|
/* no readline */
|
||||||
#endif /* HAVE_LIBREADLINE */
|
#endif /* HAVE_LIBREADLINE */
|
||||||
|
|
||||||
#ifdef HAVE_READLINE_HISTORY
|
#ifdef HAVE_READLINE_HISTORY
|
||||||
#if defined(HAVE_READLINE_HISTORY_H)
|
# if defined(HAVE_READLINE_HISTORY_H)
|
||||||
#include <readline/history.h>
|
# include <readline/history.h>
|
||||||
#elif defined(HAVE_HISTORY_H)
|
# elif defined(HAVE_HISTORY_H)
|
||||||
#include <history.h>
|
# include <history.h>
|
||||||
#endif
|
# else /* !defined(HAVE_HISTORY_H) */
|
||||||
#endif
|
extern void add_history ();
|
||||||
|
extern int write_history ();
|
||||||
|
extern int read_history ();
|
||||||
|
# endif /* defined(HAVE_READLINE_HISTORY_H) */
|
||||||
|
/* no history */
|
||||||
|
#endif /* HAVE_READLINE_HISTORY */
|
||||||
|
|
||||||
|
|
||||||
#include "mu-runtime.h"
|
#include "mu-runtime.h"
|
||||||
#include "mu-cmd.h"
|
#include "mu-cmd.h"
|
||||||
|
@ -1295,7 +1306,7 @@ struct Readline {
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Wrapper around readline (if available) or nothing otherwise.
|
/// Wrapper around readline (if available) or nothing otherwise.
|
||||||
#if defined(HAVE_LIBREADLINE) && defined(HAVE_READLINE_HISTORY) && defined(HAVE_READLINE_H)
|
#if defined(HAVE_LIBREADLINE) && defined(HAVE_READLINE_HISTORY)
|
||||||
Readline::Readline (const std::string& histpath, size_t max_lines):
|
Readline::Readline (const std::string& histpath, size_t max_lines):
|
||||||
histpath_{histpath}, max_lines_{max_lines}
|
histpath_{histpath}, max_lines_{max_lines}
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue