mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-08 04:08:32 +00:00
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:
parent
dba7552c1e
commit
ea0b5d9d1c
775 changed files with 6864 additions and 3963 deletions
16
libc/nt/struct/editmenu.h
Normal file
16
libc/nt/struct/editmenu.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_EDITMENU_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_EDITMENU_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
struct NtEditMenu {
|
||||
int64_t hmenu;
|
||||
uint16_t idEdit;
|
||||
uint16_t idCut;
|
||||
uint16_t idCopy;
|
||||
uint16_t idPaste;
|
||||
uint16_t idClear;
|
||||
uint16_t idUndo;
|
||||
};
|
||||
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_STRUCT_EDITMENU_H_ */
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_IMAGEAUXSYMBOL_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_IMAGEAUXSYMBOL_H_
|
||||
#include "libc/nt/pedef.h"
|
||||
#include "libc/nt/struct/imageauxsymboltokendef.h"
|
||||
#include "libc/nt/pedef.internal.h"
|
||||
#include "libc/nt/struct/imageauxsymboltokendef.internal.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
union NtImageAuxSymbol {
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_IMAGEAUXSYMBOLEX_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_IMAGEAUXSYMBOLEX_H_
|
||||
#include "libc/nt/struct/imageauxsymboltokendef.h"
|
||||
#include "libc/nt/struct/imagesymbolex.h"
|
||||
#include "libc/nt/struct/imageauxsymboltokendef.internal.h"
|
||||
#include "libc/nt/struct/imagesymbolex.internal.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
union NtImageAuxSymbolEx {
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_IMAGEDYNAMICRELOCATION_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_IMAGEDYNAMICRELOCATION_H_
|
||||
#include "libc/nt/struct/imagebaserelocation.h"
|
||||
#include "libc/nt/struct/imagebaserelocation.internal.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
struct NtImageDynamicRelocation {
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_IMAGEDYNAMICRELOCATIONTABLE_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_IMAGEDYNAMICRELOCATIONTABLE_H_
|
||||
#include "libc/nt/struct/imagedynamicrelocation.h"
|
||||
#include "libc/nt/struct/imagedynamicrelocation.internal.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
struct NtImageDynamicRelocationTable {
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_IMAGEENCLAVECONFIG_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_IMAGEENCLAVECONFIG_H_
|
||||
#include "libc/nt/pedef.h"
|
||||
#include "libc/nt/pedef.internal.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
struct NtImageEnclaveConfig {
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_IMAGEENCLAVEIMPORT_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_IMAGEENCLAVEIMPORT_H_
|
||||
#include "libc/nt/pedef.h"
|
||||
#include "libc/nt/pedef.internal.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
struct NtImageEnclaveImport {
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_IMAGELOADCONFIGDIRECTORY_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_IMAGELOADCONFIGDIRECTORY_H_
|
||||
#include "libc/nt/struct/imageloadconfigcodeintegrity.h"
|
||||
#include "libc/nt/struct/imageloadconfigcodeintegrity.internal.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
struct NtImageLoadConfigDirectory {
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_IMAGENTHEADERS_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_IMAGENTHEADERS_H_
|
||||
#include "libc/nt/struct/imagefileheader.h"
|
||||
#include "libc/nt/struct/imageoptionalheader.h"
|
||||
#include "libc/nt/struct/imagefileheader.internal.h"
|
||||
#include "libc/nt/struct/imageoptionalheader.internal.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
struct NtImageNtHeaders {
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_IMAGEOPTIONALHEADER_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_IMAGEOPTIONALHEADER_H_
|
||||
#include "libc/nt/pedef.h"
|
||||
#include "libc/nt/struct/imagedatadirectory.h"
|
||||
#include "libc/nt/pedef.internal.h"
|
||||
#include "libc/nt/struct/imagedatadirectory.internal.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
struct NtImageOptionalHeader {
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_IMAGESECTIONHEADER_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_IMAGESECTIONHEADER_H_
|
||||
#include "libc/nt/pedef.internal.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
#include "libc/nt/pedef.h"
|
||||
|
||||
struct NtImageSectionHeader {
|
||||
uint8_t Name[kNtImageSizeofShortName];
|
|
@ -1,10 +1,9 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_NTEXCEPTIONPOINTERS_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_NTEXCEPTIONPOINTERS_H_
|
||||
#include "libc/nt/struct/context.h"
|
||||
#include "libc/nt/struct/ntexceptionrecord.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
struct NtContext;
|
||||
struct NtExceptionRecord;
|
||||
|
||||
struct NtExceptionPointers {
|
||||
struct NtExceptionRecord *ExceptionRecord;
|
||||
struct NtContext *ContextRecord;
|
||||
|
|
33
libc/nt/struct/openfilename.h
Normal file
33
libc/nt/struct/openfilename.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_OPENFILENAME_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_OPENFILENAME_H_
|
||||
#include "libc/nt/struct/editmenu.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
struct NtOpenFilename {
|
||||
uint32_t lStructSize;
|
||||
int64_t hwndOwner;
|
||||
int64_t hInstance;
|
||||
const char16_t *lpstrFilter;
|
||||
char16_t *lpstrCustomFilter;
|
||||
uint32_t nMaxCustFilter;
|
||||
uint32_t nFilterIndex;
|
||||
char16_t *lpstrFile;
|
||||
uint32_t nMaxFile;
|
||||
char16_t *lpstrFileTitle;
|
||||
uint32_t nMaxFileTitle;
|
||||
const char16_t *lpstrInitialDir;
|
||||
const char16_t *lpstrTitle;
|
||||
uint32_t Flags;
|
||||
uint16_t nFileOffset;
|
||||
uint16_t nFileExtension;
|
||||
const char16_t *lpstrDefExt;
|
||||
intptr_t lCustData;
|
||||
uint64_t (*lpfnHook)(int64_t, uint32_t, uint64_t, int64_t);
|
||||
const char16_t *lpTemplateName;
|
||||
void *pvReserved;
|
||||
uint32_t dwReserved;
|
||||
uint32_t FlagsEx;
|
||||
};
|
||||
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_STRUCT_OPENFILENAME_H_ */
|
|
@ -2,7 +2,6 @@
|
|||
#define COSMOPOLITAN_LIBC_NT_STRUCT_PAINTSTRUCT_H_
|
||||
#include "libc/nt/struct/rect.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct NtPaintStruct {
|
||||
int64_t hdc;
|
||||
|
@ -13,6 +12,5 @@ struct NtPaintStruct {
|
|||
uint8_t rgbReserved[32];
|
||||
};
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_STRUCT_PAINTSTRUCT_H_ */
|
||||
|
|
6
libc/nt/struct/procthreadattributelist.h
Normal file
6
libc/nt/struct/procthreadattributelist.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_PROCTHREADATTRIBUTELIST_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_PROCTHREADATTRIBUTELIST_H_
|
||||
|
||||
struct NtProcThreadAttributeList;
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_STRUCT_PROCTHREADATTRIBUTELIST_H_ */
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_RECT_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_RECT_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct NtRect {
|
||||
int32_t left;
|
||||
|
@ -10,6 +9,5 @@ struct NtRect {
|
|||
int32_t bottom;
|
||||
};
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_STRUCT_RECT_H_ */
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_STARTUPINFOEX_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_STARTUPINFOEX_H_
|
||||
#include "libc/nt/struct/procthreadattributelist.h"
|
||||
#include "libc/nt/struct/startupinfo.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct NtProcThreadAttributeList;
|
||||
|
||||
struct NtStartupInfoEx {
|
||||
struct NtStartupInfo StartupInfo;
|
||||
struct NtProcThreadAttributeList *lpAttributeList;
|
||||
};
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_STRUCT_STARTUPINFOEX_H_ */
|
||||
|
|
|
@ -11,5 +11,4 @@ struct NtSystemProcessorPerformanceInformation {
|
|||
};
|
||||
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_STRUCT_SYSTEMPROCESSORPERFORMANCEINFORMATION_H_ \
|
||||
*/
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_STRUCT_SYSTEMPROCESSORPERFORMANCEINFORMATION_H_*/
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_SYSTEMTHREADS_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_SYSTEMTHREADS_H_
|
||||
#include "libc/nt/enum/kwaitreason.h"
|
||||
#include "libc/nt/enum/threadstate.h"
|
||||
#include "libc/nt/struct/clientid.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
|
@ -15,7 +14,7 @@ struct NtSystemThreads {
|
|||
int32_t Priority;
|
||||
int32_t BasePriority;
|
||||
uint32_t ContextSwitchCount;
|
||||
enum NtThreadState State;
|
||||
int State;
|
||||
uint32_t WaitReason;
|
||||
};
|
||||
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
#include "libc/nt/struct/peb.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
#if 0
|
||||
/* These macros address directly into NT's TEB a.k.a. TIB */
|
||||
#endif
|
||||
#define NtGetPeb() gs((struct NtPeb **)(0x60ULL))
|
||||
#define NtGetTeb() gs((void **)(0x30)) /* %gs:0 linear address */
|
||||
#define NtGetPid() gs((uint32_t *)(0x40)) /* GetCurrentProcessId() */
|
||||
|
|
18
libc/nt/struct/windowplacement.h
Normal file
18
libc/nt/struct/windowplacement.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_WINDOWPLACEMENT_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_WINDOWPLACEMENT_H_
|
||||
#include "libc/nt/struct/point.h"
|
||||
#include "libc/nt/struct/rect.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
struct NtWindowPlacement {
|
||||
uint32_t length;
|
||||
uint32_t flags;
|
||||
uint32_t showCmd;
|
||||
struct NtPoint ptMinPosition;
|
||||
struct NtPoint ptMaxPosition;
|
||||
struct NtRect rcNormalPosition;
|
||||
struct NtRect rcDevice;
|
||||
};
|
||||
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_STRUCT_WINDOWPLACEMENT_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue