Trim down redbean a little bit

This makes redbean.c a little less long. It also reduces the size of
redbean-original.com from being 333K to 213K.
This commit is contained in:
Justine Tunney 2022-03-21 19:31:03 -07:00
parent 87029ac3f9
commit 5022f9e920
21 changed files with 999 additions and 669 deletions

23
third_party/lua/cosmo.h vendored Normal file
View file

@ -0,0 +1,23 @@
#ifndef COSMOPOLITAN_THIRD_PARTY_LUA_COSMO_H_
#define COSMOPOLITAN_THIRD_PARTY_LUA_COSMO_H_
#include "net/http/http.h"
#include "net/http/url.h"
#include "third_party/lua/lauxlib.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
char *LuaFormatStack(lua_State *) nodiscard;
int LuaCallWithTrace(lua_State *, int, int, lua_State *);
int LuaEncodeJsonData(lua_State *, char **, int, char *);
int LuaEncodeLuaData(lua_State *, char **, int, char *);
int LuaEncodeUrl(lua_State *);
int LuaParseUrl(lua_State *);
void EscapeLuaString(char *, size_t, char **);
void LuaPushUrlParams(lua_State *, struct UrlParams *);
int LuaPushHeaders(lua_State *, struct HttpMessage *, const char *);
void LuaPushLatin1(lua_State *, const char *, size_t);
int LuaPushHeader(lua_State *, struct HttpMessage *, char *, int);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_THIRD_PARTY_LUA_COSMO_H_ */