1 Add support of linenoise (replace readline)
3 see discussion, http://lua-users.org/lists/lua-l/2010-03/msg00879.html
5 Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
8 ===================================================================
12 add_history(lua_tostring(L, idx)); /* add it to history */
13 #define lua_freeline(L,b) ((void)L, free(b))
15 +#elif defined(LUA_USE_LINENOISE)
17 +#include <linenoise.h>
18 +#define lua_readline(L,b,p) ((void)L, ((b)=linenoise(p)) != NULL)
19 +#define lua_saveline(L,idx) \
20 + if (lua_rawlen(L,idx) > 0) /* non-empty line? */ \
21 + linenoiseHistoryAdd(lua_tostring(L, idx)); /* add it to history */
22 +#define lua_freeline(L,b) ((void)L, free(b))
24 #elif !defined(lua_readline)
26 #define lua_readline(L,b,p) \