MiniQuake

src/miniquake/filesystem.ml

Package
miniquake.filesystem
Reachable
Yes

Imports

Declarations

addDirectory

function addDirectory(system, directory)

Add state for add directory.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `addDirectory`.
directorydynamic—The directory input consumed by `addDirectory`.

View source

addGameDirectory

function addGameDirectory(system, directory)

Add state for add game directory.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `addGameDirectory`.
directorydynamic—The directory input consumed by `addGameDirectory`.

View source

addPack

function addPack(system, filename)

Add state for add pack.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `addPack`.
filenamedynamic—Path of the file to process.

View source

cachedLocation

function cachedLocation(system, netPath)

Return cached location derived from the active module state.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `cachedLocation`.
netPathdynamic—Filesystem path used by the operation.

View source

cachePath

function cachePath(system, netPath)

Return cache path derived from the active module state.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `cachePath`.
netPathdynamic—Filesystem path used by the operation.

View source

checkRegistered

function checkRegistered(system)

Validate registered and report any incompatibility.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `checkRegistered`.

View source

closeFile

function closeFile(handle)

Release state for close file.

ParameterTypeDefaultDescription
handledynamic—The handle input consumed by `closeFile`.

View source

COM_AddGameDirectory

function COM_AddGameDirectory(system, directory)

Mirror Quake's COM_AddGameDirectory routine and its observable state changes.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `COM_AddGameDirectory`.
directorydynamic—The directory input consumed by `COM_AddGameDirectory`.

View source

COM_CheckRegistered

function COM_CheckRegistered(system)

Original WinQuake/common.c filesystem entry points. The state that was global in C is explicit in MiniLang, but the observable operations are the same and remain independently differential-testable.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `COM_CheckRegistered`.

View source

COM_CloseFile

function COM_CloseFile(handle)

Mirror Quake's COM_CloseFile routine and its observable state changes.

ParameterTypeDefaultDescription
handledynamic—The handle input consumed by `COM_CloseFile`.

View source

COM_CopyFile

function COM_CopyFile(netPath, cachePath)

Mirror Quake's COM_CopyFile routine and its observable state changes.

ParameterTypeDefaultDescription
netPathdynamic—Filesystem path used by the operation.
cachePathdynamic—Filesystem path used by the operation.

View source

COM_CreatePath

function COM_CreatePath(path)

Mirror Quake's COM_CreatePath routine and its observable state changes.

ParameterTypeDefaultDescription
pathdynamic—Filesystem path to process.

View source

COM_FindFile

function COM_FindFile(system, filename)

Mirror Quake's COM_FindFile routine and its observable state changes.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `COM_FindFile`.
filenamedynamic—Path of the file to process.

View source

COM_FOpenFile

function COM_FOpenFile(system, filename)

Mirror Quake's COM_FOpenFile routine and its observable state changes.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `COM_FOpenFile`.
filenamedynamic—Path of the file to process.

View source

COM_InitFilesystem

function COM_InitFilesystem(suppliedBaseDirectory, commandLine)

Mirror Quake's COM_InitFilesystem routine and its observable state changes.

ParameterTypeDefaultDescription
suppliedBaseDirectorydynamic—The supplied base directory input consumed by `COM_InitFilesystem`.
commandLinedynamic—The command line input consumed by `COM_InitFilesystem`.

View source

COM_LoadCacheFile

function COM_LoadCacheFile(system, path)

Mirror Quake's COM_LoadCacheFile routine and its observable state changes.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `COM_LoadCacheFile`.
pathdynamic—Filesystem path to process.

View source

COM_LoadFile

function COM_LoadFile(system, path)

Mirror Quake's COM_LoadFile routine and its observable state changes.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `COM_LoadFile`.
pathdynamic—Filesystem path to process.

View source

COM_LoadHunkFile

function COM_LoadHunkFile(system, path)

Mirror Quake's COM_LoadHunkFile routine and its observable state changes.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `COM_LoadHunkFile`.
pathdynamic—Filesystem path to process.

View source

COM_LoadPackFile

function COM_LoadPackFile(filename)

Mirror Quake's COM_LoadPackFile routine and its observable state changes.

ParameterTypeDefaultDescription
filenamedynamic—Path of the file to process.

View source

COM_LoadStackFile

function COM_LoadStackFile(system, path, buffer)

Mirror Quake's COM_LoadStackFile routine and its observable state changes.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `COM_LoadStackFile`.
pathdynamic—Filesystem path to process.
bufferdynamic—The buffer input consumed by `COM_LoadStackFile`.

View source

COM_LoadTempFile

function COM_LoadTempFile(system, path)

Mirror Quake's COM_LoadTempFile routine and its observable state changes.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `COM_LoadTempFile`.
pathdynamic—Filesystem path to process.

View source

COM_OpenFile

function COM_OpenFile(system, filename)

Mirror Quake's COM_OpenFile routine and its observable state changes.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `COM_OpenFile`.
filenamedynamic—Path of the file to process.

View source

COM_Path_f

function COM_Path_f(system)

Mirror Quake's COM_Path_f routine and its observable state changes.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `COM_Path_f`.

View source

COM_WriteFile

function COM_WriteFile(system, filename, data)

Mirror Quake's COM_WriteFile routine and its observable state changes.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `COM_WriteFile`.
filenamedynamic—Path of the file to process.
datadynamic—Input data consumed by the operation.

View source

containsDirectorySeparator

function containsDirectorySeparator(name)

Implements the `containsDirectorySeparator` operation for `miniquake.filesystem` (contains directory separator).

ParameterTypeDefaultDescription
namedynamic—Stable name that identifies the requested object or option.

View source

copyFile

function copyFile(netPath, destination)

Transfer data for copy file.

ParameterTypeDefaultDescription
netPathdynamic—Filesystem path used by the operation.
destinationdynamic—Destination value or collection to update.

View source

copyTerminated

function copyTerminated(destination, source)

Transfer data for copy terminated.

ParameterTypeDefaultDescription
destinationdynamic—Destination value or collection to update.
sourcedynamic—Source value or collection to read.

View source

create

function create(baseDirectory, gameDirectory)

Implements the `create` operation for `miniquake.filesystem` (create).

ParameterTypeDefaultDescription
baseDirectorydynamic—Root directory containing the Quake installation.
gameDirectorydynamic—Selected Quake game-data directory.

View source

createDirectory

function createDirectory(path)

Create one directory component on the active host platform and report whether it exists after the operation.

ParameterTypeDefaultDescription
pathdynamic—Filesystem path to create.

View source

CreateDirectoryW

extern function CreateDirectoryW(path as wstr, security as ptr) from "kernel32.dll" returns bool

Create a directory through the Win32 wide-character filesystem API.

ParameterTypeDefaultDescription
pathwstr—Filesystem path to create.
securityptr—Optional Win32 security attributes pointer.

Returns: True when Windows creates the directory.

View source

createPath

function createPath(path)

Create and initialize path.

ParameterTypeDefaultDescription
pathdynamic—Filesystem path to process.

View source

describe

function describe(system)

Implements the `describe` operation for `miniquake.filesystem` (describe).

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `describe`.

View source

exists

function exists(system, name)

Report whether exists holds for the active state.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `exists`.
namedynamic—Stable name that identifies the requested object or option.

View source

fileExists

function fileExists(system, name)

Report whether file exists holds for the active state.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `fileExists`.
namedynamic—Stable name that identifies the requested object or option.

View source

fileTime

function fileTime(path)

Implements the `fileTime` operation for `miniquake.filesystem` (file time).

ParameterTypeDefaultDescription
pathdynamic—Filesystem path to process.

View source

findFile

function findFile(system, name)

Return file.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `findFile`.
namedynamic—Stable name that identifies the requested object or option.

View source

findLocation

function findLocation(system, name)

Return location.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `findLocation`.
namedynamic—Stable name that identifies the requested object or option.

View source

fOpenFile

function fOpenFile(system, name)

Implements the `fOpenFile` operation for `miniquake.filesystem` (f open file).

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `fOpenFile`.
namedynamic—Stable name that identifies the requested object or option.

View source

gamePath

function gamePath(system, name)

Return game path derived from the active module state.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `gamePath`.
namedynamic—Stable name that identifies the requested object or option.

View source

GetFileAttributesExW

extern function GetFileAttributesExW(path as wstr, infoLevel as i32, data as bytes) from "kernel32.dll" returns bool

Read file metadata through the Win32 wide-character filesystem API.

ParameterTypeDefaultDescription
pathwstr—Filesystem path to inspect.
infoLeveli32—Win32 attribute-information level.
databytes—Caller-owned output buffer for the attribute record.

Returns: True when Windows reads the metadata successfully.

View source

handleRead

function handleRead(handle, count)

Handle read and update the associated state.

ParameterTypeDefaultDescription
handledynamic—The handle input consumed by `handleRead`.
countdynamic—Number of entries or units to process.

View source

handleSeek

function handleSeek(handle, position)

Handle seek and update the associated state.

ParameterTypeDefaultDescription
handledynamic—The handle input consumed by `handleSeek`.
positiondynamic—Position used by the operation.

View source

initFilesystem

function initFilesystem(suppliedBaseDirectory, commandLine)

Initialize state for init filesystem.

ParameterTypeDefaultDescription
suppliedBaseDirectorydynamic—The supplied base directory input consumed by `initFilesystem`.
commandLinedynamic—The command line input consumed by `initFilesystem`.

View source

initialize

function initialize(baseDirectory, gameName)

Initializes ialize for `miniquake.filesystem`.

ParameterTypeDefaultDescription
baseDirectorydynamic—Root directory containing the Quake installation.
gameNamedynamic—Name that identifies the requested value or resource.

View source

initializeArguments

function initializeArguments(suppliedBaseDirectory, commandLine)

Initialize state for initialize arguments.

ParameterTypeDefaultDescription
suppliedBaseDirectorydynamic—The supplied base directory input consumed by `initializeArguments`.
commandLinedynamic—The command line input consumed by `initializeArguments`.

View source

isModified

function isModified(system)

Report whether is modified.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `isModified`.

View source

join

function join(a, b)

Implements the `join` operation for `miniquake.filesystem` (join).

ParameterTypeDefaultDescription
adynamic—The a input consumed by `join`.
bdynamic—The b input consumed by `join`.

View source

loadCacheAllocation

function loadCacheAllocation(system, memoryState, name)

Read and validate cache allocation.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `loadCacheAllocation`.
memoryStatedynamic—Mutable state used by `loadCacheAllocation`.
namedynamic—Stable name that identifies the requested object or option.

View source

loadCacheFile

function loadCacheFile(system, name)

Read and validate cache file.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `loadCacheFile`.
namedynamic—Stable name that identifies the requested object or option.

View source

loadFile

function loadFile(system, name)

COM_LoadFile always allocated one extra byte and NUL-terminated it. Keep readFile as the raw COM_FindFile view used by binary parsers, and expose the load-family behavior explicitly.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `loadFile`.
namedynamic—Stable name that identifies the requested object or option.

View source

loadHunkAllocation

function loadHunkAllocation(system, memoryState, name)

Read and validate hunk allocation.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `loadHunkAllocation`.
memoryStatedynamic—Mutable state used by `loadHunkAllocation`.
namedynamic—Stable name that identifies the requested object or option.

View source

loadHunkFile

function loadHunkFile(system, name)

Read and validate hunk file.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `loadHunkFile`.
namedynamic—Stable name that identifies the requested object or option.

View source

loadPackFile

function loadPackFile(filename)

Read and validate pack file.

ParameterTypeDefaultDescription
filenamedynamic—Path of the file to process.

View source

loadStackAllocation

function loadStackAllocation(system, memoryState, name, buffer)

Read and validate stack allocation.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `loadStackAllocation`.
memoryStatedynamic—Mutable state used by `loadStackAllocation`.
namedynamic—Stable name that identifies the requested object or option.
bufferdynamic—The buffer input consumed by `loadStackAllocation`.

View source

loadStackFile

function loadStackFile(system, name, buffer)

Read and validate stack file.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `loadStackFile`.
namedynamic—Stable name that identifies the requested object or option.
bufferdynamic—The buffer input consumed by `loadStackFile`.

View source

loadTempAllocation

function loadTempAllocation(system, memoryState, name)

Read and validate temp allocation.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `loadTempAllocation`.
memoryStatedynamic—Mutable state used by `loadTempAllocation`.
namedynamic—Stable name that identifies the requested object or option.

View source

loadTempFile

function loadTempFile(system, name)

Read and validate temp file.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `loadTempFile`.
namedynamic—Stable name that identifies the requested object or option.

View source

loadZoneAllocation

function loadZoneAllocation(system, memoryState, name)

Read and validate zone allocation.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `loadZoneAllocation`.
memoryStatedynamic—Mutable state used by `loadZoneAllocation`.
namedynamic—Stable name that identifies the requested object or option.

View source

musicTrackName

function musicTrackName(track)

Return music track name derived from the active module state.

ParameterTypeDefaultDescription
trackdynamic—The track input consumed by `musicTrackName`.

View source

musicTrackPath

function musicTrackPath(system, track)

Return music track path derived from the active module state.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `musicTrackPath`.
trackdynamic—The track input consumed by `musicTrackPath`.

View source

normalizeName

function normalizeName(name)

Convert name into its canonical representation.

ParameterTypeDefaultDescription
namedynamic—Stable name that identifies the requested object or option.

View source

openFile

function openFile(system, name)

Initialize state for open file.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `openFile`.
namedynamic—Stable name that identifies the requested object or option.

View source

packFileCount

function packFileCount(system)

Return pack file count derived from the active module state.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `packFileCount`.

View source

pathCommandText

function pathCommandText(system)

Return path command text for the active module state.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `pathCommandText`.

View source

readFile

function readFile(system, name)

Read and validate file.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `readFile`.
namedynamic—Stable name that identifies the requested object or option.

View source

readLooseMusicTrack

function readLooseMusicTrack(directory, filename)

Read and validate loose music track.

ParameterTypeDefaultDescription
directorydynamic—The directory input consumed by `readLooseMusicTrack`.
filenamedynamic—Path of the file to process.

View source

readMusicTrack

function readMusicTrack(system, track)

Read and validate music track.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `readMusicTrack`.
trackdynamic—The track input consumed by `readMusicTrack`.

View source

readText

function readText(system, name)

Reads text for `miniquake.filesystem`.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `readText`.
namedynamic—Stable name that identifies the requested object or option.

View source

registeredWords

function registeredWords()

Registers ed words for `miniquake.filesystem`.

View source

release

function release(system)

Release or remove state for the requested value.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `release`.

View source

rereleaseMusicDirectory

function rereleaseMusicDirectory(system, gameDirectory)

Implements the `rereleaseMusicDirectory` operation for `miniquake.filesystem` (rerelease music directory).

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `rereleaseMusicDirectory`.
gameDirectorydynamic—Selected Quake game-data directory.

View source

resolve

function resolve(system, name)

Implements the `resolve` operation for `miniquake.filesystem` (resolve).

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `resolve`.
namedynamic—Stable name that identifies the requested object or option.

View source

searchPathSummary

function searchPathSummary(system)

Return search path summary derived from the active module state.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `searchPathSummary`.

View source

standard

function standard(baseDirectory, gameName)

Implements the `standard` operation for `miniquake.filesystem` (standard).

ParameterTypeDefaultDescription
baseDirectorydynamic—Root directory containing the Quake installation.
gameNamedynamic—Name that identifies the requested value or resource.

View source

trimTrailingSeparator

function trimTrailingSeparator(path)

Implements the `trimTrailingSeparator` operation for `miniquake.filesystem` (trim trailing separator).

ParameterTypeDefaultDescription
pathdynamic—Filesystem path to process.

View source

writeBytes

function writeBytes(system, name, data)

Writes bytes for `miniquake.filesystem`.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `writeBytes`.
namedynamic—Stable name that identifies the requested object or option.
datadynamic—Input data consumed by the operation.

View source

writeFile

function writeFile(system, name, data)

Encode and write file.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `writeFile`.
namedynamic—Stable name that identifies the requested object or option.
datadynamic—Input data consumed by the operation.

View source

writeText

function writeText(system, name, text)

Writes text for `miniquake.filesystem`.

ParameterTypeDefaultDescription
systemdynamic—The system input consumed by `writeText`.
namedynamic—Stable name that identifies the requested object or option.
textdynamic—Text to parse or process.

View source