From 921bade0eb0289374f201f4e788b0b83fa7acaa9 Mon Sep 17 00:00:00 2001 From: ame Date: Tue, 23 Apr 2024 07:22:26 -0500 Subject: io stuff --- readme.md | 6 ++---- src/io.c | 9 +++++++++ src/net.c | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index ec31035..9be2615 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -build with `make`, output is `./llib.dll` +build with `make`, output is `./llib.so` or (win)`./llib.dll` windows works through msys2 @@ -10,9 +10,7 @@ todo: * finish up http server - * https - - * :serve() + * https * ~~check memory saftey~~ (*should* be good) (now work on indirect & more lifetime stuff) diff --git a/src/io.c b/src/io.c index 0440c1d..36561d1 100644 --- a/src/io.c +++ b/src/io.c @@ -1,4 +1,5 @@ #include +#include "lua5.4/lua.h" #include "types/str.h" #include "io.h" #include "stdlib.h" @@ -138,6 +139,14 @@ void i_pprint(lua_State* L, int indent, int skip_indent){ if(!skip_indent) print_indentation(indent); printf(color_yellow"(%p)"color_reset, lua_topointer(L, -1)); break; + case LUA_TUSERDATA: + if(!skip_indent) print_indentation(indent); + printf(color_yellow"(ud,%p)"color_reset, lua_touserdata(L,-1)); + break; + case LUA_TLIGHTUSERDATA: + if(!skip_indent) print_indentation(indent); + printf(color_yellow"(lud,%p)"color_reset, lua_topointer(L,-1)); + break; default: if(!skip_indent) print_indentation(indent); printf(color_yellow"%s"color_reset, lua_tostring(L,-1)); diff --git a/src/net.c b/src/net.c index fadad1c..14882f8 100644 --- a/src/net.c +++ b/src/net.c @@ -819,6 +819,7 @@ void* handle_client(void *_arg){ int res_idx = lua_gettop(L); //handle cookies + //TODO: enable and test with valgrind if(0 && sC != NULL){ lua_newtable(L); int lcookie = lua_gettop(L); -- cgit v1.2.3