mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 07:18:30 +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
third_party/musl/crypt.c
vendored
1
third_party/musl/crypt.c
vendored
|
@ -32,7 +32,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2014 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
/**
|
||||
* Encrypts password the old fashioned way.
|
||||
|
|
2
third_party/musl/crypt.h
vendored
2
third_party/musl/crypt.h
vendored
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_MUSL_CRYPT_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_MUSL_CRYPT_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct crypt_data {
|
||||
|
@ -14,5 +13,4 @@ char *crypt(const char *, const char *);
|
|||
char *crypt_r(const char *, const char *, struct crypt_data *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_MUSL_CRYPT_H_ */
|
||||
|
|
2
third_party/musl/crypt.internal.h
vendored
2
third_party/musl/crypt.internal.h
vendored
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_MUSL_CRYPT_INTERNAL_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_MUSL_CRYPT_INTERNAL_H_
|
||||
#include "third_party/musl/crypt.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
char *__crypt_des(const char *, const char *, char *);
|
||||
|
@ -11,5 +10,4 @@ char *__crypt_sha256(const char *, const char *, char *);
|
|||
char *__crypt_sha512(const char *, const char *, char *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_MUSL_CRYPT_INTERNAL_H_ */
|
||||
|
|
1
third_party/musl/crypt_blowfish.c
vendored
1
third_party/musl/crypt_blowfish.c
vendored
|
@ -37,7 +37,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2014 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
/* Modified by Rich Felker in for inclusion in musl libc, based on
|
||||
* Solar Designer's second size-optimized version sent to the musl
|
||||
|
|
1
third_party/musl/crypt_des.c
vendored
1
third_party/musl/crypt_des.c
vendored
|
@ -36,7 +36,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2014 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
/*
|
||||
* This version has been further modified by Rich Felker, primary author
|
||||
|
|
1
third_party/musl/crypt_des.internal.h
vendored
1
third_party/musl/crypt_des.internal.h
vendored
|
@ -1,4 +1,3 @@
|
|||
// clang-format off
|
||||
#ifndef CRYPT_DES_H
|
||||
#define CRYPT_DES_H
|
||||
|
||||
|
|
1
third_party/musl/crypt_md5.c
vendored
1
third_party/musl/crypt_md5.c
vendored
|
@ -37,7 +37,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2014 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
/*
|
||||
* md5 crypt implementation
|
||||
|
|
1
third_party/musl/crypt_r.c
vendored
1
third_party/musl/crypt_r.c
vendored
|
@ -32,7 +32,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2014 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
/**
|
||||
* Encrypts password the old fashioned way.
|
||||
|
|
1
third_party/musl/crypt_sha256.c
vendored
1
third_party/musl/crypt_sha256.c
vendored
|
@ -47,7 +47,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2014 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
/*
|
||||
* public domain sha256 crypt implementation
|
||||
|
|
1
third_party/musl/crypt_sha512.c
vendored
1
third_party/musl/crypt_sha512.c
vendored
|
@ -47,7 +47,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2014 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
/*
|
||||
* public domain sha512 crypt implementation
|
||||
|
|
1
third_party/musl/encrypt.c
vendored
1
third_party/musl/encrypt.c
vendored
|
@ -46,7 +46,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2014 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
static struct expanded_key __encrypt_key;
|
||||
|
||||
|
|
2
third_party/musl/fnmatch.h
vendored
2
third_party/musl/fnmatch.h
vendored
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_REGEX_FNMATCH_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_REGEX_FNMATCH_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define FNM_PATHNAME 0x1
|
||||
|
@ -16,5 +15,4 @@ COSMOPOLITAN_C_START_
|
|||
int fnmatch(const char *, const char *, int);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_REGEX_FNMATCH_H_ */
|
||||
|
|
2
third_party/musl/glob.h
vendored
2
third_party/musl/glob.h
vendored
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_MUSL_GLOB_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_MUSL_GLOB_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define GLOB_ERR 0x01
|
||||
|
@ -32,5 +31,4 @@ int glob(const char *, int, int (*)(const char *, int), glob_t *);
|
|||
void globfree(glob_t *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_MUSL_GLOB_H_ */
|
||||
|
|
1
third_party/musl/hsearch.c
vendored
1
third_party/musl/hsearch.c
vendored
|
@ -33,7 +33,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2020 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
/*
|
||||
open addressing hash table with 2^n table size
|
||||
|
|
1
third_party/musl/insque.c
vendored
1
third_party/musl/insque.c
vendored
|
@ -31,7 +31,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2020 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
|
||||
struct node {
|
||||
|
|
1
third_party/musl/lockf.c
vendored
1
third_party/musl/lockf.c
vendored
|
@ -37,7 +37,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2014 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
/**
|
||||
* Locks file.
|
||||
|
|
2
third_party/musl/lockf.h
vendored
2
third_party/musl/lockf.h
vendored
|
@ -6,11 +6,9 @@
|
|||
#define F_TLOCK 2
|
||||
#define F_TEST 3
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
int lockf(int, int, int64_t);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_MUSL_LOCKF_H_ */
|
||||
|
|
1
third_party/musl/lsearch.c
vendored
1
third_party/musl/lsearch.c
vendored
|
@ -33,7 +33,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2020 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
|
||||
void *lsearch(const void *key, void *base, size_t *nelp, size_t width,
|
||||
|
|
1
third_party/musl/mntent.c
vendored
1
third_party/musl/mntent.c
vendored
|
@ -36,7 +36,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2014 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
static char *internal_buf;
|
||||
static size_t internal_bufsize;
|
||||
|
|
2
third_party/musl/mntent.h
vendored
2
third_party/musl/mntent.h
vendored
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_MUSL_MNTENT_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_MUSL_MNTENT_H_
|
||||
#include "libc/stdio/stdio.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define MOUNTED "/etc/mtab"
|
||||
|
@ -33,5 +32,4 @@ int addmntent(FILE *, const struct mntent *);
|
|||
char *hasmntopt(const struct mntent *, const char *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_MUSL_MNTENT_H_ */
|
||||
|
|
2
third_party/musl/passwd.h
vendored
2
third_party/musl/passwd.h
vendored
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_PASSWD_H_
|
||||
#define COSMOPOLITAN_LIBC_PASSWD_H_
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct FILE;
|
||||
|
@ -46,5 +45,4 @@ int getgrouplist(const char *, gid_t, gid_t *, int *);
|
|||
int initgroups(const char *, gid_t);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_PASSWD_H_ */
|
||||
|
|
1
third_party/musl/pwd.c
vendored
1
third_party/musl/pwd.c
vendored
|
@ -43,7 +43,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2014 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
#ifdef FTRACE
|
||||
// if the default mode debugging tools are enabled, and we're linking
|
||||
|
|
1
third_party/musl/rand48.c
vendored
1
third_party/musl/rand48.c
vendored
|
@ -32,7 +32,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2014 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
static unsigned short __seed48[7] = { 0, 0, 0, 0xe66d, 0xdeec, 0x5, 0xb };
|
||||
|
||||
|
|
2
third_party/musl/rand48.h
vendored
2
third_party/musl/rand48.h
vendored
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_MUSL_RAND48_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_MUSL_RAND48_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
double drand48(void);
|
||||
|
@ -14,5 +13,4 @@ unsigned short *seed48(unsigned short[3]);
|
|||
void lcong48(unsigned short[7]);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_MUSL_RAND48_H_ */
|
||||
|
|
1
third_party/musl/search.h
vendored
1
third_party/musl/search.h
vendored
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_THIRDPARTY_MUSL_SEARCH_H
|
||||
#define COSMOPOLITAN_THIRDPARTY_MUSL_SEARCH_H
|
||||
/* clang-format off */
|
||||
|
||||
typedef enum { FIND, ENTER } ACTION;
|
||||
typedef enum { preorder, postorder, endorder, leaf } VISIT;
|
||||
|
|
1
third_party/musl/strfmon.c
vendored
1
third_party/musl/strfmon.c
vendored
|
@ -35,7 +35,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2014 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
static ssize_t vstrfmon_l(char *s, size_t n, locale_t loc, const char *fmt, va_list ap)
|
||||
{
|
||||
|
|
1
third_party/musl/tdelete.c
vendored
1
third_party/musl/tdelete.c
vendored
|
@ -32,7 +32,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2020 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
|
||||
void *tdelete(const void *restrict key, void **restrict rootp,
|
||||
|
|
1
third_party/musl/tdestroy.c
vendored
1
third_party/musl/tdestroy.c
vendored
|
@ -32,7 +32,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2020 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
void tdestroy(void *root, void (*freekey)(void *))
|
||||
{
|
||||
|
|
1
third_party/musl/tempnam.c
vendored
1
third_party/musl/tempnam.c
vendored
|
@ -44,7 +44,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2014 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
|
||||
static char *
|
||||
__randname(char *template)
|
||||
|
|
2
third_party/musl/tempnam.h
vendored
2
third_party/musl/tempnam.h
vendored
|
@ -1,10 +1,8 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_MUSL_TEMPNAM_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_MUSL_TEMPNAM_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
char *tempnam(const char *, const char *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_MUSL_TEMPNAM_H_ */
|
||||
|
|
1
third_party/musl/tfind.c
vendored
1
third_party/musl/tfind.c
vendored
|
@ -31,7 +31,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2020 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
void *tfind(const void *key, void *const *rootp,
|
||||
int(*cmp)(const void *, const void *))
|
||||
|
|
1
third_party/musl/tsearch.c
vendored
1
third_party/musl/tsearch.c
vendored
|
@ -33,7 +33,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2020 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
static inline int height(struct node *n) { return n ? n->h : 0; }
|
||||
|
||||
|
|
1
third_party/musl/twalk.c
vendored
1
third_party/musl/twalk.c
vendored
|
@ -31,7 +31,6 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2020 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
// clang-format off
|
||||
|
||||
|
||||
static void walk(const struct node *r, void (*action)(const void *, VISIT, int), int d)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue