diff options
| author | ame <[email protected]> | 2026-06-12 00:56:21 -0500 |
|---|---|---|
| committer | ame <[email protected]> | 2026-06-12 00:56:21 -0500 |
| commit | 4ecdd3c18ccc5d3bcaa82ed720bf28443aa0ca9d (patch) | |
| tree | 0c263f51545c664dd1d818cf63f6912ef0e73837 /src/lua.c | |
| parent | 66aedfd65cff3494b70e8072646094479e3bfed8 (diff) | |
http body parsing rewrite
Diffstat (limited to 'src/lua.c')
| -rw-r--r-- | src/lua.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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));
|
