mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-30 19:17:36 +00:00
Run clang-format (#1197)
This commit is contained in:
parent
ea081b262c
commit
f032b5570b
183 changed files with 1074 additions and 983 deletions
|
@ -132,7 +132,7 @@
|
|||
#define SHSTUB2(SYM, X) \
|
||||
HIDDEN(SYM##_bcs0 = BCD_LEFT(X)); \
|
||||
HIDDEN(SYM##_bcs1 = BCD_RIGHT(X))
|
||||
#define BCD_SMEAR(X) ((X) + (X) * 10000)
|
||||
#define BCD_SMEAR(X) ((X) + (X)*10000)
|
||||
#define BCD_LEFT(X) \
|
||||
(((X)) < 10000 ? BCD_RIGHT(BCD_SMEAR(X)) | 0x10 \
|
||||
: (X) < 100000 ? BCD_RIGHT(BCD_SMEAR((X) / 10)) \
|
||||
|
@ -140,23 +140,16 @@
|
|||
: (X) < 10000000 ? BCD_RIGHT(BCD_SMEAR((X) / 1000)) \
|
||||
: (X) < 100000000 ? BCD_RIGHT(BCD_SMEAR((X) / 10000)) \
|
||||
: 0xffffffffffffffff)
|
||||
#define BCD_RIGHT(X) \
|
||||
(((X)) < 10000 ? 0x20202020 \
|
||||
: (X) < 100000 ? 0x20202030 + \
|
||||
(X) % 10 \
|
||||
: (X) < 1000000 ? 0x20203030 + \
|
||||
((X) / 10) % 10 + \
|
||||
(X) % 10 * 0x100 \
|
||||
: (X) < 10000000 ? 0x20303030 + \
|
||||
((X) / 100) % 10 + \
|
||||
((X) / 10) % 10 * 0x100 + \
|
||||
(X) % 10 * 0x10000 \
|
||||
: (X) < 100000000 ? 0x30303030 + \
|
||||
((X) / 1000) % 10 + \
|
||||
((X) / 100) % 10 * 0x100 + \
|
||||
((X) / 10) % 10 * 0x10000 + \
|
||||
(X) % 10 * 0x1000000 \
|
||||
: 0xffffffffffffffff)
|
||||
#define BCD_RIGHT(X) \
|
||||
(((X)) < 10000 ? 0x20202020 \
|
||||
: (X) < 100000 ? 0x20202030 + (X) % 10 \
|
||||
: (X) < 1000000 ? 0x20203030 + ((X) / 10) % 10 + (X) % 10 * 0x100 \
|
||||
: (X) < 10000000 ? 0x20303030 + ((X) / 100) % 10 + \
|
||||
((X) / 10) % 10 * 0x100 + (X) % 10 * 0x10000 \
|
||||
: (X) < 100000000 \
|
||||
? 0x30303030 + ((X) / 1000) % 10 + ((X) / 100) % 10 * 0x100 + \
|
||||
((X) / 10) % 10 * 0x10000 + (X) % 10 * 0x1000000 \
|
||||
: 0xffffffffffffffff)
|
||||
|
||||
/**
|
||||
* Laying out the GDT entries for a TSS for bare metal operation.
|
||||
|
@ -165,15 +158,11 @@
|
|||
HIDDEN(SYM##_desc_ent0 = TSSDESC_ENT0(BASE, LIM)); \
|
||||
HIDDEN(SYM##_desc_ent1 = TSSDESC_ENT1(BASE)); \
|
||||
ASSERT((LIM) >= 0 && (LIM) <= 0xffff, "bare metal TSS is suspiciously fat")
|
||||
#define TSSDESC_ENT0(BASE, LIM) \
|
||||
(((LIM) << 0 & 0x000000000000ffff) | \
|
||||
((BASE) << 16 & 0x000000ffffff0000) | \
|
||||
0x89 << 40 | \
|
||||
((LIM) >> 16 << 48 & 0x000f000000000000) | \
|
||||
0x2 << 52 | \
|
||||
#define TSSDESC_ENT0(BASE, LIM) \
|
||||
(((LIM) << 0 & 0x000000000000ffff) | ((BASE) << 16 & 0x000000ffffff0000) | \
|
||||
0x89 << 40 | ((LIM) >> 16 << 48 & 0x000f000000000000) | 0x2 << 52 | \
|
||||
((BASE) >> 24 << 56 & 0xff00000000000000))
|
||||
#define TSSDESC_ENT1(BASE) \
|
||||
((BASE) >> 32 << 0 & 0x00000000ffffffff)
|
||||
#define TSSDESC_ENT1(BASE) ((BASE) >> 32 << 0 & 0x00000000ffffffff)
|
||||
|
||||
#endif /* __ASSEMBLER__ */
|
||||
#endif /* APE_MACROS_H_ */
|
||||
|
|
|
@ -9,8 +9,8 @@ int mulaw(int);
|
|||
int unmulaw(int);
|
||||
void *double2byte(long, const void *, double, double) vallocesque;
|
||||
void *byte2double(long, const void *, double, double) vallocesque;
|
||||
void *dct(float[restrict hasatleast 8][8], unsigned,
|
||||
float, float, float, float, float);
|
||||
void *dct(float[restrict hasatleast 8][8], unsigned, float, float, float, float,
|
||||
float);
|
||||
void *dctjpeg(float[restrict hasatleast 8][8], unsigned);
|
||||
double det3(const double[3][3]) nosideeffect;
|
||||
void *inv3(double[restrict 3][3], const double[restrict 3][3], double);
|
||||
|
|
|
@ -65,8 +65,8 @@
|
|||
*
|
||||
* @cost ~100ns
|
||||
*/
|
||||
void *dct(float M[restrict hasatleast 8][8], unsigned stride,
|
||||
float c0, float c1, float c2, float c3, float c4) {
|
||||
void *dct(float M[restrict hasatleast 8][8], unsigned stride, float c0,
|
||||
float c1, float c2, float c3, float c4) {
|
||||
unsigned y, x;
|
||||
for (y = 0; y < stride * 8; y += stride) {
|
||||
DCT(M[y][0], M[y][1], M[y][2], M[y][3], M[y][4], M[y][5], M[y][6], M[y][7],
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "dsp/core/core.h"
|
||||
#include "dsp/core/gamma.h"
|
||||
#include "dsp/core/core.h"
|
||||
#include "libc/math.h"
|
||||
|
||||
double rgb2stdpc(double x, double g) {
|
||||
|
|
|
@ -64,7 +64,8 @@ forceinline bool plm_buffer_has(plm_buffer_t *b, size_t bits) {
|
|||
}
|
||||
|
||||
forceinline int plm_buffer_read(plm_buffer_t *self, int count) {
|
||||
if (!plm_buffer_has(self, count)) return 0;
|
||||
if (!plm_buffer_has(self, count))
|
||||
return 0;
|
||||
int value = 0;
|
||||
while (count) {
|
||||
int current_byte = self->bytes[self->bit_index >> 3];
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
#include "dsp/mpeg/mpeg.h"
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define START_PACK 0xBA
|
||||
#define START_END 0xB9
|
||||
#define START_PACK 0xBA
|
||||
#define START_END 0xB9
|
||||
#define START_SYSTEM 0xBB
|
||||
|
||||
typedef struct plm_demux_t {
|
||||
|
|
|
@ -24,9 +24,13 @@
|
|||
* The alternate buffer trick lets one restore the console exactly as it
|
||||
* was, once the program is done running.
|
||||
*/
|
||||
int ttyenablealtbuf(int ttyfd) { return ttysend(ttyfd, "\e[?1049h"); }
|
||||
int ttyenablealtbuf(int ttyfd) {
|
||||
return ttysend(ttyfd, "\e[?1049h");
|
||||
}
|
||||
|
||||
/**
|
||||
* Asks teletypewriter to restore blinking box thing.
|
||||
*/
|
||||
int ttydisablealtbuf(int ttyfd) { return ttysend(ttyfd, "\e[?1049l"); }
|
||||
int ttydisablealtbuf(int ttyfd) {
|
||||
return ttysend(ttyfd, "\e[?1049l");
|
||||
}
|
||||
|
|
|
@ -21,9 +21,13 @@
|
|||
/**
|
||||
* Asks teletypewriter to push current position.
|
||||
*/
|
||||
int ttysavecursor(int ttyfd) { return ttysend(ttyfd, "\e[s"); }
|
||||
int ttysavecursor(int ttyfd) {
|
||||
return ttysend(ttyfd, "\e[s");
|
||||
}
|
||||
|
||||
/**
|
||||
* Asks teletypewriter to pop previous position.
|
||||
*/
|
||||
int ttyrestorecursor(int ttyfd) { return ttysend(ttyfd, "\e[u"); }
|
||||
int ttyrestorecursor(int ttyfd) {
|
||||
return ttysend(ttyfd, "\e[u");
|
||||
}
|
||||
|
|
|
@ -39,8 +39,12 @@ static char *setansibgfg(char *p, unsigned bg, unsigned fg) {
|
|||
return p;
|
||||
}
|
||||
|
||||
char *setbg16_(char *p, struct TtyRgb bg) { return setansibgfg(p, bg.xt, -1u); }
|
||||
char *setfg16_(char *p, struct TtyRgb fg) { return setansibgfg(p, -1u, fg.xt); }
|
||||
char *setbg16_(char *p, struct TtyRgb bg) {
|
||||
return setansibgfg(p, bg.xt, -1u);
|
||||
}
|
||||
char *setfg16_(char *p, struct TtyRgb fg) {
|
||||
return setansibgfg(p, -1u, fg.xt);
|
||||
}
|
||||
char *setbgfg16_(char *p, struct TtyRgb bg, struct TtyRgb fg) {
|
||||
return setansibgfg(p, bg.xt, fg.xt);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
fprintf(stderr, "%s (%s)\n", argv[0], GetProgramExecutableName());
|
||||
for (char **p = environ; *p; ++p) {
|
||||
for (char** p = environ; *p; ++p) {
|
||||
printf("%s\n", *p);
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
│ • http://creativecommons.org/publicdomain/zero/1.0/ │
|
||||
╚─────────────────────────────────────────────────────────────────*/
|
||||
#endif
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "third_party/hiredis/hiredis.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/hiredis/hiredis.h"
|
||||
|
||||
/**
|
||||
* @fileoverview Demo of using hiredis to connect to a Redis server
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#define PARSE_AND_PRINT(type, scan_fmt, print_fmt, str) \
|
||||
do { \
|
||||
type val; int ret; \
|
||||
ret = sscanf(str, scan_fmt, &val); \
|
||||
printf("\"%s\" => " print_fmt " = %d\n", str, val, ret); \
|
||||
#define PARSE_AND_PRINT(type, scan_fmt, print_fmt, str) \
|
||||
do { \
|
||||
type val; \
|
||||
int ret; \
|
||||
ret = sscanf(str, scan_fmt, &val); \
|
||||
printf("\"%s\" => " print_fmt " = %d\n", str, val, ret); \
|
||||
} while (0)
|
||||
|
||||
int main()
|
||||
{
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "0.3715");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", ".3715");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "3715");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "111.11");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "-2.22");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "Nan");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "nAn(2)");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "-NAN(_asdfZXCV1234_)");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "-nan");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "+nan");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "inF");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "iNfINiTy");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "+inf");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "-inf");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "0X1.BC70A3D70A3D7P+6");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "1.18973e+4932zzz");
|
||||
PARSE_AND_PRINT(float, "%f", "%.10f", " -0.0000000123junk");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "junk");
|
||||
return 0;
|
||||
int main() {
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "0.3715");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", ".3715");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "3715");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "111.11");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "-2.22");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "Nan");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "nAn(2)");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "-NAN(_asdfZXCV1234_)");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "-nan");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "+nan");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "inF");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "iNfINiTy");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "+inf");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "-inf");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "0X1.BC70A3D70A3D7P+6");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "1.18973e+4932zzz");
|
||||
PARSE_AND_PRINT(float, "%f", "%.10f", " -0.0000000123junk");
|
||||
PARSE_AND_PRINT(float, "%f", "%f", "junk");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -2601,7 +2601,8 @@ static int shlex() {
|
|||
case 'y':
|
||||
case 'z':
|
||||
p = buf;
|
||||
while (buf++, is_in_name(*buf));
|
||||
while (buf++, is_in_name(*buf))
|
||||
;
|
||||
yylval.name = stalloc(buf - p + 1);
|
||||
*(char *)mempcpy(yylval.name, p, buf - p) = 0;
|
||||
value = ARITH_VAR;
|
||||
|
@ -7757,7 +7758,8 @@ static int ulimitcmd(int argc, char **argv) {
|
|||
what = optc;
|
||||
}
|
||||
}
|
||||
for (l = limits; l->option != what; l++);
|
||||
for (l = limits; l->option != what; l++)
|
||||
;
|
||||
set = *argptr ? 1 : 0;
|
||||
if (set) {
|
||||
char *p = *argptr;
|
||||
|
@ -7986,7 +7988,8 @@ static void setparam(char **argv) {
|
|||
char **newparam;
|
||||
char **ap;
|
||||
int nparam;
|
||||
for (nparam = 0; argv[nparam]; nparam++);
|
||||
for (nparam = 0; argv[nparam]; nparam++)
|
||||
;
|
||||
ap = newparam = ckmalloc((nparam + 1) * sizeof *ap);
|
||||
while (*argv) {
|
||||
*ap++ = savestr(*argv++);
|
||||
|
@ -8664,7 +8667,8 @@ static void parsefname(void) {
|
|||
if (heredoclist == NULL)
|
||||
heredoclist = here;
|
||||
else {
|
||||
for (p = heredoclist; p->next; p = p->next);
|
||||
for (p = heredoclist; p->next; p = p->next)
|
||||
;
|
||||
p->next = here;
|
||||
}
|
||||
} else if (n->type == NTOFD || n->type == NFROMFD) {
|
||||
|
@ -8788,7 +8792,8 @@ static int xxreadtoken(void) {
|
|||
case '\t':
|
||||
continue;
|
||||
case '#':
|
||||
while ((c = pgetc()) != '\n' && c != PEOF);
|
||||
while ((c = pgetc()) != '\n' && c != PEOF)
|
||||
;
|
||||
pungetc();
|
||||
continue;
|
||||
case '\n':
|
||||
|
@ -8912,7 +8917,7 @@ static int readtoken1(int firstc, char const *syntax, char *eofmark,
|
|||
quotef = 0;
|
||||
bqlist = NULL;
|
||||
STARTSTACKSTR(out);
|
||||
loop: { /* for each line, until end of word */
|
||||
loop : { /* for each line, until end of word */
|
||||
CHECKEND(); /* set c to PEOF if at end of here document */
|
||||
for (;;) { /* until end of line or end of word */
|
||||
CHECKSTRSPACE(4, out); /* permit 4 calls to USTPUTC */
|
||||
|
@ -9064,7 +9069,7 @@ endword:
|
|||
* is called, c is set to the first character of the next input line. If
|
||||
* we are at the end of the here document, this routine sets the c to PEOF.
|
||||
*/
|
||||
checkend: {
|
||||
checkend : {
|
||||
if (realeofmark(eofmark)) {
|
||||
int markloc;
|
||||
char *p;
|
||||
|
@ -9107,7 +9112,7 @@ checkend: {
|
|||
* specifying the fd to be redirected. The variable "c" contains the
|
||||
* first character of the redirection operator.
|
||||
*/
|
||||
parseredir: {
|
||||
parseredir : {
|
||||
char fd = *out;
|
||||
union node *np;
|
||||
np = (union node *)stalloc(sizeof(struct nfile));
|
||||
|
@ -9164,7 +9169,7 @@ parseredir: {
|
|||
* Parse a substitution. At this point, we have read the dollar sign
|
||||
* and nothing else.
|
||||
*/
|
||||
parsesub: {
|
||||
parsesub : {
|
||||
int subtype;
|
||||
int typeloc;
|
||||
char *p;
|
||||
|
@ -9282,7 +9287,7 @@ parsesub: {
|
|||
* list of commands (passed by reference), and savelen is the number of
|
||||
* characters on the top of the stack which must be preserved.
|
||||
*/
|
||||
parsebackq: {
|
||||
parsebackq : {
|
||||
struct nodelist **nlpp;
|
||||
union node *n;
|
||||
char *str;
|
||||
|
@ -9377,7 +9382,7 @@ parsebackq: {
|
|||
/*
|
||||
* Parse an arithmetic expansion (indicate start of one and set state)
|
||||
*/
|
||||
parsearith: {
|
||||
parsearith : {
|
||||
synstack_push(&synstack, synstack->prev ?: alloca(sizeof(*synstack)),
|
||||
ARISYNTAX);
|
||||
synstack->dblquote = 1;
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
#endif
|
||||
#include "libc/errno.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/ftw.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/exit.h"
|
||||
#include "libc/sysv/consts/s.h"
|
||||
#include "libc/stdio/ftw.h"
|
||||
|
||||
/**
|
||||
* @fileoverview Directory walker example.
|
||||
|
|
|
@ -10,12 +10,12 @@ void end_cancelation_point(int);
|
|||
#define END_CANCELATION_POINT (void)0
|
||||
#else
|
||||
#define BEGIN_CANCELATION_POINT \
|
||||
do { \
|
||||
int _Cp; \
|
||||
do { \
|
||||
int _Cp; \
|
||||
_Cp = begin_cancelation_point()
|
||||
#define END_CANCELATION_POINT \
|
||||
end_cancelation_point(_Cp); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
#endif
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
#include "libc/dce.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/intrin/weaken.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
#include "libc/runtime/zipos.internal.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
||||
/**
|
||||
* Duplicates file descriptor.
|
||||
|
|
|
@ -76,7 +76,7 @@ int dup2(int oldfd, int newfd) {
|
|||
rc = oldfd;
|
||||
} else
|
||||
#endif
|
||||
if (!IsWindows()) {
|
||||
if (!IsWindows()) {
|
||||
if (__isfdkind(oldfd, kFdZip) || __isfdkind(newfd, kFdZip)) {
|
||||
if (__vforked) {
|
||||
return enotsup();
|
||||
|
|
|
@ -66,7 +66,7 @@ static struct HostAdapterInfoNode {
|
|||
struct sockaddr netmask;
|
||||
struct sockaddr broadcast;
|
||||
short flags;
|
||||
} * __hostInfo;
|
||||
} *__hostInfo;
|
||||
|
||||
static int ioctl_default(int fd, unsigned long request, void *arg) {
|
||||
int rc;
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/proc/execve.internal.h"
|
||||
#include "libc/serialize.h"
|
||||
|
||||
/**
|
||||
* Returns true if executable image is supported by APE Loader.
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
#include "libc/intrin/describeflags.internal.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/intrin/weaken.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
#include "libc/runtime/zipos.internal.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
||||
/**
|
||||
* Creates hard filesystem link.
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
#include "libc/intrin/describeflags.internal.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/intrin/weaken.h"
|
||||
#include "libc/runtime/zipos.internal.h"
|
||||
#include "libc/sysv/consts/at.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
#include "libc/runtime/zipos.internal.h"
|
||||
|
||||
/**
|
||||
* Creates directory a.k.a. folder.
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/pc.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/runtime/zipos.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/at.h"
|
||||
#include "libc/sysv/consts/map.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/prot.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
#include "libc/runtime/zipos.internal.h"
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
#include "libc/intrin/describeflags.internal.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/intrin/weaken.h"
|
||||
#include "libc/runtime/zipos.internal.h"
|
||||
#include "libc/sysv/consts/at.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
#include "libc/runtime/zipos.internal.h"
|
||||
|
||||
/**
|
||||
* Renames files relative to directories.
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/stdio/sysparam.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/paths.h"
|
||||
#include "libc/stdio/sysparam.h"
|
||||
|
||||
/**
|
||||
* Returns name of terminal.
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
#include "libc/intrin/describeflags.internal.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/intrin/weaken.h"
|
||||
#include "libc/runtime/zipos.internal.h"
|
||||
#include "libc/sysv/consts/s.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
#include "libc/runtime/zipos.internal.h"
|
||||
|
||||
/**
|
||||
* Deletes inode and maybe the file too.
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
#include "libc/elf/struct/phdr.h"
|
||||
#include "libc/elf/struct/shdr.h"
|
||||
#include "libc/elf/struct/sym.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/log/libfatal.internal.h"
|
||||
#include "libc/serialize.h"
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define GetStr(tab, rva) ((char *)(tab) + (rva))
|
||||
|
@ -30,7 +30,8 @@ static inline char *GetStrtab(const Elf64_Ehdr *e, size_t *n) {
|
|||
if (shdr->sh_type == SHT_STRTAB) {
|
||||
name = GetSectionName(e, GetShdr(e, i));
|
||||
if (name && READ64LE(name) == READ64LE(".strtab")) {
|
||||
if (n) *n = shdr->sh_size;
|
||||
if (n)
|
||||
*n = shdr->sh_size;
|
||||
return GetSection(e, shdr);
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +45,8 @@ static inline Elf64_Sym *GetSymtab(const Elf64_Ehdr *e, Elf64_Xword *n) {
|
|||
for (i = e->e_shnum; i-- > 0;) {
|
||||
shdr = GetShdr(e, i);
|
||||
if (shdr->sh_type == SHT_SYMTAB) {
|
||||
if (n) *n = shdr->sh_size / sizeof(Elf64_Sym);
|
||||
if (n)
|
||||
*n = shdr->sh_size / sizeof(Elf64_Sym);
|
||||
return GetSection(e, shdr);
|
||||
}
|
||||
}
|
||||
|
@ -60,14 +62,19 @@ static inline void GetImageRange(const Elf64_Ehdr *elf, intptr_t *x,
|
|||
end = 0;
|
||||
for (i = 0; i < elf->e_phnum; ++i) {
|
||||
phdr = GetPhdr(elf, i);
|
||||
if (phdr->p_type != PT_LOAD) continue;
|
||||
if (phdr->p_type != PT_LOAD)
|
||||
continue;
|
||||
pstart = phdr->p_vaddr;
|
||||
pend = phdr->p_vaddr + phdr->p_memsz;
|
||||
if (pstart < start) start = pstart;
|
||||
if (pend > end) end = pend;
|
||||
if (pstart < start)
|
||||
start = pstart;
|
||||
if (pend > end)
|
||||
end = pend;
|
||||
}
|
||||
if (x) *x = start;
|
||||
if (y) *y = end;
|
||||
if (x)
|
||||
*x = start;
|
||||
if (y)
|
||||
*y = end;
|
||||
}
|
||||
|
||||
static inline bool GetElfSymbolValue(const Elf64_Ehdr *ehdr, const char *name,
|
||||
|
@ -75,8 +82,10 @@ static inline bool GetElfSymbolValue(const Elf64_Ehdr *ehdr, const char *name,
|
|||
Elf64_Xword i, n;
|
||||
const char *stab;
|
||||
const Elf64_Sym *st;
|
||||
if (!(stab = GetStrtab(ehdr, 0))) return false;
|
||||
if (!(st = GetSymtab(ehdr, &n))) return false;
|
||||
if (!(stab = GetStrtab(ehdr, 0)))
|
||||
return false;
|
||||
if (!(st = GetSymtab(ehdr, &n)))
|
||||
return false;
|
||||
for (i = 0; i < n; ++i) {
|
||||
if (!__strcmp(GetStr(stab, st[i].st_name), name)) {
|
||||
*res = st[i].st_value;
|
||||
|
|
|
@ -3,13 +3,16 @@
|
|||
#include "libc/errno.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
#define CONSUME_SPACES(t, s, c) \
|
||||
if (endptr) *endptr = (t *)(s); \
|
||||
while (c == ' ' || c == '\t') c = *++s
|
||||
#define CONSUME_SPACES(t, s, c) \
|
||||
if (endptr) \
|
||||
*endptr = (t *)(s); \
|
||||
while (c == ' ' || c == '\t') \
|
||||
c = *++s
|
||||
|
||||
#define GET_SIGN(s, c, d) \
|
||||
d = c == '-' ? -1 : 1; \
|
||||
if (c == '-' || c == '+') c = *++s
|
||||
#define GET_SIGN(s, c, d) \
|
||||
d = c == '-' ? -1 : 1; \
|
||||
if (c == '-' || c == '+') \
|
||||
c = *++s
|
||||
|
||||
#define GET_RADIX(s, c, r) \
|
||||
if (!r) { \
|
||||
|
|
|
@ -33,19 +33,22 @@ static inline struct Dll *dll_last(struct Dll *list) {
|
|||
|
||||
static inline struct Dll *dll_first(struct Dll *list) {
|
||||
struct Dll *first = 0;
|
||||
if (list) first = list->next;
|
||||
if (list)
|
||||
first = list->next;
|
||||
return first;
|
||||
}
|
||||
|
||||
static inline struct Dll *dll_next(struct Dll *list, struct Dll *e) {
|
||||
struct Dll *next = 0;
|
||||
if (e != list) next = e->next;
|
||||
if (e != list)
|
||||
next = e->next;
|
||||
return next;
|
||||
}
|
||||
|
||||
static inline struct Dll *dll_prev(struct Dll *list, struct Dll *e) {
|
||||
struct Dll *prev = 0;
|
||||
if (e != list->next) prev = e->prev;
|
||||
if (e != list->next)
|
||||
prev = e->prev;
|
||||
return prev;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
*/
|
||||
|
||||
#define asint(x) ((union pun){x}).i
|
||||
#define isnan(x) (((x) & 0x7fff) > 0x7c00)
|
||||
#define isnan(x) (((x)&0x7fff) > 0x7c00)
|
||||
|
||||
union pun {
|
||||
_Float16 f;
|
||||
|
|
|
@ -49,7 +49,8 @@ void uvprintf(const char *, va_list) libcesque;
|
|||
do { \
|
||||
kprintf("\r\e[30;101mfatal: %s:%d: " FMT "\e[0m\n", __FILE__, __LINE__, \
|
||||
##__VA_ARGS__); \
|
||||
for (;;) asm volatile("cli\n\thlt"); \
|
||||
for (;;) \
|
||||
asm volatile("cli\n\thlt"); \
|
||||
} while (0)
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#ifdef __x86_64__
|
||||
|
||||
#define INVERT(x) (BANE + PHYSICAL((uintptr_t)(x)))
|
||||
#define NOPAGE ((uint64_t) - 1)
|
||||
#define NOPAGE ((uint64_t)-1)
|
||||
|
||||
#define APE_STACK_VADDR \
|
||||
({ \
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
forceinline void repmovsb(void **dest, const void **src, size_t cx) {
|
||||
char *di = (char *)*dest;
|
||||
const char *si = (const char *)*src;
|
||||
while (cx) *di++ = *si++, cx--;
|
||||
while (cx)
|
||||
*di++ = *si++, cx--;
|
||||
*dest = di, *src = si;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
|
||||
forceinline void *repstosb(void *dest, unsigned char al, size_t cx) {
|
||||
unsigned char *di = (unsigned char *)dest;
|
||||
while (cx) *di++ = al, cx--;
|
||||
while (cx)
|
||||
*di++ = al, cx--;
|
||||
return di;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,8 @@ COSMOPOLITAN_C_START_
|
|||
({ \
|
||||
autotype(a) FirstNonNullA = (a); \
|
||||
autotype(a) FirstNonNullB = (b); \
|
||||
if (!FirstNonNullA && !FirstNonNullB) abort(); \
|
||||
if (!FirstNonNullA && !FirstNonNullB) \
|
||||
abort(); \
|
||||
FirstNonNullA ? FirstNonNullA : FirstNonNullB; \
|
||||
})
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
|
||||
__attribute__((__weak__)) void __stack_chk_fail(void) {
|
||||
|
|
|
@ -31,7 +31,7 @@ static __vex size_t __strlen(const char *s) {
|
|||
m = __builtin_ia32_pmovmskb128(*++p == z);
|
||||
return (const char *)p + __builtin_ctzl(m) - s;
|
||||
#else
|
||||
#define ONES ((word) - 1 / 255)
|
||||
#define ONES ((word)-1 / 255)
|
||||
#define BANE (ONES * (255 / 2 + 1))
|
||||
typedef unsigned long mayalias word;
|
||||
word w;
|
||||
|
|
|
@ -62,8 +62,8 @@ textstartup void _AcpiFadtInit(void) {
|
|||
_Static_assert(offsetof(AcpiTableFadt, Dsdt) == 40);
|
||||
_Static_assert(offsetof(AcpiTableFadt, BootFlags) == 109);
|
||||
_Static_assert(offsetof(AcpiTableFadt, XDsdt) == 140);
|
||||
if (length >= offsetof(AcpiTableFadt, BootFlags) + sizeof(fadt->BootFlags))
|
||||
{
|
||||
if (length >=
|
||||
offsetof(AcpiTableFadt, BootFlags) + sizeof(fadt->BootFlags)) {
|
||||
_AcpiBootFlags = flags = fadt->BootFlags;
|
||||
KINFOF("FADT: boot flags %#x", (unsigned)flags);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/atomic.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/intrin/directmap.internal.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/irq/acpi.internal.h"
|
||||
|
@ -34,6 +33,7 @@
|
|||
#include "libc/macros.internal.h"
|
||||
#include "libc/nt/efi.h"
|
||||
#include "libc/runtime/pc.internal.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/map.h"
|
||||
#include "libc/sysv/consts/prot.h"
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
#define COSMOPOLITAN_LIBC_ISO646_H_
|
||||
|
||||
#ifndef __cplusplus
|
||||
#define and &&
|
||||
#define and &&
|
||||
#define and_eq &=
|
||||
#define bitand &
|
||||
#define bitor |
|
||||
#define compl ~
|
||||
#define not !
|
||||
#define bitor |
|
||||
#define compl ~
|
||||
#define not !
|
||||
#define not_eq !=
|
||||
#define or ||
|
||||
#define or_eq |=
|
||||
#define xor ^
|
||||
#define or ||
|
||||
#define or_eq |=
|
||||
#define xor ^
|
||||
#define xor_eq ^=
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_CXXABI_H_
|
||||
#define COSMOPOLITAN_LIBC_ISYSTEM_CXXABI_H_
|
||||
#include "third_party/libcxxabi/include/cxxabi.h"
|
||||
#include "libc/cxxabi.h"
|
||||
#include "third_party/libcxxabi/include/cxxabi.h"
|
||||
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_CXXABI_H_ */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef _FTW_H
|
||||
#define _FTW_H
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/sysv/consts/s.h"
|
||||
#include "libc/stdio/ftw.h"
|
||||
#include "libc/sysv/consts/s.h"
|
||||
#endif /* _FTW_H */
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_SYS_PARAM_H_
|
||||
#define COSMOPOLITAN_LIBC_ISYSTEM_SYS_PARAM_H_
|
||||
#include "libc/intrin/newbie.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/rlimit.h"
|
||||
#include "libc/calls/struct/rusage.h"
|
||||
#include "libc/stdio/sysparam.h"
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/intrin/newbie.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/stdio/sysparam.h"
|
||||
#include "libc/sysv/consts/endian.h"
|
||||
#include "libc/sysv/consts/prio.h"
|
||||
#include "libc/sysv/consts/rlim.h"
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/sigaction.h"
|
||||
#include "libc/calls/struct/siginfo.h"
|
||||
#include "libc/sysv/consts/sig.h"
|
||||
#include "libc/sysv/consts/sicode.h"
|
||||
#include "libc/sysv/consts/sig.h"
|
||||
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_SYS_SIGNAL_H_ */
|
||||
|
|
|
@ -7,324 +7,316 @@
|
|||
|
||||
/* from https://en.cppreference.com/w/c/numeric/tgmath */
|
||||
|
||||
#define fabs(x) \
|
||||
_Generic((x), float \
|
||||
: fabsf, default \
|
||||
: fabs, long double \
|
||||
: fabsl, complex float \
|
||||
: cabsf, complex double \
|
||||
: cabs, complex long double \
|
||||
: cabsl)(x)
|
||||
#define fabs(x) \
|
||||
_Generic((x), \
|
||||
float: fabsf, \
|
||||
default: fabs, \
|
||||
long double: fabsl, \
|
||||
complex float: cabsf, \
|
||||
complex double: cabs, \
|
||||
complex long double: cabsl)(x)
|
||||
|
||||
#define exp(x) \
|
||||
_Generic((x), float \
|
||||
: expf, default \
|
||||
: exp, long double \
|
||||
: expl, complex float \
|
||||
: cexpf, complex double \
|
||||
: cexp, complex long double \
|
||||
: cexpl)(x)
|
||||
#define exp(x) \
|
||||
_Generic((x), \
|
||||
float: expf, \
|
||||
default: exp, \
|
||||
long double: expl, \
|
||||
complex float: cexpf, \
|
||||
complex double: cexp, \
|
||||
complex long double: cexpl)(x)
|
||||
|
||||
#define log(x) \
|
||||
_Generic((x), float \
|
||||
: logf, default \
|
||||
: log, long double \
|
||||
: logl, complex float \
|
||||
: clogf, complex double \
|
||||
: clog, complex long double \
|
||||
: clogl)(x)
|
||||
#define log(x) \
|
||||
_Generic((x), \
|
||||
float: logf, \
|
||||
default: log, \
|
||||
long double: logl, \
|
||||
complex float: clogf, \
|
||||
complex double: clog, \
|
||||
complex long double: clogl)(x)
|
||||
|
||||
#define pow(x, y) \
|
||||
_Generic((x), float \
|
||||
: powf, default \
|
||||
: pow, long double \
|
||||
: powl, complex float \
|
||||
: cpowf, complex double \
|
||||
: cpow, complex long double \
|
||||
: cpowl)(x, y)
|
||||
#define pow(x, y) \
|
||||
_Generic((x), \
|
||||
float: powf, \
|
||||
default: pow, \
|
||||
long double: powl, \
|
||||
complex float: cpowf, \
|
||||
complex double: cpow, \
|
||||
complex long double: cpowl)(x, y)
|
||||
|
||||
#define sqrt(x) \
|
||||
_Generic((x), float \
|
||||
: sqrtf, default \
|
||||
: sqrt, long double \
|
||||
: sqrtl, complex float \
|
||||
: csqrtf, complex double \
|
||||
: csqrt, complex long double \
|
||||
: csqrtl)(x)
|
||||
#define sqrt(x) \
|
||||
_Generic((x), \
|
||||
float: sqrtf, \
|
||||
default: sqrt, \
|
||||
long double: sqrtl, \
|
||||
complex float: csqrtf, \
|
||||
complex double: csqrt, \
|
||||
complex long double: csqrtl)(x)
|
||||
|
||||
#define sin(x) \
|
||||
_Generic((x), float \
|
||||
: sinf, default \
|
||||
: sin, long double \
|
||||
: sinl, complex float \
|
||||
: csinf, complex double \
|
||||
: csin, complex long double \
|
||||
: csinl)(x)
|
||||
#define sin(x) \
|
||||
_Generic((x), \
|
||||
float: sinf, \
|
||||
default: sin, \
|
||||
long double: sinl, \
|
||||
complex float: csinf, \
|
||||
complex double: csin, \
|
||||
complex long double: csinl)(x)
|
||||
|
||||
#define cos(x) \
|
||||
_Generic((x), float \
|
||||
: cosf, default \
|
||||
: cos, long double \
|
||||
: cosl, complex float \
|
||||
: ccosf, complex double \
|
||||
: ccos, complex long double \
|
||||
: ccosl)(x)
|
||||
#define cos(x) \
|
||||
_Generic((x), \
|
||||
float: cosf, \
|
||||
default: cos, \
|
||||
long double: cosl, \
|
||||
complex float: ccosf, \
|
||||
complex double: ccos, \
|
||||
complex long double: ccosl)(x)
|
||||
|
||||
#define tan(x) \
|
||||
_Generic((x), float \
|
||||
: tanf, default \
|
||||
: tan, long double \
|
||||
: tanl, complex float \
|
||||
: ctanf, complex double \
|
||||
: ctan, complex long double \
|
||||
: ctanl)(x)
|
||||
#define tan(x) \
|
||||
_Generic((x), \
|
||||
float: tanf, \
|
||||
default: tan, \
|
||||
long double: tanl, \
|
||||
complex float: ctanf, \
|
||||
complex double: ctan, \
|
||||
complex long double: ctanl)(x)
|
||||
|
||||
#define asin(x) \
|
||||
_Generic((x), float \
|
||||
: asinf, default \
|
||||
: asin, long double \
|
||||
: asinl, complex float \
|
||||
: casinf, complex double \
|
||||
: casin, complex long double \
|
||||
: casinl)(x)
|
||||
#define asin(x) \
|
||||
_Generic((x), \
|
||||
float: asinf, \
|
||||
default: asin, \
|
||||
long double: asinl, \
|
||||
complex float: casinf, \
|
||||
complex double: casin, \
|
||||
complex long double: casinl)(x)
|
||||
|
||||
#define acos(x) \
|
||||
_Generic((x), float \
|
||||
: acosf, default \
|
||||
: acos, long double \
|
||||
: acosl, complex float \
|
||||
: cacosf, complex double \
|
||||
: cacos, complex long double \
|
||||
: cacosl)(x)
|
||||
#define acos(x) \
|
||||
_Generic((x), \
|
||||
float: acosf, \
|
||||
default: acos, \
|
||||
long double: acosl, \
|
||||
complex float: cacosf, \
|
||||
complex double: cacos, \
|
||||
complex long double: cacosl)(x)
|
||||
|
||||
#define atan(x) \
|
||||
_Generic((x), float \
|
||||
: atanf, default \
|
||||
: atan, long double \
|
||||
: atanl, complex float \
|
||||
: catanf, complex double \
|
||||
: catan, complex long double \
|
||||
: catanl)(x)
|
||||
#define atan(x) \
|
||||
_Generic((x), \
|
||||
float: atanf, \
|
||||
default: atan, \
|
||||
long double: atanl, \
|
||||
complex float: catanf, \
|
||||
complex double: catan, \
|
||||
complex long double: catanl)(x)
|
||||
|
||||
#define sinh(x) \
|
||||
_Generic((x), float \
|
||||
: sinhf, default \
|
||||
: sinh, long double \
|
||||
: sinhl, complex float \
|
||||
: csinhf, complex double \
|
||||
: csinh, complex long double \
|
||||
: csinhl)(x)
|
||||
#define sinh(x) \
|
||||
_Generic((x), \
|
||||
float: sinhf, \
|
||||
default: sinh, \
|
||||
long double: sinhl, \
|
||||
complex float: csinhf, \
|
||||
complex double: csinh, \
|
||||
complex long double: csinhl)(x)
|
||||
|
||||
#define cosh(x) \
|
||||
_Generic((x), float \
|
||||
: coshf, default \
|
||||
: cosh, long double \
|
||||
: coshl, complex float \
|
||||
: ccoshf, complex double \
|
||||
: ccosh, complex long double \
|
||||
: ccoshl)(x)
|
||||
#define cosh(x) \
|
||||
_Generic((x), \
|
||||
float: coshf, \
|
||||
default: cosh, \
|
||||
long double: coshl, \
|
||||
complex float: ccoshf, \
|
||||
complex double: ccosh, \
|
||||
complex long double: ccoshl)(x)
|
||||
|
||||
#define tanh(x) \
|
||||
_Generic((x), float \
|
||||
: tanhf, default \
|
||||
: tanh, long double \
|
||||
: tanhl, complex float \
|
||||
: ctanhf, complex double \
|
||||
: ctanh, complex long double \
|
||||
: ctanhl)(x)
|
||||
#define tanh(x) \
|
||||
_Generic((x), \
|
||||
float: tanhf, \
|
||||
default: tanh, \
|
||||
long double: tanhl, \
|
||||
complex float: ctanhf, \
|
||||
complex double: ctanh, \
|
||||
complex long double: ctanhl)(x)
|
||||
|
||||
#define asinh(x) \
|
||||
_Generic((x), float \
|
||||
: asinhf, default \
|
||||
: asinh, long double \
|
||||
: asinhl, complex float \
|
||||
: casinhf, complex double \
|
||||
: casinh, complex long double \
|
||||
: casinhl)(x)
|
||||
#define asinh(x) \
|
||||
_Generic((x), \
|
||||
float: asinhf, \
|
||||
default: asinh, \
|
||||
long double: asinhl, \
|
||||
complex float: casinhf, \
|
||||
complex double: casinh, \
|
||||
complex long double: casinhl)(x)
|
||||
|
||||
#define acosh(x) \
|
||||
_Generic((x), float \
|
||||
: acoshf, default \
|
||||
: acosh, long double \
|
||||
: acoshl, complex float \
|
||||
: cacoshf, complex double \
|
||||
: cacosh, complex long double \
|
||||
: cacoshl)(x)
|
||||
#define acosh(x) \
|
||||
_Generic((x), \
|
||||
float: acoshf, \
|
||||
default: acosh, \
|
||||
long double: acoshl, \
|
||||
complex float: cacoshf, \
|
||||
complex double: cacosh, \
|
||||
complex long double: cacoshl)(x)
|
||||
|
||||
#define atanh(x) \
|
||||
_Generic((x), float \
|
||||
: atanhf, default \
|
||||
: atanh, long double \
|
||||
: atanhl, complex float \
|
||||
: catanhf, complex double \
|
||||
: catanh, complex long double \
|
||||
: catanhl)(x)
|
||||
#define atanh(x) \
|
||||
_Generic((x), \
|
||||
float: atanhf, \
|
||||
default: atanh, \
|
||||
long double: atanhl, \
|
||||
complex float: catanhf, \
|
||||
complex double: catanh, \
|
||||
complex long double: catanhl)(x)
|
||||
|
||||
#define atan2(x, y) \
|
||||
_Generic((x), float : atan2f, default : atan2, long double : atan2l)(x, y)
|
||||
_Generic((x), float: atan2f, default: atan2, long double: atan2l)(x, y)
|
||||
|
||||
#define cbrt(x) \
|
||||
_Generic((x), float : cbrtf, default : cbrt, long double : cbrtl)(x)
|
||||
_Generic((x), float: cbrtf, default: cbrt, long double: cbrtl)(x)
|
||||
|
||||
#define ceil(x) \
|
||||
_Generic((x), float : ceilf, default : ceil, long double : ceill)(x)
|
||||
_Generic((x), float: ceilf, default: ceil, long double: ceill)(x)
|
||||
|
||||
#define copysign(x, y) \
|
||||
_Generic((x), float \
|
||||
: copysignf, default \
|
||||
: copysign, long double \
|
||||
: copysignl)(x, y)
|
||||
#define copysign(x, y) \
|
||||
_Generic((x), float: copysignf, default: copysign, long double: copysignl)( \
|
||||
x, y)
|
||||
|
||||
#define erf(x) _Generic((x), float : erff, default : erf, long double : erfl)(x)
|
||||
#define erf(x) _Generic((x), float: erff, default: erf, long double: erfl)(x)
|
||||
|
||||
#define erfc(x) \
|
||||
_Generic((x), float : erfcf, default : erfc, long double : erfcl)(x)
|
||||
_Generic((x), float: erfcf, default: erfc, long double: erfcl)(x)
|
||||
|
||||
#define exp2(x) \
|
||||
_Generic((x), float : exp2f, default : exp2, long double : exp2l)(x)
|
||||
_Generic((x), float: exp2f, default: exp2, long double: exp2l)(x)
|
||||
|
||||
#define expm1(x) \
|
||||
_Generic((x), float : expm1f, default : expm1, long double : expm1l)(x)
|
||||
_Generic((x), float: expm1f, default: expm1, long double: expm1l)(x)
|
||||
|
||||
#define fdim(x, y) \
|
||||
_Generic((x), float : fdimf, default : fdim, long double : fdiml)(x, y)
|
||||
_Generic((x), float: fdimf, default: fdim, long double: fdiml)(x, y)
|
||||
|
||||
#define floor(x) \
|
||||
_Generic((x), float : floorf, default : floor, long double : floorl)(x)
|
||||
_Generic((x), float: floorf, default: floor, long double: floorl)(x)
|
||||
|
||||
#define fma(x, y, z) \
|
||||
_Generic((x), float : fmaf, default : fma, long double : fmal)(x, y, z)
|
||||
_Generic((x), float: fmaf, default: fma, long double: fmal)(x, y, z)
|
||||
|
||||
#define fmax(x, y) \
|
||||
_Generic((x), float : fmaxf, default : fmax, long double : fmaxl)(x, y)
|
||||
_Generic((x), float: fmaxf, default: fmax, long double: fmaxl)(x, y)
|
||||
|
||||
#define fmin(x, y) \
|
||||
_Generic((x), float : fminf, default : fmin, long double : fminl)(x, y)
|
||||
_Generic((x), float: fminf, default: fmin, long double: fminl)(x, y)
|
||||
|
||||
#define fmod(x, y) \
|
||||
_Generic((x), float : fmodf, default : fmod, long double : fmodl)(x, y)
|
||||
_Generic((x), float: fmodf, default: fmod, long double: fmodl)(x, y)
|
||||
|
||||
#define frexp(x, y) \
|
||||
_Generic((x), float : frexpf, default : frexp, long double : frexpl)(x, y)
|
||||
_Generic((x), float: frexpf, default: frexp, long double: frexpl)(x, y)
|
||||
|
||||
#define hypot(x, y) \
|
||||
_Generic((x), float : hypotf, default : hypot, long double : hypotl)(x, y)
|
||||
_Generic((x), float: hypotf, default: hypot, long double: hypotl)(x, y)
|
||||
|
||||
#define ilogb(x) \
|
||||
_Generic((x), float : ilogbf, default : ilogb, long double : ilogbl)(x)
|
||||
_Generic((x), float: ilogbf, default: ilogb, long double: ilogbl)(x)
|
||||
|
||||
#define ldexp(x, y) \
|
||||
_Generic((x), float : ldexpf, default : ldexp, long double : ldexpl)(x, y)
|
||||
_Generic((x), float: ldexpf, default: ldexp, long double: ldexpl)(x, y)
|
||||
|
||||
#define lgamma(x) \
|
||||
_Generic((x), float : lgammaf, default : lgamma, long double : lgammal)(x)
|
||||
_Generic((x), float: lgammaf, default: lgamma, long double: lgammal)(x)
|
||||
|
||||
#define llrint(x) \
|
||||
_Generic((x), float : llrintf, default : llrint, long double : llrintl)(x)
|
||||
_Generic((x), float: llrintf, default: llrint, long double: llrintl)(x)
|
||||
|
||||
#define llround(x) \
|
||||
_Generic((x), float : llroundf, default : llround, long double : llroundl)(x)
|
||||
_Generic((x), float: llroundf, default: llround, long double: llroundl)(x)
|
||||
|
||||
#define log10(x) \
|
||||
_Generic((x), float : log10f, default : log10, long double : log10l)(x)
|
||||
_Generic((x), float: log10f, default: log10, long double: log10l)(x)
|
||||
|
||||
#define log1p(x) \
|
||||
_Generic((x), float : log1pf, default : log1p, long double : log1pl)(x)
|
||||
_Generic((x), float: log1pf, default: log1p, long double: log1pl)(x)
|
||||
|
||||
#define log2(x) \
|
||||
_Generic((x), float : log2f, default : log2, long double : log2l)(x)
|
||||
_Generic((x), float: log2f, default: log2, long double: log2l)(x)
|
||||
|
||||
#define logb(x) \
|
||||
_Generic((x), float : logbf, default : logb, long double : logbl)(x)
|
||||
_Generic((x), float: logbf, default: logb, long double: logbl)(x)
|
||||
|
||||
#define lrint(x) \
|
||||
_Generic((x), float : lrintf, default : lrint, long double : lrintl)(x)
|
||||
_Generic((x), float: lrintf, default: lrint, long double: lrintl)(x)
|
||||
|
||||
#define lround(x) \
|
||||
_Generic((x), float : lroundf, default : lround, long double : lroundl)(x)
|
||||
_Generic((x), float: lroundf, default: lround, long double: lroundl)(x)
|
||||
|
||||
#define nearbyint(x) \
|
||||
_Generic((x), float \
|
||||
: nearbyintf, default \
|
||||
: nearbyint, long double \
|
||||
: nearbyintl)(x)
|
||||
#define nearbyint(x) \
|
||||
_Generic((x), \
|
||||
float: nearbyintf, \
|
||||
default: nearbyint, \
|
||||
long double: nearbyintl)(x)
|
||||
|
||||
#define nextafter(x, y) \
|
||||
_Generic((x), float \
|
||||
: nextafterf, default \
|
||||
: nextafter, long double \
|
||||
: nextafterl)(x, y)
|
||||
#define nextafter(x, y) \
|
||||
_Generic((x), \
|
||||
float: nextafterf, \
|
||||
default: nextafter, \
|
||||
long double: nextafterl)(x, y)
|
||||
|
||||
#define nexttoward(x, y) \
|
||||
_Generic((x), float \
|
||||
: nexttowardf, default \
|
||||
: nexttoward, long double \
|
||||
: nexttowardl)(x, y)
|
||||
#define nexttoward(x, y) \
|
||||
_Generic((x), \
|
||||
float: nexttowardf, \
|
||||
default: nexttoward, \
|
||||
long double: nexttowardl)(x, y)
|
||||
|
||||
#define remainder(x, y) \
|
||||
_Generic((x), float \
|
||||
: remainderf, default \
|
||||
: remainder, long double \
|
||||
: remainderl)(x, y)
|
||||
#define remainder(x, y) \
|
||||
_Generic((x), \
|
||||
float: remainderf, \
|
||||
default: remainder, \
|
||||
long double: remainderl)(x, y)
|
||||
|
||||
#define remquo(x, y, z) \
|
||||
_Generic((x), float \
|
||||
: remquof, default \
|
||||
: remquo, long double \
|
||||
: remquol)(x, y, z)
|
||||
#define remquo(x, y, z) \
|
||||
_Generic((x), float: remquof, default: remquo, long double: remquol)(x, y, z)
|
||||
|
||||
#define rint(x) \
|
||||
_Generic((x), float : rintf, default : rint, long double : rintl)(x)
|
||||
_Generic((x), float: rintf, default: rint, long double: rintl)(x)
|
||||
|
||||
#define round(x) \
|
||||
_Generic((x), float : roundf, default : round, long double : roundl)(x)
|
||||
_Generic((x), float: roundf, default: round, long double: roundl)(x)
|
||||
|
||||
#define scalbln(x, y) \
|
||||
_Generic((x), float \
|
||||
: scalblnf, default \
|
||||
: scalbln, long double \
|
||||
: scalblnl)(x, y)
|
||||
#define scalbln(x, y) \
|
||||
_Generic((x), float: scalblnf, default: scalbln, long double: scalblnl)(x, y)
|
||||
|
||||
#define scalbn(x, y) \
|
||||
_Generic((x), float : scalbnf, default : scalbn, long double : scalbnl)(x, y)
|
||||
_Generic((x), float: scalbnf, default: scalbn, long double: scalbnl)(x, y)
|
||||
|
||||
#define tgamma(x) \
|
||||
_Generic((x), float : tgammaf, default : tgamma, long double : tgammal)(x)
|
||||
_Generic((x), float: tgammaf, default: tgamma, long double: tgammal)(x)
|
||||
|
||||
#define trunc(x) \
|
||||
_Generic((x), float : truncf, default : trunc, long double : truncl)(x)
|
||||
_Generic((x), float: truncf, default: trunc, long double: truncl)(x)
|
||||
|
||||
#define carg(x) \
|
||||
_Generic((x), complex float \
|
||||
: cargf, default \
|
||||
: carg, complex long double \
|
||||
: cargl)(x)
|
||||
#define carg(x) \
|
||||
_Generic((x), \
|
||||
complex float: cargf, \
|
||||
default: carg, \
|
||||
complex long double: cargl)(x)
|
||||
|
||||
#define conj(x) \
|
||||
_Generic((x), complex float \
|
||||
: conjf, default \
|
||||
: conj, complex long double \
|
||||
: conjl)(x)
|
||||
#define conj(x) \
|
||||
_Generic((x), \
|
||||
complex float: conjf, \
|
||||
default: conj, \
|
||||
complex long double: conjl)(x)
|
||||
|
||||
#undef creal
|
||||
#define creal(x) \
|
||||
_Generic((x), complex float \
|
||||
: crealf, default \
|
||||
: creal, complex long double \
|
||||
: creall)(x)
|
||||
#define creal(x) \
|
||||
_Generic((x), \
|
||||
complex float: crealf, \
|
||||
default: creal, \
|
||||
complex long double: creall)(x)
|
||||
|
||||
#undef cimag
|
||||
#define cimag(x) \
|
||||
_Generic((x), complex float \
|
||||
: cimagf, default \
|
||||
: cimag, complex long double \
|
||||
: cimagl)(x)
|
||||
#define cimag(x) \
|
||||
_Generic((x), \
|
||||
complex float: cimagf, \
|
||||
default: cimag, \
|
||||
complex long double: cimagl)(x)
|
||||
|
||||
#define cproj(x) \
|
||||
_Generic((x), complex float \
|
||||
: cprojf, default \
|
||||
: cproj, complex long double \
|
||||
: cprojl)(x)
|
||||
#define cproj(x) \
|
||||
_Generic((x), \
|
||||
complex float: cprojf, \
|
||||
default: cproj, \
|
||||
complex long double: cprojl)(x)
|
||||
|
||||
#endif /* C11 */
|
||||
#endif /* _TGMATH_H */
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/struct/rusage.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/math.h"
|
||||
#include "libc/runtime/clktck.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/stdio/append.h"
|
||||
|
||||
struct State {
|
||||
|
|
|
@ -36,7 +36,8 @@ COSMOPOLITAN_C_START_
|
|||
: "=r"(Info)); \
|
||||
Cond = (x); \
|
||||
++Info->total; \
|
||||
if (Cond) ++Info->taken; \
|
||||
if (Cond) \
|
||||
++Info->taken; \
|
||||
Cond; \
|
||||
})
|
||||
|
||||
|
|
|
@ -31,7 +31,8 @@ int AttachDebugger(intptr_t);
|
|||
while ((Rc = __inline_wait4(Pid, NULL, WNOHANG, NULL)) == 0) { \
|
||||
if (g_gdbsync) { \
|
||||
g_gdbsync = 0; \
|
||||
if (Rc > 0) Pid = 0; \
|
||||
if (Rc > 0) \
|
||||
Pid = 0; \
|
||||
break; \
|
||||
} else { \
|
||||
sched_yield(); \
|
||||
|
|
|
@ -5,13 +5,15 @@ COSMOPOLITAN_C_START_
|
|||
|
||||
forceinline unsigned long __strlen(const char *s) {
|
||||
unsigned long n = 0;
|
||||
while (*s++) ++n;
|
||||
while (*s++)
|
||||
++n;
|
||||
return n;
|
||||
}
|
||||
|
||||
forceinline int __strcmp(const char *l, const char *r) {
|
||||
size_t i = 0;
|
||||
while (l[i] == r[i] && r[i]) ++i;
|
||||
while (l[i] == r[i] && r[i])
|
||||
++i;
|
||||
return (l[i] & 255) - (r[i] & 255);
|
||||
}
|
||||
|
||||
|
@ -86,12 +88,14 @@ forceinline char *__uintcpy(char p[hasatleast 21], uint64_t x) {
|
|||
}
|
||||
|
||||
forceinline char *__intcpy(char p[hasatleast 21], int64_t x) {
|
||||
if (x < 0) *p++ = '-', x = -(uint64_t)x;
|
||||
if (x < 0)
|
||||
*p++ = '-', x = -(uint64_t)x;
|
||||
return __uintcpy(p, x);
|
||||
}
|
||||
|
||||
forceinline char *__fixcpy(char p[hasatleast 17], uint64_t x, uint8_t k) {
|
||||
while (k > 0) *p++ = "0123456789abcdef"[(x >> (k -= 4)) & 15];
|
||||
while (k > 0)
|
||||
*p++ = "0123456789abcdef"[(x >> (k -= 4)) & 15];
|
||||
*p = '\0';
|
||||
return p;
|
||||
}
|
||||
|
@ -114,11 +118,15 @@ forceinline char *__strstr(const char *haystack, const char *needle) {
|
|||
size_t i;
|
||||
for (;;) {
|
||||
for (i = 0;; ++i) {
|
||||
if (!needle[i]) return (/*unconst*/ char *)haystack;
|
||||
if (!haystack[i]) break;
|
||||
if (needle[i] != haystack[i]) break;
|
||||
if (!needle[i])
|
||||
return (/*unconst*/ char *)haystack;
|
||||
if (!haystack[i])
|
||||
break;
|
||||
if (needle[i] != haystack[i])
|
||||
break;
|
||||
}
|
||||
if (!*haystack++) break;
|
||||
if (!*haystack++)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -128,35 +136,44 @@ forceinline char16_t *__strstr16(const char16_t *haystack,
|
|||
size_t i;
|
||||
for (;;) {
|
||||
for (i = 0;; ++i) {
|
||||
if (!needle[i]) return (/*unconst*/ char16_t *)haystack;
|
||||
if (!haystack[i]) break;
|
||||
if (needle[i] != haystack[i]) break;
|
||||
if (!needle[i])
|
||||
return (/*unconst*/ char16_t *)haystack;
|
||||
if (!haystack[i])
|
||||
break;
|
||||
if (needle[i] != haystack[i])
|
||||
break;
|
||||
}
|
||||
if (!*haystack++) break;
|
||||
if (!*haystack++)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
forceinline const char *__strchr(const char *s, unsigned char c) {
|
||||
for (;; ++s) {
|
||||
if ((*s & 255) == c) return s;
|
||||
if (!*s) return 0;
|
||||
if ((*s & 255) == c)
|
||||
return s;
|
||||
if (!*s)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
forceinline unsigned long __atoul(const char *p) {
|
||||
int c;
|
||||
unsigned long x = 0;
|
||||
while ('0' <= (c = *p++) && c <= '9') x *= 10, x += c - '0';
|
||||
while ('0' <= (c = *p++) && c <= '9')
|
||||
x *= 10, x += c - '0';
|
||||
return x;
|
||||
}
|
||||
|
||||
forceinline long __atol(const char *p) {
|
||||
int s = *p;
|
||||
unsigned long x;
|
||||
if (s == '-' || s == '+') ++p;
|
||||
if (s == '-' || s == '+')
|
||||
++p;
|
||||
x = __atoul(p);
|
||||
if (s == '-') x = -x;
|
||||
if (s == '-')
|
||||
x = -x;
|
||||
return x;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,22 +61,26 @@ extern unsigned __log_level; /* log level for runtime check */
|
|||
// log a message with the specified log level (not checking if LOGGABLE)
|
||||
#define LOGF(LEVEL, FMT, ...) \
|
||||
do { \
|
||||
if (!_LOG_TINY) _log_untrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_untrace(); \
|
||||
flogf(LEVEL, __FILE__, __LINE__, NULL, FMT, ##__VA_ARGS__); \
|
||||
if (!_LOG_TINY) _log_retrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_retrace(); \
|
||||
} while (0)
|
||||
|
||||
// report an error without backtrace and debugger invocation
|
||||
#define FATALF(FMT, ...) \
|
||||
do { \
|
||||
if (!_LOG_TINY) _log_untrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_untrace(); \
|
||||
flogf(kLogError, __FILE__, __LINE__, NULL, FMT, ##__VA_ARGS__); \
|
||||
_log_exit(1); \
|
||||
} while (0)
|
||||
|
||||
#define DIEF(FMT, ...) \
|
||||
do { \
|
||||
if (!_LOG_TINY) _log_untrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_untrace(); \
|
||||
ffatalf(kLogFatal, __FILE__, __LINE__, NULL, FMT, ##__VA_ARGS__); \
|
||||
__builtin_unreachable(); \
|
||||
} while (0)
|
||||
|
@ -105,51 +109,62 @@ extern unsigned __log_level; /* log level for runtime check */
|
|||
#define VERBOSEF(FMT, ...) \
|
||||
do { \
|
||||
if (LOGGABLE(kLogVerbose)) { \
|
||||
if (!_LOG_TINY) _log_untrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_untrace(); \
|
||||
fverbosef(kLogVerbose, __FILE__, __LINE__, NULL, FMT, ##__VA_ARGS__); \
|
||||
if (!_LOG_TINY) _log_retrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_retrace(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define DEBUGF(FMT, ...) \
|
||||
do { \
|
||||
if (_LOG_UNLIKELY(LOGGABLE(kLogDebug))) { \
|
||||
if (!_LOG_TINY) _log_untrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_untrace(); \
|
||||
fdebugf(kLogDebug, __FILE__, __LINE__, NULL, FMT, ##__VA_ARGS__); \
|
||||
if (!_LOG_TINY) _log_retrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_retrace(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define NOISEF(FMT, ...) \
|
||||
do { \
|
||||
if (_LOG_UNLIKELY(LOGGABLE(kLogNoise))) { \
|
||||
if (!_LOG_TINY) _log_untrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_untrace(); \
|
||||
fnoisef(kLogNoise, __FILE__, __LINE__, NULL, FMT, ##__VA_ARGS__); \
|
||||
if (!_LOG_TINY) _log_retrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_retrace(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define FLOGF(F, FMT, ...) \
|
||||
do { \
|
||||
if (LOGGABLE(kLogInfo)) { \
|
||||
if (!_LOG_TINY) _log_untrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_untrace(); \
|
||||
flogf(kLogInfo, __FILE__, __LINE__, F, FMT, ##__VA_ARGS__); \
|
||||
if (!_LOG_TINY) _log_retrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_retrace(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define FWARNF(F, FMT, ...) \
|
||||
do { \
|
||||
if (LOGGABLE(kLogWarn)) { \
|
||||
if (!_LOG_TINY) _log_untrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_untrace(); \
|
||||
flogf(kLogWarn, __FILE__, __LINE__, F, FMT, ##__VA_ARGS__); \
|
||||
if (!_LOG_TINY) _log_retrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_retrace(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define FFATALF(F, FMT, ...) \
|
||||
do { \
|
||||
if (!_LOG_TINY) _log_untrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_untrace(); \
|
||||
flogf(kLogError, __FILE__, __LINE__, F, FMT, ##__VA_ARGS__); \
|
||||
_log_exit(1); \
|
||||
} while (0)
|
||||
|
@ -157,18 +172,22 @@ extern unsigned __log_level; /* log level for runtime check */
|
|||
#define FDEBUGF(F, FMT, ...) \
|
||||
do { \
|
||||
if (_LOG_UNLIKELY(LOGGABLE(kLogDebug))) { \
|
||||
if (!_LOG_TINY) _log_untrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_untrace(); \
|
||||
fdebugf(kLogDebug, __FILE__, __LINE__, F, FMT, ##__VA_ARGS__); \
|
||||
if (!_LOG_TINY) _log_retrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_retrace(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define FNOISEF(F, FMT, ...) \
|
||||
do { \
|
||||
if (_LOG_UNLIKELY(LOGGABLE(kLogNoise))) { \
|
||||
if (!_LOG_TINY) _log_untrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_untrace(); \
|
||||
fnoisef(kLogNoise, __FILE__, __LINE__, F, FMT, ##__VA_ARGS__); \
|
||||
if (!_LOG_TINY) _log_retrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_retrace(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
@ -177,9 +196,11 @@ extern unsigned __log_level; /* log level for runtime check */
|
|||
int e = _log_get_errno(); \
|
||||
autotype(FORM) Ax = (FORM); \
|
||||
if (_LOG_UNLIKELY(Ax == (typeof(Ax))(-1)) && LOGGABLE(kLogWarn)) { \
|
||||
if (!_LOG_TINY) _log_untrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_untrace(); \
|
||||
_log_errno(__FILE__, __LINE__, #FORM); \
|
||||
if (!_LOG_TINY) _log_retrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_retrace(); \
|
||||
_log_set_errno(e); \
|
||||
} \
|
||||
Ax; \
|
||||
|
@ -190,9 +211,11 @@ extern unsigned __log_level; /* log level for runtime check */
|
|||
int e = _log_get_errno(); \
|
||||
autotype(FORM) Ax = (FORM); \
|
||||
if (Ax == NULL && LOGGABLE(kLogWarn)) { \
|
||||
if (!_LOG_TINY) _log_untrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_untrace(); \
|
||||
_log_errno(__FILE__, __LINE__, #FORM); \
|
||||
if (!_LOG_TINY) _log_retrace(); \
|
||||
if (!_LOG_TINY) \
|
||||
_log_retrace(); \
|
||||
_log_set_errno(e); \
|
||||
} \
|
||||
Ax; \
|
||||
|
|
|
@ -16,12 +16,12 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/log/backtrace.internal.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/runtime/symbols.internal.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
#define IS2POW(X) (!((X) & ((X) - 1)))
|
||||
#define ROUNDUP(X, K) (((X) + (K) - 1) & -(K))
|
||||
#define IS2POW(X) (!((X) & ((X)-1)))
|
||||
#define ROUNDUP(X, K) (((X) + (K)-1) & -(K))
|
||||
#define ROUNDDOWN(X, K) ((X) & -(K))
|
||||
#ifndef __ASSEMBLER__
|
||||
#define ABS(X) ((X) >= 0 ? (X) : -(X))
|
||||
|
@ -40,7 +40,7 @@
|
|||
#define STRINGIFY(A) __STRINGIFY(A)
|
||||
#define EQUIVALENT(X, Y) (__builtin_constant_p((X) == (Y)) && ((X) == (Y)))
|
||||
#define TYPE_BIT(type) (sizeof(type) * CHAR_BIT)
|
||||
#define TYPE_SIGNED(type) (((type) - 1) < 0)
|
||||
#define TYPE_SIGNED(type) (((type)-1) < 0)
|
||||
#define TYPE_INTEGRAL(type) (((type)0.5) != 0.5)
|
||||
|
||||
#define ARRAYLEN(A) \
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "libc/nexgen32e/x86feature.h"
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define TSC_AUX_CORE(MSR) ((MSR) & 0xfff)
|
||||
#define TSC_AUX_CORE(MSR) ((MSR)&0xfff)
|
||||
#define TSC_AUX_NODE(MSR) (((MSR) >> 12) & 0xfff)
|
||||
|
||||
/**
|
||||
|
@ -25,7 +25,8 @@ COSMOPOLITAN_C_START_
|
|||
: /* no inputs */ \
|
||||
: "memory"); \
|
||||
EcxOut = (OPT_OUT_IA32_TSC_AUX); \
|
||||
if (EcxOut) *EcxOut = Ecx; \
|
||||
if (EcxOut) \
|
||||
*EcxOut = Ecx; \
|
||||
Rdx << 32 | Rax; \
|
||||
})
|
||||
|
||||
|
|
|
@ -2,22 +2,22 @@
|
|||
#define COSMOPOLITAN_LIBC_NT_ENUM_CONSOLEMODEFLAGS_H_
|
||||
|
||||
/* input mode */
|
||||
#define kNtEnableProcessedInput 0x0001u
|
||||
#define kNtEnableLineInput 0x0002u
|
||||
#define kNtEnableEchoInput 0x0004u
|
||||
#define kNtEnableWindowInput 0x0008u
|
||||
#define kNtEnableMouseInput 0x0010u
|
||||
#define kNtEnableInsertMode 0x0020u
|
||||
#define kNtEnableQuickEditMode 0x0040u
|
||||
#define kNtEnableExtendedFlags 0x0080u
|
||||
#define kNtEnableAutoPosition 0x0100u
|
||||
#define kNtEnableProcessedInput 0x0001u
|
||||
#define kNtEnableLineInput 0x0002u
|
||||
#define kNtEnableEchoInput 0x0004u
|
||||
#define kNtEnableWindowInput 0x0008u
|
||||
#define kNtEnableMouseInput 0x0010u
|
||||
#define kNtEnableInsertMode 0x0020u
|
||||
#define kNtEnableQuickEditMode 0x0040u
|
||||
#define kNtEnableExtendedFlags 0x0080u
|
||||
#define kNtEnableAutoPosition 0x0100u
|
||||
#define kNtEnableVirtualTerminalInput 0x0200u
|
||||
|
||||
/* output mode */
|
||||
#define kNtEnableProcessedOutput 0x0001u
|
||||
#define kNtEnableWrapAtEolOutput 0x0002u
|
||||
#define kNtEnableProcessedOutput 0x0001u
|
||||
#define kNtEnableWrapAtEolOutput 0x0002u
|
||||
#define kNtEnableVirtualTerminalProcessing 0x0004u
|
||||
#define kNtDisableNewlineAutoReturn 0x0008u
|
||||
#define kNtEnableLvbGridWorldwide 0x0010u
|
||||
#define kNtDisableNewlineAutoReturn 0x0008u
|
||||
#define kNtEnableLvbGridWorldwide 0x0010u
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_CONSOLEMODEFLAGS_H_ */
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_CONSOLESELECTIONFLAGS_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_ENUM_CONSOLESELECTIONFLAGS_H_
|
||||
|
||||
#define kNtConsoleNoSelection 0x0000u
|
||||
#define kNtConsoleNoSelection 0x0000u
|
||||
#define kNtConsoleSelectionInProgress 0x0001u
|
||||
#define kNtConsoleSelectionNotEmpty 0x0002u
|
||||
#define kNtConsoleMouseSelection 0x0004u
|
||||
#define kNtConsoleMouseDown 0x0008u
|
||||
#define kNtConsoleSelectionNotEmpty 0x0002u
|
||||
#define kNtConsoleMouseSelection 0x0004u
|
||||
#define kNtConsoleMouseDown 0x0008u
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_CONSOLESELECTIONFLAGS_H_ */
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_CREATIONDISPOSITION_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_ENUM_CREATIONDISPOSITION_H_
|
||||
|
||||
#define kNtCreateNew 1
|
||||
#define kNtCreateAlways 2
|
||||
#define kNtOpenExisting 3
|
||||
#define kNtOpenAlways 4
|
||||
#define kNtCreateNew 1
|
||||
#define kNtCreateAlways 2
|
||||
#define kNtOpenExisting 3
|
||||
#define kNtOpenAlways 4
|
||||
#define kNtTruncateExisting 5
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_CREATIONDISPOSITION_H_ */
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_CTRLEVENT_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_ENUM_CTRLEVENT_H_
|
||||
|
||||
#define kNtCtrlCEvent 0 /* SIGINT */
|
||||
#define kNtCtrlBreakEvent 1 /* SIGQUIT */
|
||||
#define kNtCtrlCloseEvent 2 /* SIGHUP */
|
||||
#define kNtCtrlLogoffEvent 5 /* SIGTERM */
|
||||
#define kNtCtrlCEvent 0 /* SIGINT */
|
||||
#define kNtCtrlBreakEvent 1 /* SIGQUIT */
|
||||
#define kNtCtrlCloseEvent 2 /* SIGHUP */
|
||||
#define kNtCtrlLogoffEvent 5 /* SIGTERM */
|
||||
#define kNtCtrlShutdownEvent 6
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_CTRLEVENT_H_ */
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_EXCEPTIONHANDLERACTIONS_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_ENUM_EXCEPTIONHANDLERACTIONS_H_
|
||||
|
||||
#define kNtExceptionExecuteHandler 0x1u
|
||||
#define kNtExceptionExecuteHandler 0x1u
|
||||
#define kNtExceptionContinueExecution 0xffffffffu
|
||||
#define kNtExceptionContinueSearch 0x0u
|
||||
#define kNtExceptionContinueSearch 0x0u
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_EXCEPTIONHANDLERACTIONS_H_ */
|
||||
|
|
|
@ -1,46 +1,46 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_FILEINFORMATIONCLASS_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_ENUM_FILEINFORMATIONCLASS_H_
|
||||
|
||||
#define kNtFileDirectoryInformation 1 /*→ struct NtFileDirectoryInformation */
|
||||
#define kNtFileFullDirectoryInformation 2 /*→ etc. */
|
||||
#define kNtFileBothDirectoryInformation 3
|
||||
#define kNtFileBasicInformation 4
|
||||
#define kNtFileStandardInformation 5
|
||||
#define kNtFileInternalInformation 6
|
||||
#define kNtFileEaInformation 7
|
||||
#define kNtFileAccessInformation 8
|
||||
#define kNtFileNameInformation 9
|
||||
#define kNtFileRenameInformation 10
|
||||
#define kNtFileLinkInformation 11
|
||||
#define kNtFileNamesInformation 12
|
||||
#define kNtFileDispositionInformation 13
|
||||
#define kNtFilePositionInformation 14
|
||||
#define kNtFileFullEaInformation 15
|
||||
#define kNtFileModeInformation 16
|
||||
#define kNtFileAlignmentInformation 17
|
||||
#define kNtFileAllInformation 18
|
||||
#define kNtFileAllocationInformation 19
|
||||
#define kNtFileEndOfFileInformation 20
|
||||
#define kNtFileAlternateNameInformation 21
|
||||
#define kNtFileStreamInformation 22
|
||||
#define kNtFilePipeInformation 23
|
||||
#define kNtFilePipeLocalInformation 24
|
||||
#define kNtFilePipeRemoteInformation 25
|
||||
#define kNtFileMailslotQueryInformation 26
|
||||
#define kNtFileMailslotSetInformation 27
|
||||
#define kNtFileCompressionInformation 28
|
||||
#define kNtFileObjectIdInformation 29
|
||||
#define kNtFileCompletionInformation 30
|
||||
#define kNtFileMoveClusterInformation 31
|
||||
#define kNtFileQuotaInformation 32
|
||||
#define kNtFileReparsePointInformation 33
|
||||
#define kNtFileNetworkOpenInformation 34
|
||||
#define kNtFileAttributeTagInformation 35
|
||||
#define kNtFileTrackingInformation 36
|
||||
#define kNtFileDirectoryInformation 1 /*→ struct NtFileDirectoryInformation */
|
||||
#define kNtFileFullDirectoryInformation 2 /*→ etc. */
|
||||
#define kNtFileBothDirectoryInformation 3
|
||||
#define kNtFileBasicInformation 4
|
||||
#define kNtFileStandardInformation 5
|
||||
#define kNtFileInternalInformation 6
|
||||
#define kNtFileEaInformation 7
|
||||
#define kNtFileAccessInformation 8
|
||||
#define kNtFileNameInformation 9
|
||||
#define kNtFileRenameInformation 10
|
||||
#define kNtFileLinkInformation 11
|
||||
#define kNtFileNamesInformation 12
|
||||
#define kNtFileDispositionInformation 13
|
||||
#define kNtFilePositionInformation 14
|
||||
#define kNtFileFullEaInformation 15
|
||||
#define kNtFileModeInformation 16
|
||||
#define kNtFileAlignmentInformation 17
|
||||
#define kNtFileAllInformation 18
|
||||
#define kNtFileAllocationInformation 19
|
||||
#define kNtFileEndOfFileInformation 20
|
||||
#define kNtFileAlternateNameInformation 21
|
||||
#define kNtFileStreamInformation 22
|
||||
#define kNtFilePipeInformation 23
|
||||
#define kNtFilePipeLocalInformation 24
|
||||
#define kNtFilePipeRemoteInformation 25
|
||||
#define kNtFileMailslotQueryInformation 26
|
||||
#define kNtFileMailslotSetInformation 27
|
||||
#define kNtFileCompressionInformation 28
|
||||
#define kNtFileObjectIdInformation 29
|
||||
#define kNtFileCompletionInformation 30
|
||||
#define kNtFileMoveClusterInformation 31
|
||||
#define kNtFileQuotaInformation 32
|
||||
#define kNtFileReparsePointInformation 33
|
||||
#define kNtFileNetworkOpenInformation 34
|
||||
#define kNtFileAttributeTagInformation 35
|
||||
#define kNtFileTrackingInformation 36
|
||||
#define kNtFileIdBothDirectoryInformation 37
|
||||
#define kNtFileIdFullDirectoryInformation 38
|
||||
#define kNtFileValidDataLengthInformation 39
|
||||
#define kNtFileShortNameInformation 40
|
||||
#define kNtFileInformation_MAX 40
|
||||
#define kNtFileShortNameInformation 40
|
||||
#define kNtFileInformation_MAX 40
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_FILEINFORMATIONCLASS_H_ */
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#define COSMOPOLITAN_LIBC_NT_ENUM_FILESHAREFLAGS_H_
|
||||
|
||||
#define kNtFileShareExclusive 0x00000000u
|
||||
#define kNtFileShareRead 0x00000001u
|
||||
#define kNtFileShareWrite 0x00000002u
|
||||
#define kNtFileShareDelete 0x00000004u
|
||||
#define kNtFileShareRead 0x00000001u
|
||||
#define kNtFileShareWrite 0x00000002u
|
||||
#define kNtFileShareDelete 0x00000004u
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_FILESHAREFLAGS_H_ */
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_NTFILLATTRIBUTE_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_NTFILLATTRIBUTE_H_
|
||||
|
||||
#define kNtForegroundBlue 0x0001
|
||||
#define kNtForegroundGreen 0x0002
|
||||
#define kNtForegroundRed 0x0004
|
||||
#define kNtForegroundBlue 0x0001
|
||||
#define kNtForegroundGreen 0x0002
|
||||
#define kNtForegroundRed 0x0004
|
||||
#define kNtForegroundIntensity 0x0008
|
||||
#define kNtBackgroundBlue 0x0010
|
||||
#define kNtBackgroundGreen 0x0020
|
||||
#define kNtBackgroundRed 0x0040
|
||||
#define kNtBackgroundBlue 0x0010
|
||||
#define kNtBackgroundGreen 0x0020
|
||||
#define kNtBackgroundRed 0x0040
|
||||
#define kNtBackgroundIntensity 0x0080
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_NTFILLATTRIBUTE_H_ */
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_FSINFORMATIONCLASS_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_ENUM_FSINFORMATIONCLASS_H_
|
||||
|
||||
#define kNtFileFsVolumeInformation 1
|
||||
#define kNtFileFsLabelInformation 2
|
||||
#define kNtFileFsSizeInformation 3
|
||||
#define kNtFileFsDeviceInformation 4
|
||||
#define kNtFileFsAttributeInformation 5
|
||||
#define kNtFileFsControlInformation 6
|
||||
#define kNtFileFsFullSizeInformation 7
|
||||
#define kNtFileFsObjectIdInformation 8
|
||||
#define kNtFileFsVolumeInformation 1
|
||||
#define kNtFileFsLabelInformation 2
|
||||
#define kNtFileFsSizeInformation 3
|
||||
#define kNtFileFsDeviceInformation 4
|
||||
#define kNtFileFsAttributeInformation 5
|
||||
#define kNtFileFsControlInformation 6
|
||||
#define kNtFileFsFullSizeInformation 7
|
||||
#define kNtFileFsObjectIdInformation 8
|
||||
#define kNtFileFsDriverPathInformation 9
|
||||
#define kNtFileFsInformation_MAX 10
|
||||
#define kNtFileFsInformation_MAX 10
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_FSINFORMATIONCLASS_H_ */
|
||||
|
|
|
@ -1,33 +1,33 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_KWAITREASON_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_ENUM_KWAITREASON_H_
|
||||
|
||||
#define kNtExecutive 0
|
||||
#define kNtFreePage 1
|
||||
#define kNtPageIn 2
|
||||
#define kNtPoolAllocation 3
|
||||
#define kNtDelayExecution 4
|
||||
#define kNtSuspended 5
|
||||
#define kNtUserRequest 6
|
||||
#define kNtWrExecutive 7
|
||||
#define kNtWrFreePage 8
|
||||
#define kNtWrPageIn 9
|
||||
#define kNtWrPoolAllocation 10
|
||||
#define kNtWrDelayExecution 11
|
||||
#define kNtWrSuspended 12
|
||||
#define kNtWrUserRequest 13
|
||||
#define kNtWrEventPair 14
|
||||
#define kNtWrQueue 15
|
||||
#define kNtWrLpcReceive 16
|
||||
#define kNtWrLpcReply 17
|
||||
#define kNtWrVirtualMemory 18
|
||||
#define kNtWrPageOut 19
|
||||
#define kNtWrRendezvous 20
|
||||
#define kNtSpare2 21
|
||||
#define kNtSpare3 22
|
||||
#define kNtSpare4 23
|
||||
#define kNtSpare5 24
|
||||
#define kNtSpare6 25
|
||||
#define kNtWrKernel 26
|
||||
#define kNtExecutive 0
|
||||
#define kNtFreePage 1
|
||||
#define kNtPageIn 2
|
||||
#define kNtPoolAllocation 3
|
||||
#define kNtDelayExecution 4
|
||||
#define kNtSuspended 5
|
||||
#define kNtUserRequest 6
|
||||
#define kNtWrExecutive 7
|
||||
#define kNtWrFreePage 8
|
||||
#define kNtWrPageIn 9
|
||||
#define kNtWrPoolAllocation 10
|
||||
#define kNtWrDelayExecution 11
|
||||
#define kNtWrSuspended 12
|
||||
#define kNtWrUserRequest 13
|
||||
#define kNtWrEventPair 14
|
||||
#define kNtWrQueue 15
|
||||
#define kNtWrLpcReceive 16
|
||||
#define kNtWrLpcReply 17
|
||||
#define kNtWrVirtualMemory 18
|
||||
#define kNtWrPageOut 19
|
||||
#define kNtWrRendezvous 20
|
||||
#define kNtSpare2 21
|
||||
#define kNtSpare3 22
|
||||
#define kNtSpare4 23
|
||||
#define kNtSpare5 24
|
||||
#define kNtSpare6 25
|
||||
#define kNtWrKernel 26
|
||||
#define kNtMaximumWaitReason 27
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_KWAITREASON_H_ */
|
||||
|
|
|
@ -2,19 +2,19 @@
|
|||
#define COSMOPOLITAN_LIBC_NT_ENUM_PROCESSACCESS_H_
|
||||
#include "libc/nt/enum/accessmask.h"
|
||||
|
||||
#define kNtProcessCreateProcess 0x0080u
|
||||
#define kNtProcessCreateThread 0x0002u
|
||||
#define kNtProcessDupHandle 0x0040u
|
||||
#define kNtProcessQueryInformation 0x0400u
|
||||
#define kNtProcessCreateProcess 0x0080u
|
||||
#define kNtProcessCreateThread 0x0002u
|
||||
#define kNtProcessDupHandle 0x0040u
|
||||
#define kNtProcessQueryInformation 0x0400u
|
||||
#define kNtProcessQueryLimitedInformation 0x1000u
|
||||
#define kNtProcessSetInformation 0x0200u
|
||||
#define kNtProcessSetQuota 0x0100u
|
||||
#define kNtProcessSuspendResume 0x0800u
|
||||
#define kNtProcessTerminate 0x0001u
|
||||
#define kNtProcessVmOperation 0x0008u
|
||||
#define kNtProcessVmRead 0x0010u
|
||||
#define kNtProcessVmWrite 0x0020u
|
||||
#define kNtProcessSynchronize kNtSynchronize
|
||||
#define kNtProcessSetInformation 0x0200u
|
||||
#define kNtProcessSetQuota 0x0100u
|
||||
#define kNtProcessSuspendResume 0x0800u
|
||||
#define kNtProcessTerminate 0x0001u
|
||||
#define kNtProcessVmOperation 0x0008u
|
||||
#define kNtProcessVmRead 0x0010u
|
||||
#define kNtProcessVmWrite 0x0020u
|
||||
#define kNtProcessSynchronize kNtSynchronize
|
||||
#define kNtProcessAllAccess \
|
||||
(kNtStandardRightsRequired | kNtSynchronize | 0xffffu)
|
||||
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
#define COSMOPOLITAN_LIBC_NT_ENUM_PROCTHREADATTRIBUTES_H_
|
||||
|
||||
#define kNtProcThreadAttributeReplaceValue 1
|
||||
#define kNtProcThreadAttributeHandleList 0x00020002
|
||||
#define kNtProcThreadAttributeHandleList 0x00020002
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_PROCTHREADATTRIBUTES_H_ */
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_SECURITYINFORMATION_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_ENUM_SECURITYINFORMATION_H_
|
||||
|
||||
#define kNtOwnerSecurityInformation 0x00000001
|
||||
#define kNtGroupSecurityInformation 0x00000002
|
||||
#define kNtDaclSecurityInformation 0x00000004
|
||||
#define kNtSaclSecurityInformation 0x00000008
|
||||
#define kNtLabelSecurityInformation 0x00000010
|
||||
#define kNtAttributeSecurityInformation 0x00000020
|
||||
#define kNtScopeSecurityInformation 0x00000040
|
||||
#define kNtOwnerSecurityInformation 0x00000001
|
||||
#define kNtGroupSecurityInformation 0x00000002
|
||||
#define kNtDaclSecurityInformation 0x00000004
|
||||
#define kNtSaclSecurityInformation 0x00000008
|
||||
#define kNtLabelSecurityInformation 0x00000010
|
||||
#define kNtAttributeSecurityInformation 0x00000020
|
||||
#define kNtScopeSecurityInformation 0x00000040
|
||||
#define kNtProcessTrustLabelSecurityInformation 0x00000080
|
||||
#define kNtAccessFilterSecurityInformation 0x00000100
|
||||
#define kNtBackupSecurityInformation 0x00010000
|
||||
#define kNtProtectedDaclSecurityInformation 0x80000000
|
||||
#define kNtProtectedSaclSecurityInformation 0x40000000
|
||||
#define kNtUnprotectedDaclSecurityInformation 0x20000000
|
||||
#define kNtUnprotectedSaclSecurityInformation 0x10000000
|
||||
#define kNtAccessFilterSecurityInformation 0x00000100
|
||||
#define kNtBackupSecurityInformation 0x00010000
|
||||
#define kNtProtectedDaclSecurityInformation 0x80000000
|
||||
#define kNtProtectedSaclSecurityInformation 0x40000000
|
||||
#define kNtUnprotectedDaclSecurityInformation 0x20000000
|
||||
#define kNtUnprotectedSaclSecurityInformation 0x10000000
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_SECURITYINFORMATION_H_ */
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_STARTF_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_ENUM_STARTF_H_
|
||||
|
||||
#define kNtStartfUseshowwindow 0x00000001 /* otherwise wShowWindow ignored */
|
||||
#define kNtStartfUsesize 0x00000002 /* otherwise dwX / dwY ignored */
|
||||
#define kNtStartfUseposition 0x00000004 /* otherwise dwX/YSize ignored */
|
||||
#define kNtStartfUsecountchars 0x00000008 /* otherwise dwX/YCountChars ign. */
|
||||
#define kNtStartfUseshowwindow 0x00000001 /* otherwise wShowWindow ignored */
|
||||
#define kNtStartfUsesize 0x00000002 /* otherwise dwX / dwY ignored */
|
||||
#define kNtStartfUseposition 0x00000004 /* otherwise dwX/YSize ignored */
|
||||
#define kNtStartfUsecountchars 0x00000008 /* otherwise dwX/YCountChars ign. */
|
||||
#define kNtStartfUsefillattribute 0x00000010 /* etc. */
|
||||
#define kNtStartfRunfullscreen 0x00000020
|
||||
#define kNtStartfForceonfeedback 0x00000040
|
||||
#define kNtStartfRunfullscreen 0x00000020
|
||||
#define kNtStartfForceonfeedback 0x00000040
|
||||
#define kNtStartfForceofffeedback 0x00000080
|
||||
#define kNtStartfUsestdhandles 0x00000100 /* otherwise hStd... ignored */
|
||||
#define kNtStartfUsehotkey 0x00000200
|
||||
#define kNtStartfTitleislinkname 0x00000800
|
||||
#define kNtStartfTitleisappid 0x00001000
|
||||
#define kNtStartfPreventpinning 0x00002000
|
||||
#define kNtStartfUntrustedsource 0x00008000
|
||||
#define kNtStartfUsestdhandles 0x00000100 /* otherwise hStd... ignored */
|
||||
#define kNtStartfUsehotkey 0x00000200
|
||||
#define kNtStartfTitleislinkname 0x00000800
|
||||
#define kNtStartfTitleisappid 0x00001000
|
||||
#define kNtStartfPreventpinning 0x00002000
|
||||
#define kNtStartfUntrustedsource 0x00008000
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_STARTF_H_ */
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_SYSTEMINFORMATIONCLASS_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_ENUM_SYSTEMINFORMATIONCLASS_H_
|
||||
|
||||
#define kNtSystemBasicInformation 0
|
||||
#define kNtSystemProcessorInformation 1
|
||||
#define kNtSystemPerformanceInformation 2
|
||||
#define kNtSystemTimeOfDayInformation 3
|
||||
#define kNtSystemProcessInformation 5
|
||||
#define kNtSystemProcessorTimes 8
|
||||
#define kNtSystemGlobalFlag 9
|
||||
#define kNtSystemModuleInformation 11
|
||||
#define kNtSystemLockInformation 12
|
||||
#define kNtSystemHandleInformation 16
|
||||
#define kNtSystemObjectInformation 17
|
||||
#define kNtSystemInterruptInformation 23
|
||||
#define kNtSystemExceptionInformation 33
|
||||
#define kNtSystemBasicInformation 0
|
||||
#define kNtSystemProcessorInformation 1
|
||||
#define kNtSystemPerformanceInformation 2
|
||||
#define kNtSystemTimeOfDayInformation 3
|
||||
#define kNtSystemProcessInformation 5
|
||||
#define kNtSystemProcessorTimes 8
|
||||
#define kNtSystemGlobalFlag 9
|
||||
#define kNtSystemModuleInformation 11
|
||||
#define kNtSystemLockInformation 12
|
||||
#define kNtSystemHandleInformation 16
|
||||
#define kNtSystemObjectInformation 17
|
||||
#define kNtSystemInterruptInformation 23
|
||||
#define kNtSystemExceptionInformation 33
|
||||
#define kNtSystemRegistryQuotaInformation 37
|
||||
#define kNtSystemLookasideInformation 45
|
||||
#define kNtSystemLookasideInformation 45
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_SYSTEMINFORMATIONCLASS_H_ */
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
#define COSMOPOLITAN_LIBC_NT_ENUM_THREADACCESS_H_
|
||||
#include "libc/nt/enum/accessmask.h"
|
||||
|
||||
#define kNtThreadTerminate 0x0001
|
||||
#define kNtThreadSuspendResume 0x0002
|
||||
#define kNtThreadGetContext 0x0008
|
||||
#define kNtThreadSetContext 0x0010
|
||||
#define kNtThreadQueryInformation 0x0040
|
||||
#define kNtThreadSetInformation 0x0020
|
||||
#define kNtThreadSetThreadToken 0x0080
|
||||
#define kNtThreadImpersonate 0x0100
|
||||
#define kNtThreadDirectImpersonation 0x0200
|
||||
#define kNtThreadSetLimitedInformation 0x0400
|
||||
#define kNtThreadTerminate 0x0001
|
||||
#define kNtThreadSuspendResume 0x0002
|
||||
#define kNtThreadGetContext 0x0008
|
||||
#define kNtThreadSetContext 0x0010
|
||||
#define kNtThreadQueryInformation 0x0040
|
||||
#define kNtThreadSetInformation 0x0020
|
||||
#define kNtThreadSetThreadToken 0x0080
|
||||
#define kNtThreadImpersonate 0x0100
|
||||
#define kNtThreadDirectImpersonation 0x0200
|
||||
#define kNtThreadSetLimitedInformation 0x0400
|
||||
#define kNtThreadQueryLimitedInformation 0x0800
|
||||
#define kNtThreadResume 0x1000
|
||||
#define kNtThreadAllAccess (kNtStandardRightsRequired | kNtSynchronize | 0xFFFF)
|
||||
#define kNtThreadResume 0x1000
|
||||
#define kNtThreadAllAccess (kNtStandardRightsRequired | kNtSynchronize | 0xFFFF)
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_THREADACCESS_H_ */
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_TOKENINFORMATIONCLASS_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_ENUM_TOKENINFORMATIONCLASS_H_
|
||||
|
||||
#define kNtTokenUser 1
|
||||
#define kNtTokenGroups 2
|
||||
#define kNtTokenPrivileges 3
|
||||
#define kNtTokenOwner 4
|
||||
#define kNtTokenPrimaryGroup 5
|
||||
#define kNtTokenDefaultDacl 6
|
||||
#define kNtTokenSource 7
|
||||
#define kNtTokenType 8
|
||||
#define kNtTokenImpersonationLevel 9
|
||||
#define kNtTokenStatistics 10
|
||||
#define kNtTokenRestrictedSids 11
|
||||
#define kNtTokenSessionId 12
|
||||
#define kNtTokenUser 1
|
||||
#define kNtTokenGroups 2
|
||||
#define kNtTokenPrivileges 3
|
||||
#define kNtTokenOwner 4
|
||||
#define kNtTokenPrimaryGroup 5
|
||||
#define kNtTokenDefaultDacl 6
|
||||
#define kNtTokenSource 7
|
||||
#define kNtTokenType 8
|
||||
#define kNtTokenImpersonationLevel 9
|
||||
#define kNtTokenStatistics 10
|
||||
#define kNtTokenRestrictedSids 11
|
||||
#define kNtTokenSessionId 12
|
||||
#define kNtTokenGroupsAndPrivileges 13
|
||||
#define kNtTokenSessionReference 14
|
||||
#define kNtTokenSandBoxInert 15
|
||||
#define kNtTokenAuditPolicy 16
|
||||
#define kNtTokenOrigin 17
|
||||
#define kNtTokenInfoClass_MAX 18
|
||||
#define kNtTokenSessionReference 14
|
||||
#define kNtTokenSandBoxInert 15
|
||||
#define kNtTokenAuditPolicy 16
|
||||
#define kNtTokenOrigin 17
|
||||
#define kNtTokenInfoClass_MAX 18
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_TOKENINFORMATIONCLASS_H_ */
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#define kNtExceptionMaximumParameters 15
|
||||
#define kNtExceptionNoncontinuable 1
|
||||
|
||||
|
||||
struct NtExceptionRecord {
|
||||
uint32_t ExceptionCode; /* kNtException... */
|
||||
uint32_t ExceptionFlags; /* kNtExceptionNoncontinuable */
|
||||
|
|
|
@ -74,8 +74,8 @@ char *GetInterpreterExecutableName(char *p, size_t n) {
|
|||
cmd[2] = 12; // KERN_PROC_PATHNAME
|
||||
} else { //
|
||||
cmd[2] = 5; // KERN_PROC_PATHNAME
|
||||
} //
|
||||
cmd[3] = -1; // current process
|
||||
} //
|
||||
cmd[3] = -1; // current process
|
||||
if (sysctl(cmd, ARRAYLEN(cmd), p, &n, 0, 0) != -1) {
|
||||
errno = e;
|
||||
return p;
|
||||
|
|
|
@ -205,9 +205,9 @@ void __unref_page(struct mman *, uint64_t *, uint64_t);
|
|||
* I/O devices.
|
||||
*/
|
||||
forceinline void __invert_and_perm_ref_memory_area(struct mman *mm,
|
||||
uint64_t *pml4t, uint64_t ps,
|
||||
uint64_t size,
|
||||
uint64_t pte_flags) {
|
||||
uint64_t *pml4t, uint64_t ps,
|
||||
uint64_t size,
|
||||
uint64_t pte_flags) {
|
||||
__invert_memory_area(mm, pml4t, ps, size, pte_flags | PAGE_REFC);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,8 +31,7 @@ static int __zipos_dupfd(int fd, int cmd, int start) {
|
|||
if (start < 0)
|
||||
return einval();
|
||||
if (IsWindows()) {
|
||||
return sys_dup_nt(fd, -1, (cmd == F_DUPFD_CLOEXEC ? _O_CLOEXEC : 0),
|
||||
start);
|
||||
return sys_dup_nt(fd, -1, (cmd == F_DUPFD_CLOEXEC ? _O_CLOEXEC : 0), start);
|
||||
}
|
||||
rc = sys_fcntl(fd, cmd, start, __sys_fcntl);
|
||||
if (rc != -1) {
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
* @return virtual base address of new mapping, or MAP_FAILED w/ errno
|
||||
*/
|
||||
void *__zipos_mmap(void *addr, size_t size, int prot, int flags,
|
||||
struct ZiposHandle *h, int64_t off) {
|
||||
struct ZiposHandle *h, int64_t off) {
|
||||
|
||||
if (off < 0) {
|
||||
STRACE("negative zipos mmap offset");
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
#include "libc/runtime/zipos.internal.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
||||
int __zipos_notat(int dirfd, const char *path) {
|
||||
struct ZiposUri zipname;
|
||||
|
|
|
@ -127,7 +127,7 @@ https://github.com/piscisaureus/wepoll");
|
|||
} while (0)
|
||||
|
||||
#define CONTAINOF(ptr, type, member) \
|
||||
((type *)((uintptr_t)(ptr) - offsetof(type, member)))
|
||||
((type *)((uintptr_t)(ptr)-offsetof(type, member)))
|
||||
|
||||
#define TREE__ROTATE(cis, trans) \
|
||||
struct TreeNode *p = node; \
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
#include "libc/calls/syscall-sysv.internal.h"
|
||||
#include "libc/calls/syscall_support-nt.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/nt/errors.h"
|
||||
#include "libc/nt/iphlpapi.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/af.h"
|
||||
|
|
|
@ -553,9 +553,10 @@ int __vcscanf(int callback(void *), //
|
|||
items = -1;
|
||||
goto Done;
|
||||
} else if (rawmode && j != width) {
|
||||
/* The C standard says that %c "matches a sequence of characters of
|
||||
* **exactly** the number specified by the field width". If we have
|
||||
* fewer characters, what we've just read is invalid. */
|
||||
/* The C standard says that %c "matches a sequence of characters
|
||||
* of
|
||||
* **exactly** the number specified by the field width". If we
|
||||
* have fewer characters, what we've just read is invalid. */
|
||||
goto Done;
|
||||
} else if (!rawmode && j < bufsize) {
|
||||
if (charbytes == sizeof(char)) {
|
||||
|
|
|
@ -372,76 +372,76 @@ int iswpunct(wint_t c) {
|
|||
case u'⹍': // PARAGRAPHUS MARK (0x2e4d Po)
|
||||
case u'⹎': // PUNCTUS ELEVATUS MARK (0x2e4e Po)
|
||||
case u'⹏': // CORNISH VERSE DIVIDER (0x2e4f Po)
|
||||
case u'、': // IDEOGRAPHIC COMMA (0x3001 Po)
|
||||
case u'。': // IDEOGRAPHIC FULL STOP (0x3002 Po)
|
||||
case u'〃': // DITTO MARK (0x3003 Po)
|
||||
case u'〈': // LEFT ANGLE BRACKET (0x3008 Ps)
|
||||
case u'〉': // RIGHT ANGLE BRACKET (0x3009 Pe)
|
||||
case u'《': // LEFT DOUBLE ANGLE BRACKET (0x300a Ps)
|
||||
case u'》': // RIGHT DOUBLE ANGLE BRACKET (0x300b Pe)
|
||||
case u'「': // LEFT CORNER BRACKET (0x300c Ps)
|
||||
case u'」': // RIGHT CORNER BRACKET (0x300d Pe)
|
||||
case u'『': // LEFT WHITE CORNER BRACKET (0x300e Ps)
|
||||
case u'』': // RIGHT WHITE CORNER BRACKET (0x300f Pe)
|
||||
case u'【': // LEFT BLACK LENTICULAR BRACKET (0x3010 Ps)
|
||||
case u'】': // RIGHT BLACK LENTICULAR BRACKET (0x3011 Pe)
|
||||
case u'〔': // LEFT TORTOISE SHELL BRACKET (0x3014 Ps)
|
||||
case u'〕': // RIGHT TORTOISE SHELL BRACKET (0x3015 Pe)
|
||||
case u'〖': // LEFT WHITE LENTICULAR BRACKET (0x3016 Ps)
|
||||
case u'〗': // RIGHT WHITE LENTICULAR BRACKET (0x3017 Pe)
|
||||
case u'〘': // LEFT WHITE TORTOISE SHELL BRACKET (0x3018 Ps)
|
||||
case u'〙': // RIGHT WHITE TORTOISE SHELL BRACKET (0x3019 Pe)
|
||||
case u'〚': // LEFT WHITE SQUARE BRACKET (0x301a Ps)
|
||||
case u'〛': // RIGHT WHITE SQUARE BRACKET (0x301b Pe)
|
||||
case u'〜': // WAVE DASH (0x301c Pd)
|
||||
case u'〝': // REVERSED DOUBLE PRIME QUOTATION MARK (0x301d Ps)
|
||||
case u'〞': // DOUBLE PRIME QUOTATION MARK (0x301e Pe)
|
||||
case u'〟': // LOW DOUBLE PRIME QUOTATION MARK (0x301f Pe)
|
||||
case u'〰': // WAVY DASH (0x3030 Pd)
|
||||
case u'〽': // PART ALTERNATION MARK (0x303d Po)
|
||||
case u'゠': // KATAKANA-HIRAGANA DOUBLE HYPHEN (0x30a0 Pd)
|
||||
case u'・': // KATAKANA MIDDLE DOT (0x30fb Po)
|
||||
case u'꓾': // LISU PUNCTUATION COMMA (0xa4fe Po)
|
||||
case u'꓿': // LISU PUNCTUATION FULL STOP (0xa4ff Po)
|
||||
case u'꘍': // VAI COMMA (0xa60d Po)
|
||||
case u'꘎': // VAI FULL STOP (0xa60e Po)
|
||||
case u'꘏': // VAI QUESTION MARK (0xa60f Po)
|
||||
case u'꙾': // CYRILLIC KAVYKA (0xa67e Po)
|
||||
case u'꡴': // PHAGS-PA SINGLE HEAD MARK (0xa874 Po)
|
||||
case u'꡵': // PHAGS-PA DOUBLE HEAD MARK (0xa875 Po)
|
||||
case u'꡶': // PHAGS-PA MARK SHAD (0xa876 Po)
|
||||
case u'꡷': // PHAGS-PA MARK DOUBLE SHAD (0xa877 Po)
|
||||
case u'꣎': // SAURASHTRA DANDA (0xa8ce Po)
|
||||
case u'꣏': // SAURASHTRA DOUBLE DANDA (0xa8cf Po)
|
||||
case u'꣸': // DEVANAGARI SIGN PUSHPIKA (0xa8f8 Po)
|
||||
case u'꣹': // DEVANAGARI GAP FILLER (0xa8f9 Po)
|
||||
case u'꣺': // DEVANAGARI CARET (0xa8fa Po)
|
||||
case u'꣼': // DEVANAGARI SIGN SIDDHAM (0xa8fc Po)
|
||||
case u'꧁': // JAVANESE LEFT RERENGGAN (0xa9c1 Po)
|
||||
case u'꧂': // JAVANESE RIGHT RERENGGAN (0xa9c2 Po)
|
||||
case u'꧃': // JAVANESE PADA ANDAP (0xa9c3 Po)
|
||||
case u'꧄': // JAVANESE PADA MADYA (0xa9c4 Po)
|
||||
case u'꧅': // JAVANESE PADA LUHUR (0xa9c5 Po)
|
||||
case u'꧆': // JAVANESE PADA WINDU (0xa9c6 Po)
|
||||
case u'꧇': // JAVANESE PADA PANGKAT (0xa9c7 Po)
|
||||
case u'꧈': // JAVANESE PADA LINGSA (0xa9c8 Po)
|
||||
case u'꧉': // JAVANESE PADA LUNGSI (0xa9c9 Po)
|
||||
case u'꧊': // JAVANESE PADA ADEG (0xa9ca Po)
|
||||
case u'꧋': // JAVANESE PADA ADEG ADEG (0xa9cb Po)
|
||||
case u'꧌': // JAVANESE PADA PISELEH (0xa9cc Po)
|
||||
case u'꧍': // JAVANESE TURNED PADA PISELEH (0xa9cd Po)
|
||||
case u'꧞': // JAVANESE PADA TIRTA TUMETES (0xa9de Po)
|
||||
case u'꧟': // JAVANESE PADA ISEN-ISEN (0xa9df Po)
|
||||
case u'꩜': // CHAM PUNCTUATION SPIRAL (0xaa5c Po)
|
||||
case u'꩝': // CHAM PUNCTUATION DANDA (0xaa5d Po)
|
||||
case u'꩞': // CHAM PUNCTUATION DOUBLE DANDA (0xaa5e Po)
|
||||
case u'꩟': // CHAM PUNCTUATION TRIPLE DANDA (0xaa5f Po)
|
||||
case u'꫞': // TAI VIET SYMBOL HO HOI (0xaade Po)
|
||||
case u'꫟': // TAI VIET SYMBOL KOI KOI (0xaadf Po)
|
||||
case u'꫰': // MEETEI MAYEK CHEIKHAN (0xaaf0 Po)
|
||||
case u'꫱': // MEETEI MAYEK AHANG KHUDAM (0xaaf1 Po)
|
||||
case u'꯫': // MEETEI MAYEK CHEIKHEI (0xabeb Po)
|
||||
case u'︐': // PRESENTATION FORM FOR VERTICAL COMMA (0xfe10 Po)
|
||||
case u'、': // IDEOGRAPHIC COMMA (0x3001 Po)
|
||||
case u'。': // IDEOGRAPHIC FULL STOP (0x3002 Po)
|
||||
case u'〃': // DITTO MARK (0x3003 Po)
|
||||
case u'〈': // LEFT ANGLE BRACKET (0x3008 Ps)
|
||||
case u'〉': // RIGHT ANGLE BRACKET (0x3009 Pe)
|
||||
case u'《': // LEFT DOUBLE ANGLE BRACKET (0x300a Ps)
|
||||
case u'》': // RIGHT DOUBLE ANGLE BRACKET (0x300b Pe)
|
||||
case u'「': // LEFT CORNER BRACKET (0x300c Ps)
|
||||
case u'」': // RIGHT CORNER BRACKET (0x300d Pe)
|
||||
case u'『': // LEFT WHITE CORNER BRACKET (0x300e Ps)
|
||||
case u'』': // RIGHT WHITE CORNER BRACKET (0x300f Pe)
|
||||
case u'【': // LEFT BLACK LENTICULAR BRACKET (0x3010 Ps)
|
||||
case u'】': // RIGHT BLACK LENTICULAR BRACKET (0x3011 Pe)
|
||||
case u'〔': // LEFT TORTOISE SHELL BRACKET (0x3014 Ps)
|
||||
case u'〕': // RIGHT TORTOISE SHELL BRACKET (0x3015 Pe)
|
||||
case u'〖': // LEFT WHITE LENTICULAR BRACKET (0x3016 Ps)
|
||||
case u'〗': // RIGHT WHITE LENTICULAR BRACKET (0x3017 Pe)
|
||||
case u'〘': // LEFT WHITE TORTOISE SHELL BRACKET (0x3018 Ps)
|
||||
case u'〙': // RIGHT WHITE TORTOISE SHELL BRACKET (0x3019 Pe)
|
||||
case u'〚': // LEFT WHITE SQUARE BRACKET (0x301a Ps)
|
||||
case u'〛': // RIGHT WHITE SQUARE BRACKET (0x301b Pe)
|
||||
case u'〜': // WAVE DASH (0x301c Pd)
|
||||
case u'〝': // REVERSED DOUBLE PRIME QUOTATION MARK (0x301d Ps)
|
||||
case u'〞': // DOUBLE PRIME QUOTATION MARK (0x301e Pe)
|
||||
case u'〟': // LOW DOUBLE PRIME QUOTATION MARK (0x301f Pe)
|
||||
case u'〰': // WAVY DASH (0x3030 Pd)
|
||||
case u'〽': // PART ALTERNATION MARK (0x303d Po)
|
||||
case u'゠': // KATAKANA-HIRAGANA DOUBLE HYPHEN (0x30a0 Pd)
|
||||
case u'・': // KATAKANA MIDDLE DOT (0x30fb Po)
|
||||
case u'꓾': // LISU PUNCTUATION COMMA (0xa4fe Po)
|
||||
case u'꓿': // LISU PUNCTUATION FULL STOP (0xa4ff Po)
|
||||
case u'꘍': // VAI COMMA (0xa60d Po)
|
||||
case u'꘎': // VAI FULL STOP (0xa60e Po)
|
||||
case u'꘏': // VAI QUESTION MARK (0xa60f Po)
|
||||
case u'꙾': // CYRILLIC KAVYKA (0xa67e Po)
|
||||
case u'꡴': // PHAGS-PA SINGLE HEAD MARK (0xa874 Po)
|
||||
case u'꡵': // PHAGS-PA DOUBLE HEAD MARK (0xa875 Po)
|
||||
case u'꡶': // PHAGS-PA MARK SHAD (0xa876 Po)
|
||||
case u'꡷': // PHAGS-PA MARK DOUBLE SHAD (0xa877 Po)
|
||||
case u'꣎': // SAURASHTRA DANDA (0xa8ce Po)
|
||||
case u'꣏': // SAURASHTRA DOUBLE DANDA (0xa8cf Po)
|
||||
case u'꣸': // DEVANAGARI SIGN PUSHPIKA (0xa8f8 Po)
|
||||
case u'꣹': // DEVANAGARI GAP FILLER (0xa8f9 Po)
|
||||
case u'꣺': // DEVANAGARI CARET (0xa8fa Po)
|
||||
case u'꣼': // DEVANAGARI SIGN SIDDHAM (0xa8fc Po)
|
||||
case u'꧁': // JAVANESE LEFT RERENGGAN (0xa9c1 Po)
|
||||
case u'꧂': // JAVANESE RIGHT RERENGGAN (0xa9c2 Po)
|
||||
case u'꧃': // JAVANESE PADA ANDAP (0xa9c3 Po)
|
||||
case u'꧄': // JAVANESE PADA MADYA (0xa9c4 Po)
|
||||
case u'꧅': // JAVANESE PADA LUHUR (0xa9c5 Po)
|
||||
case u'꧆': // JAVANESE PADA WINDU (0xa9c6 Po)
|
||||
case u'꧇': // JAVANESE PADA PANGKAT (0xa9c7 Po)
|
||||
case u'꧈': // JAVANESE PADA LINGSA (0xa9c8 Po)
|
||||
case u'꧉': // JAVANESE PADA LUNGSI (0xa9c9 Po)
|
||||
case u'꧊': // JAVANESE PADA ADEG (0xa9ca Po)
|
||||
case u'꧋': // JAVANESE PADA ADEG ADEG (0xa9cb Po)
|
||||
case u'꧌': // JAVANESE PADA PISELEH (0xa9cc Po)
|
||||
case u'꧍': // JAVANESE TURNED PADA PISELEH (0xa9cd Po)
|
||||
case u'꧞': // JAVANESE PADA TIRTA TUMETES (0xa9de Po)
|
||||
case u'꧟': // JAVANESE PADA ISEN-ISEN (0xa9df Po)
|
||||
case u'꩜': // CHAM PUNCTUATION SPIRAL (0xaa5c Po)
|
||||
case u'꩝': // CHAM PUNCTUATION DANDA (0xaa5d Po)
|
||||
case u'꩞': // CHAM PUNCTUATION DOUBLE DANDA (0xaa5e Po)
|
||||
case u'꩟': // CHAM PUNCTUATION TRIPLE DANDA (0xaa5f Po)
|
||||
case u'꫞': // TAI VIET SYMBOL HO HOI (0xaade Po)
|
||||
case u'꫟': // TAI VIET SYMBOL KOI KOI (0xaadf Po)
|
||||
case u'꫰': // MEETEI MAYEK CHEIKHAN (0xaaf0 Po)
|
||||
case u'꫱': // MEETEI MAYEK AHANG KHUDAM (0xaaf1 Po)
|
||||
case u'꯫': // MEETEI MAYEK CHEIKHEI (0xabeb Po)
|
||||
case u'︐': // PRESENTATION FORM FOR VERTICAL COMMA (0xfe10 Po)
|
||||
case u'︑': // PRESENTATION FORM FOR VERTICAL IDEOGRAPHIC COMMA (0xfe11 Po)
|
||||
case u'︒': // PRESENTATION FORM FOR VERTICAL IDEO FULL STOP (0xfe12 Po)
|
||||
case u'︓': // PRESENTATION FORM FOR VERTICAL COLON (0xfe13 Po)
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define LC_GLOBAL_LOCALE ((locale_t) - 1)
|
||||
#define LC_GLOBAL_LOCALE ((locale_t)-1)
|
||||
|
||||
struct __locale_map {
|
||||
const void *map;
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/intrin/pushpop.internal.h"
|
||||
#include "libc/intrin/repmovsb.h"
|
||||
#include "libc/nexgen32e/kompressor.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,25 +13,30 @@
|
|||
forceinline int tpdecodecb(wint_t *out, int first,
|
||||
int get(void *arg, uint32_t i), void *arg) {
|
||||
uint32_t wc, cb, need, msb, j, i = 1;
|
||||
if (__builtin_expect((wc = first) == -1, 0)) return -1;
|
||||
if (__builtin_expect((wc = first) == -1, 0))
|
||||
return -1;
|
||||
while (__builtin_expect((wc & 0b11000000) == 0b10000000, 0)) {
|
||||
if ((wc = get(arg, i++)) == -1) return -1;
|
||||
if ((wc = get(arg, i++)) == -1)
|
||||
return -1;
|
||||
}
|
||||
if (__builtin_expect(!(0 <= wc && wc <= 0x7F), 0)) {
|
||||
msb = wc < 252 ? bsr(~wc & 0xff) : 1;
|
||||
need = 7 - msb;
|
||||
wc &= ((1u << msb) - 1) | 0b00000011;
|
||||
for (j = 1; j < need; ++j) {
|
||||
if ((cb = get(arg, i++)) == -1) return -1;
|
||||
if ((cb = get(arg, i++)) == -1)
|
||||
return -1;
|
||||
if ((cb & 0b11000000) == 0b10000000) {
|
||||
wc = wc << 6 | (cb & 0b00111111);
|
||||
} else {
|
||||
if (out) *out = u'\xFFFD';
|
||||
if (out)
|
||||
*out = u'\xFFFD';
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (__builtin_expect(!!out, 1)) *out = (wint_t)wc;
|
||||
if (__builtin_expect(!!out, 1))
|
||||
*out = (wint_t)wc;
|
||||
return i;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
static const char kWcTypeNames[][8] = {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_FILENO_H_
|
||||
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_FILENO_H_
|
||||
|
||||
#define STDIN_FILENO 0
|
||||
#define STDIN_FILENO 0
|
||||
#define STDOUT_FILENO 1
|
||||
#define STDERR_FILENO 2
|
||||
|
||||
|
|
|
@ -1,39 +1,36 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_ICMP6_H_
|
||||
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_ICMP6_H_
|
||||
|
||||
#define ICMP6_DST_UNREACH ICMP6_DST_UNREACH
|
||||
#define ICMP6_DST_UNREACH_ADDR ICMP6_DST_UNREACH_ADDR
|
||||
#define ICMP6_DST_UNREACH_ADMIN ICMP6_DST_UNREACH_ADMIN
|
||||
#define ICMP6_DST_UNREACH_BEYONDSCOPE ICMP6_DST_UNREACH_BEYONDSCOPE
|
||||
#define ICMP6_DST_UNREACH_NOPORT ICMP6_DST_UNREACH_NOPORT
|
||||
#define ICMP6_DST_UNREACH_NOROUTE ICMP6_DST_UNREACH_NOROUTE
|
||||
#define ICMP6_ECHO_REPLY ICMP6_ECHO_REPLY
|
||||
#define ICMP6_ECHO_REQUEST ICMP6_ECHO_REQUEST
|
||||
#define ICMP6_FILTER ICMP6_FILTER
|
||||
#define ICMP6_INFOMSG_MASK ICMP6_INFOMSG_MASK
|
||||
#define ICMP6_PACKET_TOO_BIG ICMP6_PACKET_TOO_BIG
|
||||
#define ICMP6_PARAMPROB_HEADER ICMP6_PARAMPROB_HEADER
|
||||
#define ICMP6_PARAMPROB_NEXTHEADER ICMP6_PARAMPROB_NEXTHEADER
|
||||
#define ICMP6_PARAMPROB_OPTION ICMP6_PARAMPROB_OPTION
|
||||
#define ICMP6_PARAM_PROB ICMP6_PARAM_PROB
|
||||
#define ICMP6_ROUTER_RENUMBERING ICMP6_ROUTER_RENUMBERING
|
||||
#define ICMP6_RR_FLAGS_FORCEAPPLY ICMP6_RR_FLAGS_FORCEAPPLY
|
||||
#define ICMP6_RR_FLAGS_PREVDONE ICMP6_RR_FLAGS_PREVDONE
|
||||
#define ICMP6_RR_FLAGS_REQRESULT ICMP6_RR_FLAGS_REQRESULT
|
||||
#define ICMP6_RR_FLAGS_SPECSITE ICMP6_RR_FLAGS_SPECSITE
|
||||
#define ICMP6_RR_FLAGS_TEST ICMP6_RR_FLAGS_TEST
|
||||
#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME \
|
||||
ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME
|
||||
#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME \
|
||||
ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME
|
||||
#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO ICMP6_RR_PCOUSE_RAFLAGS_AUTO
|
||||
#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK ICMP6_RR_PCOUSE_RAFLAGS_ONLINK
|
||||
#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN \
|
||||
ICMP6_RR_RESULT_FLAGS_FORBIDDEN
|
||||
#define ICMP6_RR_RESULT_FLAGS_OOB ICMP6_RR_RESULT_FLAGS_OOB
|
||||
#define ICMP6_TIME_EXCEEDED ICMP6_TIME_EXCEEDED
|
||||
#define ICMP6_TIME_EXCEED_REASSEMBLY ICMP6_TIME_EXCEED_REASSEMBLY
|
||||
#define ICMP6_TIME_EXCEED_TRANSIT ICMP6_TIME_EXCEED_TRANSIT
|
||||
#define ICMP6_DST_UNREACH ICMP6_DST_UNREACH
|
||||
#define ICMP6_DST_UNREACH_ADDR ICMP6_DST_UNREACH_ADDR
|
||||
#define ICMP6_DST_UNREACH_ADMIN ICMP6_DST_UNREACH_ADMIN
|
||||
#define ICMP6_DST_UNREACH_BEYONDSCOPE ICMP6_DST_UNREACH_BEYONDSCOPE
|
||||
#define ICMP6_DST_UNREACH_NOPORT ICMP6_DST_UNREACH_NOPORT
|
||||
#define ICMP6_DST_UNREACH_NOROUTE ICMP6_DST_UNREACH_NOROUTE
|
||||
#define ICMP6_ECHO_REPLY ICMP6_ECHO_REPLY
|
||||
#define ICMP6_ECHO_REQUEST ICMP6_ECHO_REQUEST
|
||||
#define ICMP6_FILTER ICMP6_FILTER
|
||||
#define ICMP6_INFOMSG_MASK ICMP6_INFOMSG_MASK
|
||||
#define ICMP6_PACKET_TOO_BIG ICMP6_PACKET_TOO_BIG
|
||||
#define ICMP6_PARAMPROB_HEADER ICMP6_PARAMPROB_HEADER
|
||||
#define ICMP6_PARAMPROB_NEXTHEADER ICMP6_PARAMPROB_NEXTHEADER
|
||||
#define ICMP6_PARAMPROB_OPTION ICMP6_PARAMPROB_OPTION
|
||||
#define ICMP6_PARAM_PROB ICMP6_PARAM_PROB
|
||||
#define ICMP6_ROUTER_RENUMBERING ICMP6_ROUTER_RENUMBERING
|
||||
#define ICMP6_RR_FLAGS_FORCEAPPLY ICMP6_RR_FLAGS_FORCEAPPLY
|
||||
#define ICMP6_RR_FLAGS_PREVDONE ICMP6_RR_FLAGS_PREVDONE
|
||||
#define ICMP6_RR_FLAGS_REQRESULT ICMP6_RR_FLAGS_REQRESULT
|
||||
#define ICMP6_RR_FLAGS_SPECSITE ICMP6_RR_FLAGS_SPECSITE
|
||||
#define ICMP6_RR_FLAGS_TEST ICMP6_RR_FLAGS_TEST
|
||||
#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME
|
||||
#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME
|
||||
#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO ICMP6_RR_PCOUSE_RAFLAGS_AUTO
|
||||
#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK ICMP6_RR_PCOUSE_RAFLAGS_ONLINK
|
||||
#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN ICMP6_RR_RESULT_FLAGS_FORBIDDEN
|
||||
#define ICMP6_RR_RESULT_FLAGS_OOB ICMP6_RR_RESULT_FLAGS_OOB
|
||||
#define ICMP6_TIME_EXCEEDED ICMP6_TIME_EXCEEDED
|
||||
#define ICMP6_TIME_EXCEED_REASSEMBLY ICMP6_TIME_EXCEED_REASSEMBLY
|
||||
#define ICMP6_TIME_EXCEED_TRANSIT ICMP6_TIME_EXCEED_TRANSIT
|
||||
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
|
|
|
@ -38,5 +38,4 @@ COSMOPOLITAN_C_END_
|
|||
#define IFF_RUNNING IFF_RUNNING
|
||||
#define IFF_SLAVE IFF_SLAVE
|
||||
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_IFF_H_ */
|
||||
|
|
|
@ -102,6 +102,5 @@ extern const int IP_XFRM_POLICY;
|
|||
#define IP_UNICAST_IF IP_UNICAST_IF
|
||||
#define IP_XFRM_POLICY IP_XFRM_POLICY
|
||||
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_IP_H_ */
|
||||
|
|
|
@ -122,6 +122,5 @@ extern const int IPV6_XFRM_POLICY;
|
|||
#define IPV6_V6ONLY IPV6_V6ONLY
|
||||
#define IPV6_XFRM_POLICY IPV6_XFRM_POLICY
|
||||
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_IPV6_H_ */
|
||||
|
|
|
@ -24,6 +24,5 @@ extern const int MAX_INPUT;
|
|||
#define MAX_CANON MAX_CANON
|
||||
#define MAX_INPUT MAX_INPUT
|
||||
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_LIMITS_H_ */
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_LIO_H_
|
||||
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_LIO_H_
|
||||
|
||||
#define LIO_NOP LIO_NOP
|
||||
#define LIO_NOP LIO_NOP
|
||||
#define LIO_NOWAIT LIO_NOWAIT
|
||||
#define LIO_READ LIO_READ
|
||||
#define LIO_WAIT LIO_WAIT
|
||||
#define LIO_WRITE LIO_WRITE
|
||||
#define LIO_READ LIO_READ
|
||||
#define LIO_WAIT LIO_WAIT
|
||||
#define LIO_WRITE LIO_WRITE
|
||||
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
|
|
|
@ -15,5 +15,4 @@ COSMOPOLITAN_C_END_
|
|||
#define LOCK_SH LOCK_SH
|
||||
#define LOCK_UN LOCK_UN
|
||||
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_LOCK_H_ */
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_MCAST_H_
|
||||
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_MCAST_H_
|
||||
|
||||
#define MCAST_BLOCK_SOURCE MCAST_BLOCK_SOURCE
|
||||
#define MCAST_EXCLUDE MCAST_EXCLUDE
|
||||
#define MCAST_INCLUDE MCAST_INCLUDE
|
||||
#define MCAST_JOIN_GROUP MCAST_JOIN_GROUP
|
||||
#define MCAST_JOIN_SOURCE_GROUP MCAST_JOIN_SOURCE_GROUP
|
||||
#define MCAST_LEAVE_GROUP MCAST_LEAVE_GROUP
|
||||
#define MCAST_BLOCK_SOURCE MCAST_BLOCK_SOURCE
|
||||
#define MCAST_EXCLUDE MCAST_EXCLUDE
|
||||
#define MCAST_INCLUDE MCAST_INCLUDE
|
||||
#define MCAST_JOIN_GROUP MCAST_JOIN_GROUP
|
||||
#define MCAST_JOIN_SOURCE_GROUP MCAST_JOIN_SOURCE_GROUP
|
||||
#define MCAST_LEAVE_GROUP MCAST_LEAVE_GROUP
|
||||
#define MCAST_LEAVE_SOURCE_GROUP MCAST_LEAVE_SOURCE_GROUP
|
||||
#define MCAST_MSFILTER MCAST_MSFILTER
|
||||
#define MCAST_UNBLOCK_SOURCE MCAST_UNBLOCK_SOURCE
|
||||
#define MCAST_MSFILTER MCAST_MSFILTER
|
||||
#define MCAST_UNBLOCK_SOURCE MCAST_UNBLOCK_SOURCE
|
||||
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
|
|
|
@ -36,6 +36,5 @@ extern const int TIOCM_ST;
|
|||
#define TIOCMBIC TIOCMBIC
|
||||
#define TIOCMBIS TIOCMBIS
|
||||
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_MODEM_H_ */
|
||||
|
|
|
@ -92,6 +92,5 @@ extern const int MNT_SNAPSHOT;
|
|||
#define MNT_NOCLUSTERW MNT_NOCLUSTERW
|
||||
#define MNT_SNAPSHOT MNT_SNAPSHOT
|
||||
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_MOUNT_H_ */
|
||||
|
|
|
@ -94,6 +94,5 @@ extern const int PF_X25;
|
|||
#define PF_WANPIPE PF_WANPIPE
|
||||
#define PF_X25 PF_X25
|
||||
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_PF_H_ */
|
||||
|
|
|
@ -27,6 +27,5 @@ extern const int16_t POLLWRNORM;
|
|||
#define POLLWRBAND POLLWRBAND
|
||||
#define POLLWRNORM POLLWRNORM
|
||||
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_POLL_H_ */
|
||||
|
|
|
@ -22,6 +22,5 @@ extern const int POSIX_MADV_DONTNEED;
|
|||
|
||||
#define POSIX_MADV_DONTNEED POSIX_MADV_DONTNEED
|
||||
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_POSIX_H_ */
|
||||
|
|
|
@ -23,6 +23,5 @@ extern const int TIOCPKT_STOP;
|
|||
|
||||
#define TIOCPKT TIOCPKT
|
||||
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_PTY_H_ */
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_READ_H_
|
||||
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_READ_H_
|
||||
|
||||
#define READ_10 READ_10
|
||||
#define READ_12 READ_12
|
||||
#define READ_6 READ_6
|
||||
#define READ_BLOCK_LIMITS READ_BLOCK_LIMITS
|
||||
#define READ_BUFFER READ_BUFFER
|
||||
#define READ_CAPACITY READ_CAPACITY
|
||||
#define READ_DEFECT_DATA READ_DEFECT_DATA
|
||||
#define READ_10 READ_10
|
||||
#define READ_12 READ_12
|
||||
#define READ_6 READ_6
|
||||
#define READ_BLOCK_LIMITS READ_BLOCK_LIMITS
|
||||
#define READ_BUFFER READ_BUFFER
|
||||
#define READ_CAPACITY READ_CAPACITY
|
||||
#define READ_DEFECT_DATA READ_DEFECT_DATA
|
||||
#define READ_ELEMENT_STATUS READ_ELEMENT_STATUS
|
||||
#define READ_LONG READ_LONG
|
||||
#define READ_POSITION READ_POSITION
|
||||
#define READ_REVERSE READ_REVERSE
|
||||
#define READ_TOC READ_TOC
|
||||
#define READ_LONG READ_LONG
|
||||
#define READ_POSITION READ_POSITION
|
||||
#define READ_REVERSE READ_REVERSE
|
||||
#define READ_TOC READ_TOC
|
||||
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
|
|
|
@ -26,6 +26,5 @@ extern const unsigned RB_NOSYNC;
|
|||
#define RB_DISABLE_CAD RB_DISABLE_CAD
|
||||
#define RB_NOSYNC RB_NOSYNC
|
||||
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_REBOOT_H_ */
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue