> > while (lua_next(L, -2) != 0) {
> > + int header_type = lua_type(L, -1);
> > + if (header_type != LUA_TSTRING) {
>
> 2. Why so complex instead of just lua_isstring()?
It is not quite same. lua_isstring() accepts numbers as well as strings.