Module libc/windows

libc/windows
Stability: unstable — a raw C binding, not a Yo design, and Windows-only: every import must sit inside a `Platform.Windows` comptime arm or the `<windows.h>` / `<io.h>` / `<direct.h>` includes reach other platforms' emitted C. The public surfaces above it are `std/env` (cwd, `current_exe`, environment), `std/fs` (delete / rmdir) and `std/time` (local time via `_localtime64_s`). It is additive-by-demand — a Win32 symbol appears here the first time a `std/` module needs it — and the selection embeds real Windows decisions, e.g. CRT `_write` is deliberately NOT bound because async-opened fds wrap `FILE_FLAG_OVERLAPPED` handles the CRT cannot serve. Freezing follows the modules above it, not a release count. — stable modules only change additively; this one may still change.

Windows-specific C API bindings. Only available when compiling for Windows.

Stability

unstable — a raw C binding, not a Yo design, and Windows-only: every import must sit inside a Platform.Windows comptime arm or the <windows.h> / <io.h> / <direct.h> includes reach other platforms' emitted C. The public surfaces above it are std/env (cwd, current_exe, environment), std/fs (delete / rmdir) and std/time (local time via _localtime64_s). It is additive-by-demand — a Win32 symbol appears here the first time a std/ module needs it — and the selection embeds real Windows decisions, e.g. CRT _write is deliberately NOT bound because async-opened fds wrap FILE_FLAG_OVERLAPPED handles the CRT cannot serve. Freezing follows the modules above it, not a release count.

Types

DWORD type-alias
ulong

Win32's DWORD — a 32-bit unsigned count or error code, bound as ulong because that is what it is on the Windows ABI. Every size, length and GetLastError value below is one of these.

WCHAR type-alias
ushort

Win32's WCHAR — ONE UTF-16 code unit, not a character: a non-BMP code point is two of these, so a *WCHAR buffer length is in code units and WideCharToMultiByte is what turns it into Yo's UTF-8.

BOOL type-alias
int

Win32's BOOL — a C int, where zero is failure and ANY non-zero value is success. It is not Yo's bool; compare against zero rather than casting.

Functions

_localtime64_s function
fn(result : *(void), timer : *(i64)) -> int

Parameters

NameTypeNotes
result*(void)
timer*(i64)

Returns: int

fn(nBufferLength : ulong, lpBuffer : ?(*(ushort))) -> ulong

Parameters

NameTypeNotes
nBufferLengthulong
lpBuffer?(*(ushort))

Returns: ulong

fn(lpPathName : *(char)) -> int

Parameters

NameTypeNotes
lpPathName*(char)

Returns: int

fn(CodePage : u32, dwFlags : ulong, lpWideCharStr : ?(*(ushort)), cchWideChar : i32, lpMultiByteStr : ?(*(u8)), cbMultiByte : i32, lpDefaultChar : ?(*(u8)), lpUsedDefaultChar : ?(*(i32))) -> i32

Parameters

NameTypeNotes
CodePageu32
dwFlagsulong
lpWideCharStr?(*(ushort))
cchWideChari32
lpMultiByteStr?(*(u8))
cbMultiBytei32
lpDefaultChar?(*(u8))
lpUsedDefaultChar?(*(i32))

Returns: i32

_putenv_s function
fn(varname : *(char), value_string : *(char)) -> int

Parameters

NameTypeNotes
varname*(char)
value_string*(char)

Returns: int

fn(hModule : ?(*(void)), lpFilename : *(ushort), nSize : ulong) -> ulong

Parameters

NameTypeNotes
hModule?(*(void))
lpFilename*(ushort)
nSizeulong

Returns: ulong

GetLastError function
fn() -> ulong

Returns: ulong

_rmdir function
fn(path : *(char)) -> int

Parameters

NameTypeNotes
path*(char)

Returns: int

Constants

_environ constant *(?(*(char)))

Value: <unknown: *(?(*(char)))>

CP_UTF8 constant u32

Value: <unknown: u32>