diff options
| author | amelia squires <[email protected]> | 2024-09-08 05:13:11 -0500 |
|---|---|---|
| committer | amelia squires <[email protected]> | 2024-09-08 05:13:11 -0500 |
| commit | e9cb2e0f75cbfa6bde188b9e043ebfd8d30b9451 (patch) | |
| tree | 57368ce9ae49e89809171dc6ae85fde936a2b5f2 /src/test.c | |
| parent | 6ca752754556c44c485c4534b5f3453c7a1490c7 (diff) | |
| parent | ab5c24cd0eb59b704cf98d388338293db3768c81 (diff) | |
merge rewrite-net-route-matching
Diffstat (limited to 'src/test.c')
| -rw-r--r-- | src/test.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test.c b/src/test.c new file mode 100644 index 0000000..4408878 --- /dev/null +++ b/src/test.c @@ -0,0 +1,25 @@ +#include "test.h" +#include "net/util.h" +#include "types/parray.h" + +int ld_match(lua_State* L){ + parray_t* a = parray_init(); + int o = match_param(lua_tostring(L, 1), lua_tostring(L, 2), a); + + if(o == 0){ + lua_pushinteger(L, o); + return 1; + } + + lua_newtable(L); + int tidx = lua_gettop(L); + for(int i = 0; i != a->len; i++){ + //printf("%s:%s\n",a->P[i].key->c, (char*)a->P[i].value); + luaI_tsets(L, tidx, a->P[i].key->c, (char*)a->P[i].value); + } + + lua_pushinteger(L, o); + lua_pushvalue(L, tidx); + return 2; +} + |
