Get Cosmopolitan into releasable state

A new rollup tool now exists for flattening out the headers in a way
that works better for our purposes than cpp. A lot of the API clutter
has been removed. APIs that aren't a sure thing in terms of general
recommendation are now marked internal.

There's now a smoke test for the amalgamation archive and gigantic
header file. So we can now guarantee you can use this project on the
easiest difficulty setting without the gigantic repository.

A website is being created, which is currently a work in progress:
https://justine.storage.googleapis.com/cosmopolitan/index.html
This commit is contained in:
Justine Tunney
2020-11-25 08:19:00 -08:00
parent dba7552c1e
commit ea0b5d9d1c
775 changed files with 6864 additions and 3963 deletions

View File

@@ -3,7 +3,6 @@
#include "libc/nt/enum/status.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
▒▒▒░░░▒▒▒▒▒▒▒▓▓▓░
▒▒▒▒░░░▒▒▒▒▒▒▓▓▓▓▓▓░
@@ -32,7 +31,6 @@ COSMOPOLITAN_C_START_
the operating system and subject to change from one release of
Windows to the next, and possibly even between service packs for
each release.” ──Quoth MSDN */
#endif
struct NtContext;

View File

@@ -6,7 +6,6 @@
#include "libc/nt/typedef/ioapcroutine.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
▒▒▒░░░▒▒▒▒▒▒▒▓▓▓░
▒▒▒▒░░░▒▒▒▒▒▒▓▓▓▓▓▓░
@@ -35,7 +34,6 @@ COSMOPOLITAN_C_START_
the operating system and subject to change from one release of
Windows to the next, and possibly even between service packs for
each release.” ──Quoth MSDN */
#endif
struct NtIoStatusBlock;
struct NtObjectAttributes;

View File

@@ -3,7 +3,6 @@
#include "libc/nt/enum/status.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
▒▒▒░░░▒▒▒▒▒▒▒▓▓▓░
▒▒▒▒░░░▒▒▒▒▒▒▓▓▓▓▓▓░
@@ -32,7 +31,6 @@ COSMOPOLITAN_C_START_
the operating system and subject to change from one release of
Windows to the next, and possibly even between service packs for
each release.” ──Quoth MSDN */
#endif
struct NtIoStatusBlock;
struct NtObjectAttributes;

View File

@@ -4,7 +4,6 @@
#include "libc/nt/typedef/wambda.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
▒▒▒░░░▒▒▒▒▒▒▒▓▓▓░
▒▒▒▒░░░▒▒▒▒▒▒▓▓▓▓▓▓░
@@ -33,7 +32,6 @@ COSMOPOLITAN_C_START_
the operating system and subject to change from one release of
Windows to the next, and possibly even between service packs for
each release.” ──Quoth MSDN */
#endif
struct NtAnsiString;
struct NtLdrDataTableEntry;

View File

@@ -4,7 +4,6 @@
#include "libc/nt/enum/status.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
▒▒▒░░░▒▒▒▒▒▒▒▓▓▓░
▒▒▒▒░░░▒▒▒▒▒▒▓▓▓▓▓▓░
@@ -33,7 +32,6 @@ COSMOPOLITAN_C_START_
the operating system and subject to change from one release of
Windows to the next, and possibly even between service packs for
each release.” ──Quoth MSDN */
#endif
NtStatus NtAllocateVirtualMemory(int64_t ProcessHandle,
void **inout_BaseAddress, uint32_t dwZeroBits,
@@ -42,11 +40,11 @@ NtStatus NtAllocateVirtualMemory(int64_t ProcessHandle,
uint32_t dwPageProtect);
NtStatus NtFreeVirtualMemory(int64_t ProcessHandle, void **inout_BaseAddress,
size_t *inout_FreeSize, uint32_t FreeType);
NtStatus NtQueryVirtualMemory(
int64_t ProcessHandle, const void *BaseAddress,
enum NtMemoryInformationClass MemoryInformationClass,
void *out_MemoryInformation, size_t MemoryInformationLength,
size_t *opt_out_ReturnLength);
NtStatus NtQueryVirtualMemory(int64_t ProcessHandle, const void *BaseAddress,
int MemoryInformationClass,
void *out_MemoryInformation,
size_t MemoryInformationLength,
size_t *opt_out_ReturnLength);
NtStatus NtProtectVirtualMemory(int64_t ProcessHandle, void **inout_BaseAddress,
uint32_t *inout_ProtectSize,
uint32_t NewProtect, uint32_t *out_OldProtect);

View File

@@ -4,7 +4,6 @@
#include "libc/nt/thunk/msabi.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
▒▒▒░░░▒▒▒▒▒▒▒▓▓▓░
▒▒▒▒░░░▒▒▒▒▒▒▓▓▓▓▓▓░
@@ -33,7 +32,6 @@ COSMOPOLITAN_C_START_
the operating system and subject to change from one release of
Windows to the next, and possibly even between service packs for
each release.” ──Quoth MSDN */
#endif
struct NtClientId;
struct NtObjectAttributes;

View File

@@ -1,13 +1,10 @@
#ifndef COSMOPOLITAN_LIBC_NT_NT_SECTIONS_H_
#define COSMOPOLITAN_LIBC_NT_NT_SECTIONS_H_
#include "libc/nt/enum/sectioninformationclass.h"
#include "libc/nt/enum/sectioninherit.h"
#include "libc/nt/enum/status.h"
#include "libc/nt/struct/objectattributes.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct NtObjectAttributes;
NtStatus NtCreateSection(int64_t *out_SectionHandle, uint32_t DesiredAccess,
struct NtObjectAttributes *ObjectAttributes,
int64_t *opt_SectionSize, uint32_t Protect,
@@ -17,12 +14,10 @@ NtStatus NtOpenSection(int64_t *out_SectionHandle, uint32_t DesiredAccess,
NtStatus NtMapViewOfSection(int64_t SectionHandle, int64_t ProcessHandle,
void **inout_BaseAddress, uint32_t *ZeroBits,
size_t CommitSize, int64_t *opt_inout_SectionOffset,
size_t *inout_ViewSize,
enum NtSectionInherit InheritDisposition,
size_t *inout_ViewSize, int InheritDisposition,
uint32_t AllocationType, uint32_t Protect);
NtStatus NtUnmapViewOfSection(int64_t ProcessHandle, void *BaseAddress);
NtStatus NtQuerySection(int64_t SectionHandle,
enum NtSectionInformationClass SectionInformationClass,
NtStatus NtQuerySection(int64_t SectionHandle, int SectionInformationClass,
void *out_SectionInformation,
uint32_t SectionInformationLength,
uint32_t *opt_out_ResultLength);

View File

@@ -3,7 +3,6 @@
#include "libc/nt/enum/status.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
▒▒▒░░░▒▒▒▒▒▒▒▓▓▓░
▒▒▒▒░░░▒▒▒▒▒▒▓▓▓▓▓▓░
@@ -32,7 +31,6 @@ COSMOPOLITAN_C_START_
the operating system and subject to change from one release of
Windows to the next, and possibly even between service packs for
each release.” ──Quoth MSDN */
#endif
NtStatus CsrClientCallServer(void *inout_Message, void *unknown,
uint32_t Opcode, uint32_t Size);

View File

@@ -4,7 +4,6 @@
#include "libc/nt/enum/threadinfoclass.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
▒▒▒░░░▒▒▒▒▒▒▒▓▓▓░
▒▒▒▒░░░▒▒▒▒▒▒▓▓▓▓▓▓░
@@ -33,7 +32,6 @@ COSMOPOLITAN_C_START_
the operating system and subject to change from one release of
Windows to the next, and possibly even between service packs for
each release.” ──Quoth MSDN */
#endif
struct NtClientId;
struct NtContext;

View File

@@ -4,7 +4,6 @@
#include "libc/nt/thunk/msabi.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#if 0
/* ░░░░
▒▒▒░░░▒▒▒▒▒▒▒▓▓▓░
▒▒▒▒░░░▒▒▒▒▒▒▓▓▓▓▓▓░
@@ -33,7 +32,6 @@ COSMOPOLITAN_C_START_
the operating system and subject to change from one release of
Windows to the next, and possibly even between service packs for
each release.” ──Quoth MSDN */
#endif
NtStatus NtDelayExecution(bool32 alertable, int64_t *AbsCobolOrNegRelHectoNano);