mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 06:48:31 +00:00
Ues linenoise in Lua, Python, and SQLite
This commit is contained in:
parent
fe29710e4e
commit
1e5bd4d23e
14 changed files with 230 additions and 303 deletions
8
third_party/lua/lua.main.c
vendored
8
third_party/lua/lua.main.c
vendored
|
@ -412,6 +412,14 @@ static int handle_luainit (lua_State *L) {
|
|||
#define lua_saveline(L,line) ((void)L, add_history(line))
|
||||
#define lua_freeline(L,b) ((void)L, free(b))
|
||||
|
||||
#elif defined(LUA_USE_LINENOISE)
|
||||
#include "third_party/linenoise/linenoise.h"
|
||||
|
||||
#define lua_initreadline(L) ((void)L)
|
||||
#define lua_readline(L,b,p) ((void)L, ((b)=linenoise(p)) != NULL)
|
||||
#define lua_saveline(L,line) ((void)L, linenoiseHistoryAdd(line))
|
||||
#define lua_freeline(L,b) ((void)L, free(b))
|
||||
|
||||
#else /* }{ */
|
||||
|
||||
#define lua_initreadline(L) ((void)L)
|
||||
|
|
1
third_party/lua/lua.mk
vendored
1
third_party/lua/lua.mk
vendored
|
@ -34,6 +34,7 @@ THIRD_PARTY_LUA_DIRECTDEPS = \
|
|||
LIBC_TIME \
|
||||
LIBC_TINYMATH \
|
||||
LIBC_UNICODE \
|
||||
THIRD_PARTY_LINENOISE \
|
||||
THIRD_PARTY_GDTOA
|
||||
|
||||
THIRD_PARTY_LUA_DEPS := \
|
||||
|
|
1
third_party/lua/luaconf.h
vendored
1
third_party/lua/luaconf.h
vendored
|
@ -7,6 +7,7 @@
|
|||
#include "third_party/gdtoa/gdtoa.h"
|
||||
|
||||
#define LUA_USE_POSIX
|
||||
#define LUA_USE_LINENOISE
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue