abla/platform/host

Generated from source.

Import with import "abla/platform/host".

Source: abla/platform/host/entry.ab

ablaHostIsMacOS (extern)

noescape extern:"intrinsic" fun ablaHostIsMacOS(): bool

These query the executing target (the compiler host during CT evaluation).

ablaHostIsIOS (extern)

noescape extern:"intrinsic" fun ablaHostIsIOS(): bool

Returns true when the host target is iOS.

ablaHostValueArgumentsIndirect (extern)

noescape extern:"intrinsic" fun ablaHostValueArgumentsIndirect(): bool

LLVM's byval attribute follows the x86-64 C ABI, while Apple AArch64 passes an AblaValue-sized aggregate through an ordinary indirect pointer. The backend queries this ABI capability instead of naming an architecture.

ablaHostReadFile (fun)

fun ablaHostReadFile(path: string): string

Returns the file's bytes, or empty text for an empty or unreadable file.

ablaHostWriteFile (fun)

fun ablaHostWriteFile(path: string, contents: string)

Writes the supplied bytes to the file, discarding the write status.

ablaHostWriteFileAtomic (fun)

fun ablaHostWriteFileAtomic(path: string, contents: string): bool

Returns true if the file was atomically replaced with the supplied bytes.

ablaHostCreateParentDirectories (fun)

fun ablaHostCreateParentDirectories(path: string)

Attempts to create any missing parent directories for the given file path.

ablaHostCreateDirectories (fun)

fun ablaHostCreateDirectories(path: string): bool

Returns true if the directory and its parents already exist or can be created.

ablaHostFileKind (fun)

fun ablaHostFileKind(path: string): int

0: absent, otherwise the kind linuxFileInfo reports (1: a regular file).

ablaHostFileSize (fun)

fun ablaHostFileSize(path: string): int

Returns the file size in bytes, or -1 if its metadata cannot be read.

ablaHostListDirectory (fun)

fun ablaHostListDirectory(path: string): array<string>

The entry names, sorted bytewise so every host lists them in one order; [] when the directory does not exist.

ablaHostNameBefore (fun)

fun ablaHostNameBefore(left: string, right: string): bool

Returns true if the left name sorts before the right in byte order.

ablaHostMoveFile (fun)

fun ablaHostMoveFile(source: string, destination: string): bool

Returns true if the file is renamed to the destination successfully.

ablaHostRemoveFile (fun)

fun ablaHostRemoveFile(path: string): bool

Returns true if the path was removed successfully.

ablaHostCurrentDirectory (fun)

fun ablaHostCurrentDirectory(): string

Returns the current working directory as path text.

ablaHostFileRevision (fun)

fun ablaHostFileRevision(path: string): int

The file's modification time in nanoseconds (0 when absent).

ablaHostStandardInput (var)

var ablaHostStandardInput: LinuxInput

The buffered input reader used by the host's standard input routines.

ablaHostReadStdinLine (fun)

fun ablaHostReadStdinLine(): string

The next line of standard input without its terminator ("" at the end).

ablaHostStdinLineAvailable (fun)

fun ablaHostStdinLineAvailable(): bool

Returns true if standard input is ready without waiting.

ablaHostWriteStdout (fun)

fun ablaHostWriteStdout(text: string): void

Writes the bytes to standard output.

ablaHostWriteStderr (fun)

fun ablaHostWriteStderr(text: string): void

Writes the bytes to standard error.

ablaHostArgumentCount (fun)

fun ablaHostArgumentCount(): int

Returns the number of arguments following the executable name.

ablaHostArgument (fun)

fun ablaHostArgument(index: int): string

Returns an argument by index, with -1 selecting the executable and an empty string for an invalid index.

ablaHostSleep (fun)

fun ablaHostSleep(milliseconds: int)

Sleeps for the requested milliseconds, discarding the sleep status.

ablaHostMonotonicMilliseconds (fun)

fun ablaHostMonotonicMilliseconds(): int

Returns a monotonic timestamp in milliseconds, or zero if the clock read fails.

ablaHostProcessorCount (fun)

fun ablaHostProcessorCount(): int

Returns the count of online processors from the host CPU list, or one if the list is unavailable.

ablaHostCommand (fun)

fun ablaHostCommand(arguments: array<string>): LinuxCommand

Returns a command using the first argument as the executable, or an empty executable if the array is empty.

ablaHostRunProcess (fun)

fun ablaHostRunProcess(arguments: array<string>): int

The exit status (-1 when there is nothing to run).

ablaHostCaptureProcess (fun)

fun ablaHostCaptureProcess(arguments: array<string>): string

The process's standard output.

ablaHostStartProcess (fun)

fun ablaHostStartProcess(arguments: array<string>): int

The started process's identifier (negative on failure).

ablaHostStartProcessConfigured (fun)

fun ablaHostStartProcessConfigured(
    directory: string,
    arguments: array<string>,
    environmentNames: array<string>,
    environmentValues: array<string>,
    outputPath: string
): int

Returns the child identifier for a process launched with the supplied directory, environment, and output path, or a negative value on failure.

ablaHostPollProcess (fun)

fun ablaHostPollProcess(process: int): int

Returns -1 while the process is still running, otherwise its exit status.

ablaHostStopProcessTree (fun)

fun ablaHostStopProcessTree(process: int, graceMilliseconds: int): int

Stops a child process group and returns the child's terminal status.

ablaHostStopProcess (fun)

fun ablaHostStopProcess(process: int): int

Stops a child process using the default grace period and returns its terminal status.

ablaHostStopProcessGracefully (fun)

fun ablaHostStopProcessGracefully(process: int, graceMilliseconds: int): int

Stops a child process with the supplied grace period and returns its terminal status.

ablaHostSecureRandom (fun)

fun ablaHostSecureRandom(count: int): string

count bytes from the system's entropy source ("" on failure).

ablaHostNetLastStatus (var)

var ablaHostNetLastStatus: int

Outcome code from the most recent host socket read, write, or receive.

ablaHostNetLastError (var)

var ablaHostNetLastError: int

Errno from the most recent host socket read, write, or receive.

ablaHostNetLastSourceAddress (var)

var ablaHostNetLastSourceAddress: string

Source address recorded for the most recent UDP receive.

ablaHostNetLastSourcePort (var)

var ablaHostNetLastSourcePort: int

Source port recorded for the most recent UDP receive, or -1 before receipt.

ablaHostNetRecord (fun)

fun ablaHostNetRecord(status: string, errorCode: int): void

Stores errno and maps an I/O result to the host's numeric socket outcome.

ablaHostNetIpv6 (fun)

fun ablaHostNetIpv6(host: string): bool

Returns true for a numeric IPv6 address the host can parse.

ablaHostNetConnect (fun)

fun ablaHostNetConnect(host: string, port: int, timeoutMilliseconds: int): int

A connected descriptor (negative on failure). Names resolve through DNS.

ablaHostNetListen (fun)

fun ablaHostNetListen(host: string, port: int, backlog: int, dualStack: bool): int

Returns a listening TCP descriptor bound to the numeric endpoint, or a negative result if the bind or listen fails.

ablaHostNetAccept (fun)

fun ablaHostNetAccept(listener: int): int

Returns the accepted client descriptor, or a negative value if accept fails.

ablaHostNetSetNonblocking (fun)

fun ablaHostNetSetNonblocking(descriptor: int, enabled: bool): bool

Returns true if the socket's nonblocking flag was updated successfully.

ablaHostNetLocalPort (fun)

fun ablaHostNetLocalPort(descriptor: int): int

Returns the socket's local port or -1 if the address cannot be read.

ablaHostNetRead (fun)

fun ablaHostNetRead(descriptor: int, maximum: int): string

Returns the available bytes and records the socket status, with empty bytes for EOF or failure.

ablaHostNetWrite (fun)

fun ablaHostNetWrite(descriptor: int, contents: string): int

The bytes written (negative on failure).

ablaHostNetStatus (fun)

fun ablaHostNetStatus(): int

Returns the last socket outcome as 0 for success, 1 for EOF, 2 for would-block, or 3 for another failure.

ablaHostNetError (fun)

fun ablaHostNetError(): int

Returns the errno recorded for the most recent host socket I/O.

ablaHostNetClose (fun)

fun ablaHostNetClose(descriptor: int): bool

Returns true if closing the descriptor succeeds.

ablaHostNetUdpBind (fun)

fun ablaHostNetUdpBind(host: string, port: int, dualStack: bool): int

Returns a bound UDP descriptor for the numeric endpoint, or a negative value if the bind fails.

ablaHostNetUdpSend (fun)

fun ablaHostNetUdpSend(descriptor: int, host: string, port: int, contents: string): int

Sends one datagram and returns the number of bytes written or a negative errno.

ablaHostNetUdpReceive (fun)

fun ablaHostNetUdpReceive(descriptor: int, maximum: int): string

Returns one datagram's bytes and records the sender and outcome, with empty bytes on failure.

ablaHostNetSourceAddress (fun)

fun ablaHostNetSourceAddress(): string

Returns the sender address recorded by the most recent UDP receive.

ablaHostNetSourcePort (fun)

fun ablaHostNetSourcePort(): int

Returns the sender port recorded by the most recent UDP receive.

ablaHostNetPollerCreate (fun)

fun ablaHostNetPollerCreate(): int

Returns a new kernel poller descriptor, or a negative result on failure.

ablaHostNetPollerControl (fun)

fun ablaHostNetPollerControl(
    poller: int,
    descriptor: int,
    readable: bool,
    writable: bool,
    operation: int
): bool

operation: 1 add, 2 remove, 3 modify (epoll's control operations).

ablaHostNetPollerWait (fun)

fun ablaHostNetPollerWait(poller: int, maximumEvents: int, timeoutMilliseconds: int): string

The ready events in SocketPoller.waitCompact's encoding.

Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.