aboutsummaryrefslogtreecommitdiff
path: root/src/lua.c
diff options
context:
space:
mode:
authorame <[email protected]>2026-06-12 00:56:21 -0500
committerame <[email protected]>2026-06-12 00:56:21 -0500
commit4ecdd3c18ccc5d3bcaa82ed720bf28443aa0ca9d (patch)
tree0c263f51545c664dd1d818cf63f6912ef0e73837 /src/lua.c
parent66aedfd65cff3494b70e8072646094479e3bfed8 (diff)
http body parsing rewrite
Diffstat (limited to 'src/lua.c')
-rw-r--r--src/lua.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lua.c b/src/lua.c
index 2c9692f..212f7c4 100644
--- a/src/lua.c
+++ b/src/lua.c
@@ -14,6 +14,16 @@ int luaI_nothing(lua_State* L){
return 0;
}
+void luaI_fromparray(lua_State* L, int table_idx, parray_t* table, int strval){
+ for(int i = 0; i != table->len; i++){
+ if(table->P[i].value == NULL) lua_pushboolean(L, 1);
+ else if(strval) lua_pushlstring(L, ((str*)table->P[i].value)->c, ((str*)table->P[i].value)->len);
+ else lua_pushstring(L, (char*)table->P[i].value);
+
+ lua_setfield(L, table_idx, table->P[i].key->c);
+ }
+}
+
int luaI_lowercase_index(lua_State* L){
if(lua_type(L, 2) == LUA_TSTRING){
str* s = str_init(lua_tostring(L, 2));