Perform build and magnum tuning

Building o//third_party/python now takes 5 seconds on my PC

This change works towards modifying Python to use runtime dispatching
when appropriate. For example, when loading the magnums in the socket
module, it's a good idea to check if the magnum is zero, because that
means the local system platform doesn't support it.
This commit is contained in:
Justine Tunney 2021-08-10 10:26:13 -07:00
parent ee7e296339
commit d26d7ae0e4
1028 changed files with 6576 additions and 172777 deletions

3
.gitattributes vendored Normal file
View file

@ -0,0 +1,3 @@
# -*- conf -*-
/build/bootstrap/*.com binary
/usr/share/zoneinfo/* binary

29
libc/sock/alg.h Normal file
View file

@ -0,0 +1,29 @@
#ifndef COSMOPOLITAN_LIBC_SOCK_ALG_H_
#define COSMOPOLITAN_LIBC_SOCK_ALG_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct sockaddr_alg {
uint16_t salg_family;
uint8_t salg_type[14];
uint32_t salg_feat;
uint32_t salg_mask;
uint8_t salg_name[64];
};
struct sockaddr_alg_new {
uint16_t salg_family;
uint8_t salg_type[14];
uint32_t salg_feat;
uint32_t salg_mask;
uint8_t salg_name[]; /* Linux v4.12+ */
};
struct af_alg_iv {
uint32_t ivlen;
uint8_t iv[0];
};
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_SOCK_ALG_H_ */

View file

@ -44,7 +44,7 @@ syscon errno EEXIST 17 17 17 17 17 183 # file exists; unix conse
syscon errno EXDEV 18 18 18 18 18 17 # improper link; unix consensus; kNtErrorNotSameDevice; raised by copy_file_range(2), fanotify_mark(2), ioctl_ficlonerange(2), ioctl_fideduperange(2), link(2), openat2(2), rename(2)
syscon errno ENODEV 19 19 19 19 19 1200 # no such device; unix consensus; kNtErrorBadDevice; raised by arch_prctl(2), eventfd(2), fallocate(2), fanotify_mark(2), mmap(2), mount(2), move_pages(2), open(2), pciconfig_read(2), perf_event_open(2), pidfd_open(2), prctl(2), s390_pci_mmio_write(2), signalfd(2), spu_create(2), timerfd_create(2)
syscon errno ENOTDIR 20 20 20 20 20 3 # not a directory; unix consensus; kNtErrorPathNotFound; raised by access(2), acct(2), bind(2), chdir(2), chmod(2), chown(2), chroot(2), execve(2), execveat(2), fanotify_mark(2), fcntl(2), futimesat(2), getdents(2), inotify_add_watch(2), ioctl_fat(2), keyctl(2), link(2), mkdir(2), mknod(2), mount(2), open(2), open_by_handle_at(2), pivot_root(2), readdir(2), readlink(2), rename(2), rmdir(2), spu_create(2), stat(2), statfs(2), statx(2), symlink(2), sysctl(2), truncate(2), unlink(2), utimensat(2)
syscon errno EISDIR 21 21 21 21 21 267 # is a a directory; unix consensus; kNtErrorDirectoryNotSupported; raised by acct(2), copy_file_range(2), execve(2), ioctl_ficlonerange(2), ioctl_fideduperange(2), open(2), read(2), rename(2), truncate(2), unlink(2)
syscon errno EISDIR 21 21 21 21 21 267 # is a a directory; unix consensus; kNtErrorDirectory; raised by acct(2), copy_file_range(2), execve(2), ioctl_ficlonerange(2), ioctl_fideduperange(2), open(2), read(2), rename(2), truncate(2), unlink(2)
syscon errno EINVAL 22 22 22 22 22 87 # invalid argument; unix consensus; kNtErrorInvalidParameter; raised by accept(2), access(2), add_key(2), adjtimex(2), arch_prctl(2), bdflush(2), bind(2), bpf(2), cacheflush(2), capget(2), chmod(2), chown(2), clock_getres(2), clock_nanosleep(2), clone(2), copy_file_range(2), create_module(2), dup(2), epoll_create(2), epoll_ctl(2), epoll_wait(2), eventfd(2), execve(2), execveat(2), fallocate(2), fanotify_init(2), fanotify_mark(2), fcntl(2), flock(2), futex(2), get_mempolicy(2), get_robust_list(2), getdents(2), getdomainname(2), getgroups(2), gethostname(2), getitimer(2), getpeername(2), getpriority(2), getrandom(2), getrlimit(2), getrusage(2), getsockname(2), getsockopt(2), gettimeofday(2), init_module(2), inotify_add_watch(2), inotify_init(2), inotify_rm_watch(2), io_cancel(2), io_destroy(2), io_getevents(2), io_setup(2), io_submit(2), ioctl(2), ioctl_console(2), ioctl_ficlonerange(2), ioctl_fideduperange(2), ioctl_getfsmap(2), ioctl_ns(2), ioctl_tty(2), ioctl_userfaultfd(2), ioperm(2), iopl(2), ioprio_set(2), kcmp(2), kexec_load(2), keyctl(2), kill(2), link(2), llseek(2), lookup_dcookie(2), lseek(2), madvise(2), mbind(2), membarrier(2), memfd_create(2), migrate_pages(2), mincore(2), mkdir(2), mknod(2), mlock(2), mmap(2), mmap2(2), modify_ldt(2), mount(2), move_pages(2), mprotect(2), mremap(2), msgctl(2), msgop(2), msync(2), nanosleep(2), open(2), open_by_handle_at(2), openat2(2), pciconfig_read(2), perf_event_open(2), personality(2), pidfd_getfd(2), pidfd_open(2), pidfd_send_signal(2), pipe(2), pivot_root(2), pkey_alloc(2), poll(2), posix_fadvise(2), prctl(2), process_vm_readv(2), ptrace(2), query_module(2), quotactl(2), read(2), readahead(2), readdir(2), readlink(2), readv(2), reboot(2), recv(2), recvmmsg(2), remap_file_pages(2), rename(2), request_key(2), rmdir(2), rt_sigqueueinfo(2), s390_guarded_storage(2), s390_pci_mmio_write(2), s390_runtime_instr(2), s390_sthyi(2), sched_get_priority_max(2), sched_rr_get_interval(2), sched_setaffinity(2), sched_setattr(2), sched_setparam(2), sched_setscheduler(2), seccomp(2), select(2), semctl(2), semget(2), semop(2), send(2), sendfile(2), set_mempolicy(2), set_thread_area(2), seteuid(2), setfsgid(2), setfsuid(2), setgid(2), setns(2), setpgid(2), setresuid(2), setreuid(2), setuid(2), shmctl(2), shmget(2), shmop(2), shutdown(2), sigaction(2), sigaltstack(2), signal(2), signalfd(2), sigprocmask(2), sigsuspend(2), sigwaitinfo(2), socket(2), splice(2), spu_create(2), spu_run(2), stat(2), statx(2), subpage_prot(2), swapon(2), sync_file_range(2), sysfs(2), syslog(2), tee(2), timer_create(2), timer_delete(2), timer_getoverrun(2), timer_settime(2), timerfd_create(2), tkill(2), truncate(2), umount(2), unlink(2), unshare(2), userfaultfd(2), ustat(2), utimensat(2), vmsplice(2), wait(2), write(2), unix(7), ip(7)
syscon errno ENFILE 23 23 23 23 23 331 # too many open files in system; unix consensus; kNtErrorTooManyDescriptors; raised by accept(2), acct(2), epoll_create(2), eventfd(2), execve(2), futex(2), inotify_init(2), memfd_create(2), mmap(2), open(2), pidfd_getfd(2), pidfd_open(2), pipe(2), shmget(2), signalfd(2), socket(2), socketpair(2), spu_create(2), swapon(2), timerfd_create(2), uselib(2), userfaultfd(2)
syscon errno EMFILE 24 24 24 24 24 336 # too many open files; unix consensus; kNtErrorTooManyOpenFiles; raised by accept(2), dup(2), epoll_create(2), eventfd(2), execve(2), fanotify_init(2), fcntl(2), inotify_init(2), memfd_create(2), mount(2), open(2), perf_event_open(2), pidfd_getfd(2), pidfd_open(2), pipe(2), signalfd(2), socket(2), socketpair(2), spu_create(2), timerfd_create(2)
@ -626,6 +626,7 @@ syscon so SO_REUSEADDR 2 4 4 4 4 0 # bsd consensus (default behav
syscon so SO_KEEPALIVE 9 8 8 8 8 8 # bsd consensus
syscon so SO_DONTROUTE 5 0x10 0x10 0x10 0x10 0x10 # bsd consensus
syscon so SO_BROADCAST 6 0x20 0x20 0x20 0x20 0x20 # bsd consensus
syscon so SO_USELOOPBACK 0 0x40 0x40 0x40 0x40 0x40 # bsd consensus
syscon so SO_LINGER 13 0x80 0x80 0x80 0x80 0x80 # takes struct linger; causes close() return value to actually mean something; bsd consensus
syscon so SO_DEBUG 1 1 1 1 1 1 # consensus
syscon so SO_ACCEPTCONN 30 2 2 2 2 2 # takes int pointer and stores boolean indicating if listen() was called on fd; bsd consensus
@ -640,10 +641,12 @@ syscon so SO_EXCLUSIVEADDRUSE 0 0 0 0 0 0xfffffffb # hoo boy
syscon so SO_SNDLOWAT 19 0x1003 0x1003 0x1003 0x1003 0x1003 # bsd consensus
syscon so SO_TYPE 3 0x1008 0x1008 0x1008 0x1008 0x1008 # bsd consensus
syscon so SO_TIMESTAMP 29 0x0400 0x0400 0x0800 0x2000 0
syscon so SO_DOMAIN 39 0 0x1019 0 0 0
syscon so SO_SETFIB 0 0 0x1014 0 0 0
syscon so SO_DOMAIN 39 0 0x1019 0x1024 0 0
syscon so SO_MAX_PACING_RATE 47 0 0x1018 0 0 0
syscon so SO_PEERCRED 17 0 0 0x1022 0x1022 0
syscon so SO_PROTOCOL 38 0 0x1016 0 0 0
syscon so SO_PEERCRED 17 0 0 0x1022 0 0
syscon so LOCAL_PEERCRED 0 1 1 0 0 0
syscon so SO_PROTOCOL 38 0 0x1016 0x1025 0 0
syscon so SO_ATTACH_BPF 50 0 0 0 0 0
syscon so SO_ATTACH_FILTER 26 0 0 0 0 0
syscon so SO_ATTACH_REUSEPORT_CBPF 51 0 0 0 0 0
@ -707,6 +710,13 @@ syscon sol SOL_RXRPC 272 0 0 0 0 0
syscon sol SOL_TIPC 271 0 0 0 0 0
syscon sol SOL_X25 262 0 0 0 0 0
syscon alg ALG_SET_KEY 1 0 0 0 0 0
syscon alg ALG_SET_IV 2 0 0 0 0 0
syscon alg ALG_SET_OP 3 0 0 0 0 0
syscon alg ALG_SET_AEAD_ASSOCLEN 4 0 0 0 0 0
syscon alg ALG_SET_AEAD_AUTHSIZE 5 0 0 0 0 0
syscon alg ALG_SET_DRBG_ENTROPY 6 0 0 0 0 0
# {set,get}sockopt(fd, level=IPPROTO_TCP, X, ...)
# » most elite of all tuning groups
#
@ -758,15 +768,16 @@ syscon ip IP_MAX_MEMBERSHIPS 20 0x0fff 0x0fff 0x0fff 0x0fff 20 # b
syscon ip IP_OPTIONS 4 1 1 1 1 1 # bsd consensus
syscon ip IP_TOS 1 3 3 3 3 8 # bsd consensus
syscon ip IP_RECVTTL 12 24 65 31 23 21
syscon ip IP_ADD_MEMBERSHIP 35 12 12 12 12 0 # bsd consensus
syscon ip IP_DROP_MEMBERSHIP 36 13 13 13 13 0 # bsd consensus
syscon ip IP_MULTICAST_IF 0x20 9 9 9 9 0 # bsd consensus
syscon ip IP_MULTICAST_LOOP 34 11 11 11 11 0 # bsd consensus
syscon ip IP_MULTICAST_TTL 33 10 10 10 10 0 # bsd consensus
syscon ip IP_ADD_MEMBERSHIP 35 12 12 12 12 5 # bsd consensus
syscon ip IP_DROP_MEMBERSHIP 36 13 13 13 13 6 # bsd consensus
syscon ip IP_MULTICAST_IF 0x20 9 9 9 9 2 # bsd consensus
syscon ip IP_MULTICAST_LOOP 34 11 11 11 11 4 # bsd consensus
syscon ip IP_MULTICAST_TTL 33 10 10 10 10 3 # bsd consensus
syscon ip IP_RECVOPTS 6 5 5 5 5 0 # bsd consensus
syscon ip IP_RECVRETOPTS 7 6 6 6 6 0 # bsd consensus
syscon ip IP_RECVDSTADDR 0 7 7 7 7 0 # bsd consensus
syscon ip IP_RETOPTS 7 8 8 8 8 0 # bsd consensus
syscon ip IP_TTL 2 4 4 4 4 0 # bsd consensus
syscon ip IP_TTL 2 4 4 4 4 7 # bsd consensus
syscon ip IP_ADD_SOURCE_MEMBERSHIP 39 70 70 0 0 15
syscon ip IP_BLOCK_SOURCE 38 72 72 0 0 17
syscon ip IP_DROP_SOURCE_MEMBERSHIP 40 71 71 0 0 0x10
@ -800,6 +811,8 @@ syscon ip IP_TRANSPARENT 19 0 0 0 0 0
syscon ip IP_XFRM_POLICY 17 0 0 0 0 0
syscon ip INET_ADDRSTRLEN 0x10 0x10 0x10 0x10 0x10 22 # unix consensus
syscon ipport IPPORT_USERRESERVED 5000 5000 5000 49151 5000 5000
# ptrace() codes
#
# group name GNU/Systemd XNU's Not UNIX! FreeBSD OpenBSD NetBSD The New Technology Commentary
@ -1052,7 +1065,7 @@ syscon af AF_LOCAL 1 1 1 1 1 1 # consensus
syscon af AF_FILE 1 0 0 0 0 0
syscon af AF_INET 2 2 2 2 2 2 # consensus
syscon af AF_AX25 3 0 0 0 0 0
syscon af AF_IPX 4 23 23 23 23 0 # bsd consensus
syscon af AF_IPX 4 23 23 23 23 6 # bsd consensus
syscon af AF_APPLETALK 5 0x10 0x10 0x10 0x10 0x10 # bsd consensus
syscon af AF_NETROM 6 0 0 0 0 0
syscon af AF_BRIDGE 7 0 0 0 0 0
@ -1062,10 +1075,11 @@ syscon af AF_INET6 10 30 28 24 24 23
syscon af AF_ROSE 11 0 0 0 0 0
syscon af AF_NETBEUI 13 0 0 0 0 0
syscon af AF_SECURITY 14 0 0 0 0 0
syscon af AF_KEY 15 0 0 30 30 0
syscon af AF_KEY 15 0 0 30 0 0
syscon af AF_ROUTE 16 17 17 17 34 0 # bsd consensus
syscon af AF_NETLINK 16 0 0 0 0 0
syscon af AF_PACKET 17 0 0 0 0 0
syscon af AF_LINK 0 18 18 18 18 0
syscon af AF_ASH 18 0 0 0 0 0
syscon af AF_ECONET 19 0 0 0 0 0
syscon af AF_ATMSVC 20 0 0 0 0 0
@ -1113,7 +1127,7 @@ syscon pf PF_ATMSVC 20 0 0 0 0 0
syscon pf PF_AX25 3 0 0 0 0 0
syscon pf PF_BRIDGE 7 0 0 0 0 0
syscon pf PF_CAIF 37 0 0 0 0 0
syscon pf PF_CAN 29 0 0 0 0 0
syscon af PF_CAN 29 0 0 0 35 0
syscon pf PF_ECONET 19 0 0 0 0 0
syscon pf PF_FILE 1 0 0 0 0 0
syscon pf PF_IB 27 0 0 0 0 0
@ -1255,7 +1269,8 @@ syscon msg MSG_WAITFORONE 0x010000 0 0x080000 0 0x2000 0
syscon msg MSG_BATCH 0x040000 0 0 0 0 0
syscon msg MSG_CONFIRM 0x0800 0 0 0 0 0
syscon msg MSG_EXCEPT 0x2000 0 0 0 0 0
syscon msg MSG_FIN 0x0200 0 0 0 0 0
syscon msg MSG_FIN 0x0200 0x0100 0x0100 0 0 0
syscon msg MSG_EOF 0x0200 0x0100 0x0100 0 0 0
syscon msg MSG_INFO 12 0 0 0 0 0
syscon msg MSG_MORE 0x8000 0 0 0 0 0
syscon msg MSG_PARITY_ERROR 9 0 0 0 0 0
@ -1263,6 +1278,9 @@ syscon msg MSG_PROXY 0x10 0 0 0 0 0
syscon msg MSG_RST 0x1000 0 0 0 0 0
syscon msg MSG_STAT 11 0 0 0 0 0
syscon msg MSG_SYN 0x0400 0 0 0 0 0
syscon msg MSG_BCAST 0 0 0 0x100 0x100 0
syscon msg MSG_MCAST 0 0 0 0x200 0x200 0
syscon msg MSG_NOTIFICATION 0x8000 0 0x2000 0 0x4000 0
# getpriority() / setpriority() magnums (a.k.a. nice)
#

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon af,AF_IPX,4,23,23,23,23,0
.syscon af,AF_IPX,4,23,23,23,23,6

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon af,AF_KEY,15,0,0,30,30,0
.syscon af,AF_KEY,15,0,0,30,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon af,AF_LINK,0,18,18,18,18,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon alg,ALG_SET_AEAD_ASSOCLEN,4,0,0,0,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon alg,ALG_SET_AEAD_AUTHSIZE,5,0,0,0,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon alg,ALG_SET_DRBG_ENTROPY,6,0,0,0,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon alg,ALG_SET_IV,2,0,0,0,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon alg,ALG_SET_KEY,1,0,0,0,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon alg,ALG_SET_OP,3,0,0,0,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon ipport,IPPORT_USERRESERVED,5000,5000,5000,49151,5000,5000

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon ip,IP_ADD_MEMBERSHIP,35,12,12,12,12,0
.syscon ip,IP_ADD_MEMBERSHIP,35,12,12,12,12,5

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon ip,IP_DROP_MEMBERSHIP,36,13,13,13,13,0
.syscon ip,IP_DROP_MEMBERSHIP,36,13,13,13,13,6

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon ip,IP_MULTICAST_IF,0x20,9,9,9,9,0
.syscon ip,IP_MULTICAST_IF,0x20,9,9,9,9,2

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon ip,IP_MULTICAST_LOOP,34,11,11,11,11,0
.syscon ip,IP_MULTICAST_LOOP,34,11,11,11,11,4

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon ip,IP_MULTICAST_TTL,33,10,10,10,10,0
.syscon ip,IP_MULTICAST_TTL,33,10,10,10,10,3

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon ip,IP_RECVDSTADDR,0,7,7,7,7,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon ip,IP_TTL,2,4,4,4,4,0
.syscon ip,IP_TTL,2,4,4,4,4,7

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon so,LOCAL_PEERCRED,0,1,1,0,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon msg,MSG_BCAST,0,0,0,0x100,0x100,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon msg,MSG_EOF,0x0200,0x0100,0x0100,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon msg,MSG_FIN,0x0200,0,0,0,0,0
.syscon msg,MSG_FIN,0x0200,0x0100,0x0100,0,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon msg,MSG_MCAST,0,0,0,0x200,0x200,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon msg,MSG_NOTIFICATION,0x8000,0,0x2000,0,0x4000,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon pf,PF_CAN,29,0,0,0,0,0
.syscon af,PF_CAN,29,0,0,0,35,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon so,SO_DOMAIN,39,0,0x1019,0,0,0
.syscon so,SO_DOMAIN,39,0,0x1019,0x1024,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon so,SO_PEERCRED,17,0,0,0x1022,0x1022,0
.syscon so,SO_PEERCRED,17,0,0,0x1022,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon so,SO_PROTOCOL,38,0,0x1016,0,0,0
.syscon so,SO_PROTOCOL,38,0,0x1016,0x1025,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon so,SO_SETFIB,0,0,0x1014,0,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon so,SO_USELOOPBACK,0,0x40,0x40,0x40,0x40,0x40

View file

@ -26,6 +26,7 @@ extern const long AF_ISDN;
extern const long AF_IUCV;
extern const long AF_KCM;
extern const long AF_KEY;
extern const long AF_LINK;
extern const long AF_LLC;
extern const long AF_LOCAL;
extern const long AF_MAX;
@ -53,50 +54,51 @@ extern const long AF_X25;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define AF_ALG SYMBOLIC(AF_ALG)
#define AF_APPLETALK SYMBOLIC(AF_APPLETALK)
#define AF_ASH SYMBOLIC(AF_ASH)
#define AF_ATMPVC SYMBOLIC(AF_ATMPVC)
#define AF_ATMSVC SYMBOLIC(AF_ATMSVC)
#define AF_AX25 SYMBOLIC(AF_AX25)
#define AF_BLUETOOTH SYMBOLIC(AF_BLUETOOTH)
#define AF_BRIDGE SYMBOLIC(AF_BRIDGE)
#define AF_CAIF SYMBOLIC(AF_CAIF)
#define AF_CAN SYMBOLIC(AF_CAN)
#define AF_ECONET SYMBOLIC(AF_ECONET)
#define AF_FILE SYMBOLIC(AF_FILE)
#define AF_IB SYMBOLIC(AF_IB)
#define AF_ALG SYMBOLIC(AF_ALG)
#define AF_LINK SYMBOLIC(AF_LINK)
#define AF_APPLETALK SYMBOLIC(AF_APPLETALK)
#define AF_ASH SYMBOLIC(AF_ASH)
#define AF_ATMPVC SYMBOLIC(AF_ATMPVC)
#define AF_ATMSVC SYMBOLIC(AF_ATMSVC)
#define AF_AX25 SYMBOLIC(AF_AX25)
#define AF_BLUETOOTH SYMBOLIC(AF_BLUETOOTH)
#define AF_BRIDGE SYMBOLIC(AF_BRIDGE)
#define AF_CAIF SYMBOLIC(AF_CAIF)
#define AF_CAN SYMBOLIC(AF_CAN)
#define AF_ECONET SYMBOLIC(AF_ECONET)
#define AF_FILE SYMBOLIC(AF_FILE)
#define AF_IB SYMBOLIC(AF_IB)
#define AF_IEEE802154 SYMBOLIC(AF_IEEE802154)
#define AF_INET LITERALLY(2)
#define AF_INET6 SYMBOLIC(AF_INET6)
#define AF_IPX SYMBOLIC(AF_IPX)
#define AF_IRDA SYMBOLIC(AF_IRDA)
#define AF_ISDN SYMBOLIC(AF_ISDN)
#define AF_IUCV SYMBOLIC(AF_IUCV)
#define AF_KCM SYMBOLIC(AF_KCM)
#define AF_KEY SYMBOLIC(AF_KEY)
#define AF_LLC SYMBOLIC(AF_LLC)
#define AF_LOCAL SYMBOLIC(AF_LOCAL)
#define AF_MAX SYMBOLIC(AF_MAX)
#define AF_MPLS SYMBOLIC(AF_MPLS)
#define AF_NETBEUI SYMBOLIC(AF_NETBEUI)
#define AF_NETLINK SYMBOLIC(AF_NETLINK)
#define AF_NETROM SYMBOLIC(AF_NETROM)
#define AF_NFC SYMBOLIC(AF_NFC)
#define AF_PACKET SYMBOLIC(AF_PACKET)
#define AF_PHONET SYMBOLIC(AF_PHONET)
#define AF_PPPOX SYMBOLIC(AF_PPPOX)
#define AF_RDS SYMBOLIC(AF_RDS)
#define AF_ROSE SYMBOLIC(AF_ROSE)
#define AF_ROUTE SYMBOLIC(AF_ROUTE)
#define AF_RXRPC SYMBOLIC(AF_RXRPC)
#define AF_SECURITY SYMBOLIC(AF_SECURITY)
#define AF_SNA SYMBOLIC(AF_SNA)
#define AF_TIPC SYMBOLIC(AF_TIPC)
#define AF_UNIX LITERALLY(1)
#define AF_UNSPEC LITERALLY(0)
#define AF_VSOCK SYMBOLIC(AF_VSOCK)
#define AF_WANPIPE SYMBOLIC(AF_WANPIPE)
#define AF_X25 SYMBOLIC(AF_X25)
#define AF_INET LITERALLY(2)
#define AF_INET6 SYMBOLIC(AF_INET6)
#define AF_IPX SYMBOLIC(AF_IPX)
#define AF_IRDA SYMBOLIC(AF_IRDA)
#define AF_ISDN SYMBOLIC(AF_ISDN)
#define AF_IUCV SYMBOLIC(AF_IUCV)
#define AF_KCM SYMBOLIC(AF_KCM)
#define AF_KEY SYMBOLIC(AF_KEY)
#define AF_LLC SYMBOLIC(AF_LLC)
#define AF_LOCAL SYMBOLIC(AF_LOCAL)
#define AF_MAX SYMBOLIC(AF_MAX)
#define AF_MPLS SYMBOLIC(AF_MPLS)
#define AF_NETBEUI SYMBOLIC(AF_NETBEUI)
#define AF_NETLINK SYMBOLIC(AF_NETLINK)
#define AF_NETROM SYMBOLIC(AF_NETROM)
#define AF_NFC SYMBOLIC(AF_NFC)
#define AF_PACKET SYMBOLIC(AF_PACKET)
#define AF_PHONET SYMBOLIC(AF_PHONET)
#define AF_PPPOX SYMBOLIC(AF_PPPOX)
#define AF_RDS SYMBOLIC(AF_RDS)
#define AF_ROSE SYMBOLIC(AF_ROSE)
#define AF_ROUTE SYMBOLIC(AF_ROUTE)
#define AF_RXRPC SYMBOLIC(AF_RXRPC)
#define AF_SECURITY SYMBOLIC(AF_SECURITY)
#define AF_SNA SYMBOLIC(AF_SNA)
#define AF_TIPC SYMBOLIC(AF_TIPC)
#define AF_UNIX LITERALLY(1)
#define AF_UNSPEC LITERALLY(0)
#define AF_VSOCK SYMBOLIC(AF_VSOCK)
#define AF_WANPIPE SYMBOLIC(AF_WANPIPE)
#define AF_X25 SYMBOLIC(AF_X25)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_AF_H_ */

30
libc/sysv/consts/alg.h Normal file
View file

@ -0,0 +1,30 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_ALG_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_ALG_H_
#include "libc/runtime/symbolic.h"
#define ALG_SET_AEAD_ASSOCLEN SYMBOLIC(ALG_SET_AEAD_ASSOCLEN)
#define ALG_SET_AEAD_AUTHSIZE SYMBOLIC(ALG_SET_AEAD_AUTHSIZE)
#define ALG_SET_DRBG_ENTROPY SYMBOLIC(ALG_SET_DRBG_ENTROPY)
#define ALG_SET_IV SYMBOLIC(ALG_SET_IV)
#define ALG_SET_KEY SYMBOLIC(ALG_SET_KEY)
#define ALG_SET_OP SYMBOLIC(ALG_SET_OP)
#define ALG_OP_DECRYPT SYMBOLIC(ALG_OP_DECRYPT)
#define ALG_OP_ENCRYPT SYMBOLIC(ALG_OP_ENCRYPT)
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const long ALG_SET_AEAD_ASSOCLEN;
extern const long ALG_SET_AEAD_AUTHSIZE;
extern const long ALG_SET_DRBG_ENTROPY;
extern const long ALG_SET_IV;
extern const long ALG_SET_KEY;
extern const long ALG_SET_OP;
extern const long ALG_OP_DECRYPT;
extern const long ALG_OP_ENCRYPT;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_ALG_H_ */

View file

@ -2,54 +2,55 @@
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_IP_H_
#include "libc/runtime/symbolic.h"
#define IP_ADD_MEMBERSHIP SYMBOLIC(IP_ADD_MEMBERSHIP)
#define IP_ADD_SOURCE_MEMBERSHIP SYMBOLIC(IP_ADD_SOURCE_MEMBERSHIP)
#define IP_BIND_ADDRESS_NO_PORT SYMBOLIC(IP_BIND_ADDRESS_NO_PORT)
#define IP_BLOCK_SOURCE SYMBOLIC(IP_BLOCK_SOURCE)
#define IP_CHECKSUM SYMBOLIC(IP_CHECKSUM)
#define IP_ADD_MEMBERSHIP SYMBOLIC(IP_ADD_MEMBERSHIP)
#define IP_ADD_SOURCE_MEMBERSHIP SYMBOLIC(IP_ADD_SOURCE_MEMBERSHIP)
#define IP_BIND_ADDRESS_NO_PORT SYMBOLIC(IP_BIND_ADDRESS_NO_PORT)
#define IP_BLOCK_SOURCE SYMBOLIC(IP_BLOCK_SOURCE)
#define IP_CHECKSUM SYMBOLIC(IP_CHECKSUM)
#define IP_DEFAULT_MULTICAST_LOOP SYMBOLIC(IP_DEFAULT_MULTICAST_LOOP)
#define IP_DEFAULT_MULTICAST_TTL SYMBOLIC(IP_DEFAULT_MULTICAST_TTL)
#define IP_DROP_MEMBERSHIP SYMBOLIC(IP_DROP_MEMBERSHIP)
#define IP_DEFAULT_MULTICAST_TTL SYMBOLIC(IP_DEFAULT_MULTICAST_TTL)
#define IP_DROP_MEMBERSHIP SYMBOLIC(IP_DROP_MEMBERSHIP)
#define IP_DROP_SOURCE_MEMBERSHIP SYMBOLIC(IP_DROP_SOURCE_MEMBERSHIP)
#define IP_FREEBIND SYMBOLIC(IP_FREEBIND)
#define IP_HDRINCL SYMBOLIC(IP_HDRINCL)
#define IP_IPSEC_POLICY SYMBOLIC(IP_IPSEC_POLICY)
#define IP_MAX_MEMBERSHIPS SYMBOLIC(IP_MAX_MEMBERSHIPS)
#define IP_MINTTL SYMBOLIC(IP_MINTTL)
#define IP_MSFILTER SYMBOLIC(IP_MSFILTER)
#define IP_MTU SYMBOLIC(IP_MTU)
#define IP_MTU_DISCOVER SYMBOLIC(IP_MTU_DISCOVER)
#define IP_MULTICAST_ALL SYMBOLIC(IP_MULTICAST_ALL)
#define IP_MULTICAST_IF SYMBOLIC(IP_MULTICAST_IF)
#define IP_MULTICAST_LOOP SYMBOLIC(IP_MULTICAST_LOOP)
#define IP_MULTICAST_TTL SYMBOLIC(IP_MULTICAST_TTL)
#define IP_NODEFRAG SYMBOLIC(IP_NODEFRAG)
#define IP_OPTIONS SYMBOLIC(IP_OPTIONS)
#define IP_ORIGDSTADDR SYMBOLIC(IP_ORIGDSTADDR)
#define IP_PASSSEC SYMBOLIC(IP_PASSSEC)
#define IP_PKTINFO SYMBOLIC(IP_PKTINFO)
#define IP_PKTOPTIONS SYMBOLIC(IP_PKTOPTIONS)
#define IP_PMTUDISC SYMBOLIC(IP_PMTUDISC)
#define IP_PMTUDISC_DO SYMBOLIC(IP_PMTUDISC_DO)
#define IP_PMTUDISC_DONT SYMBOLIC(IP_PMTUDISC_DONT)
#define IP_PMTUDISC_INTERFACE SYMBOLIC(IP_PMTUDISC_INTERFACE)
#define IP_PMTUDISC_OMIT SYMBOLIC(IP_PMTUDISC_OMIT)
#define IP_PMTUDISC_PROBE SYMBOLIC(IP_PMTUDISC_PROBE)
#define IP_PMTUDISC_WANT SYMBOLIC(IP_PMTUDISC_WANT)
#define IP_RECVERR SYMBOLIC(IP_RECVERR)
#define IP_RECVOPTS SYMBOLIC(IP_RECVOPTS)
#define IP_RECVORIGDSTADDR SYMBOLIC(IP_RECVORIGDSTADDR)
#define IP_RECVRETOPTS SYMBOLIC(IP_RECVRETOPTS)
#define IP_RECVTOS SYMBOLIC(IP_RECVTOS)
#define IP_RECVTTL SYMBOLIC(IP_RECVTTL)
#define IP_RETOPTS SYMBOLIC(IP_RETOPTS)
#define IP_ROUTER_ALERT SYMBOLIC(IP_ROUTER_ALERT)
#define IP_TOS SYMBOLIC(IP_TOS)
#define IP_TRANSPARENT SYMBOLIC(IP_TRANSPARENT)
#define IP_TTL SYMBOLIC(IP_TTL)
#define IP_UNBLOCK_SOURCE SYMBOLIC(IP_UNBLOCK_SOURCE)
#define IP_UNICAST_IF SYMBOLIC(IP_UNICAST_IF)
#define IP_XFRM_POLICY SYMBOLIC(IP_XFRM_POLICY)
#define IP_FREEBIND SYMBOLIC(IP_FREEBIND)
#define IP_HDRINCL SYMBOLIC(IP_HDRINCL)
#define IP_IPSEC_POLICY SYMBOLIC(IP_IPSEC_POLICY)
#define IP_MAX_MEMBERSHIPS SYMBOLIC(IP_MAX_MEMBERSHIPS)
#define IP_MINTTL SYMBOLIC(IP_MINTTL)
#define IP_MSFILTER SYMBOLIC(IP_MSFILTER)
#define IP_MTU SYMBOLIC(IP_MTU)
#define IP_MTU_DISCOVER SYMBOLIC(IP_MTU_DISCOVER)
#define IP_MULTICAST_ALL SYMBOLIC(IP_MULTICAST_ALL)
#define IP_MULTICAST_IF SYMBOLIC(IP_MULTICAST_IF)
#define IP_MULTICAST_LOOP SYMBOLIC(IP_MULTICAST_LOOP)
#define IP_MULTICAST_TTL SYMBOLIC(IP_MULTICAST_TTL)
#define IP_NODEFRAG SYMBOLIC(IP_NODEFRAG)
#define IP_OPTIONS SYMBOLIC(IP_OPTIONS)
#define IP_ORIGDSTADDR SYMBOLIC(IP_ORIGDSTADDR)
#define IP_PASSSEC SYMBOLIC(IP_PASSSEC)
#define IP_PKTINFO SYMBOLIC(IP_PKTINFO)
#define IP_PKTOPTIONS SYMBOLIC(IP_PKTOPTIONS)
#define IP_PMTUDISC SYMBOLIC(IP_PMTUDISC)
#define IP_PMTUDISC_DO SYMBOLIC(IP_PMTUDISC_DO)
#define IP_PMTUDISC_DONT SYMBOLIC(IP_PMTUDISC_DONT)
#define IP_PMTUDISC_INTERFACE SYMBOLIC(IP_PMTUDISC_INTERFACE)
#define IP_PMTUDISC_OMIT SYMBOLIC(IP_PMTUDISC_OMIT)
#define IP_PMTUDISC_PROBE SYMBOLIC(IP_PMTUDISC_PROBE)
#define IP_PMTUDISC_WANT SYMBOLIC(IP_PMTUDISC_WANT)
#define IP_RECVDSTADDR SYMBOLIC(IP_RECVDSTADDR)
#define IP_RECVERR SYMBOLIC(IP_RECVERR)
#define IP_RECVOPTS SYMBOLIC(IP_RECVOPTS)
#define IP_RECVORIGDSTADDR SYMBOLIC(IP_RECVORIGDSTADDR)
#define IP_RECVRETOPTS SYMBOLIC(IP_RECVRETOPTS)
#define IP_RECVTOS SYMBOLIC(IP_RECVTOS)
#define IP_RECVTTL SYMBOLIC(IP_RECVTTL)
#define IP_RETOPTS SYMBOLIC(IP_RETOPTS)
#define IP_ROUTER_ALERT SYMBOLIC(IP_ROUTER_ALERT)
#define IP_TOS SYMBOLIC(IP_TOS)
#define IP_TRANSPARENT SYMBOLIC(IP_TRANSPARENT)
#define IP_TTL SYMBOLIC(IP_TTL)
#define IP_UNBLOCK_SOURCE SYMBOLIC(IP_UNBLOCK_SOURCE)
#define IP_UNICAST_IF SYMBOLIC(IP_UNICAST_IF)
#define IP_XFRM_POLICY SYMBOLIC(IP_XFRM_POLICY)
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -88,6 +89,7 @@ extern const long IP_PMTUDISC_INTERFACE;
extern const long IP_PMTUDISC_OMIT;
extern const long IP_PMTUDISC_PROBE;
extern const long IP_PMTUDISC_WANT;
extern const long IP_RECVDSTADDR;
extern const long IP_RECVERR;
extern const long IP_RECVOPTS;
extern const long IP_RECVORIGDSTADDR;

View file

@ -1,61 +1,69 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_IPPORT_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_IPPORT_H_
#include "libc/runtime/symbolic.h"
/**
* ARPA network ports.
*/
#define IPPORT_ECHO 7
#define IPPORT_DISCARD 9
#define IPPORT_SYSTAT 11
#define IPPORT_DAYTIME 13
#define IPPORT_NETSTAT 15
#define IPPORT_FTP 21
#define IPPORT_TELNET 23
#define IPPORT_SMTP 25
#define IPPORT_TIMESERVER 37
#define IPPORT_NAMESERVER 42
#define IPPORT_WHOIS 43
#define IPPORT_MTP 57
#define IPPORT_TFTP 69
#define IPPORT_RJE 77
#define IPPORT_FINGER 79
#define IPPORT_TTYLINK 87
#define IPPORT_SUPDUP 95
#define IPPORT_EXECSERVER 512
#define IPPORT_LOGINSERVER 513
#define IPPORT_CMDSERVER 514
#define IPPORT_EFSSERVER 520
#define IPPORT_BIFFUDP 512
#define IPPORT_WHOSERVER 513
#define IPPORT_ROUTESERVER 520
#define IPPORT_RESERVED 1024
#define IPPORT_USERRESERVED 5000
#define IPPORT_ECHO 7
#define IPPORT_DISCARD 9
#define IPPORT_SYSTAT 11
#define IPPORT_DAYTIME 13
#define IPPORT_NETSTAT 15
#define IPPORT_FTP 21
#define IPPORT_TELNET 23
#define IPPORT_SMTP 25
#define IPPORT_TIMESERVER 37
#define IPPORT_NAMESERVER 42
#define IPPORT_WHOIS 43
#define IPPORT_MTP 57
#define IPPORT_TFTP 69
#define IPPORT_RJE 77
#define IPPORT_FINGER 79
#define IPPORT_TTYLINK 87
#define IPPORT_SUPDUP 95
#define IPPORT_EXECSERVER 512
#define IPPORT_LOGINSERVER 513
#define IPPORT_CMDSERVER 514
#define IPPORT_EFSSERVER 520
#define IPPORT_BIFFUDP 512
#define IPPORT_WHOSERVER 513
#define IPPORT_ROUTESERVER 520
#define IPPORT_RESERVED 1024
#define IPPORT_USERRESERVED SYMBOLIC(IPPORT_USERRESERVED)
/**
* Modern network ports.
*/
#define IPPORT_SSH 22
#define IPPORT_DOMAIN 53
#define IPPORT_HTTP 80
#define IPPORT_POP3 110
#define IPPORT_SFTP 115
#define IPPORT_NTP 123
#define IPPORT_IMAP2 143
#define IPPORT_NETBIOS_NS 137
#define IPPORT_SSH 22
#define IPPORT_DOMAIN 53
#define IPPORT_HTTP 80
#define IPPORT_POP3 110
#define IPPORT_SFTP 115
#define IPPORT_NTP 123
#define IPPORT_IMAP2 143
#define IPPORT_NETBIOS_NS 137
#define IPPORT_NETBIOS_DGM 138
#define IPPORT_NETBIOS_SSN 139
#define IPPORT_BGP 179
#define IPPORT_IRC 194
#define IPPORT_HTTPS 443
#define IPPORT_PRINTER 515
#define IPPORT_NFS 2049
#define IPPORT_DISTCC 3632
#define IPPORT_SIP 5060
#define IPPORT_POSTGRESQL 5432
#define IPPORT_X11 6000
#define IPPORT_GIT 9418
#define IPPORT_IRCD 6667
#define IPPORT_IMAPS 993
#define IPPORT_POP3S 995
#define IPPORT_BGP 179
#define IPPORT_IRC 194
#define IPPORT_HTTPS 443
#define IPPORT_PRINTER 515
#define IPPORT_NFS 2049
#define IPPORT_DISTCC 3632
#define IPPORT_SIP 5060
#define IPPORT_POSTGRESQL 5432
#define IPPORT_X11 6000
#define IPPORT_GIT 9418
#define IPPORT_IRCD 6667
#define IPPORT_IMAPS 993
#define IPPORT_POP3S 995
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const long IPPORT_USERRESERVED;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_IPPORT_H_ */

View file

@ -5,20 +5,24 @@
COSMOPOLITAN_C_START_
extern const long MSG_BATCH;
extern const long MSG_BCAST;
extern const long MSG_CMSG_CLOEXEC;
extern const long MSG_CONFIRM;
extern const long MSG_CTRUNC;
extern const long MSG_DONTROUTE;
extern const long MSG_DONTWAIT;
extern const long MSG_EOF;
extern const long MSG_EOR;
extern const long MSG_ERRQUEUE;
extern const long MSG_EXCEPT;
extern const long MSG_FASTOPEN;
extern const long MSG_FIN;
extern const long MSG_INFO;
extern const long MSG_MCAST;
extern const long MSG_MORE;
extern const long MSG_NOERROR;
extern const long MSG_NOSIGNAL;
extern const long MSG_NOTIFICATION;
extern const long MSG_OOB;
extern const long MSG_PARITY_ERROR;
extern const long MSG_PEEK;
@ -33,30 +37,34 @@ extern const long MSG_WAITFORONE;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define MSG_BATCH SYMBOLIC(MSG_BATCH)
#define MSG_BATCH SYMBOLIC(MSG_BATCH)
#define MSG_BCAST SYMBOLIC(MSG_BCAST)
#define MSG_CMSG_CLOEXEC SYMBOLIC(MSG_CMSG_CLOEXEC)
#define MSG_CONFIRM SYMBOLIC(MSG_CONFIRM)
#define MSG_CTRUNC SYMBOLIC(MSG_CTRUNC)
#define MSG_DONTROUTE LITERALLY(4)
#define MSG_DONTWAIT SYMBOLIC(MSG_DONTWAIT)
#define MSG_EOR SYMBOLIC(MSG_EOR)
#define MSG_ERRQUEUE SYMBOLIC(MSG_ERRQUEUE)
#define MSG_EXCEPT SYMBOLIC(MSG_EXCEPT)
#define MSG_FASTOPEN SYMBOLIC(MSG_FASTOPEN)
#define MSG_FIN SYMBOLIC(MSG_FIN)
#define MSG_INFO SYMBOLIC(MSG_INFO)
#define MSG_MORE SYMBOLIC(MSG_MORE)
#define MSG_NOERROR SYMBOLIC(MSG_NOERROR)
#define MSG_NOSIGNAL SYMBOLIC(MSG_NOSIGNAL)
#define MSG_OOB LITERALLY(1)
#define MSG_CONFIRM SYMBOLIC(MSG_CONFIRM)
#define MSG_CTRUNC SYMBOLIC(MSG_CTRUNC)
#define MSG_DONTROUTE LITERALLY(4)
#define MSG_DONTWAIT SYMBOLIC(MSG_DONTWAIT)
#define MSG_EOF SYMBOLIC(MSG_EOF)
#define MSG_EOR SYMBOLIC(MSG_EOR)
#define MSG_ERRQUEUE SYMBOLIC(MSG_ERRQUEUE)
#define MSG_EXCEPT SYMBOLIC(MSG_EXCEPT)
#define MSG_FASTOPEN SYMBOLIC(MSG_FASTOPEN)
#define MSG_FIN SYMBOLIC(MSG_FIN)
#define MSG_INFO SYMBOLIC(MSG_INFO)
#define MSG_MCAST SYMBOLIC(MSG_MCAST)
#define MSG_MORE SYMBOLIC(MSG_MORE)
#define MSG_NOERROR SYMBOLIC(MSG_NOERROR)
#define MSG_NOSIGNAL SYMBOLIC(MSG_NOSIGNAL)
#define MSG_NOTIFICATION SYMBOLIC(MSG_NOTIFICATION)
#define MSG_OOB LITERALLY(1)
#define MSG_PARITY_ERROR SYMBOLIC(MSG_PARITY_ERROR)
#define MSG_PEEK LITERALLY(2)
#define MSG_PROXY SYMBOLIC(MSG_PROXY)
#define MSG_RST SYMBOLIC(MSG_RST)
#define MSG_STAT SYMBOLIC(MSG_STAT)
#define MSG_SYN SYMBOLIC(MSG_SYN)
#define MSG_TRUNC SYMBOLIC(MSG_TRUNC)
#define MSG_WAITALL SYMBOLIC(MSG_WAITALL)
#define MSG_WAITFORONE SYMBOLIC(MSG_WAITFORONE)
#define MSG_PEEK LITERALLY(2)
#define MSG_PROXY SYMBOLIC(MSG_PROXY)
#define MSG_RST SYMBOLIC(MSG_RST)
#define MSG_STAT SYMBOLIC(MSG_STAT)
#define MSG_SYN SYMBOLIC(MSG_SYN)
#define MSG_TRUNC SYMBOLIC(MSG_TRUNC)
#define MSG_WAITALL SYMBOLIC(MSG_WAITALL)
#define MSG_WAITFORONE SYMBOLIC(MSG_WAITFORONE)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_MSG_H_ */

View file

@ -2,66 +2,72 @@
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_SO_H_
#include "libc/runtime/symbolic.h"
#define SO_ACCEPTCONN SYMBOLIC(SO_ACCEPTCONN)
#define SO_ATTACH_BPF SYMBOLIC(SO_ATTACH_BPF)
#define SO_ATTACH_FILTER SYMBOLIC(SO_ATTACH_FILTER)
#define LOCAL_PEERCRED SYMBOLIC(LOCAL_PEERCRED)
#define SO_ACCEPTCONN SYMBOLIC(SO_ACCEPTCONN)
#define SO_ATTACH_BPF SYMBOLIC(SO_ATTACH_BPF)
#define SO_ATTACH_FILTER SYMBOLIC(SO_ATTACH_FILTER)
#define SO_ATTACH_REUSEPORT_CBPF SYMBOLIC(SO_ATTACH_REUSEPORT_CBPF)
#define SO_ATTACH_REUSEPORT_EBPF SYMBOLIC(SO_ATTACH_REUSEPORT_EBPF)
#define SO_BINDTODEVICE SYMBOLIC(SO_BINDTODEVICE)
#define SO_BPF_EXTENSIONS SYMBOLIC(SO_BPF_EXTENSIONS)
#define SO_BROADCAST SYMBOLIC(SO_BROADCAST)
#define SO_BSDCOMPAT SYMBOLIC(SO_BSDCOMPAT)
#define SO_BUSY_POLL SYMBOLIC(SO_BUSY_POLL)
#define SO_CNX_ADVICE SYMBOLIC(SO_CNX_ADVICE)
#define SO_DEBUG SYMBOLIC(SO_DEBUG)
#define SO_DETACH_BPF SYMBOLIC(SO_DETACH_BPF)
#define SO_DETACH_FILTER SYMBOLIC(SO_DETACH_FILTER)
#define SO_DOMAIN SYMBOLIC(SO_DOMAIN)
#define SO_DONTROUTE SYMBOLIC(SO_DONTROUTE)
#define SO_ERROR SYMBOLIC(SO_ERROR)
#define SO_EXCLUSIVEADDRUSE SYMBOLIC(SO_EXCLUSIVEADDRUSE)
#define SO_GET_FILTER SYMBOLIC(SO_GET_FILTER)
#define SO_INCOMING_CPU SYMBOLIC(SO_INCOMING_CPU)
#define SO_KEEPALIVE SYMBOLIC(SO_KEEPALIVE)
#define SO_LINGER SYMBOLIC(SO_LINGER)
#define SO_LOCK_FILTER SYMBOLIC(SO_LOCK_FILTER)
#define SO_MARK SYMBOLIC(SO_MARK)
#define SO_MAX_PACING_RATE SYMBOLIC(SO_MAX_PACING_RATE)
#define SO_NOFCS SYMBOLIC(SO_NOFCS)
#define SO_NO_CHECK SYMBOLIC(SO_NO_CHECK)
#define SO_OOBINLINE SYMBOLIC(SO_OOBINLINE)
#define SO_PASSCRED SYMBOLIC(SO_PASSCRED)
#define SO_PASSSEC SYMBOLIC(SO_PASSSEC)
#define SO_PEEK_OFF SYMBOLIC(SO_PEEK_OFF)
#define SO_PEERCRED SYMBOLIC(SO_PEERCRED)
#define SO_PEERNAME SYMBOLIC(SO_PEERNAME)
#define SO_PEERSEC SYMBOLIC(SO_PEERSEC)
#define SO_PRIORITY SYMBOLIC(SO_PRIORITY)
#define SO_PROTOCOL SYMBOLIC(SO_PROTOCOL)
#define SO_RCVBUF SYMBOLIC(SO_RCVBUF)
#define SO_RCVBUFFORCE SYMBOLIC(SO_RCVBUFFORCE)
#define SO_RCVLOWAT SYMBOLIC(SO_RCVLOWAT)
#define SO_RCVTIMEO SYMBOLIC(SO_RCVTIMEO)
#define SO_REUSEADDR SYMBOLIC(SO_REUSEADDR)
#define SO_REUSEPORT SYMBOLIC(SO_REUSEPORT)
#define SO_RXQ_OVFL SYMBOLIC(SO_RXQ_OVFL)
#define SO_SECURITY_AUTHENTICATION SYMBOLIC(SO_SECURITY_AUTHENTICATION)
#define SO_BINDTODEVICE SYMBOLIC(SO_BINDTODEVICE)
#define SO_BPF_EXTENSIONS SYMBOLIC(SO_BPF_EXTENSIONS)
#define SO_BROADCAST SYMBOLIC(SO_BROADCAST)
#define SO_BSDCOMPAT SYMBOLIC(SO_BSDCOMPAT)
#define SO_BUSY_POLL SYMBOLIC(SO_BUSY_POLL)
#define SO_CNX_ADVICE SYMBOLIC(SO_CNX_ADVICE)
#define SO_DEBUG SYMBOLIC(SO_DEBUG)
#define SO_DETACH_BPF SYMBOLIC(SO_DETACH_BPF)
#define SO_DETACH_FILTER SYMBOLIC(SO_DETACH_FILTER)
#define SO_DOMAIN SYMBOLIC(SO_DOMAIN)
#define SO_DONTROUTE SYMBOLIC(SO_DONTROUTE)
#define SO_ERROR SYMBOLIC(SO_ERROR)
#define SO_EXCLUSIVEADDRUSE SYMBOLIC(SO_EXCLUSIVEADDRUSE)
#define SO_GET_FILTER SYMBOLIC(SO_GET_FILTER)
#define SO_INCOMING_CPU SYMBOLIC(SO_INCOMING_CPU)
#define SO_KEEPALIVE SYMBOLIC(SO_KEEPALIVE)
#define SO_LINGER SYMBOLIC(SO_LINGER)
#define SO_LOCK_FILTER SYMBOLIC(SO_LOCK_FILTER)
#define SO_MARK SYMBOLIC(SO_MARK)
#define SO_MAX_PACING_RATE SYMBOLIC(SO_MAX_PACING_RATE)
#define SO_NOFCS SYMBOLIC(SO_NOFCS)
#define SO_NO_CHECK SYMBOLIC(SO_NO_CHECK)
#define SO_OOBINLINE SYMBOLIC(SO_OOBINLINE)
#define SO_PASSCRED SYMBOLIC(SO_PASSCRED)
#define SO_PASSSEC SYMBOLIC(SO_PASSSEC)
#define SO_PEEK_OFF SYMBOLIC(SO_PEEK_OFF)
#define SO_PEERCRED SYMBOLIC(SO_PEERCRED)
#define SO_PEERNAME SYMBOLIC(SO_PEERNAME)
#define SO_PEERSEC SYMBOLIC(SO_PEERSEC)
#define SO_PRIORITY SYMBOLIC(SO_PRIORITY)
#define SO_PROTOCOL SYMBOLIC(SO_PROTOCOL)
#define SO_RCVBUF SYMBOLIC(SO_RCVBUF)
#define SO_RCVBUFFORCE SYMBOLIC(SO_RCVBUFFORCE)
#define SO_RCVLOWAT SYMBOLIC(SO_RCVLOWAT)
#define SO_RCVTIMEO SYMBOLIC(SO_RCVTIMEO)
#define SO_REUSEADDR SYMBOLIC(SO_REUSEADDR)
#define SO_REUSEPORT SYMBOLIC(SO_REUSEPORT)
#define SO_RXQ_OVFL SYMBOLIC(SO_RXQ_OVFL)
#define SO_SELECT_ERR_QUEUE SYMBOLIC(SO_SELECT_ERR_QUEUE)
#define SO_SETFIB SYMBOLIC(SO_SETFIB)
#define SO_SNDBUF SYMBOLIC(SO_SNDBUF)
#define SO_SNDBUFFORCE SYMBOLIC(SO_SNDBUFFORCE)
#define SO_SNDLOWAT SYMBOLIC(SO_SNDLOWAT)
#define SO_SNDTIMEO SYMBOLIC(SO_SNDTIMEO)
#define SO_TIMESTAMP SYMBOLIC(SO_TIMESTAMP)
#define SO_TIMESTAMPING SYMBOLIC(SO_TIMESTAMPING)
#define SO_TIMESTAMPNS SYMBOLIC(SO_TIMESTAMPNS)
#define SO_TYPE SYMBOLIC(SO_TYPE)
#define SO_USELOOPBACK SYMBOLIC(SO_USELOOPBACK)
#define SO_WIFI_STATUS SYMBOLIC(SO_WIFI_STATUS)
#define SO_SECURITY_AUTHENTICATION SYMBOLIC(SO_SECURITY_AUTHENTICATION)
#define SO_SECURITY_ENCRYPTION_NETWORK SYMBOLIC(SO_SECURITY_ENCRYPTION_NETWORK)
#define SO_SECURITY_ENCRYPTION_TRANSPORT SYMBOLIC(SO_SECURITY_ENCRYPTION_TRANSPORT)
#define SO_SELECT_ERR_QUEUE SYMBOLIC(SO_SELECT_ERR_QUEUE)
#define SO_SNDBUF SYMBOLIC(SO_SNDBUF)
#define SO_SNDBUFFORCE SYMBOLIC(SO_SNDBUFFORCE)
#define SO_SNDLOWAT SYMBOLIC(SO_SNDLOWAT)
#define SO_SNDTIMEO SYMBOLIC(SO_SNDTIMEO)
#define SO_TIMESTAMP SYMBOLIC(SO_TIMESTAMP)
#define SO_TIMESTAMPING SYMBOLIC(SO_TIMESTAMPING)
#define SO_TIMESTAMPNS SYMBOLIC(SO_TIMESTAMPNS)
#define SO_TYPE SYMBOLIC(SO_TYPE)
#define SO_WIFI_STATUS SYMBOLIC(SO_WIFI_STATUS)
#define SO_SECURITY_ENCRYPTION_TRANSPORT \
SYMBOLIC(SO_SECURITY_ENCRYPTION_TRANSPORT)
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const long LOCAL_PEERCRED;
extern const long SO_ACCEPTCONN;
extern const long SO_ATTACH_BPF;
extern const long SO_ATTACH_FILTER;
@ -109,6 +115,7 @@ extern const long SO_SECURITY_AUTHENTICATION;
extern const long SO_SECURITY_ENCRYPTION_NETWORK;
extern const long SO_SECURITY_ENCRYPTION_TRANSPORT;
extern const long SO_SELECT_ERR_QUEUE;
extern const long SO_SETFIB;
extern const long SO_SNDBUF;
extern const long SO_SNDBUFFORCE;
extern const long SO_SNDLOWAT;
@ -117,6 +124,7 @@ extern const long SO_TIMESTAMP;
extern const long SO_TIMESTAMPING;
extern const long SO_TIMESTAMPNS;
extern const long SO_TYPE;
extern const long SO_USELOOPBACK;
extern const long SO_WIFI_STATUS;
COSMOPOLITAN_C_END_

View file

@ -540,10 +540,8 @@ extern void __gdtoa_memcpy(void *, const void *, size_t);
#define gethex __gdtoa_gethex
#define hexdig __gdtoa_hexdig
#define hexnan __gdtoa_hexnan
#define hi0bits(x) __gdtoa_hi0bits((ULong)(x))
#define i2b __gdtoa_i2b
#define increment __gdtoa_increment
#define lo0bits __gdtoa_lo0bits
#define lshift __gdtoa_lshift
#define match __gdtoa_match
#define mult __gdtoa_mult
@ -594,10 +592,8 @@ extern char *g__fmt(char *, char *, char *, int, ULong, size_t);
extern int gethex(CONST char **, CONST FPI *, Long *, Bigint **, int MTd);
extern void __gdtoa_hexdig_init(void);
extern int hexnan(CONST char **, CONST FPI *, ULong *);
extern int __gdtoa_hi0bits(ULong);
extern Bigint *i2b(int MTd);
extern Bigint *increment(Bigint *MTd);
extern int lo0bits(ULong *);
extern Bigint *lshift(Bigint *, int MTd);
extern int match(CONST char **, char *);
extern Bigint *mult(Bigint *, Bigint *MTd);
@ -617,6 +613,21 @@ extern Bigint *sum(Bigint *, Bigint *MTd);
extern int trailz(Bigint *);
extern double ulp(U *);
forceinline int lo0bits(ULong *y) {
int k;
if (*y) {
k = __builtin_ctz(*y);
*y >>= k;
return k;
} else {
return 32;
}
}
forceinline int hi0bits(ULong x) {
return x ? __builtin_clz(x) : 32;
}
#ifdef __cplusplus
}
#endif

View file

@ -177,49 +177,6 @@ Bfree(Bigint *v MTd)
}
}
int
lo0bits(ULong *y)
{
int k;
ULong x = *y;
if (x & 7) {
if (x & 1)
return 0;
if (x & 2) {
*y = x >> 1;
return 1;
}
*y = x >> 2;
return 2;
}
k = 0;
if (!(x & 0xffff)) {
k = 16;
x >>= 16;
}
if (!(x & 0xff)) {
k += 8;
x >>= 8;
}
if (!(x & 0xf)) {
k += 4;
x >>= 4;
}
if (!(x & 0x3)) {
k += 2;
x >>= 2;
}
if (!(x & 1)) {
k++;
x >>= 1;
if (!x)
return 32;
}
*y = x;
return k;
}
Bigint *
multadd(Bigint *b, int m, int a MTd) /* multiply by m and add a */
{
@ -272,35 +229,6 @@ multadd(Bigint *b, int m, int a MTd) /* multiply by m and add a */
return b;
}
int
__gdtoa_hi0bits(ULong x)
{
int k = 0;
if (!(x & 0xffff0000)) {
k = 16;
x <<= 16;
}
if (!(x & 0xff000000)) {
k += 8;
x <<= 8;
}
if (!(x & 0xf0000000)) {
k += 4;
x <<= 4;
}
if (!(x & 0xc0000000)) {
k += 2;
x <<= 2;
}
if (!(x & 0x80000000)) {
k++;
if (!(x & 0x40000000))
return 32;
}
return k;
}
Bigint *
i2b(int i MTd)
{

View file

@ -52,7 +52,7 @@ o/$(MODE)/third_party/lua/lua.com.dbg: \
$(THIRD_PARTY_LUA_DEPS) \
$(THIRD_PARTY_LUA_A) \
$(THIRD_PARTY_LUA_A).pkg \
o/$(MODE)/third_party/lua/lua.o \
o/$(MODE)/third_party/lua/lua.main.o \
$(CRT) \
$(APE)
-@$(APELINK)
@ -61,7 +61,7 @@ o/$(MODE)/third_party/lua/luac.com.dbg: \
$(THIRD_PARTY_LUA_DEPS) \
$(THIRD_PARTY_LUA_A) \
$(THIRD_PARTY_LUA_A).pkg \
o/$(MODE)/third_party/lua/luac.o \
o/$(MODE)/third_party/lua/luac.main.o \
$(CRT) \
$(APE)
-@$(APELINK)

View file

@ -1,17 +1,14 @@
# Binary data types
# -*- conf -*-
*.com binary
*.aif binary
*.aifc binary
*.aiff binary
*.au binary
*.bmp binary
*.exe binary
*.icns binary
*.gif binary
*.ico binary
*.jpg binary
*.pck binary
*.png binary
*.psd binary
*.tar binary
*.wav binary
*.whl binary

View file

@ -1,57 +1,29 @@
#ifndef Py_PYTHON_H
#define Py_PYTHON_H
/* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */
#include "libc/assert.h"
#include "libc/calls/calls.h"
#include "libc/calls/weirdtypes.h"
#include "libc/errno.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/fmt.h"
#include "libc/limits.h"
#include "libc/log/log.h"
#include "libc/mem/mem.h"
#include "libc/rand/rand.h"
#include "libc/runtime/runtime.h"
#include "libc/stdio/stdio.h"
#include "libc/stdio/temp.h"
#include "libc/str/str.h"
#include "libc/sysv/consts/exit.h"
#include "libc/sysv/consts/fileno.h"
#include "libc/sysv/consts/o.h"
#include "third_party/python/Include/patchlevel.h"
#include "third_party/python/Include/pymacconfig.h"
#include "third_party/python/pyconfig.h"
/* clang-format off */
/* Include nearly all Python header files */
#include "patchlevel.h"
#include "pyconfig.h"
#include "pymacconfig.h"
#include <limits.h>
#ifndef UCHAR_MAX
#error "Something's broken. UCHAR_MAX should be defined in limits.h."
#endif
#if UCHAR_MAX != 255
#error "Python's source code assumes C's unsigned char is an 8-bit type."
#endif
#if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE)
#define _SGI_MP_SOURCE
#endif
#include <stdio.h>
#ifndef NULL
# error "Python.h requires that stdio.h define NULL."
#endif
#include <string.h>
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_CRYPT_H
#include <crypt.h>
#endif
/* For size_t? */
#ifdef HAVE_STDDEF_H
#include <stddef.h>
#endif
/* CAUTION: Build setups should ensure that NDEBUG is defined on the
* compiler command line when building Python in release mode; else
* assert() calls won't be removed.
*/
#include <assert.h>
#include "pyport.h"
#include "pymacro.h"
#include "third_party/python/Include/pyport.h"
#include "third_party/python/Include/pymacro.h"
/* A convenient way for code to know if clang's memory sanitizer is enabled. */
#if defined(__has_feature)
@ -62,7 +34,7 @@
# endif
#endif
#include "pyatomic.h"
#include "third_party/python/Include/pyatomic.h"
/* Debug-mode build with pymalloc implies PYMALLOC_DEBUG.
* PYMALLOC_DEBUG is in error if pymalloc is not in use.
@ -73,76 +45,77 @@
#if defined(PYMALLOC_DEBUG) && !defined(WITH_PYMALLOC)
#error "PYMALLOC_DEBUG requires WITH_PYMALLOC"
#endif
#include "pymath.h"
#include "pytime.h"
#include "pymem.h"
#include "object.h"
#include "objimpl.h"
#include "typeslots.h"
#include "pyhash.h"
#include "third_party/python/Include/pymath.h"
#include "third_party/python/Include/pytime.h"
#include "third_party/python/Include/pymem.h"
#include "pydebug.h"
#include "third_party/python/Include/object.h"
#include "third_party/python/Include/objimpl.h"
#include "third_party/python/Include/typeslots.h"
#include "third_party/python/Include/pyhash.h"
#include "bytearrayobject.h"
#include "bytesobject.h"
#include "unicodeobject.h"
#include "longobject.h"
#include "longintrepr.h"
#include "boolobject.h"
#include "floatobject.h"
#include "complexobject.h"
#include "rangeobject.h"
#include "memoryobject.h"
#include "tupleobject.h"
#include "listobject.h"
#include "dictobject.h"
#include "odictobject.h"
#include "enumobject.h"
#include "setobject.h"
#include "methodobject.h"
#include "moduleobject.h"
#include "funcobject.h"
#include "classobject.h"
#include "fileobject.h"
#include "pycapsule.h"
#include "traceback.h"
#include "sliceobject.h"
#include "cellobject.h"
#include "iterobject.h"
#include "genobject.h"
#include "descrobject.h"
#include "warnings.h"
#include "weakrefobject.h"
#include "structseq.h"
#include "namespaceobject.h"
#include "third_party/python/Include/pydebug.h"
#include "codecs.h"
#include "pyerrors.h"
#include "third_party/python/Include/bytearrayobject.h"
#include "third_party/python/Include/bytesobject.h"
#include "third_party/python/Include/unicodeobject.h"
#include "third_party/python/Include/longobject.h"
#include "third_party/python/Include/longintrepr.h"
#include "third_party/python/Include/boolobject.h"
#include "third_party/python/Include/floatobject.h"
#include "third_party/python/Include/complexobject.h"
#include "third_party/python/Include/rangeobject.h"
#include "third_party/python/Include/memoryobject.h"
#include "third_party/python/Include/tupleobject.h"
#include "third_party/python/Include/listobject.h"
#include "third_party/python/Include/dictobject.h"
#include "third_party/python/Include/odictobject.h"
#include "third_party/python/Include/enumobject.h"
#include "third_party/python/Include/setobject.h"
#include "third_party/python/Include/methodobject.h"
#include "third_party/python/Include/moduleobject.h"
#include "third_party/python/Include/funcobject.h"
#include "third_party/python/Include/classobject.h"
#include "third_party/python/Include/fileobject.h"
#include "third_party/python/Include/pycapsule.h"
#include "third_party/python/Include/traceback.h"
#include "third_party/python/Include/sliceobject.h"
#include "third_party/python/Include/cellobject.h"
#include "third_party/python/Include/iterobject.h"
#include "third_party/python/Include/genobject.h"
#include "third_party/python/Include/descrobject.h"
#include "third_party/python/Include/warnings.h"
#include "third_party/python/Include/weakrefobject.h"
#include "third_party/python/Include/structseq.h"
#include "third_party/python/Include/namespaceobject.h"
#include "pystate.h"
#include "third_party/python/Include/codecs.h"
#include "third_party/python/Include/pyerrors.h"
#include "pyarena.h"
#include "modsupport.h"
#include "pythonrun.h"
#include "pylifecycle.h"
#include "ceval.h"
#include "sysmodule.h"
#include "osmodule.h"
#include "intrcheck.h"
#include "import.h"
#include "third_party/python/Include/pystate.h"
#include "abstract.h"
#include "bltinmodule.h"
#include "third_party/python/Include/pyarena.h"
#include "third_party/python/Include/modsupport.h"
#include "third_party/python/Include/pythonrun.h"
#include "third_party/python/Include/pylifecycle.h"
#include "third_party/python/Include/ceval.h"
#include "third_party/python/Include/sysmodule.h"
#include "third_party/python/Include/osmodule.h"
#include "third_party/python/Include/intrcheck.h"
#include "third_party/python/Include/import.h"
#include "compile.h"
#include "eval.h"
#include "third_party/python/Include/abstract.h"
#include "third_party/python/Include/bltinmodule.h"
#include "pyctype.h"
#include "pystrtod.h"
#include "pystrcmp.h"
#include "dtoa.h"
#include "fileutils.h"
#include "pyfpe.h"
#include "third_party/python/Include/compile.h"
#include "third_party/python/Include/eval.h"
#include "third_party/python/Include/pyctype.h"
#include "third_party/python/Include/pystrtod.h"
#include "third_party/python/Include/pystrcmp.h"
#include "third_party/python/Include/dtoa.h"
#include "third_party/python/Include/fileutils.h"
#include "third_party/python/Include/pyfpe.h"
#endif /* !Py_PYTHON_H */

View file

@ -1,8 +1,7 @@
#ifndef Py_ABSTRACTOBJECT_H
#define Py_ABSTRACTOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
#ifdef PY_SSIZE_T_CLEAN
#define PyObject_CallFunction _PyObject_CallFunction_SizeT
@ -1370,8 +1369,5 @@ PyAPI_FUNC(void) _Py_add_one_to_index_C(int nd, Py_ssize_t *index,
const Py_ssize_t *shape);
#endif /* !Py_LIMITED_API */
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* Py_ABSTRACTOBJECT_H */

View file

@ -1,20 +1,8 @@
#ifndef Py_LIMITED_API
#ifndef Py_ACCU_H
#define Py_ACCU_H
/*** This is a private API for use by the interpreter and the stdlib.
*** Its definition may be changed or removed at any moment.
***/
/*
* A two-level accumulator of unicode objects that avoids both the overhead
* of keeping a huge number of small separate objects, and the quadratic
* behaviour of using a naive repeated concatenation scheme.
*/
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
#undef small /* defined by some Windows headers */
@ -29,9 +17,6 @@ PyAPI_FUNC(PyObject *) _PyAccu_FinishAsList(_PyAccu *acc);
PyAPI_FUNC(PyObject *) _PyAccu_Finish(_PyAccu *acc);
PyAPI_FUNC(void) _PyAccu_Destroy(_PyAccu *acc);
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* Py_ACCU_H */
#endif /* Py_LIMITED_API */

View file

@ -1,5 +1,6 @@
#ifndef Py_ASDL_H
#define Py_ASDL_H
/* clang-format off */
typedef PyObject * identifier;
typedef PyObject * string;

View file

@ -1,9 +1,9 @@
#ifndef Py_AST_H
#define Py_AST_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
extern int foo;
PyAPI_FUNC(int) PyAST_Validate(mod_ty);
PyAPI_FUNC(mod_ty) PyAST_FromNode(
const node *n,
@ -16,7 +16,5 @@ PyAPI_FUNC(mod_ty) PyAST_FromNodeObject(
PyObject *filename,
PyArena *arena);
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_AST_H */

View file

@ -1,11 +1,7 @@
#ifndef Py_BITSET_H
#define Py_BITSET_H
#ifdef __cplusplus
extern "C" {
#endif
/* Bitset interface */
COSMOPOLITAN_C_START_
/* clang-format off */
#define BYTE char
@ -26,7 +22,5 @@ void mergebitset(bitset bs1, bitset bs2, int nbits);
#define BIT2MASK(ibit) (1 << BIT2SHIFT(ibit))
#define BYTE2BIT(ibyte) ((ibyte) * BITSPERBYTE)
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_BITSET_H */

View file

@ -1,14 +1,11 @@
#ifndef Py_BLTINMODULE_H
#define Py_BLTINMODULE_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
PyAPI_DATA(PyTypeObject) PyFilter_Type;
PyAPI_DATA(PyTypeObject) PyMap_Type;
PyAPI_DATA(PyTypeObject) PyZip_Type;
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_BLTINMODULE_H */

View file

@ -1,11 +1,7 @@
/* Boolean object interface */
#ifndef Py_BOOLOBJECT_H
#define Py_BOOLOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
PyAPI_DATA(PyTypeObject) PyBool_Type;
@ -18,17 +14,15 @@ Don't forget to apply Py_INCREF() when returning either!!! */
PyAPI_DATA(struct _longobject) _Py_FalseStruct, _Py_TrueStruct;
/* Use these macros */
#define Py_False ((PyObject *) &_Py_FalseStruct)
#define Py_True ((PyObject *) &_Py_TrueStruct)
#define Py_False ((PyObject *)&_Py_FalseStruct)
#define Py_True ((PyObject *)&_Py_TrueStruct)
/* Macros for returning Py_True or Py_False, respectively */
#define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True
#define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True
#define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False
/* Function to return a bool from a C long */
PyAPI_FUNC(PyObject *) PyBool_FromLong(long);
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_BOOLOBJECT_H */

View file

@ -1,12 +1,7 @@
/* ByteArray object interface */
#ifndef Py_BYTEARRAYOBJECT_H
#define Py_BYTEARRAYOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdarg.h>
COSMOPOLITAN_C_START_
/* clang-format off */
/* Type PyByteArrayObject represents a mutable array of bytes.
* The Python API is that of a sequence;
@ -56,7 +51,5 @@ PyAPI_FUNC(int) PyByteArray_Resize(PyObject *, Py_ssize_t);
PyAPI_DATA(char) _PyByteArray_empty_string[];
#endif
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_BYTEARRAYOBJECT_H */

View file

@ -1,6 +1,7 @@
#ifndef Py_LIMITED_API
#ifndef Py_BYTES_CTYPE_H
#define Py_BYTES_CTYPE_H
/* clang-format off */
/*
* The internal implementation behind PyBytes (bytes) and PyByteArray (bytearray)

View file

@ -1,13 +1,7 @@
/* Bytes (String) object interface */
#ifndef Py_BYTESOBJECT_H
#define Py_BYTESOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdarg.h>
COSMOPOLITAN_C_START_
/* clang-format off */
/*
Type PyBytesObject represents a character string. An extra zero byte is
@ -218,7 +212,5 @@ PyAPI_FUNC(void*) _PyBytesWriter_WriteBytes(_PyBytesWriter *writer,
Py_ssize_t size);
#endif /* Py_LIMITED_API */
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_BYTESOBJECT_H */

View file

@ -1,10 +1,8 @@
/* Cell object interface */
#ifndef Py_LIMITED_API
#ifndef Py_CELLOBJECT_H
#define Py_CELLOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
typedef struct {
PyObject_HEAD
@ -22,8 +20,6 @@ PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *);
#define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref)
#define PyCell_SET(op, v) (((PyCellObject *)(op))->ob_ref = v)
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_TUPLEOBJECT_H */
#endif /* Py_LIMITED_API */

View file

@ -1,9 +1,7 @@
#ifndef Py_CEVAL_H
#define Py_CEVAL_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
/* Interface to random parts in ceval.c */
@ -232,7 +230,5 @@ PyAPI_FUNC(void) _PyEval_SignalAsyncExc(void);
#define FVS_MASK 0x4
#define FVS_HAVE_SPEC 0x4
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_CEVAL_H */

View file

@ -1,13 +1,8 @@
/* Former class object interface -- now only bound methods are here */
/* Revealing some structures (not for general use) */
#ifndef Py_LIMITED_API
#ifndef Py_CLASSOBJECT_H
#define Py_CLASSOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
typedef struct {
PyObject_HEAD
@ -51,8 +46,6 @@ PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *);
#define PyInstanceMethod_GET_FUNCTION(meth) \
(((PyInstanceMethodObject *)meth) -> func)
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_CLASSOBJECT_H */
#endif /* Py_LIMITED_API */

View file

@ -1,11 +1,8 @@
/* Definitions for bytecode */
#ifndef Py_LIMITED_API
#ifndef Py_CODE_H
#define Py_CODE_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
typedef uint16_t _Py_CODEUNIT;
@ -150,8 +147,6 @@ PyAPI_FUNC(int) _PyCode_SetExtra(PyObject *code, Py_ssize_t index,
void *extra);
#endif
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_CODE_H */
#endif /* Py_LIMITED_API */

View file

@ -1,8 +1,7 @@
#ifndef Py_CODECREGISTRY_H
#define Py_CODECREGISTRY_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
/* ------------------------------------------------------------------------
@ -234,7 +233,5 @@ PyAPI_FUNC(PyObject *) PyCodec_NameReplaceErrors(PyObject *exc);
PyAPI_DATA(const char *) Py_hexdigits;
#endif
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_CODECREGISTRY_H */

View file

@ -1,12 +1,14 @@
#ifndef Py_COMPILE_H
#define Py_COMPILE_H
#include "third_party/python/Include/code.h"
COSMOPOLITAN_C_START_
#define Py_single_input 256
#define Py_file_input 257
#define Py_eval_input 258
#ifndef Py_LIMITED_API
#include "code.h"
#ifdef __cplusplus
extern "C" {
#endif
/* clang-format off */
/* Public interface */
struct _node; /* Declare the existence of this type */
@ -58,16 +60,6 @@ PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
#define PY_INVALID_STACK_EFFECT INT_MAX
PyAPI_FUNC(int) PyCompile_OpcodeStackEffect(int opcode, int oparg);
#ifdef __cplusplus
}
#endif
#endif /* !Py_LIMITED_API */
/* These definitions must match corresponding definitions in graminit.h.
There's code in compile.c that checks that they are the same. */
#define Py_single_input 256
#define Py_file_input 257
#define Py_eval_input 258
COSMOPOLITAN_C_END_
#endif /* !Py_COMPILE_H */

View file

@ -1,10 +1,7 @@
/* Complex number structure */
#ifndef Py_COMPLEXOBJECT_H
#define Py_COMPLEXOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
#ifndef Py_LIMITED_API
typedef struct {
@ -63,7 +60,5 @@ PyAPI_FUNC(int) _PyComplex_FormatAdvancedWriter(
Py_ssize_t end);
#endif
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_COMPLEXOBJECT_H */

View file

@ -1,11 +1,8 @@
/* datetime.h
*/
#ifndef Py_LIMITED_API
#ifndef DATETIME_H
#define DATETIME_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
/* Fields are packed into successive bytes, each viewed as unsigned and
* big-endian, unless otherwise noted:
@ -253,8 +250,6 @@ static PyDateTime_CAPI *PyDateTimeAPI = NULL;
#endif /* Py_BUILD_CORE */
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif
#endif /* !Py_LIMITED_API */

View file

@ -1,9 +1,7 @@
/* Descriptors */
#ifndef Py_DESCROBJECT_H
#define Py_DESCROBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
typedef PyObject *(*getter)(PyObject *, void *);
typedef int (*setter)(PyObject *, PyObject *, void *);
@ -100,8 +98,6 @@ PyAPI_FUNC(PyObject *) PyWrapper_New(PyObject *, PyObject *);
PyAPI_DATA(PyTypeObject) PyProperty_Type;
#ifdef __cplusplus
}
#endif
#endif /* !Py_DESCROBJECT_H */
COSMOPOLITAN_C_END_
#endif /* !Py_DESCROBJECT_H */

View file

@ -1,9 +1,7 @@
#ifndef Py_DICTOBJECT_H
#define Py_DICTOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
/* Dictionary object type -- mapping from hashable object to object */
@ -171,7 +169,5 @@ int _PyObjectDict_SetItem(PyTypeObject *tp, PyObject **dictptr, PyObject *name,
PyObject *_PyDict_LoadGlobal(PyDictObject *, PyDictObject *, PyObject *);
#endif
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_DICTOBJECT_H */

View file

@ -1,8 +1,7 @@
#ifndef Py_LIMITED_API
#ifndef PY_NO_SHORT_FLOAT_REPR
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
PyAPI_FUNC(double) _Py_dg_strtod(const char *str, char **ptr);
PyAPI_FUNC(char *) _Py_dg_dtoa(double d, int mode, int ndigits,
@ -11,9 +10,6 @@ PyAPI_FUNC(void) _Py_dg_freedtoa(char *s);
PyAPI_FUNC(double) _Py_dg_stdnan(int sign);
PyAPI_FUNC(double) _Py_dg_infinity(int sign);
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif
#endif

View file

@ -1,3 +1,5 @@
/* clang-format off */
/* Copyright (c) 2008-2009, Google Inc.
* All rights reserved.
*
@ -369,9 +371,7 @@
#endif /* DYNAMIC_ANNOTATIONS_ENABLED */
/* Use the macros above rather than using these functions directly. */
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
void AnnotateRWLockCreate(const char *file, int line,
const volatile void *lock);
void AnnotateRWLockDestroy(const char *file, int line,
@ -455,9 +455,7 @@ void AnnotateFlushState(const char *file, int line);
*/
int RunningOnValgrind(void);
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#if DYNAMIC_ANNOTATIONS_ENABLED != 0 && defined(__cplusplus)

View file

@ -1,17 +1,10 @@
#ifndef Py_ENUMOBJECT_H
#define Py_ENUMOBJECT_H
/* Enumerate Object */
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
PyAPI_DATA(PyTypeObject) PyEnum_Type;
PyAPI_DATA(PyTypeObject) PyReversed_Type;
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_ENUMOBJECT_H */

View file

@ -1,8 +1,7 @@
#ifndef Py_ERRCODE_H
#define Py_ERRCODE_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
/* Error codes passed around between file input, tokenizer, parser and
@ -32,7 +31,5 @@ extern "C" {
#define E_IDENTIFIER 26 /* Invalid characters in identifier */
#define E_BADSINGLE 27 /* Ill-formed single statement input */
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_ERRCODE_H */

View file

@ -1,11 +1,7 @@
/* Interface to execute compiled code */
#ifndef Py_EVAL_H
#define Py_EVAL_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyObject *, PyObject *, PyObject *);
@ -21,7 +17,5 @@ PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyObject *co,
PyAPI_FUNC(PyObject *) _PyEval_CallTracing(PyObject *func, PyObject *args);
#endif
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_EVAL_H */

View file

@ -1,10 +1,7 @@
/* File object interface (what's left of it -- see io.py) */
#ifndef Py_FILEOBJECT_H
#define Py_FILEOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
#define PY_STDIOTEXTMODE "b"
@ -44,7 +41,5 @@ PyAPI_DATA(PyTypeObject) PyStdPrinter_Type;
#define _PyIsSelectable_fd(FD) (1)
#endif /* HAVE_SELECT */
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_FILEOBJECT_H */

View file

@ -1,9 +1,7 @@
#ifndef Py_FILEUTILS_H
#define Py_FILEUTILS_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
PyAPI_FUNC(wchar_t *) Py_DecodeLocale(
@ -152,8 +150,5 @@ PyAPI_FUNC(int) _Py_GetLocaleconvNumeric(
#endif /* Py_LIMITED_API */
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_FILEUTILS_H */

View file

@ -1,15 +1,7 @@
/* Float object interface */
/*
PyFloatObject represents a (double precision) floating point number.
*/
#ifndef Py_FLOATOBJECT_H
#define Py_FLOATOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
#ifndef Py_LIMITED_API
typedef struct {
@ -124,7 +116,5 @@ PyAPI_FUNC(int) _PyFloat_FormatAdvancedWriter(
Py_ssize_t end);
#endif /* Py_LIMITED_API */
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_FLOATOBJECT_H */

View file

@ -1,12 +1,8 @@
/* Frame object interface */
#ifndef Py_LIMITED_API
#ifndef Py_FRAMEOBJECT_H
#define Py_FRAMEOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
typedef struct {
int b_type; /* what kind of block this is */
@ -88,8 +84,6 @@ PyAPI_FUNC(void) _PyFrame_DebugMallocStats(FILE *out);
/* Return the line of code the frame is currently executing. */
PyAPI_FUNC(int) PyFrame_GetLineNumber(PyFrameObject *);
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_FRAMEOBJECT_H */
#endif /* Py_LIMITED_API */

View file

@ -1,11 +1,8 @@
/* Function object interface */
#ifndef Py_LIMITED_API
#ifndef Py_FUNCOBJECT_H
#define Py_FUNCOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
/* Function objects and code objects should not be confused with each other:
*
@ -96,8 +93,6 @@ PyAPI_DATA(PyTypeObject) PyStaticMethod_Type;
PyAPI_FUNC(PyObject *) PyClassMethod_New(PyObject *);
PyAPI_FUNC(PyObject *) PyStaticMethod_New(PyObject *);
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_FUNCOBJECT_H */
#endif /* Py_LIMITED_API */

View file

@ -1,12 +1,8 @@
/* Generator object interface */
#ifndef Py_LIMITED_API
#ifndef Py_GENOBJECT_H
#define Py_GENOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
struct _frame; /* Avoid including frameobject.h */
@ -97,8 +93,6 @@ int PyAsyncGen_ClearFreeLists(void);
#undef _PyGenObject_HEAD
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_GENOBJECT_H */
#endif /* Py_LIMITED_API */

View file

@ -1,3 +1,4 @@
/* clang-format off */
/* Generated by Parser/pgen */
#define single_input 256

View file

@ -1,13 +1,8 @@
/* Grammar interface */
#ifndef Py_GRAMMAR_H
#define Py_GRAMMAR_H
#ifdef __cplusplus
extern "C" {
#endif
#include "bitset.h" /* Sigh... */
#include "third_party/python/Include/bitset.h"
COSMOPOLITAN_C_START_
/* clang-format off */
/* A label of an arc */
@ -88,7 +83,5 @@ void PyGrammar_RemoveAccelerators(grammar *);
void printgrammar(grammar *g, FILE *fp);
void printnonterminals(grammar *g, FILE *fp);
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_GRAMMAR_H */

View file

@ -1,11 +1,7 @@
/* Module definition and import interface */
#ifndef Py_IMPORT_H
#define Py_IMPORT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
#ifndef Py_LIMITED_API
PyAPI_FUNC(void) _PyImportZip_Init(void);
@ -134,7 +130,5 @@ struct _frozen {
PyAPI_DATA(const struct _frozen *) PyImport_FrozenModules;
#endif
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_IMPORT_H */

View file

@ -1,9 +1,7 @@
#ifndef Py_INTRCHECK_H
#define Py_INTRCHECK_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
PyAPI_FUNC(int) PyOS_InterruptOccurred(void);
PyAPI_FUNC(void) PyOS_InitInterrupts(void);
@ -18,7 +16,5 @@ PyAPI_FUNC(void*) _PyOS_SigintEvent(void);
#endif
#endif /* !Py_LIMITED_API */
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_INTRCHECK_H */

View file

@ -1,9 +1,7 @@
#ifndef Py_ITEROBJECT_H
#define Py_ITEROBJECT_H
/* Iterators (the basic kind, over a sequence) */
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
PyAPI_DATA(PyTypeObject) PySeqIter_Type;
PyAPI_DATA(PyTypeObject) PyCallIter_Type;
@ -18,8 +16,6 @@ PyAPI_FUNC(PyObject *) PySeqIter_New(PyObject *);
PyAPI_FUNC(PyObject *) PyCallIter_New(PyObject *, PyObject *);
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_ITEROBJECT_H */

View file

@ -1,7 +1,10 @@
#ifndef Py_LISTOBJECT_H
#define Py_LISTOBJECT_H
COSMOPOLITAN_C_START_
/* clang-format off */
/* List object interface */
/* List object interface
/*
Another generally useful object type is a list of object pointers.
This is a mutable type: the list items can be changed, and items can be
added or removed. Out-of-range indices or non-list objects are ignored.
@ -13,11 +16,6 @@ inserted in the list. Similarly, PyList_GetItem does not increment the
returned item's reference count.
*/
#ifndef Py_LISTOBJECT_H
#define Py_LISTOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef Py_LIMITED_API
typedef struct {
@ -75,7 +73,5 @@ PyAPI_FUNC(void) _PyList_DebugMallocStats(FILE *out);
#define _PyList_ITEMS(op) (((PyListObject *)(op))->ob_item)
#endif
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_LISTOBJECT_H */

View file

@ -1,10 +1,10 @@
#ifndef Py_LIMITED_API
#ifndef Py_LONGINTREPR_H
#define Py_LONGINTREPR_H
#ifdef __cplusplus
extern "C" {
#endif
#include "third_party/python/Include/Python.h"
#include "third_party/python/Include/pyport.h"
COSMOPOLITAN_C_START_
/* clang-format off */
/* This is published for the benefit of "friends" marshal.c and _decimal.c. */
@ -92,8 +92,6 @@ PyAPI_FUNC(PyLongObject *) _PyLong_New(Py_ssize_t);
/* Return a copy of src. */
PyAPI_FUNC(PyObject *) _PyLong_Copy(PyLongObject *src);
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_LONGINTREPR_H */
#endif /* Py_LIMITED_API */

View file

@ -1,9 +1,7 @@
#ifndef Py_LONGOBJECT_H
#define Py_LONGOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
/* Long (arbitrary precision) integer object interface */
@ -209,7 +207,5 @@ PyAPI_FUNC(long) PyOS_strtol(const char *, char **, int);
PyAPI_FUNC(PyObject *) _PyLong_GCD(PyObject *, PyObject *);
#endif /* !Py_LIMITED_API */
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_LONGOBJECT_H */

View file

@ -1,11 +1,7 @@
/* Interface for marshal.c */
#ifndef Py_MARSHAL_H
#define Py_MARSHAL_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
#define Py_MARSHAL_VERSION 4
@ -19,10 +15,7 @@ PyAPI_FUNC(int) PyMarshal_ReadShortFromFile(FILE *);
PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromFile(FILE *);
PyAPI_FUNC(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *);
#endif
PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(const char *,
Py_ssize_t);
PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(const char *, Py_ssize_t);
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_MARSHAL_H */

View file

@ -1,10 +1,7 @@
/* Memory view object. In Python this is available as "memoryview". */
#ifndef Py_MEMORYOBJECT_H
#define Py_MEMORYOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
#ifndef Py_LIMITED_API
PyAPI_DATA(PyTypeObject) _PyManagedBuffer_Type;
@ -66,7 +63,5 @@ typedef struct {
} PyMemoryViewObject;
#endif
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_MEMORYOBJECT_H */

View file

@ -1,9 +1,7 @@
#ifndef Py_METAGRAMMAR_H
#define Py_METAGRAMMAR_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
#define MSTART 256
#define RULE 257
@ -12,7 +10,5 @@ extern "C" {
#define ITEM 260
#define ATOM 261
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_METAGRAMMAR_H */

View file

@ -1,11 +1,7 @@
/* Method object interface */
#ifndef Py_METHODOBJECT_H
#define Py_METHODOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
/* This is about the type 'builtin_function_or_method',
not Python methods in user-defined classes. See classobject.h
@ -104,7 +100,5 @@ PyAPI_FUNC(void) _PyCFunction_DebugMallocStats(FILE *out);
PyAPI_FUNC(void) _PyMethod_DebugMallocStats(FILE *out);
#endif
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_METHODOBJECT_H */

View file

@ -1,15 +1,8 @@
#ifndef Py_MODSUPPORT_H
#define Py_MODSUPPORT_H
#ifdef __cplusplus
extern "C" {
#endif
/* Module support interface */
#include <stdarg.h>
#pragma GCC diagnostic ignored "-Wredundant-decls"
COSMOPOLITAN_C_START_
/* clang-format off */
/* If PY_SSIZE_T_CLEAN is defined, each functions treats #-specifier
to mean Py_ssize_t */
@ -179,7 +172,5 @@ PyAPI_FUNC(PyObject *) PyModule_FromDefAndSpec2(PyModuleDef *def,
PyAPI_DATA(char *) _Py_PackageContext;
#endif
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_MODSUPPORT_H */

View file

@ -1,11 +1,7 @@
/* Module object interface */
#ifndef Py_MODULEOBJECT_H
#define Py_MODULEOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
PyAPI_DATA(PyTypeObject) PyModule_Type;
@ -83,7 +79,5 @@ typedef struct PyModuleDef{
freefunc m_free;
} PyModuleDef;
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_MODULEOBJECT_H */

View file

@ -1,11 +1,7 @@
/* simple namespace object interface */
#ifndef NAMESPACEOBJECT_H
#define NAMESPACEOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
#ifndef Py_LIMITED_API
PyAPI_DATA(PyTypeObject) _PyNamespace_Type;
@ -13,7 +9,5 @@ PyAPI_DATA(PyTypeObject) _PyNamespace_Type;
PyAPI_FUNC(PyObject *) _PyNamespace_New(PyObject *kwds);
#endif /* !Py_LIMITED_API */
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !NAMESPACEOBJECT_H */

View file

@ -1,11 +1,7 @@
/* Parse tree node interface */
#ifndef Py_NODE_H
#define Py_NODE_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
typedef struct _node {
short n_type;
@ -38,7 +34,5 @@ PyAPI_FUNC(Py_ssize_t) _PyNode_SizeOf(node *n);
PyAPI_FUNC(void) PyNode_ListTree(node *);
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_NODE_H */

View file

@ -1,9 +1,7 @@
#ifndef Py_OBJECT_H
#define Py_OBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
/* Object and type object interface */
@ -1072,7 +1070,5 @@ PyAPI_FUNC(void)
_PyObject_DebugTypeStats(FILE *out);
#endif /* ifndef Py_LIMITED_API */
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_OBJECT_H */

View file

@ -1,15 +1,8 @@
/* The PyObject_ memory family: high-level object memory interfaces.
See pymem.h for the low-level PyMem_ family.
*/
#ifndef Py_OBJIMPL_H
#define Py_OBJIMPL_H
#include "pymem.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "third_party/python/Include/pymem.h"
COSMOPOLITAN_C_START_
/* clang-format off */
/* BEWARE:
@ -364,7 +357,5 @@ PyAPI_FUNC(void) PyObject_GC_Del(void *);
#define PyObject_GET_WEAKREFS_LISTPTR(o) \
((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset))
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_OBJIMPL_H */

View file

@ -1,9 +1,7 @@
#ifndef Py_ODICTOBJECT_H
#define Py_ODICTOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
/* OrderedDict */
/* This API is optional and mostly redundant. */
@ -37,7 +35,5 @@ PyAPI_FUNC(int) PyODict_DelItem(PyObject *od, PyObject *key);
#endif
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_ODICTOBJECT_H */

14
third_party/python/Include/opcode.h generated vendored
View file

@ -1,12 +1,10 @@
/* Auto-generated by Tools/scripts/generate_opcode_h.py */
#ifndef Py_OPCODE_H
#define Py_OPCODE_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
/* Auto-generated by Tools/scripts/generate_opcode_h.py */
/* Instruction opcodes for compiled code */
/* Instruction opcodes for compiled code */
#define POP_TOP 1
#define ROT_TWO 2
#define ROT_THREE 3
@ -140,7 +138,5 @@ enum cmp_op {PyCmp_LT=Py_LT, PyCmp_LE=Py_LE, PyCmp_EQ=Py_EQ, PyCmp_NE=Py_NE,
#define HAS_ARG(op) ((op) >= HAVE_ARGUMENT)
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_OPCODE_H */

View file

@ -1,9 +1,7 @@
#ifndef Py_OSDEFS_H
#define Py_OSDEFS_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
/* Operating system dependencies */
@ -19,15 +17,6 @@ extern "C" {
#define SEP L'/'
#endif
/* Max pathname length */
#ifdef __hpux
#include <sys/param.h>
#include <limits.h>
#ifndef PATH_MAX
#define PATH_MAX MAXPATHLEN
#endif
#endif
#ifndef MAXPATHLEN
#if defined(PATH_MAX) && PATH_MAX > 1024
#define MAXPATHLEN PATH_MAX
@ -41,7 +30,5 @@ extern "C" {
#define DELIM L':'
#endif
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_OSDEFS_H */

View file

@ -1,17 +1,11 @@
/* os module interface */
#ifndef Py_OSMODULE_H
#define Py_OSMODULE_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
PyAPI_FUNC(PyObject *) PyOS_FSPath(PyObject *path);
#endif
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_OSMODULE_H */

View file

@ -1,11 +1,8 @@
/* Parser-tokenizer link interface */
#ifndef Py_LIMITED_API
#ifndef Py_PARSETOK_H
#define Py_PARSETOK_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
typedef struct {
int error;
@ -101,8 +98,6 @@ PyAPI_FUNC(node *) PyParser_ParseStringObject(
PyAPI_FUNC(void) PyParser_SetError(perrdetail *);
PyAPI_FUNC(void) PyParser_ClearError(perrdetail *);
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_PARSETOK_H */
#endif /* !Py_LIMITED_API */

View file

@ -1,3 +1,4 @@
/* clang-format off */
/* Python version identification scheme.

View file

@ -1,9 +1,7 @@
#ifndef Py_PGEN_H
#define Py_PGEN_H
#ifdef __cplusplus
extern "C" {
#endif
COSMOPOLITAN_C_START_
/* clang-format off */
/* Parser generator interface */
@ -12,7 +10,5 @@ extern grammar *meta_grammar(void);
struct _node;
extern grammar *pgen(struct _node *);
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_PGEN_H */

View file

@ -1,13 +1,8 @@
#ifndef Py_PGENHEADERS_H
#define Py_PGENHEADERS_H
#ifdef __cplusplus
extern "C" {
#endif
/* Include files and extern declarations used by most of the parser. */
#include "Python.h"
#include "third_party/python/Include/Python.h"
COSMOPOLITAN_C_START_
/* clang-format off */
PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...)
Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
@ -37,7 +32,5 @@ PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...)
#define tok_dump _Py_tok_dump
#define translatelabels _Py_translatelabels
#ifdef __cplusplus
}
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_PGENHEADERS_H */

Some files were not shown because too many files have changed in this diff Show more