mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Updated grammar. Removal of elif. Removal of ':' ';' in some ct statements. Empty faults is now an error. Remove "define" for types. Remove "private". Better errors on incorrect bitstruct syntax. Introduction of wildcard type rather than optional wildcard. Removal of scaled vector type. mkdir and rmdir. Disallow define @Foo() = { @inline }. Add handling for @optreturn and change it to @return!. Restrict interface style functions. Updated x64 ABI. stdlib updates to string. Removed deprecated functions. Update how variadics are implemented. Extended error messages. x86 ABI fixes. Shift check fixes. '!' and '?' are flipped. No trailing ',' allowed in functions. Fix to string parsing. Allow l suffix. Simplifying flatpath. any replaces variant, anyfault replaces anyerr. Allow getting the underlying type of anyfault. De-duplicate string constants. Fix of readme. Extended list. Fix of "(MyEnum)x + 1". Clock and DateTime types. Fixes to array concat.
This commit is contained in:
committed by
Christoffer Lerno
parent
d14e778232
commit
809321e20c
@@ -1,6 +1,6 @@
|
||||
module std::os::macos::cf;
|
||||
|
||||
$if (env::OS_TYPE == OsType.MACOSX)
|
||||
$if (env::OS_TYPE == OsType.MACOS)
|
||||
|
||||
typedef CFAllocatorRef = distinct void*;
|
||||
typedef CFAllocatorContextRef = distinct void*;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module std::os::macos::cf;
|
||||
|
||||
$if (env::OS_TYPE == OsType.MACOSX)
|
||||
$if (env::OS_TYPE == OsType.MACOS)
|
||||
|
||||
typedef CFArrayRef = distinct void*;
|
||||
typedef CFArrayCallBacksRef = distinct void*;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module std::os::macos::cf;
|
||||
|
||||
$if (env::OS_TYPE == OsType.MACOSX)
|
||||
$if (env::OS_TYPE == OsType.MACOS)
|
||||
|
||||
typedef CFTypeRef = distinct void*;
|
||||
typedef CFIndex = isz;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module std::os::macos::objc;
|
||||
|
||||
$if (env::OS_TYPE == OsType.MACOSX)
|
||||
$if (env::OS_TYPE == OsType.MACOS)
|
||||
|
||||
typedef Class = distinct void*;
|
||||
typedef Method = distinct void*;
|
||||
@@ -24,7 +24,7 @@ macro Selector selector_register(char* c) => _macos_sel_registerName(c);
|
||||
macro Class! class_by_name(char* c)
|
||||
{
|
||||
Class cls = _macos_objc_lookUpClass(c);
|
||||
if (!cls) return ObjcFailure.CLASS_NOT_FOUND!;
|
||||
if (!cls) return ObjcFailure.CLASS_NOT_FOUND?;
|
||||
return cls;
|
||||
}
|
||||
|
||||
|
||||
10
lib/std/os/posix/files.c3
Normal file
10
lib/std/os/posix/files.c3
Normal file
@@ -0,0 +1,10 @@
|
||||
module std::os::posix;
|
||||
|
||||
$if (env::os_is_posix() && env::COMPILER_LIBC_AVAILABLE)
|
||||
|
||||
extern fn int rmdir(ZString);
|
||||
extern fn int mkdir(ZString, ushort mode_t);
|
||||
extern fn int chdir(ZString);
|
||||
extern fn ZString getcwd(char* pwd, usz len);
|
||||
|
||||
$endif
|
||||
@@ -1,29 +0,0 @@
|
||||
module std::os::win32::wsa;
|
||||
|
||||
$if (env::OS_TYPE == OsType.WIN32)
|
||||
extern fn int get_last_error() @extern("WSAGetLastError");
|
||||
extern fn void set_last_error(int error) @extern("WSASetLastError");
|
||||
|
||||
const int INVALID_HANDLE = 6;
|
||||
const int NOT_ENOUGHT_MEMORY = 8;
|
||||
const int INVALID_PARAMETER = 87;
|
||||
const int OPERATION_ABORTED = 995;
|
||||
const int IO_INCOMPLETE = 996;
|
||||
const int IO_PENDING = 997;
|
||||
const int EINTR = 10004;
|
||||
const int EBADF = 10009;
|
||||
const int ACCESS = 10013;
|
||||
const int EFAULT = 10014;
|
||||
const int EINVAL = 10022;
|
||||
const int EMFILE = 10024;
|
||||
const int EWOULDBLOCK = 10035;
|
||||
const int EINPROGRESS = 10036;
|
||||
const int EALREADY = 10037;
|
||||
const int ENOTSOCK = 10038;
|
||||
const int EDESTADDRREQ = 10039;
|
||||
const int EMSGSIZE = 10040;
|
||||
const int EPROTOTYPE = 10041;
|
||||
const int ENOPROTOOPT = 10042;
|
||||
const int EPROTONOSUPPORT = 10043;
|
||||
const int ESOCKTNOSUPPORT = 10044;
|
||||
$endif
|
||||
@@ -1,4 +1,4 @@
|
||||
module std::os::win32::files;
|
||||
module std::os::win32;
|
||||
|
||||
$if (env::os_is_win32())
|
||||
|
||||
@@ -8,11 +8,6 @@ enum Win32_GET_FILEEX_INFO_LEVELS
|
||||
MAX,
|
||||
}
|
||||
|
||||
struct Win32_FILETIME
|
||||
{
|
||||
Win32_DWORD dwLowDateTime;
|
||||
Win32_DWORD dwHighDateTime;
|
||||
}
|
||||
|
||||
struct Win32_FILE_ATTRIBUTE_DATA
|
||||
{
|
||||
@@ -24,18 +19,47 @@ struct Win32_FILE_ATTRIBUTE_DATA
|
||||
Win32_DWORD nFileSizeLow;
|
||||
}
|
||||
|
||||
|
||||
const MAX_PATH = 260;
|
||||
|
||||
struct Win32_WIN32_FIND_DATAW
|
||||
{
|
||||
Win32_DWORD dwFileAttributes;
|
||||
Win32_FILETIME ftCreationTime;
|
||||
Win32_FILETIME ftLastAccessTime;
|
||||
Win32_FILETIME ftLastWriteTime;
|
||||
Win32_DWORD nFileSizeHigh;
|
||||
Win32_DWORD nFileSizeLow;
|
||||
Win32_DWORD dwReserved0;
|
||||
Win32_DWORD dwReserved1;
|
||||
Win32_WCHAR[260] cFileName;
|
||||
Win32_WCHAR[14] cAlternateFileName;
|
||||
Win32_DWORD dwFileType; // Obsolete. Do not use.
|
||||
Win32_DWORD dwCreatorType; // Obsolete. Do not use
|
||||
Win32_WORD wFinderFlags; // Obsolete. Do not use
|
||||
}
|
||||
|
||||
typedef Win32_LPWIN32_FIND_DATAW = Win32_WIN32_FIND_DATAW*;
|
||||
|
||||
extern fn Win32_BOOL win32_CloseHandle(Win32_HANDLE) @extern("CloseHandle");
|
||||
extern fn Win32_BOOL win32_CreatePipe(Win32_PHANDLE hReadPipe, Win32_PHANDLE hWritePipe, Win32_LPSECURITY_ATTRIBUTES lpPipeAttributes, Win32_DWORD nSize) @extern("CreatePipe");
|
||||
extern fn Win32_BOOL win32_GetFileAttributesExW(Win32_LPCWSTR, Win32_GET_FILEEX_INFO_LEVELS, Win32_LPVOID) @extern("GetFileAttributesExW");
|
||||
extern fn Win32_BOOL win32_PathFileExistsW(Win32_LPCWSTR) @extern("PathFileExistsW");
|
||||
extern fn Win32_DWORD win32_GetTempPathW(Win32_DWORD nBufferLength, Win32_LPWSTR lpBuffer) @extern("GetTempPathW");
|
||||
extern fn Win32_BOOL win32_SetCurrentDirectoryW(Win32_LPCTSTR buffer) @extern("SetCurrentDirectoryW");
|
||||
extern fn Win32_BOOL win32_RemoveDirectoryW(Win32_LPCWSTR lpPathName) @extern("RemoveDirectoryW");
|
||||
extern fn Win32_BOOL win32_CreateDirectoryW(Win32_LPCWSTR lpPathName, Win32_LPSECURITY_ATTRIBUTES lpPipeAttributes) @extern("CreateDirectoryW");
|
||||
extern fn Win32_BOOL win32_DeleteFileW(Win32_LPCWSTR lpFileName) @extern("DeleteFileW");
|
||||
extern fn Win32_HANDLE win32_FindFirstFileW(Win32_LPCWSTR lpFileName, Win32_LPWIN32_FIND_DATAW lpFindFileData) @extern("FindFirstFileW");
|
||||
extern fn Win32_BOOL win32_FindNextFileW(Win32_HANDLE hFindFile, Win32_LPWIN32_FIND_DATAW lpFindFileData) @extern("FindNextFileW");
|
||||
extern fn Win32_BOOL win32_FindClose(Win32_HANDLE hFindFile) @extern("FindClose");
|
||||
|
||||
extern fn Char16* _wgetcwd(Char16* buffer, int maxlen);
|
||||
extern fn usz wcslen(Char16* str);
|
||||
|
||||
/*
|
||||
extern ulong _win32_GetCurrentDirectoryW(ulong, Char16* buffer) @extern("GetCurrentDirectoryW");
|
||||
extern bool _win32_CreateSymbolicLinkW(Char16* symlink_file, Char16* target_file, ulong flags) @extern("CreateSymbolicLinkW");
|
||||
extern bool _win32_CreateDirectoryW(Char16* path_name, void* security_attributes) @extern("CreateDirectoryW");
|
||||
extern bool _win32_DeleteFileW(Char16* file) @extern("DeleteFileW");
|
||||
extern bool _win32_CopyFileW(Char16* from_file, Char16* to_file, bool no_overwrite) @extern("CopyFileW");
|
||||
extern ulong _win32_GetFullPathNameW(Char16* file_name, ulong buffer_len, Char16* buffer, Char16** file_part) @extern("GetFullPathNameW");
|
||||
*/
|
||||
|
||||
227
lib/std/os/win32/general.c3
Normal file
227
lib/std/os/win32/general.c3
Normal file
@@ -0,0 +1,227 @@
|
||||
module std::os::win32;
|
||||
|
||||
$if (env::os_is_win32())
|
||||
|
||||
extern fn Win32_DWORD win32_GetLastError() @extern("GetLastError");
|
||||
|
||||
const Win32_DWORD ERROR_INVALID_FUNCTION = 0x1;
|
||||
const Win32_DWORD ERROR_FILE_NOT_FOUND = 0x2;
|
||||
const Win32_DWORD ERROR_PATH_NOT_FOUND = 0x3;
|
||||
const Win32_DWORD ERROR_TOO_MANY_OPEN_FILES = 0x4;
|
||||
const Win32_DWORD ERROR_ACCESS_DENIED = 0x5;
|
||||
const Win32_DWORD ERROR_INVALID_HANDLE = 0x6;
|
||||
const Win32_DWORD ERROR_ARENA_TRASHED = 0x7;
|
||||
const Win32_DWORD ERROR_NOT_ENOUGH_MEMORY = 0x8;
|
||||
const Win32_DWORD ERROR_INVALID_BLOCK = 0x9;
|
||||
const Win32_DWORD ERROR_BAD_ENVIRONMENT = 0xA;
|
||||
const Win32_DWORD ERROR_BAD_FORMAT = 0xB;
|
||||
const Win32_DWORD ERROR_INVALID_ACCESS = 0xC;
|
||||
const Win32_DWORD ERROR_INVALID_DATA = 0xD;
|
||||
const Win32_DWORD ERROR_OUTOFMEMORY = 0xE;
|
||||
const Win32_DWORD ERROR_INVALID_DRIVE = 0xF;
|
||||
const Win32_DWORD ERROR_CURRENT_DIRECTORY = 0x10;
|
||||
const Win32_DWORD ERROR_NOT_SAME_DEVICE = 0x11;
|
||||
const Win32_DWORD ERROR_NO_MORE_FILES = 0x12;
|
||||
const Win32_DWORD ERROR_WRITE_PROTECT = 0x13;
|
||||
const Win32_DWORD ERROR_BAD_UNIT = 0x14;
|
||||
const Win32_DWORD ERROR_NOT_READY = 0x15;
|
||||
const Win32_DWORD ERROR_BAD_COMMAND = 0x16;
|
||||
const Win32_DWORD ERROR_CRC = 0x17;
|
||||
const Win32_DWORD ERROR_BAD_LENGTH = 0x18;
|
||||
const Win32_DWORD ERROR_SEEK = 0x19;
|
||||
const Win32_DWORD ERROR_NOT_DOS_DISK = 0x1A;
|
||||
const Win32_DWORD ERROR_SECTOR_NOT_FOUND = 0x1B;
|
||||
const Win32_DWORD ERROR_OUT_OF_PAPER = 0x1C;
|
||||
const Win32_DWORD ERROR_WRITE_FAULT = 0x1D;
|
||||
const Win32_DWORD ERROR_READ_FAULT = 0x1E;
|
||||
const Win32_DWORD ERROR_GEN_FAILURE = 0x1F;
|
||||
const Win32_DWORD ERROR_SHARING_VIOLATION = 0x20;
|
||||
const Win32_DWORD ERROR_LOCK_VIOLATION = 0x21;
|
||||
const Win32_DWORD ERROR_WRONG_DISK = 0x22;
|
||||
const Win32_DWORD ERROR_SHARING_BUFFER_EXCEEDED = 0x24;
|
||||
const Win32_DWORD ERROR_HANDLE_EOF = 0x26;
|
||||
const Win32_DWORD ERROR_HANDLE_DISK_FULL = 0x27;
|
||||
const Win32_DWORD ERROR_NOT_SUPPORTED = 0x32;
|
||||
const Win32_DWORD ERROR_REM_NOT_LIST = 0x33;
|
||||
const Win32_DWORD ERROR_DUP_NAME = 0x34;
|
||||
const Win32_DWORD ERROR_BAD_NETPATH = 0x35;
|
||||
const Win32_DWORD ERROR_NETWORK_BUSY = 0x36;
|
||||
const Win32_DWORD ERROR_DEV_NOT_EXIST = 0x37;
|
||||
const Win32_DWORD ERROR_TOO_MANY_CMDS = 0x38;
|
||||
const Win32_DWORD ERROR_ADAP_HDW_ERR = 0x39;
|
||||
const Win32_DWORD ERROR_BAD_NET_RESP = 0x3A;
|
||||
const Win32_DWORD ERROR_UNEXP_NET_ERR = 0x3B;
|
||||
const Win32_DWORD ERROR_BAD_REM_ADAP = 0x3C;
|
||||
const Win32_DWORD ERROR_PRINTQ_FULL = 0x3D;
|
||||
const Win32_DWORD ERROR_NO_SPOOL_SPACE = 0x3E;
|
||||
const Win32_DWORD ERROR_PRINT_CANCELLED = 0x3F;
|
||||
const Win32_DWORD ERROR_NETNAME_DELETED = 0x40;
|
||||
const Win32_DWORD ERROR_NETWORK_ACCESS_DENIED = 0x41;
|
||||
const Win32_DWORD ERROR_BAD_DEV_TYPE = 0x42;
|
||||
const Win32_DWORD ERROR_BAD_NET_NAME = 0x43;
|
||||
const Win32_DWORD ERROR_TOO_MANY_NAMES = 0x44;
|
||||
const Win32_DWORD ERROR_TOO_MANY_SESS = 0x45;
|
||||
const Win32_DWORD ERROR_SHARING_PAUSED = 0x46;
|
||||
const Win32_DWORD ERROR_REQ_NOT_ACCEP = 0x47;
|
||||
const Win32_DWORD ERROR_REDIR_PAUSED = 0x48;
|
||||
const Win32_DWORD ERROR_FILE_EXISTS = 0x50;
|
||||
const Win32_DWORD ERROR_CANNOT_MAKE = 0x52;
|
||||
const Win32_DWORD ERROR_FAIL_I24 = 0x53;
|
||||
const Win32_DWORD ERROR_OUT_OF_STRUCTURES = 0x54;
|
||||
const Win32_DWORD ERROR_ALREADY_ASSIGNED = 0x55;
|
||||
const Win32_DWORD ERROR_INVALID_PASSWORD = 0x56;
|
||||
const Win32_DWORD ERROR_INVALID_PARAMETER = 0x57;
|
||||
const Win32_DWORD ERROR_NET_WRITE_FAULT = 0x58;
|
||||
const Win32_DWORD ERROR_NO_PROC_SLOTS = 0x59;
|
||||
const Win32_DWORD ERROR_TOO_MANY_SEMAPHORES = 0x64;
|
||||
const Win32_DWORD ERROR_EXCL_SEM_ALREADY_OWNED = 0x65;
|
||||
const Win32_DWORD ERROR_SEM_IS_SET = 0x66;
|
||||
const Win32_DWORD ERROR_TOO_MANY_SEM_REQUESTS = 0x67;
|
||||
const Win32_DWORD ERROR_INVALID_AT_INTERRUPT_TIME = 0x68;
|
||||
const Win32_DWORD ERROR_SEM_OWNER_DIED = 0x69;
|
||||
const Win32_DWORD ERROR_SEM_USER_LIMIT = 0x6A;
|
||||
const Win32_DWORD ERROR_DISK_CHANGE = 0x6B;
|
||||
const Win32_DWORD ERROR_DRIVE_LOCKED = 0x6C;
|
||||
const Win32_DWORD ERROR_BROKEN_PIPE = 0x6D;
|
||||
const Win32_DWORD ERROR_OPEN_FAILED = 0x6E;
|
||||
const Win32_DWORD ERROR_BUFFER_OVERFLOW = 0x6F;
|
||||
const Win32_DWORD ERROR_DISK_FULL = 0x70;
|
||||
const Win32_DWORD ERROR_NO_MORE_SEARCH_HANDLES = 0x71;
|
||||
const Win32_DWORD ERROR_INVALID_TARGET_HANDLE = 0x72;
|
||||
const Win32_DWORD ERROR_INVALID_CATEGORY = 0x75;
|
||||
const Win32_DWORD ERROR_INVALID_VERIFY_SWITCH = 0x76;
|
||||
const Win32_DWORD ERROR_BAD_DRIVER_LEVEL = 0x77;
|
||||
const Win32_DWORD ERROR_CALL_NOT_IMPLEMENTED = 0x78;
|
||||
const Win32_DWORD ERROR_SEM_TIMEOUT = 0x79;
|
||||
const Win32_DWORD ERROR_INSUFFICIENT_BUFFER = 0x7A;
|
||||
const Win32_DWORD ERROR_INVALID_NAME = 0x7B;
|
||||
const Win32_DWORD ERROR_INVALID_LEVEL = 0x7C;
|
||||
const Win32_DWORD ERROR_NO_VOLUME_LABEL = 0x7D;
|
||||
const Win32_DWORD ERROR_MOD_NOT_FOUND = 0x7E;
|
||||
const Win32_DWORD ERROR_PROC_NOT_FOUND = 0x7F;
|
||||
const Win32_DWORD ERROR_WAIT_NO_CHILDREN = 0x80;
|
||||
const Win32_DWORD ERROR_CHILD_NOT_COMPLETE = 0x81;
|
||||
const Win32_DWORD ERROR_DIRECT_ACCESS_HANDLE = 0x82;
|
||||
const Win32_DWORD ERROR_NEGATIVE_SEEK = 0x83;
|
||||
const Win32_DWORD ERROR_SEEK_ON_DEVICE = 0x84;
|
||||
const Win32_DWORD ERROR_IS_JOIN_TARGET = 0x85;
|
||||
const Win32_DWORD ERROR_IS_JOINED = 0x86;
|
||||
const Win32_DWORD ERROR_IS_SUBSTED = 0x87;
|
||||
const Win32_DWORD ERROR_NOT_JOINED = 0x88;
|
||||
const Win32_DWORD ERROR_NOT_SUBSTED = 0x89;
|
||||
const Win32_DWORD ERROR_JOIN_TO_JOIN = 0x8A;
|
||||
const Win32_DWORD ERROR_SUBST_TO_SUBST = 0x8B;
|
||||
const Win32_DWORD ERROR_JOIN_TO_SUBST = 0x8C;
|
||||
const Win32_DWORD ERROR_SUBST_TO_JOIN = 0x8D;
|
||||
const Win32_DWORD ERROR_BUSY_DRIVE = 0x8E;
|
||||
const Win32_DWORD ERROR_SAME_DRIVE = 0x8F;
|
||||
const Win32_DWORD ERROR_DIR_NOT_ROOT = 0x90;
|
||||
const Win32_DWORD ERROR_DIR_NOT_EMPTY = 0x91;
|
||||
const Win32_DWORD ERROR_IS_SUBST_PATH = 0x92;
|
||||
const Win32_DWORD ERROR_IS_JOIN_PATH = 0x93;
|
||||
const Win32_DWORD ERROR_PATH_BUSY = 0x94;
|
||||
const Win32_DWORD ERROR_IS_SUBST_TARGET = 0x95;
|
||||
const Win32_DWORD ERROR_SYSTEM_TRACE = 0x96;
|
||||
const Win32_DWORD ERROR_INVALID_EVENT_COUNT = 0x97;
|
||||
const Win32_DWORD ERROR_TOO_MANY_MUXWAITERS = 0x98;
|
||||
const Win32_DWORD ERROR_INVALID_LIST_FORMAT = 0x99;
|
||||
const Win32_DWORD ERROR_LABEL_TOO_LONG = 0x9A;
|
||||
const Win32_DWORD ERROR_TOO_MANY_TCBS = 0x9B;
|
||||
const Win32_DWORD ERROR_SIGNAL_REFUSED = 0x9C;
|
||||
const Win32_DWORD ERROR_DISCARDED = 0x9D;
|
||||
const Win32_DWORD ERROR_NOT_LOCKED = 0x9E;
|
||||
const Win32_DWORD ERROR_BAD_THREADID_ADDR = 0x9F;
|
||||
const Win32_DWORD ERROR_BAD_ARGUMENTS = 0xA0;
|
||||
const Win32_DWORD ERROR_BAD_PATHNAME = 0xA1;
|
||||
const Win32_DWORD ERROR_SIGNAL_PENDING = 0xA2;
|
||||
const Win32_DWORD ERROR_MAX_THRDS_REACHED = 0xA4;
|
||||
const Win32_DWORD ERROR_LOCK_FAILED = 0xA7;
|
||||
const Win32_DWORD ERROR_BUSY = 0xAA;
|
||||
const Win32_DWORD ERROR_DEVICE_SUPPORT_IN_PROGRESS = 0xAB;
|
||||
const Win32_DWORD ERROR_CANCEL_VIOLATION = 0xAD;
|
||||
const Win32_DWORD ERROR_ATOMIC_LOCKS_NOT_SUPPORTED = 0xAE;
|
||||
const Win32_DWORD ERROR_INVALID_SEGMENT_NUMBER = 0xB4;
|
||||
const Win32_DWORD ERROR_INVALID_ORDINAL = 0xB6;
|
||||
const Win32_DWORD ERROR_ALREADY_EXISTS = 0xB7;
|
||||
const Win32_DWORD ERROR_INVALID_FLAG_NUMBER = 0xBA;
|
||||
const Win32_DWORD ERROR_SEM_NOT_FOUND = 0xBB;
|
||||
const Win32_DWORD ERROR_INVALID_STARTING_CODESEG = 0xBC;
|
||||
const Win32_DWORD ERROR_INVALID_STACKSEG = 0xBD;
|
||||
const Win32_DWORD ERROR_INVALID_MODULETYPE = 0xBE;
|
||||
const Win32_DWORD ERROR_INVALID_EXE_SIGNATURE = 0xBF;
|
||||
|
||||
const Win32_DWORD ERROR_EXE_MARKED_INVALID = 0xC0;
|
||||
const Win32_DWORD ERROR_BAD_EXE_FORMAT = 0xC1;
|
||||
const Win32_DWORD ERROR_ITERATED_DATA_EXCEEDS_64K = 0xC2;
|
||||
const Win32_DWORD ERROR_INVALID_MINALLOCSIZE = 0xC3;
|
||||
const Win32_DWORD ERROR_DYNLINK_FROM_INVALID_RING = 0xC4;
|
||||
const Win32_DWORD ERROR_IOPL_NOT_ENABLED = 0xC5;
|
||||
const Win32_DWORD ERROR_INVALID_SEGDPL = 0xC6;
|
||||
const Win32_DWORD ERROR_AUTODATASEG_EXCEEDS_64K = 0xC7;
|
||||
const Win32_DWORD ERROR_RING2SEG_MUST_BE_MOVABLE = 0xC8;
|
||||
const Win32_DWORD ERROR_RELOC_CHAIN_XEEDS_SEGLIM = 0xC9;
|
||||
const Win32_DWORD ERROR_INFLOOP_IN_RELOC_CHAIN = 0xCA;
|
||||
const Win32_DWORD ERROR_ENVVAR_NOT_FOUND = 0xCB;
|
||||
const Win32_DWORD ERROR_NO_SIGNAL_SENT = 0xCD;
|
||||
const Win32_DWORD ERROR_FILENAME_EXCED_RANGE = 0xCE;
|
||||
const Win32_DWORD ERROR_RING2_STACK_IN_USE = 0xCF;
|
||||
const Win32_DWORD ERROR_META_EXPANSION_TOO_LONG = 0xD0;
|
||||
const Win32_DWORD ERROR_INVALID_SIGNAL_NUMBER = 0xD1;
|
||||
const Win32_DWORD ERROR_THREAD_1_INACTIVE = 0xD2;
|
||||
const Win32_DWORD ERROR_LOCKED = 0xD4;
|
||||
const Win32_DWORD ERROR_TOO_MANY_MODULES = 0xD6;
|
||||
const Win32_DWORD ERROR_NESTING_NOT_ALLOWED = 0xD7;
|
||||
const Win32_DWORD ERROR_EXE_MACHINE_TYPE_MISMATCH = 0xD8;
|
||||
const Win32_DWORD ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY = 0xD9;
|
||||
const Win32_DWORD ERROR_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY = 0xDA;
|
||||
const Win32_DWORD ERROR_FILE_CHECKED_OUT = 0xDC;
|
||||
const Win32_DWORD ERROR_CHECKOUT_REQUIRED = 0xDD;
|
||||
const Win32_DWORD ERROR_BAD_FILE_TYPE = 0xDE;
|
||||
const Win32_DWORD ERROR_FILE_TOO_LARGE = 0xDF;
|
||||
const Win32_DWORD ERROR_FORMS_AUTH_REQUIRED = 0xE0;
|
||||
const Win32_DWORD ERROR_VIRUS_INFECTED = 0xE1;
|
||||
const Win32_DWORD ERROR_VIRUS_DELETED = 0xE2;
|
||||
const Win32_DWORD ERROR_PIPE_LOCAL = 0xE5;
|
||||
const Win32_DWORD ERROR_BAD_PIPE = 0xE6;
|
||||
const Win32_DWORD ERROR_PIPE_BUSY = 0xE7;
|
||||
const Win32_DWORD ERROR_NO_DATA = 0xE8;
|
||||
const Win32_DWORD ERROR_PIPE_NOT_CONNECTED = 0xE9;
|
||||
const Win32_DWORD ERROR_MORE_DATA = 0xEA;
|
||||
const Win32_DWORD ERROR_VC_DISCONNECTED = 0xF0;
|
||||
const Win32_DWORD ERROR_INVALID_EA_NAME = 0xFE;
|
||||
const Win32_DWORD ERROR_EA_LIST_INCONSISTENT = 0xFF;
|
||||
const Win32_DWORD WAIT_TIMEOUT = 0x102;
|
||||
const Win32_DWORD ERROR_NO_MORE_ITEMS = 0x103;
|
||||
const Win32_DWORD ERROR_CANNOT_COPY = 0x10A;
|
||||
const Win32_DWORD ERROR_DIRECTORY = 0x10B;
|
||||
|
||||
const Win32_DWORD ERROR_EAS_DIDNT_FIT = 0x113;
|
||||
const Win32_DWORD ERROR_EA_FILE_CORRUPT = 0x114;
|
||||
const Win32_DWORD ERROR_EA_TABLE_FULL = 0x115;
|
||||
const Win32_DWORD ERROR_INVALID_EA_HANDLE = 0x116;
|
||||
const Win32_DWORD ERROR_EAS_NOT_SUPPORTED = 0x11A;
|
||||
const Win32_DWORD ERROR_NOT_OWNER = 0x120;
|
||||
const Win32_DWORD ERROR_TOO_MANY_POSTS = 0x12A;
|
||||
const Win32_DWORD ERROR_PARTIAL_COPY = 0x12A;
|
||||
const Win32_DWORD ERROR_OPLOCK_NOT_GRANTED = 0x12C;
|
||||
const Win32_DWORD ERROR_INVALID_OPLOCK_PROTOCOL = 0x12D;
|
||||
const Win32_DWORD ERROR_DISK_TOO_FRAGMENTED = 0x12E;
|
||||
const Win32_DWORD ERROR_DELETE_PENDING = 0x12F;
|
||||
const Win32_DWORD ERROR_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING = 0x130;
|
||||
const Win32_DWORD ERROR_SHORT_NAMES_NOT_ENABLED_ON_VOLUME = 0x131;
|
||||
const Win32_DWORD ERROR_SECURITY_STREAM_IS_INCONSISTENT = 0x132;
|
||||
const Win32_DWORD ERROR_INVALID_LOCK_RANGE = 0x133;
|
||||
const Win32_DWORD ERROR_IMAGE_SUBSYSTEM_NOT_PRESENT = 0x134;
|
||||
const Win32_DWORD ERROR_NOTIFICATION_GUID_ALREADY_DEFINED = 0x135;
|
||||
const Win32_DWORD ERROR_INVALID_EXCEPTION_HANDLER = 0x136;
|
||||
const Win32_DWORD ERROR_DUPLICATE_PRIVILEGES = 0x137;
|
||||
const Win32_DWORD ERROR_NO_RANGES_PROCESSED = 0x138;
|
||||
const Win32_DWORD ERROR_NOT_ALLOWED_ON_SYSTEM_FILE = 0x139;
|
||||
const Win32_DWORD ERROR_DISK_RESOURCES_EXHAUSTED = 0x13A;
|
||||
const Win32_DWORD ERROR_INVALID_TOKEN = 0x13B;
|
||||
const Win32_DWORD ERROR_DEVICE_FEATURE_NOT_SUPPORTED = 0x13C;
|
||||
const Win32_DWORD ERROR_MR_MID_NOT_FOUND = 0x13D;
|
||||
const Win32_DWORD ERROR_SCOPE_NOT_FOUND = 0x13E;
|
||||
const Win32_DWORD ERROR_UNDEFINED_SCOPE = 0x13F;
|
||||
|
||||
$endif
|
||||
@@ -1,4 +1,4 @@
|
||||
module std::os::win32::process;
|
||||
module std::os::win32;
|
||||
|
||||
$if (env::os_is_win32())
|
||||
|
||||
@@ -13,6 +13,6 @@ extern fn bool win32_CreateProcessW(
|
||||
Win32_LPCWSTR lpCurrentDirectory,
|
||||
Win32_LPSTARTUPINFOW lpStartupInfo,
|
||||
Win32_LPPROCESS_INFORMATION lpProcessInformation
|
||||
);
|
||||
) @extern("CreateProcessW");
|
||||
|
||||
$endif
|
||||
@@ -168,6 +168,8 @@ typedef Win32_WCHAR = Char16;
|
||||
typedef Win32_WORD = ushort;
|
||||
typedef Win32_WPARAM = Win32_UINT_PTR;
|
||||
|
||||
const INVALID_HANDLE_VALUE = (Win32_HANDLE)(uptr)-1;
|
||||
|
||||
struct Win32_UNICODE_STRING
|
||||
{
|
||||
Win32_USHORT length;
|
||||
@@ -230,6 +232,12 @@ struct Win32_STARTUPINFOEXW
|
||||
typedef Win32_LPPROC_THREAD_ATTRIBUTE_LIST = void*;
|
||||
typedef Win32_LPSTARTUPINFOEXW = Win32_STARTUPINFOEXW*;
|
||||
|
||||
struct Win32_FILETIME
|
||||
{
|
||||
Win32_DWORD dwLowDateTime;
|
||||
Win32_DWORD dwHighDateTime;
|
||||
}
|
||||
|
||||
struct Win32_PROCESS_INFORMATION
|
||||
{
|
||||
Win32_HANDLE hProcess;
|
||||
|
||||
36
lib/std/os/win32/wsa.c3
Normal file
36
lib/std/os/win32/wsa.c3
Normal file
@@ -0,0 +1,36 @@
|
||||
module std::os::win32;
|
||||
|
||||
typedef WSAError = distinct int;
|
||||
|
||||
$if (env::os_is_win32())
|
||||
|
||||
extern fn WSAError win32_WSAGetLastError() @extern("WSAGetLastError");
|
||||
extern fn void win32_WSASetLastError(WSAError error) @extern("WSASetLastError");
|
||||
$endif
|
||||
|
||||
module std::os::win32::wsa;
|
||||
|
||||
$if (env::os_is_win32())
|
||||
const WSAError INVALID_HANDLE = 6;
|
||||
const WSAError NOT_ENOUGHT_MEMORY = 8;
|
||||
const WSAError INVALID_PARAMETER = 87;
|
||||
const WSAError OPERATION_ABORTED = 995;
|
||||
const WSAError IO_INCOMPLETE = 996;
|
||||
const WSAError IO_PENDING = 997;
|
||||
const WSAError EINTR = 10004;
|
||||
const WSAError EBADF = 10009;
|
||||
const WSAError ACCESS = 10013;
|
||||
const WSAError EFAULT = 10014;
|
||||
const WSAError EINVAL = 10022;
|
||||
const WSAError EMFILE = 10024;
|
||||
const WSAError EWOULDBLOCK = 10035;
|
||||
const WSAError EINPROGRESS = 10036;
|
||||
const WSAError EALREADY = 10037;
|
||||
const WSAError ENOTSOCK = 10038;
|
||||
const WSAError EDESTADDRREQ = 10039;
|
||||
const WSAError EMSGSIZE = 10040;
|
||||
const WSAError EPROTOTYPE = 10041;
|
||||
const WSAError ENOPROTOOPT = 10042;
|
||||
const WSAError EPROTONOSUPPORT = 10043;
|
||||
const WSAError ESOCKTNOSUPPORT = 10044;
|
||||
$endif
|
||||
Reference in New Issue
Block a user