mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 09:48:29 +00:00
Reduce header complexity
- Remove most __ASSEMBLER__ __LINKER__ ifdefs - Rename libc/intrin/bits.h to libc/serialize.h - Block pthread cancelation in fchmodat() polyfill - Remove `clang-format off` statements in third_party
This commit is contained in:
parent
96f979dfc5
commit
fa20edc44d
3057 changed files with 410 additions and 4398 deletions
|
@ -1,11 +1,9 @@
|
|||
#ifndef COSMOPOLITAN_TOOL_NET_LFINGER_H_
|
||||
#define COSMOPOLITAN_TOOL_NET_LFINGER_H_
|
||||
#include "third_party/lua/lauxlib.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
int LuaFinger(lua_State *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_NET_LFINGER_H_ */
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "libc/errno.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/fmt/leb128.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/intrin/bsf.h"
|
||||
#include "libc/intrin/bsr.h"
|
||||
#include "libc/intrin/popcnt.h"
|
||||
|
@ -606,16 +606,16 @@ int LuaEncodeLatin1(lua_State *L) {
|
|||
}
|
||||
|
||||
dontinline int LuaBase32Impl(lua_State *L,
|
||||
char *B32(const char *, size_t, const char *, size_t, size_t *)) {
|
||||
char *B32(const char *, size_t, const char *,
|
||||
size_t, size_t *)) {
|
||||
char *p;
|
||||
size_t sl, al; // source/output and alphabet lengths
|
||||
size_t sl, al; // source/output and alphabet lengths
|
||||
const char *s = luaL_checklstring(L, 1, &sl);
|
||||
// use an empty string, as EncodeBase32 provides a default value
|
||||
const char *a = luaL_optlstring(L, 2, "", &al);
|
||||
if (!IS2POW(al) || al > 128 || al == 1)
|
||||
return luaL_error(L, "alphabet length is not a power of 2 in range 2..128");
|
||||
if (!(p = B32(s, sl, a, al, &sl)))
|
||||
return luaL_error(L, "out of memory");
|
||||
if (!(p = B32(s, sl, a, al, &sl))) return luaL_error(L, "out of memory");
|
||||
lua_pushlstring(L, p, sl);
|
||||
free(p);
|
||||
return 1;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#define COSMOPOLITAN_TOOL_NET_LFUNCS_H_
|
||||
#include "net/http/url.h"
|
||||
#include "third_party/lua/lua.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
int LuaMaxmind(lua_State *);
|
||||
|
@ -96,5 +95,4 @@ void LuaPushUrlView(lua_State *, struct UrlView *);
|
|||
char *FormatUnixHttpDateTime(char *, int64_t);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_NET_LFUNCS_H_ */
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "tool/net/ljson.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/intrin/likely.h"
|
||||
#include "libc/log/check.h"
|
||||
#include "libc/log/log.h"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_TOOL_NET_LJSON_H_
|
||||
#define COSMOPOLITAN_TOOL_NET_LJSON_H_
|
||||
#include "third_party/lua/lauxlib.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct DecodeJson {
|
||||
|
@ -12,5 +11,4 @@ struct DecodeJson {
|
|||
struct DecodeJson DecodeJson(struct lua_State *, const char *, size_t);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_NET_LJSON_H_ */
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
#ifndef COSMOPOLITAN_TOOL_NET_LPATH_H_
|
||||
#define COSMOPOLITAN_TOOL_NET_LPATH_H_
|
||||
#include "third_party/lua/lauxlib.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
int LuaPath(lua_State *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_NET_LPATH_H_ */
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "libc/mem/mem.h"
|
||||
#include "third_party/lua/cosmo.h"
|
||||
#include "third_party/lua/lua.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define AssertLuaStackIsAt(L, level) \
|
||||
|
@ -19,5 +18,4 @@ COSMOPOLITAN_C_START_
|
|||
} while (0)
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_NET_LUACHECK_H_ */
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/fmt/wintime.internal.h"
|
||||
#include "libc/intrin/atomic.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/intrin/bsr.h"
|
||||
#include "libc/intrin/likely.h"
|
||||
#include "libc/intrin/nomultics.internal.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue