From b14173fe49dfe7c436950420e1c600bc42e881ca Mon Sep 17 00:00:00 2001
From: luttje <2738114+luttje@users.noreply.github.com>
Date: Mon, 12 Aug 2024 22:40:10 +0200
Subject: [PATCH] document filesystem/handle + remove valve header on files
that aren't valves
---
docs/classes/FileHandle/Read.md | 29 +
docs/classes/FileHandle/Size.md | 24 +
docs/classes/FileHandle/Write.md | 26 +
docs/classes/FileHandle/__eq.md | 26 +
docs/classes/FileHandle/__gc.md | 23 +
docs/classes/FileHandle/__len.md | 24 +
docs/classes/FileHandle/__tostring.md | 24 +
docs/general/conventions.md | 2 +-
docs/libraries/Files/AddPackFile.md | 28 +
docs/libraries/Files/AddSearchPath.md | 30 +
docs/libraries/Files/BeginMapAccess.md | 23 +
.../libraries/Files/CancelWaitForResources.md | 25 +
docs/libraries/Files/Close.md | 25 +
.../Files/CreateDirectoryHierarchy.md | 28 +
docs/libraries/Files/DiscardPreloadData.md | 23 +
docs/libraries/Files/Disconnect.md | 23 +
.../Files/EnableAllowListFileTracking.md | 29 +
docs/libraries/Files/EndMapAccess.md | 23 +
docs/libraries/Files/EndOfFile.md | 26 +
docs/libraries/Files/FileExists.md | 29 +
docs/libraries/Files/Find.md | 29 +
docs/libraries/Files/Flush.md | 25 +
docs/libraries/Files/GetDvdMode.md | 24 +
docs/libraries/Files/GetLocalCopy.md | 25 +
docs/libraries/Files/GetSearchPath.md | 26 +
docs/libraries/Files/GetWhitelistSpewFlags.md | 24 +
docs/libraries/Files/HintResourceNeed.md | 28 +
docs/libraries/Files/IsDirectory.md | 29 +
.../Files/IsFileImmediatelyAvailable.md | 26 +
docs/libraries/Files/IsFileWritable.md | 29 +
docs/libraries/Files/IsOk.md | 26 +
docs/libraries/Files/IsSteam.md | 24 +
docs/libraries/Files/LoadCompiledKeyValues.md | 25 +
docs/libraries/Files/MarkAllCrcsUnverified.md | 23 +
.../Files/MarkPathIdByRequestOnly.md | 27 +
docs/libraries/Files/MountSteamContent.md | 27 +
docs/libraries/Files/Open.md | 31 ++
docs/libraries/Files/Precache.md | 29 +
docs/libraries/Files/PrintOpenedFiles.md | 23 +
docs/libraries/Files/PrintSearchPaths.md | 23 +
docs/libraries/Files/Read.md | 30 +
docs/libraries/Files/RemoveAllSearchPaths.md | 23 +
docs/libraries/Files/RemoveFile.md | 28 +
docs/libraries/Files/RemoveSearchPath.md | 29 +
docs/libraries/Files/RemoveSearchPaths.md | 25 +
docs/libraries/Files/RenameFile.md | 31 ++
docs/libraries/Files/SetFileWritable.md | 31 ++
docs/libraries/Files/SetWarningLevel.md | 25 +
docs/libraries/Files/SetWhitelistSpewFlags.md | 25 +
docs/libraries/Files/SetupPreloadData.md | 23 +
docs/libraries/Files/Shutdown.md | 23 +
docs/libraries/Files/Size.md | 30 +
docs/libraries/Files/UnzipFile.md | 30 +
docs/libraries/Files/WaitForResources.md | 26 +
docs/libraries/Files/Write.md | 26 +
docs/libraries/Randoms/RandomFloat.md | 30 +
.../Randoms/RandomFloatExponential.md | 33 ++
docs/libraries/Randoms/RandomInteger.md | 28 +
docs/libraries/Randoms/SetSeed.md | 25 +
.../Renders/PopFilterMagnification.md | 23 +
.../Renders/PopFilterMinification.md | 23 +
.../Renders/PushFilterMagnification.md | 25 +
.../Renders/PushFilterMinification.md | 25 +
.../modules/gmod_compatibility/sh_file.lua | 40 +-
.../modules/gmod_compatibility/sh_init.lua | 2 +-
game/experiment/bin/game_shader_dx9.dll | 2 +-
game/experiment/bin/game_shader_dx9.pdb | 2 +-
game/experiment/bin/libpng.dll | 2 +-
game/experiment/bin/libpng.pdb | 2 +-
game/experiment/bin/lua54.dll | 2 +-
game/experiment/bin/lua54.pdb | 2 +-
game/experiment/bin/luasocket.dll | 2 +-
game/experiment/bin/luasocket.pdb | 2 +-
.../lua/bin/sv_helloworld_win32.dll | 2 +-
.../lua/bin/sv_helloworld_win32.pdb | 2 +-
.../lua/utilities/test/file_handle.lua | 14 +-
src/game/client/lc_baseanimating.cpp | 6 -
src/game/client/lc_baseanimating.h | 7 -
src/game/client/lc_baseentity.cpp | 6 -
src/game/client/lc_baseplayer.cpp | 7 -
src/game/client/lc_recipientfilter.cpp | 7 -
src/game/client/lc_recipientfilter.h | 7 -
src/game/client/lcdll_util.cpp | 8 -
src/game/client/liclientshadowmgr.cpp | 8 -
src/game/client/lprediction.cpp | 7 -
.../client/scripted_controls/lCheckButton.cpp | 8 -
.../client/scripted_controls/lCheckButton.h | 7 -
.../client/scripted_controls/lControls.cpp | 6 -
src/game/client/scripted_controls/lControls.h | 7 -
.../scripted_controls/lEditablePanel.cpp | 7 -
.../client/scripted_controls/lEditablePanel.h | 7 -
src/game/client/scripted_controls/lFrame.cpp | 7 -
src/game/client/scripted_controls/lFrame.h | 7 -
.../scripted_controls/lModelImagePanel.cpp | 7 -
.../scripted_controls/lPropertyDialog.cpp | 8 -
.../scripted_controls/lPropertyDialog.h | 7 -
.../scripted_controls/lPropertyPage.cpp | 8 -
.../client/scripted_controls/lPropertyPage.h | 7 -
src/game/server/lbaseanimating.cpp | 7 -
src/game/server/lbaseanimating.h | 6 -
src/game/server/lbaseentity.cpp | 6 -
src/game/server/lbaseentity.h | 7 -
src/game/server/lplayer.cpp | 6 -
src/game/server/lrecipientfilter.cpp | 7 -
src/game/server/lrecipientfilter.h | 7 -
src/game/server/lutil.cpp | 7 -
src/game/server/lutil.h | 7 -
.../experiment/lexperiment_player_shared.cpp | 8 -
.../experiment/lexperiment_player_shared.h | 7 -
src/game/shared/lbaseanimating_shared.h | 7 -
src/game/shared/lbasecombatweapon_shared.cpp | 8 -
src/game/shared/lbasecombatweapon_shared.h | 9 -
src/game/shared/lbaseentity_shared.h | 7 -
src/game/shared/lbaseflex_shared.cpp | 6 -
src/game/shared/lbaseflex_shared.h | 7 -
src/game/shared/lbaseplayer_shared.cpp | 8 -
src/game/shared/lbaseplayer_shared.h | 7 -
src/game/shared/leffect_dispatch_data.cpp | 6 -
src/game/shared/leffect_dispatch_data.h | 7 -
src/game/shared/limovehelper.cpp | 7 -
src/game/shared/limovehelper.h | 11 -
src/game/shared/lin_buttons.cpp | 7 -
src/game/shared/lipredictionsystem.cpp | 7 -
src/game/shared/lmovedata.cpp | 7 -
src/game/shared/lmovedata.h | 12 -
src/game/shared/lparticle_system.cpp | 7 -
src/game/shared/lparticle_system.h | 7 -
src/game/shared/lrender.cpp | 8 +-
src/game/shared/lresources.h | 7 -
src/game/shared/lshareddefs.cpp | 7 -
src/game/shared/lshareddefs.h | 12 -
src/game/shared/lsrcinit.cpp | 5 +-
src/game/shared/ltakedamageinfo.cpp | 7 -
src/game/shared/ltakedamageinfo.h | 14 -
src/game/shared/luamanager.cpp | 6 -
src/game/shared/luamanager.h | 8 -
src/game/shared/luasrclib.h | 9 +-
src/game/shared/lusercmd.cpp | 7 -
src/game/shared/lusercmd.h | 14 -
src/game/shared/lutil_shared.cpp | 6 -
src/lib/public/libpng.lib | 2 +-
src/lib/public/lua54.lib | 2 +-
src/lib/public/luasocket.lib | 2 +-
src/lib/public/mathlib.lib | 2 +-
src/lib/public/raytrace.lib | 2 +-
src/lib/public/tier1.lib | 4 +-
src/lib/public/vgui_controls.lib | 2 +-
.../lisoundemittersystembase.cpp | 7 -
.../lisoundemittersystembase.h | 17 +-
src/public/engine/livdebugoverlay.cpp | 14 -
src/public/lColor.h | 7 -
src/public/lbspflags.cpp | 9 -
src/public/lcdll_int.cpp | 6 -
src/public/lcmodel.h | 17 -
src/public/lengine.cpp | 8 -
src/public/lfilesystem.cpp | 511 +++++++++++-------
src/public/lfilesystem.h | 13 -
src/public/lgametrace.cpp | 6 -
src/public/lgametrace.h | 14 -
src/public/lglobalvars_base.cpp | 6 -
src/public/licvar.cpp | 6 -
src/public/licvar.h | 6 -
src/public/lienginevgui.cpp | 9 -
src/public/linetchannelinfo.cpp | 12 -
src/public/linetchannelinfo.h | 29 +-
src/public/lnetworkstringtabledefs.cpp | 6 -
src/public/lnetworkstringtabledefs.h | 21 +-
src/public/lvphysics_interface.cpp | 7 -
src/public/lvphysics_interface.h | 58 +-
src/public/materialsystem/limaterial.cpp | 7 -
src/public/materialsystem/limaterial.h | 22 +-
src/public/mathlib/langle.cpp | 8 -
src/public/mathlib/langle.h | 20 +-
src/public/mathlib/lmathlib.cpp | 6 -
src/public/mathlib/lmathlib.h | 19 +-
src/public/mathlib/lvector.h | 18 +-
src/public/mathlib/lvmatrix.cpp | 22 -
src/public/mathlib/lvmatrix.h | 38 +-
src/public/steam/listeamfriends.cpp | 7 -
src/public/steam/listeamfriends.h | 21 +-
src/public/steam/lsteam_api.cpp | 6 -
src/public/tier0/ldbg.cpp | 8 -
src/public/tier1/LKeyValues.cpp | 7 -
src/public/tier1/LKeyValues.h | 25 +-
src/public/tier1/liconvar.cpp | 11 -
src/public/vgui/LIInput.cpp | 7 -
src/public/vgui/LIScheme.cpp | 7 -
src/public/vgui/LIScheme.h | 22 +-
src/public/vgui/LISurface.cpp | 11 +-
src/public/vgui/LVGUI.cpp | 7 -
src/public/vgui/LVGUI.h | 28 +-
src/public/vphysics/lperformance.cpp | 6 -
src/public/vphysics/lperformance.h | 19 +-
src/public/vstdlib/lrandom.cpp | 102 ++--
tools/docs-build-functions.js | 4 +
195 files changed, 2126 insertions(+), 1321 deletions(-)
create mode 100644 docs/classes/FileHandle/Read.md
create mode 100644 docs/classes/FileHandle/Size.md
create mode 100644 docs/classes/FileHandle/Write.md
create mode 100644 docs/classes/FileHandle/__eq.md
create mode 100644 docs/classes/FileHandle/__gc.md
create mode 100644 docs/classes/FileHandle/__len.md
create mode 100644 docs/classes/FileHandle/__tostring.md
create mode 100644 docs/libraries/Files/AddPackFile.md
create mode 100644 docs/libraries/Files/AddSearchPath.md
create mode 100644 docs/libraries/Files/BeginMapAccess.md
create mode 100644 docs/libraries/Files/CancelWaitForResources.md
create mode 100644 docs/libraries/Files/Close.md
create mode 100644 docs/libraries/Files/CreateDirectoryHierarchy.md
create mode 100644 docs/libraries/Files/DiscardPreloadData.md
create mode 100644 docs/libraries/Files/Disconnect.md
create mode 100644 docs/libraries/Files/EnableAllowListFileTracking.md
create mode 100644 docs/libraries/Files/EndMapAccess.md
create mode 100644 docs/libraries/Files/EndOfFile.md
create mode 100644 docs/libraries/Files/FileExists.md
create mode 100644 docs/libraries/Files/Find.md
create mode 100644 docs/libraries/Files/Flush.md
create mode 100644 docs/libraries/Files/GetDvdMode.md
create mode 100644 docs/libraries/Files/GetLocalCopy.md
create mode 100644 docs/libraries/Files/GetSearchPath.md
create mode 100644 docs/libraries/Files/GetWhitelistSpewFlags.md
create mode 100644 docs/libraries/Files/HintResourceNeed.md
create mode 100644 docs/libraries/Files/IsDirectory.md
create mode 100644 docs/libraries/Files/IsFileImmediatelyAvailable.md
create mode 100644 docs/libraries/Files/IsFileWritable.md
create mode 100644 docs/libraries/Files/IsOk.md
create mode 100644 docs/libraries/Files/IsSteam.md
create mode 100644 docs/libraries/Files/LoadCompiledKeyValues.md
create mode 100644 docs/libraries/Files/MarkAllCrcsUnverified.md
create mode 100644 docs/libraries/Files/MarkPathIdByRequestOnly.md
create mode 100644 docs/libraries/Files/MountSteamContent.md
create mode 100644 docs/libraries/Files/Open.md
create mode 100644 docs/libraries/Files/Precache.md
create mode 100644 docs/libraries/Files/PrintOpenedFiles.md
create mode 100644 docs/libraries/Files/PrintSearchPaths.md
create mode 100644 docs/libraries/Files/Read.md
create mode 100644 docs/libraries/Files/RemoveAllSearchPaths.md
create mode 100644 docs/libraries/Files/RemoveFile.md
create mode 100644 docs/libraries/Files/RemoveSearchPath.md
create mode 100644 docs/libraries/Files/RemoveSearchPaths.md
create mode 100644 docs/libraries/Files/RenameFile.md
create mode 100644 docs/libraries/Files/SetFileWritable.md
create mode 100644 docs/libraries/Files/SetWarningLevel.md
create mode 100644 docs/libraries/Files/SetWhitelistSpewFlags.md
create mode 100644 docs/libraries/Files/SetupPreloadData.md
create mode 100644 docs/libraries/Files/Shutdown.md
create mode 100644 docs/libraries/Files/Size.md
create mode 100644 docs/libraries/Files/UnzipFile.md
create mode 100644 docs/libraries/Files/WaitForResources.md
create mode 100644 docs/libraries/Files/Write.md
create mode 100644 docs/libraries/Randoms/RandomFloat.md
create mode 100644 docs/libraries/Randoms/RandomFloatExponential.md
create mode 100644 docs/libraries/Randoms/RandomInteger.md
create mode 100644 docs/libraries/Randoms/SetSeed.md
create mode 100644 docs/libraries/Renders/PopFilterMagnification.md
create mode 100644 docs/libraries/Renders/PopFilterMinification.md
create mode 100644 docs/libraries/Renders/PushFilterMagnification.md
create mode 100644 docs/libraries/Renders/PushFilterMinification.md
diff --git a/docs/classes/FileHandle/Read.md b/docs/classes/FileHandle/Read.md
new file mode 100644
index 0000000000..e7835d7cf6
--- /dev/null
+++ b/docs/classes/FileHandle/Read.md
@@ -0,0 +1,29 @@
+---
+template: lua-class-function.html
+title: Read
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: FileHandle
+ function: Read
+ realm: shared
+ description: "Read from a file."
+
+ arguments:
+ - name: "size"
+ type: number
+ default: "GET_FILE_SIZE"
+ returns:
+ - type: integer
+ description: "The number of bytes read."
+ - type: string
+ description: "The data read."
+---
+
+
+FileHandle:Read – Read from a file.
+
diff --git a/docs/classes/FileHandle/Size.md b/docs/classes/FileHandle/Size.md
new file mode 100644
index 0000000000..d952d941b5
--- /dev/null
+++ b/docs/classes/FileHandle/Size.md
@@ -0,0 +1,24 @@
+---
+template: lua-class-function.html
+title: Size
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: FileHandle
+ function: Size
+ realm: shared
+ description: "Get the size of a file."
+
+
+ returns:
+ - type: integer
+ description: "The size of the file."
+---
+
+
+FileHandle:Size – Get the size of a file.
+
diff --git a/docs/classes/FileHandle/Write.md b/docs/classes/FileHandle/Write.md
new file mode 100644
index 0000000000..c8ac18c2a4
--- /dev/null
+++ b/docs/classes/FileHandle/Write.md
@@ -0,0 +1,26 @@
+---
+template: lua-class-function.html
+title: Write
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: FileHandle
+ function: Write
+ realm: shared
+ description: "Write to a file."
+
+ arguments:
+ - name: "file"
+ type: FileHandle
+ returns:
+ - type: integer
+ description: "The number of bytes written."
+---
+
+
+FileHandle:Write – Write to a file.
+
diff --git a/docs/classes/FileHandle/__eq.md b/docs/classes/FileHandle/__eq.md
new file mode 100644
index 0000000000..b4a78165ff
--- /dev/null
+++ b/docs/classes/FileHandle/__eq.md
@@ -0,0 +1,26 @@
+---
+template: lua-class-function.html
+title: __eq
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: FileHandle
+ function: __eq
+ realm: shared
+ description: "Check if two file handles are equal."
+
+ arguments:
+ - name: "file2"
+ type: FileHandle
+ returns:
+ - type: boolean
+ description: "true if the file handles are equal, false otherwise."
+---
+
+
+FileHandle:__eq – Check if two file handles are equal.
+
diff --git a/docs/classes/FileHandle/__gc.md b/docs/classes/FileHandle/__gc.md
new file mode 100644
index 0000000000..848ad0b0d8
--- /dev/null
+++ b/docs/classes/FileHandle/__gc.md
@@ -0,0 +1,23 @@
+---
+template: lua-class-function.html
+title: __gc
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: FileHandle
+ function: __gc
+ realm: shared
+ description: "Close a file."
+
+
+ returns:
+
+---
+
+
+FileHandle:__gc – Close a file.
+
diff --git a/docs/classes/FileHandle/__len.md b/docs/classes/FileHandle/__len.md
new file mode 100644
index 0000000000..a91e51e9b1
--- /dev/null
+++ b/docs/classes/FileHandle/__len.md
@@ -0,0 +1,24 @@
+---
+template: lua-class-function.html
+title: __len
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: FileHandle
+ function: __len
+ realm: shared
+ description: "Get the length of a file."
+
+
+ returns:
+ - type: integer
+ description: "The length of the file or nil if the file handle is invalid."
+---
+
+
+FileHandle:__len – Get the length of a file.
+
diff --git a/docs/classes/FileHandle/__tostring.md b/docs/classes/FileHandle/__tostring.md
new file mode 100644
index 0000000000..789adba122
--- /dev/null
+++ b/docs/classes/FileHandle/__tostring.md
@@ -0,0 +1,24 @@
+---
+template: lua-class-function.html
+title: __tostring
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: FileHandle
+ function: __tostring
+ realm: shared
+ description: "Get the string representation of a file handle."
+
+
+ returns:
+ - type: string
+ description: "The string representation of the file handle."
+---
+
+
+FileHandle:__tostring – Get the string representation of a file handle.
+
diff --git a/docs/general/conventions.md b/docs/general/conventions.md
index e5f51d8e15..afbfb5fb6b 100644
--- a/docs/general/conventions.md
+++ b/docs/general/conventions.md
@@ -54,7 +54,7 @@ See the `.editorconfig` file for the code style.
- `sv_` for server files
- Variables and functions are not abbreviated, with the exception of these
- abbreviations:
+ common abbreviations:
- `Hud`
- `Ui`
diff --git a/docs/libraries/Files/AddPackFile.md b/docs/libraries/Files/AddPackFile.md
new file mode 100644
index 0000000000..f805206838
--- /dev/null
+++ b/docs/libraries/Files/AddPackFile.md
@@ -0,0 +1,28 @@
+---
+template: lua-library-function.html
+title: AddPackFile
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: AddPackFile
+ realm: shared
+ description: "Add a pack file to the search path."
+
+ arguments:
+ - name: "path"
+ type: string
+ - name: "pathId"
+ type: string
+ returns:
+ - type: boolean
+ description: "true if the pack file was added, false otherwise."
+---
+
+
+Files.AddPackFile – Add a pack file to the search path.
+
diff --git a/docs/libraries/Files/AddSearchPath.md b/docs/libraries/Files/AddSearchPath.md
new file mode 100644
index 0000000000..7306999cd2
--- /dev/null
+++ b/docs/libraries/Files/AddSearchPath.md
@@ -0,0 +1,30 @@
+---
+template: lua-library-function.html
+title: AddSearchPath
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: AddSearchPath
+ realm: shared
+ description: "Add a search path to the filesystem."
+
+ arguments:
+ - name: "path"
+ type: string
+ - name: "pathId"
+ type: string
+ - name: "addType"
+ type: number
+ default: "PATH_ADD_TO_TAIL"
+ returns:
+
+---
+
+
+Files.AddSearchPath – Add a search path to the filesystem.
+
diff --git a/docs/libraries/Files/BeginMapAccess.md b/docs/libraries/Files/BeginMapAccess.md
new file mode 100644
index 0000000000..af1d883e5a
--- /dev/null
+++ b/docs/libraries/Files/BeginMapAccess.md
@@ -0,0 +1,23 @@
+---
+template: lua-library-function.html
+title: BeginMapAccess
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: BeginMapAccess
+ realm: shared
+ description: "Begin map access."
+
+
+ returns:
+
+---
+
+
+Files.BeginMapAccess – Begin map access.
+
diff --git a/docs/libraries/Files/CancelWaitForResources.md b/docs/libraries/Files/CancelWaitForResources.md
new file mode 100644
index 0000000000..86af889dd3
--- /dev/null
+++ b/docs/libraries/Files/CancelWaitForResources.md
@@ -0,0 +1,25 @@
+---
+template: lua-library-function.html
+title: CancelWaitForResources
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: CancelWaitForResources
+ realm: shared
+ description: "Cancel waiting for resources."
+
+ arguments:
+ - name: "id"
+ type: number
+ returns:
+
+---
+
+
+Files.CancelWaitForResources – Cancel waiting for resources.
+
diff --git a/docs/libraries/Files/Close.md b/docs/libraries/Files/Close.md
new file mode 100644
index 0000000000..a398c4c846
--- /dev/null
+++ b/docs/libraries/Files/Close.md
@@ -0,0 +1,25 @@
+---
+template: lua-library-function.html
+title: Close
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: Close
+ realm: shared
+ description: "Close a file."
+
+ arguments:
+ - name: "file"
+ type: FileHandle
+ returns:
+
+---
+
+
+Files.Close – Close a file.
+
diff --git a/docs/libraries/Files/CreateDirectoryHierarchy.md b/docs/libraries/Files/CreateDirectoryHierarchy.md
new file mode 100644
index 0000000000..a23793592e
--- /dev/null
+++ b/docs/libraries/Files/CreateDirectoryHierarchy.md
@@ -0,0 +1,28 @@
+---
+template: lua-library-function.html
+title: CreateDirectoryHierarchy
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: CreateDirectoryHierarchy
+ realm: shared
+ description: "Create a directory hierarchy."
+
+ arguments:
+ - name: "path"
+ type: string
+ - name: "pathId"
+ type: string
+ default: "0"
+ returns:
+
+---
+
+
+Files.CreateDirectoryHierarchy – Create a directory hierarchy.
+
diff --git a/docs/libraries/Files/DiscardPreloadData.md b/docs/libraries/Files/DiscardPreloadData.md
new file mode 100644
index 0000000000..7ca12f1eae
--- /dev/null
+++ b/docs/libraries/Files/DiscardPreloadData.md
@@ -0,0 +1,23 @@
+---
+template: lua-library-function.html
+title: DiscardPreloadData
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: DiscardPreloadData
+ realm: shared
+ description: "Discard preload data."
+
+
+ returns:
+
+---
+
+
+Files.DiscardPreloadData – Discard preload data.
+
diff --git a/docs/libraries/Files/Disconnect.md b/docs/libraries/Files/Disconnect.md
new file mode 100644
index 0000000000..f0cfd015fc
--- /dev/null
+++ b/docs/libraries/Files/Disconnect.md
@@ -0,0 +1,23 @@
+---
+template: lua-library-function.html
+title: Disconnect
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: Disconnect
+ realm: shared
+ description: "Disconnect."
+
+
+ returns:
+
+---
+
+
+Files.Disconnect – Disconnect.
+
diff --git a/docs/libraries/Files/EnableAllowListFileTracking.md b/docs/libraries/Files/EnableAllowListFileTracking.md
new file mode 100644
index 0000000000..eddcef812d
--- /dev/null
+++ b/docs/libraries/Files/EnableAllowListFileTracking.md
@@ -0,0 +1,29 @@
+---
+template: lua-library-function.html
+title: EnableAllowListFileTracking
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: EnableAllowListFileTracking
+ realm: shared
+ description: "Enable allowlist file tracking."
+
+ arguments:
+ - name: "enable"
+ type: boolean
+ - name: "cacheAllVPKHashes"
+ type: boolean
+ - name: "recalculateAndCheckHashes"
+ type: boolean
+ returns:
+
+---
+
+
+Files.EnableAllowListFileTracking – Enable allowlist file tracking.
+
diff --git a/docs/libraries/Files/EndMapAccess.md b/docs/libraries/Files/EndMapAccess.md
new file mode 100644
index 0000000000..b836c0567b
--- /dev/null
+++ b/docs/libraries/Files/EndMapAccess.md
@@ -0,0 +1,23 @@
+---
+template: lua-library-function.html
+title: EndMapAccess
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: EndMapAccess
+ realm: shared
+ description: "End map access."
+
+
+ returns:
+
+---
+
+
+Files.EndMapAccess – End map access.
+
diff --git a/docs/libraries/Files/EndOfFile.md b/docs/libraries/Files/EndOfFile.md
new file mode 100644
index 0000000000..9ec418d869
--- /dev/null
+++ b/docs/libraries/Files/EndOfFile.md
@@ -0,0 +1,26 @@
+---
+template: lua-library-function.html
+title: EndOfFile
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: EndOfFile
+ realm: shared
+ description: "Check if the end of a file has been reached."
+
+ arguments:
+ - name: "file"
+ type: FileHandle
+ returns:
+ - type: boolean
+ description: "true if the end of the file has been reached, false otherwise."
+---
+
+
+Files.EndOfFile – Check if the end of a file has been reached.
+
diff --git a/docs/libraries/Files/FileExists.md b/docs/libraries/Files/FileExists.md
new file mode 100644
index 0000000000..d81dc4e4b7
--- /dev/null
+++ b/docs/libraries/Files/FileExists.md
@@ -0,0 +1,29 @@
+---
+template: lua-library-function.html
+title: FileExists
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: FileExists
+ realm: shared
+ description: "Check if a file exists."
+
+ arguments:
+ - name: "path"
+ type: string
+ - name: "pathId"
+ type: string
+ default: "0"
+ returns:
+ - type: boolean
+ description: "true if the file exists, false otherwise."
+---
+
+
+Files.FileExists – Check if a file exists.
+
diff --git a/docs/libraries/Files/Find.md b/docs/libraries/Files/Find.md
new file mode 100644
index 0000000000..c9a0b37f63
--- /dev/null
+++ b/docs/libraries/Files/Find.md
@@ -0,0 +1,29 @@
+---
+template: lua-library-function.html
+title: Find
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: Find
+ realm: shared
+ description: "Find files."
+
+ arguments:
+ - name: "path"
+ type: string
+ - name: "pathId"
+ type: string
+ default: "\"GAME\""
+ returns:
+ - type: table
+ description: "The files and directories."
+---
+
+
+Files.Find – Find files.
+
diff --git a/docs/libraries/Files/Flush.md b/docs/libraries/Files/Flush.md
new file mode 100644
index 0000000000..714a252d3b
--- /dev/null
+++ b/docs/libraries/Files/Flush.md
@@ -0,0 +1,25 @@
+---
+template: lua-library-function.html
+title: Flush
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: Flush
+ realm: shared
+ description: "Flush a file."
+
+ arguments:
+ - name: "file"
+ type: FileHandle
+ returns:
+
+---
+
+
+Files.Flush – Flush a file.
+
diff --git a/docs/libraries/Files/GetDvdMode.md b/docs/libraries/Files/GetDvdMode.md
new file mode 100644
index 0000000000..7fa5f3dc37
--- /dev/null
+++ b/docs/libraries/Files/GetDvdMode.md
@@ -0,0 +1,24 @@
+---
+template: lua-library-function.html
+title: GetDvdMode
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: GetDvdMode
+ realm: shared
+ description: "Get the DVD mode."
+
+
+ returns:
+ - type: integer
+ description: "The DVD mode."
+---
+
+
+Files.GetDvdMode – Get the DVD mode.
+
diff --git a/docs/libraries/Files/GetLocalCopy.md b/docs/libraries/Files/GetLocalCopy.md
new file mode 100644
index 0000000000..e045895b63
--- /dev/null
+++ b/docs/libraries/Files/GetLocalCopy.md
@@ -0,0 +1,25 @@
+---
+template: lua-library-function.html
+title: GetLocalCopy
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: GetLocalCopy
+ realm: shared
+ description: "Get a local copy of a file."
+
+ arguments:
+ - name: "path"
+ type: string
+ returns:
+
+---
+
+
+Files.GetLocalCopy – Get a local copy of a file.
+
diff --git a/docs/libraries/Files/GetSearchPath.md b/docs/libraries/Files/GetSearchPath.md
new file mode 100644
index 0000000000..81d092881f
--- /dev/null
+++ b/docs/libraries/Files/GetSearchPath.md
@@ -0,0 +1,26 @@
+---
+template: lua-library-function.html
+title: GetSearchPath
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: GetSearchPath
+ realm: shared
+ description: "Get the search path."
+
+ arguments:
+ - name: "path"
+ type: string
+ returns:
+ - type: string
+ description: "The search path."
+---
+
+
+Files.GetSearchPath – Get the search path.
+
diff --git a/docs/libraries/Files/GetWhitelistSpewFlags.md b/docs/libraries/Files/GetWhitelistSpewFlags.md
new file mode 100644
index 0000000000..49df7bb6a0
--- /dev/null
+++ b/docs/libraries/Files/GetWhitelistSpewFlags.md
@@ -0,0 +1,24 @@
+---
+template: lua-library-function.html
+title: GetWhitelistSpewFlags
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: GetWhitelistSpewFlags
+ realm: shared
+ description: "Get the whitelist spew flags."
+
+
+ returns:
+ - type: integer
+ description: "The whitelist spew flags."
+---
+
+
+Files.GetWhitelistSpewFlags – Get the whitelist spew flags.
+
diff --git a/docs/libraries/Files/HintResourceNeed.md b/docs/libraries/Files/HintResourceNeed.md
new file mode 100644
index 0000000000..816e922954
--- /dev/null
+++ b/docs/libraries/Files/HintResourceNeed.md
@@ -0,0 +1,28 @@
+---
+template: lua-library-function.html
+title: HintResourceNeed
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: HintResourceNeed
+ realm: shared
+ description: "Hint that a resource is needed."
+
+ arguments:
+ - name: "filename"
+ type: string
+ - name: "characterCount"
+ type: number
+ returns:
+ - type: integer
+ description: "The hint resource need."
+---
+
+
+Files.HintResourceNeed – Hint that a resource is needed.
+
diff --git a/docs/libraries/Files/IsDirectory.md b/docs/libraries/Files/IsDirectory.md
new file mode 100644
index 0000000000..41c6d4517e
--- /dev/null
+++ b/docs/libraries/Files/IsDirectory.md
@@ -0,0 +1,29 @@
+---
+template: lua-library-function.html
+title: IsDirectory
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: IsDirectory
+ realm: shared
+ description: "Check if a path is a directory."
+
+ arguments:
+ - name: "path"
+ type: string
+ - name: "pathId"
+ type: string
+ default: "0"
+ returns:
+ - type: boolean
+ description: "true if the path is a directory, false otherwise."
+---
+
+
+Files.IsDirectory – Check if a path is a directory.
+
diff --git a/docs/libraries/Files/IsFileImmediatelyAvailable.md b/docs/libraries/Files/IsFileImmediatelyAvailable.md
new file mode 100644
index 0000000000..a6e3b11115
--- /dev/null
+++ b/docs/libraries/Files/IsFileImmediatelyAvailable.md
@@ -0,0 +1,26 @@
+---
+template: lua-library-function.html
+title: IsFileImmediatelyAvailable
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: IsFileImmediatelyAvailable
+ realm: shared
+ description: "Check if a file is immediately available."
+
+ arguments:
+ - name: "path"
+ type: string
+ returns:
+ - type: boolean
+ description: "true if the file is immediately available, false otherwise."
+---
+
+
+Files.IsFileImmediatelyAvailable – Check if a file is immediately available.
+
diff --git a/docs/libraries/Files/IsFileWritable.md b/docs/libraries/Files/IsFileWritable.md
new file mode 100644
index 0000000000..e148eca3ff
--- /dev/null
+++ b/docs/libraries/Files/IsFileWritable.md
@@ -0,0 +1,29 @@
+---
+template: lua-library-function.html
+title: IsFileWritable
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: IsFileWritable
+ realm: shared
+ description: "Check if a file is writable."
+
+ arguments:
+ - name: "path"
+ type: string
+ - name: "pathId"
+ type: string
+ default: "0"
+ returns:
+ - type: boolean
+ description: "true if the file is writable, false otherwise."
+---
+
+
+Files.IsFileWritable – Check if a file is writable.
+
diff --git a/docs/libraries/Files/IsOk.md b/docs/libraries/Files/IsOk.md
new file mode 100644
index 0000000000..c7edebadb1
--- /dev/null
+++ b/docs/libraries/Files/IsOk.md
@@ -0,0 +1,26 @@
+---
+template: lua-library-function.html
+title: IsOk
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: IsOk
+ realm: shared
+ description: "Check if a file handle is valid."
+
+ arguments:
+ - name: "file"
+ type: FileHandle
+ returns:
+ - type: boolean
+ description: "true if the file handle is valid, false otherwise."
+---
+
+
+Files.IsOk – Check if a file handle is valid.
+
diff --git a/docs/libraries/Files/IsSteam.md b/docs/libraries/Files/IsSteam.md
new file mode 100644
index 0000000000..5aa404e626
--- /dev/null
+++ b/docs/libraries/Files/IsSteam.md
@@ -0,0 +1,24 @@
+---
+template: lua-library-function.html
+title: IsSteam
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: IsSteam
+ realm: shared
+ description: "Check if Steam is running."
+
+
+ returns:
+ - type: boolean
+ description: "true if Steam is running, false otherwise."
+---
+
+
+Files.IsSteam – Check if Steam is running.
+
diff --git a/docs/libraries/Files/LoadCompiledKeyValues.md b/docs/libraries/Files/LoadCompiledKeyValues.md
new file mode 100644
index 0000000000..e3b0d6b80d
--- /dev/null
+++ b/docs/libraries/Files/LoadCompiledKeyValues.md
@@ -0,0 +1,25 @@
+---
+template: lua-library-function.html
+title: LoadCompiledKeyValues
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: LoadCompiledKeyValues
+ realm: shared
+ description: "Load compiled key values."
+
+ arguments:
+ - name: "preloadType"
+ type: number
+ returns:
+
+---
+
+
+Files.LoadCompiledKeyValues – Load compiled key values.
+
diff --git a/docs/libraries/Files/MarkAllCrcsUnverified.md b/docs/libraries/Files/MarkAllCrcsUnverified.md
new file mode 100644
index 0000000000..616333eca7
--- /dev/null
+++ b/docs/libraries/Files/MarkAllCrcsUnverified.md
@@ -0,0 +1,23 @@
+---
+template: lua-library-function.html
+title: MarkAllCrcsUnverified
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: MarkAllCrcsUnverified
+ realm: shared
+ description: "Mark all CRCs as unverified."
+
+
+ returns:
+
+---
+
+
+Files.MarkAllCrcsUnverified – Mark all CRCs as unverified.
+
diff --git a/docs/libraries/Files/MarkPathIdByRequestOnly.md b/docs/libraries/Files/MarkPathIdByRequestOnly.md
new file mode 100644
index 0000000000..182f8d1e0c
--- /dev/null
+++ b/docs/libraries/Files/MarkPathIdByRequestOnly.md
@@ -0,0 +1,27 @@
+---
+template: lua-library-function.html
+title: MarkPathIdByRequestOnly
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: MarkPathIdByRequestOnly
+ realm: shared
+ description: "Mark a path ID as request only."
+
+ arguments:
+ - name: "pathId"
+ type: string
+ - name: "requestOnly"
+ type: boolean
+ returns:
+
+---
+
+
+Files.MarkPathIdByRequestOnly – Mark a path ID as request only.
+
diff --git a/docs/libraries/Files/MountSteamContent.md b/docs/libraries/Files/MountSteamContent.md
new file mode 100644
index 0000000000..d94eab7eba
--- /dev/null
+++ b/docs/libraries/Files/MountSteamContent.md
@@ -0,0 +1,27 @@
+---
+template: lua-library-function.html
+title: MountSteamContent
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: MountSteamContent
+ realm: shared
+ description: "Mount Steam content."
+
+ arguments:
+ - name: "appId"
+ type: number
+ default: "-1"
+ returns:
+ - type: integer
+ description: "The mount Steam content."
+---
+
+
+Files.MountSteamContent – Mount Steam content.
+
diff --git a/docs/libraries/Files/Open.md b/docs/libraries/Files/Open.md
new file mode 100644
index 0000000000..df728a83e1
--- /dev/null
+++ b/docs/libraries/Files/Open.md
@@ -0,0 +1,31 @@
+---
+template: lua-library-function.html
+title: Open
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: Open
+ realm: shared
+ description: "Open a file."
+
+ arguments:
+ - name: "filePath"
+ type: string
+ - name: "readMode"
+ type: string
+ - name: "pathId"
+ type: string
+ default: "0"
+ returns:
+ - type: FileHandle
+ description: "The file handle."
+---
+
+
+Files.Open – Open a file.
+
diff --git a/docs/libraries/Files/Precache.md b/docs/libraries/Files/Precache.md
new file mode 100644
index 0000000000..0be03a348b
--- /dev/null
+++ b/docs/libraries/Files/Precache.md
@@ -0,0 +1,29 @@
+---
+template: lua-library-function.html
+title: Precache
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: Precache
+ realm: shared
+ description: "Precache a file."
+
+ arguments:
+ - name: "path"
+ type: string
+ - name: "pathId"
+ type: string
+ default: "0"
+ returns:
+ - type: boolean
+ description: "true if the file was precached, false otherwise."
+---
+
+
+Files.Precache – Precache a file.
+
diff --git a/docs/libraries/Files/PrintOpenedFiles.md b/docs/libraries/Files/PrintOpenedFiles.md
new file mode 100644
index 0000000000..e736f3325b
--- /dev/null
+++ b/docs/libraries/Files/PrintOpenedFiles.md
@@ -0,0 +1,23 @@
+---
+template: lua-library-function.html
+title: PrintOpenedFiles
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: PrintOpenedFiles
+ realm: shared
+ description: "Print opened files."
+
+
+ returns:
+
+---
+
+
+Files.PrintOpenedFiles – Print opened files.
+
diff --git a/docs/libraries/Files/PrintSearchPaths.md b/docs/libraries/Files/PrintSearchPaths.md
new file mode 100644
index 0000000000..486266c7d6
--- /dev/null
+++ b/docs/libraries/Files/PrintSearchPaths.md
@@ -0,0 +1,23 @@
+---
+template: lua-library-function.html
+title: PrintSearchPaths
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: PrintSearchPaths
+ realm: shared
+ description: "Print search paths."
+
+
+ returns:
+
+---
+
+
+Files.PrintSearchPaths – Print search paths.
+
diff --git a/docs/libraries/Files/Read.md b/docs/libraries/Files/Read.md
new file mode 100644
index 0000000000..ee5c702e57
--- /dev/null
+++ b/docs/libraries/Files/Read.md
@@ -0,0 +1,30 @@
+---
+template: lua-library-function.html
+title: Read
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: Read
+ realm: shared
+ description: "Read from a file."
+
+ arguments:
+ - name: "file"
+ type: FileHandle
+ - name: "size"
+ type: number
+ returns:
+ - type: integer
+ description: "The number of bytes read."
+ - type: string
+ description: "The data read."
+---
+
+
+Files.Read – Read from a file.
+
diff --git a/docs/libraries/Files/RemoveAllSearchPaths.md b/docs/libraries/Files/RemoveAllSearchPaths.md
new file mode 100644
index 0000000000..1d6fce3f2d
--- /dev/null
+++ b/docs/libraries/Files/RemoveAllSearchPaths.md
@@ -0,0 +1,23 @@
+---
+template: lua-library-function.html
+title: RemoveAllSearchPaths
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: RemoveAllSearchPaths
+ realm: shared
+ description: "Remove all search paths."
+
+
+ returns:
+
+---
+
+
+Files.RemoveAllSearchPaths – Remove all search paths.
+
diff --git a/docs/libraries/Files/RemoveFile.md b/docs/libraries/Files/RemoveFile.md
new file mode 100644
index 0000000000..4b8898f40b
--- /dev/null
+++ b/docs/libraries/Files/RemoveFile.md
@@ -0,0 +1,28 @@
+---
+template: lua-library-function.html
+title: RemoveFile
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: RemoveFile
+ realm: shared
+ description: "Remove a file."
+
+ arguments:
+ - name: "path"
+ type: string
+ - name: "pathId"
+ type: string
+ default: "0"
+ returns:
+
+---
+
+
+Files.RemoveFile – Remove a file.
+
diff --git a/docs/libraries/Files/RemoveSearchPath.md b/docs/libraries/Files/RemoveSearchPath.md
new file mode 100644
index 0000000000..26bc126d08
--- /dev/null
+++ b/docs/libraries/Files/RemoveSearchPath.md
@@ -0,0 +1,29 @@
+---
+template: lua-library-function.html
+title: RemoveSearchPath
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: RemoveSearchPath
+ realm: shared
+ description: "Remove a search path."
+
+ arguments:
+ - name: "path"
+ type: string
+ - name: "pathId"
+ type: string
+ default: "0"
+ returns:
+ - type: boolean
+ description: "true if the search path was removed, false otherwise."
+---
+
+
+Files.RemoveSearchPath – Remove a search path.
+
diff --git a/docs/libraries/Files/RemoveSearchPaths.md b/docs/libraries/Files/RemoveSearchPaths.md
new file mode 100644
index 0000000000..ffc70440ac
--- /dev/null
+++ b/docs/libraries/Files/RemoveSearchPaths.md
@@ -0,0 +1,25 @@
+---
+template: lua-library-function.html
+title: RemoveSearchPaths
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: RemoveSearchPaths
+ realm: shared
+ description: "Remove search paths."
+
+ arguments:
+ - name: "path"
+ type: string
+ returns:
+
+---
+
+
+Files.RemoveSearchPaths – Remove search paths.
+
diff --git a/docs/libraries/Files/RenameFile.md b/docs/libraries/Files/RenameFile.md
new file mode 100644
index 0000000000..c9610f590a
--- /dev/null
+++ b/docs/libraries/Files/RenameFile.md
@@ -0,0 +1,31 @@
+---
+template: lua-library-function.html
+title: RenameFile
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: RenameFile
+ realm: shared
+ description: "Rename a file."
+
+ arguments:
+ - name: "oldPath"
+ type: string
+ - name: "newPath"
+ type: string
+ - name: "pathId"
+ type: string
+ default: "0"
+ returns:
+ - type: boolean
+ description: "true if the file was renamed, false otherwise."
+---
+
+
+Files.RenameFile – Rename a file.
+
diff --git a/docs/libraries/Files/SetFileWritable.md b/docs/libraries/Files/SetFileWritable.md
new file mode 100644
index 0000000000..982f1ef27b
--- /dev/null
+++ b/docs/libraries/Files/SetFileWritable.md
@@ -0,0 +1,31 @@
+---
+template: lua-library-function.html
+title: SetFileWritable
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: SetFileWritable
+ realm: shared
+ description: "Set a file as writable."
+
+ arguments:
+ - name: "path"
+ type: string
+ - name: "writable"
+ type: boolean
+ - name: "pathId"
+ type: string
+ default: "0"
+ returns:
+ - type: boolean
+ description: "true if the file was set as writable, false otherwise."
+---
+
+
+Files.SetFileWritable – Set a file as writable.
+
diff --git a/docs/libraries/Files/SetWarningLevel.md b/docs/libraries/Files/SetWarningLevel.md
new file mode 100644
index 0000000000..49471b0ebf
--- /dev/null
+++ b/docs/libraries/Files/SetWarningLevel.md
@@ -0,0 +1,25 @@
+---
+template: lua-library-function.html
+title: SetWarningLevel
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: SetWarningLevel
+ realm: shared
+ description: "Set the warning level."
+
+ arguments:
+ - name: "level"
+ type: number
+ returns:
+
+---
+
+
+Files.SetWarningLevel – Set the warning level.
+
diff --git a/docs/libraries/Files/SetWhitelistSpewFlags.md b/docs/libraries/Files/SetWhitelistSpewFlags.md
new file mode 100644
index 0000000000..16d322ac50
--- /dev/null
+++ b/docs/libraries/Files/SetWhitelistSpewFlags.md
@@ -0,0 +1,25 @@
+---
+template: lua-library-function.html
+title: SetWhitelistSpewFlags
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: SetWhitelistSpewFlags
+ realm: shared
+ description: "Set the whitelist spew flags."
+
+ arguments:
+ - name: "flags"
+ type: number
+ returns:
+
+---
+
+
+Files.SetWhitelistSpewFlags – Set the whitelist spew flags.
+
diff --git a/docs/libraries/Files/SetupPreloadData.md b/docs/libraries/Files/SetupPreloadData.md
new file mode 100644
index 0000000000..1b96104257
--- /dev/null
+++ b/docs/libraries/Files/SetupPreloadData.md
@@ -0,0 +1,23 @@
+---
+template: lua-library-function.html
+title: SetupPreloadData
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: SetupPreloadData
+ realm: shared
+ description: "Setup preload data."
+
+
+ returns:
+
+---
+
+
+Files.SetupPreloadData – Setup preload data.
+
diff --git a/docs/libraries/Files/Shutdown.md b/docs/libraries/Files/Shutdown.md
new file mode 100644
index 0000000000..7deef1de0c
--- /dev/null
+++ b/docs/libraries/Files/Shutdown.md
@@ -0,0 +1,23 @@
+---
+template: lua-library-function.html
+title: Shutdown
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: Shutdown
+ realm: shared
+ description: "Shutdown the filesystem."
+
+
+ returns:
+
+---
+
+
+Files.Shutdown – Shutdown the filesystem.
+
diff --git a/docs/libraries/Files/Size.md b/docs/libraries/Files/Size.md
new file mode 100644
index 0000000000..3c42a625ae
--- /dev/null
+++ b/docs/libraries/Files/Size.md
@@ -0,0 +1,30 @@
+---
+template: lua-library-function.html
+title: Size
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: Size
+ realm: shared
+ description: "Get the size of a file."
+
+ argumentSets:
+ - arguments:
+ - name: "path"
+ type: string
+ - arguments:
+ - name: "file"
+ type: FileHandle
+ returns:
+ - type: integer
+ description: "The size of the file."
+---
+
+
+Files.Size – Get the size of a file.
+
diff --git a/docs/libraries/Files/UnzipFile.md b/docs/libraries/Files/UnzipFile.md
new file mode 100644
index 0000000000..eba31a391f
--- /dev/null
+++ b/docs/libraries/Files/UnzipFile.md
@@ -0,0 +1,30 @@
+---
+template: lua-library-function.html
+title: UnzipFile
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: UnzipFile
+ realm: shared
+ description: "Unzip a file."
+
+ arguments:
+ - name: "source"
+ type: string
+ - name: "destination"
+ type: string
+ - name: "pathId"
+ type: string
+ returns:
+ - type: boolean
+ description: "true if the file was unzipped, false otherwise."
+---
+
+
+Files.UnzipFile – Unzip a file.
+
diff --git a/docs/libraries/Files/WaitForResources.md b/docs/libraries/Files/WaitForResources.md
new file mode 100644
index 0000000000..8e4994fe21
--- /dev/null
+++ b/docs/libraries/Files/WaitForResources.md
@@ -0,0 +1,26 @@
+---
+template: lua-library-function.html
+title: WaitForResources
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: WaitForResources
+ realm: shared
+ description: "Wait for resources."
+
+ arguments:
+ - name: "path"
+ type: string
+ returns:
+ - type: integer
+ description: "The wait for resources."
+---
+
+
+Files.WaitForResources – Wait for resources.
+
diff --git a/docs/libraries/Files/Write.md b/docs/libraries/Files/Write.md
new file mode 100644
index 0000000000..45bbf7cb75
--- /dev/null
+++ b/docs/libraries/Files/Write.md
@@ -0,0 +1,26 @@
+---
+template: lua-library-function.html
+title: Write
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Files
+ function: Write
+ realm: shared
+ description: "Write to a file."
+
+ arguments:
+ - name: "file"
+ type: FileHandle
+ returns:
+ - type: integer
+ description: "The number of bytes written."
+---
+
+
+Files.Write – Write to a file.
+
diff --git a/docs/libraries/Randoms/RandomFloat.md b/docs/libraries/Randoms/RandomFloat.md
new file mode 100644
index 0000000000..ff21e16909
--- /dev/null
+++ b/docs/libraries/Randoms/RandomFloat.md
@@ -0,0 +1,30 @@
+---
+template: lua-library-function.html
+title: RandomFloat
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Randoms
+ function: RandomFloat
+ realm: shared
+ description: "Generate a random float."
+
+ arguments:
+ - name: "min"
+ type: number
+ default: "0.0f"
+ - name: "max"
+ type: number
+ default: "0.0f"
+ returns:
+ - type: number
+ description: "The generated random float."
+---
+
+
+Randoms.RandomFloat – Generate a random float.
+
diff --git a/docs/libraries/Randoms/RandomFloatExponential.md b/docs/libraries/Randoms/RandomFloatExponential.md
new file mode 100644
index 0000000000..a4442a261b
--- /dev/null
+++ b/docs/libraries/Randoms/RandomFloatExponential.md
@@ -0,0 +1,33 @@
+---
+template: lua-library-function.html
+title: RandomFloatExponential
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Randoms
+ function: RandomFloatExponential
+ realm: shared
+ description: "Generate a random float with an exponential distribution."
+
+ arguments:
+ - name: "min"
+ type: number
+ default: "0.0f"
+ - name: "max"
+ type: number
+ default: "0.0f"
+ - name: "exponent"
+ type: number
+ default: "1.0f"
+ returns:
+ - type: number
+ description: "The generated random float."
+---
+
+
+Randoms.RandomFloatExponential – Generate a random float with an exponential distribution.
+
diff --git a/docs/libraries/Randoms/RandomInteger.md b/docs/libraries/Randoms/RandomInteger.md
new file mode 100644
index 0000000000..022efcdc6e
--- /dev/null
+++ b/docs/libraries/Randoms/RandomInteger.md
@@ -0,0 +1,28 @@
+---
+template: lua-library-function.html
+title: RandomInteger
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Randoms
+ function: RandomInteger
+ realm: shared
+ description: "Generate a random integer."
+
+ arguments:
+ - name: "min"
+ type: number
+ - name: "max"
+ type: number
+ returns:
+ - type: number
+ description: "The generated random integer."
+---
+
+
+Randoms.RandomInteger – Generate a random integer.
+
diff --git a/docs/libraries/Randoms/SetSeed.md b/docs/libraries/Randoms/SetSeed.md
new file mode 100644
index 0000000000..22ff471e6d
--- /dev/null
+++ b/docs/libraries/Randoms/SetSeed.md
@@ -0,0 +1,25 @@
+---
+template: lua-library-function.html
+title: SetSeed
+icon: lua-shared
+tags:
+ - lua
+ - shared
+ - needs-verification
+ - needs-example
+lua:
+ library: Randoms
+ function: SetSeed
+ realm: shared
+ description: "Set the seed for the random number generator."
+
+ arguments:
+ - name: "seed"
+ type: number
+ returns:
+
+---
+
+
+Randoms.SetSeed – Set the seed for the random number generator.
+
diff --git a/docs/libraries/Renders/PopFilterMagnification.md b/docs/libraries/Renders/PopFilterMagnification.md
new file mode 100644
index 0000000000..7173428e19
--- /dev/null
+++ b/docs/libraries/Renders/PopFilterMagnification.md
@@ -0,0 +1,23 @@
+---
+template: lua-library-function.html
+title: PopFilterMagnification
+icon: lua-client
+tags:
+ - lua
+ - client
+ - needs-verification
+ - needs-example
+lua:
+ library: Renders
+ function: PopFilterMagnification
+ realm: client
+ description: "Pop a magnification filter. (Non-functional; help wanted)"
+
+
+ returns:
+
+---
+
+
+Renders.PopFilterMagnification – Pop a magnification filter. (Non-functional; help wanted)
+
diff --git a/docs/libraries/Renders/PopFilterMinification.md b/docs/libraries/Renders/PopFilterMinification.md
new file mode 100644
index 0000000000..5eccd7a535
--- /dev/null
+++ b/docs/libraries/Renders/PopFilterMinification.md
@@ -0,0 +1,23 @@
+---
+template: lua-library-function.html
+title: PopFilterMinification
+icon: lua-client
+tags:
+ - lua
+ - client
+ - needs-verification
+ - needs-example
+lua:
+ library: Renders
+ function: PopFilterMinification
+ realm: client
+ description: "Pop a minification filter."
+
+
+ returns:
+
+---
+
+
+Renders.PopFilterMinification – Pop a minification filter.
+
diff --git a/docs/libraries/Renders/PushFilterMagnification.md b/docs/libraries/Renders/PushFilterMagnification.md
new file mode 100644
index 0000000000..5969d8716f
--- /dev/null
+++ b/docs/libraries/Renders/PushFilterMagnification.md
@@ -0,0 +1,25 @@
+---
+template: lua-library-function.html
+title: PushFilterMagnification
+icon: lua-client
+tags:
+ - lua
+ - client
+ - needs-verification
+ - needs-example
+lua:
+ library: Renders
+ function: PushFilterMagnification
+ realm: client
+ description: "Push a magnification filter."
+
+ arguments:
+ - name: "filter"
+ type: number
+ returns:
+
+---
+
+
+Renders.PushFilterMagnification – Push a magnification filter.
+
diff --git a/docs/libraries/Renders/PushFilterMinification.md b/docs/libraries/Renders/PushFilterMinification.md
new file mode 100644
index 0000000000..c8ccc6c5dd
--- /dev/null
+++ b/docs/libraries/Renders/PushFilterMinification.md
@@ -0,0 +1,25 @@
+---
+template: lua-library-function.html
+title: PushFilterMinification
+icon: lua-client
+tags:
+ - lua
+ - client
+ - needs-verification
+ - needs-example
+lua:
+ library: Renders
+ function: PushFilterMinification
+ realm: client
+ description: "Push a minification filter. (Non-functional; help wanted)"
+
+ arguments:
+ - name: "filter"
+ type: number
+ returns:
+
+---
+
+
+Renders.PushFilterMinification – Push a minification filter. (Non-functional; help wanted)
+
diff --git a/game/experiment/addons/gmod_compatibility/scripts/lua/includes/modules/gmod_compatibility/sh_file.lua b/game/experiment/addons/gmod_compatibility/scripts/lua/includes/modules/gmod_compatibility/sh_file.lua
index a9cdf6e4f6..eb18ffaedd 100644
--- a/game/experiment/addons/gmod_compatibility/scripts/lua/includes/modules/gmod_compatibility/sh_file.lua
+++ b/game/experiment/addons/gmod_compatibility/scripts/lua/includes/modules/gmod_compatibility/sh_file.lua
@@ -1,14 +1,14 @@
-local FileSystem = require("FileSystem")
+local Files = require("Files")
file = {}
-- Appends content to a file relative to the data folder
function file.Append(fileName, content)
- local file = FileSystem.Open(fileName, "a", "DATA")
+ local file = Files.Open(fileName, "a", "DATA")
if (file) then
- FileSystem.Write(content, file)
- FileSystem.Close(file)
+ Files.Write(content, file)
+ Files.Close(file)
end
end
@@ -19,22 +19,22 @@ end
-- Creates a directory relative to the data folder
function file.CreateDir(name)
- FileSystem.CreateDirHierarchy(name, "DATA")
+ Files.CreateDirectoryHierarchy(name, "DATA")
end
-- Deletes a file or empty folder relative to the data folder
function file.Delete(name, gamePath)
- FileSystem.RemoveFile(name, gamePath or "DATA")
+ Files.RemoveFile(name, gamePath or "DATA")
end
-- Checks if a file or directory exists
function file.Exists(name, gamePath)
- return FileSystem.FileExists(name, gamePath or "DATA")
+ return Files.FileExists(name, gamePath or "DATA")
end
-- Returns a list of files and directories inside a folder
function file.Find(name, path, sorting)
- local files, directories = FileSystem.Find(name, path)
+ local files, directories = Files.Find(name, path)
if (sorting) then
MsgN("file.Find Sorting is not supported in the GMod compatibility layer!")
@@ -45,52 +45,52 @@ end
-- Checks if the given path is a directory
function file.IsDir(fileName, gamePath)
- return FileSystem.IsDirectory(fileName, gamePath or "DATA")
+ return Files.IsDirectory(fileName, gamePath or "DATA")
end
-- Opens a file with the given mode
function file.Open(fileName, fileMode, gamePath)
- return FileSystem.Open(fileName, fileMode, gamePath or "DATA")
+ return Files.Open(fileName, fileMode, gamePath or "DATA")
end
-- Reads the content of a file
function file.Read(fileName, gamePath)
- local file = FileSystem.Open(fileName, "r", gamePath)
+ local file = Files.Open(fileName, "r", gamePath)
if (file == FILESYSTEM_INVALID_HANDLE) then
return nil
end
- local size = FileSystem.Size(file)
- local size, content = FileSystem.Read(size, file)
- FileSystem.Close(file)
+ local size = Files.Size(file)
+ local size, content = Files.Read(size, file)
+ Files.Close(file)
return content
end
-- Renames a file
function file.Rename(originalFileName, targetFileName)
- return FileSystem.RenameFile(originalFileName, targetFileName, "DATA")
+ return Files.RenameFile(originalFileName, targetFileName, "DATA")
end
-- Returns the size of a file in bytes
function file.Size(fileName, gamePath)
- return FileSystem.Size(fileName, gamePath or "DATA")
+ return Files.Size(fileName, gamePath or "DATA")
end
-- Returns the last modified time of a file or folder in Unix time
function file.Time(path, gamePath)
- return FileSystem.Time(path, gamePath or "DATA")
+ return Files.Time(path, gamePath or "DATA")
end
-- Writes content to a file, erasing previous data
function file.Write(fileName, content)
- local file = FileSystem.Open(fileName, "w", "DATA")
+ local file = Files.Open(fileName, "w", "DATA")
if (not file) then
error("file.Write: Couldn't open file '" .. fileName .. "' for writing!")
return
end
- FileSystem.Write(content, file)
- FileSystem.Close(file)
+ Files.Write(content, file)
+ Files.Close(file)
end
diff --git a/game/experiment/addons/gmod_compatibility/scripts/lua/includes/modules/gmod_compatibility/sh_init.lua b/game/experiment/addons/gmod_compatibility/scripts/lua/includes/modules/gmod_compatibility/sh_init.lua
index 115051f3ad..bc16e34a2d 100644
--- a/game/experiment/addons/gmod_compatibility/scripts/lua/includes/modules/gmod_compatibility/sh_init.lua
+++ b/game/experiment/addons/gmod_compatibility/scripts/lua/includes/modules/gmod_compatibility/sh_init.lua
@@ -1279,7 +1279,7 @@ end)
package.IncludePath = "lua/;" .. package.IncludePath
-- Setup to search for modules in all search paths
-local searchPathsString = FileSystem.GetSearchPath("GAME")
+local searchPathsString = Files.GetSearchPath("GAME")
for searchPath in searchPathsString:gmatch("([^;]+)") do
if (searchPath:find("%.bsp$") or searchPath:find("%.vpk$")) then
diff --git a/game/experiment/bin/game_shader_dx9.dll b/game/experiment/bin/game_shader_dx9.dll
index 3f0ce0a546..d16719dfea 100644
--- a/game/experiment/bin/game_shader_dx9.dll
+++ b/game/experiment/bin/game_shader_dx9.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:b591bd580296f067a01cde0efbe8c2e86173e2f2aa10bd4a2b41abbe8ecf2813
+oid sha256:88a17a90556c93ac580fc7205a01c8226997b27816dd89a87a158f80964f4e1f
size 1041920
diff --git a/game/experiment/bin/game_shader_dx9.pdb b/game/experiment/bin/game_shader_dx9.pdb
index e496d98196..c8c7ee2a43 100644
--- a/game/experiment/bin/game_shader_dx9.pdb
+++ b/game/experiment/bin/game_shader_dx9.pdb
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:45c2d903e18947a27b209e687ad6855e4ac0507b466b0aeb5bc9cf13e24ee6b2
+oid sha256:cf83e99088ec5b134240a59010e16aafd11744024103499a8ac20bb1f5114d33
size 4091904
diff --git a/game/experiment/bin/libpng.dll b/game/experiment/bin/libpng.dll
index 738289994b..18f615d9d2 100644
--- a/game/experiment/bin/libpng.dll
+++ b/game/experiment/bin/libpng.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e8aacfcb8645213884341e69f19c4c08adb2bad223e972404d156ae53f459686
+oid sha256:1cd83098758a709c74570b2d5a701284c98811237edfda739a939a135a8f0931
size 956416
diff --git a/game/experiment/bin/libpng.pdb b/game/experiment/bin/libpng.pdb
index 6b05fd4ca2..3dcf04a3b2 100644
--- a/game/experiment/bin/libpng.pdb
+++ b/game/experiment/bin/libpng.pdb
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:7831c8f1cf421175e942791c6be56d84fb4071eccef597c04d1f30e98cae04d0
+oid sha256:68dc14747c12ffa5cd47e6d13efa3d25b7a84cb4d2a8054614b291c8c427ba26
size 3272704
diff --git a/game/experiment/bin/lua54.dll b/game/experiment/bin/lua54.dll
index f1f8ce4135..b472d5fb6e 100644
--- a/game/experiment/bin/lua54.dll
+++ b/game/experiment/bin/lua54.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:60f9f365428561ef4d1c32f8115f00303016b78a84915d85b009ddeef791cbde
+oid sha256:748db11c147565e0269a4140b6a892bfd99c4bfb5db6b567bc9278660ee78017
size 326656
diff --git a/game/experiment/bin/lua54.pdb b/game/experiment/bin/lua54.pdb
index c4197715ba..e42a39d752 100644
--- a/game/experiment/bin/lua54.pdb
+++ b/game/experiment/bin/lua54.pdb
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:da372e8d9af0ff1a63f8d67d02167c3cf3ad9d30b201f19d4009facd59925088
+oid sha256:d24e53e7225e2e0e52d699f0578c014abcabb7cd4bdb59ada6a283739e621c2d
size 1142784
diff --git a/game/experiment/bin/luasocket.dll b/game/experiment/bin/luasocket.dll
index 9daa95149f..74015db811 100644
--- a/game/experiment/bin/luasocket.dll
+++ b/game/experiment/bin/luasocket.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:441061fc5a60c4f1148646d9ae55e124fb6c24f9dcda76bdf0889228da12e881
+oid sha256:b52e9b70c26bd8e56781679264bd2137e4df1e1208e62ece51640f3c8089e14e
size 581120
diff --git a/game/experiment/bin/luasocket.pdb b/game/experiment/bin/luasocket.pdb
index 8c328bb167..7f9d71d4a9 100644
--- a/game/experiment/bin/luasocket.pdb
+++ b/game/experiment/bin/luasocket.pdb
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:be6e67628a2c38c805310b4e9ae371973eae19a444556d22418bae395b6904b9
+oid sha256:5bbc1bdd92332ed7096cbd90ef0533baa70e62e6ea5a9c33848cb23911b72159
size 2469888
diff --git a/game/experiment/lua/bin/sv_helloworld_win32.dll b/game/experiment/lua/bin/sv_helloworld_win32.dll
index adc3cfedd2..59f970804e 100644
--- a/game/experiment/lua/bin/sv_helloworld_win32.dll
+++ b/game/experiment/lua/bin/sv_helloworld_win32.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:cea8ec28ae0d008c83d9761fbe02e2a8f7addc4dbc69e4d569b89b04f70690dd
+oid sha256:c57208378360afee04ba7b10702103ec60d8f7b93a9c22419170bc8ba9004a63
size 17408
diff --git a/game/experiment/lua/bin/sv_helloworld_win32.pdb b/game/experiment/lua/bin/sv_helloworld_win32.pdb
index 39806669bf..8a73afd9d4 100644
--- a/game/experiment/lua/bin/sv_helloworld_win32.pdb
+++ b/game/experiment/lua/bin/sv_helloworld_win32.pdb
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:105dfe971b7a5ae4cd83b96e0fd396896a483232b6e50e07c53060c95972d200
+oid sha256:455f78739507fcdf3c861dd65d6082e0b286a177ef79c963959d0de5a3125bf6
size 282624
diff --git a/game/experiment/scripts/lua/utilities/test/file_handle.lua b/game/experiment/scripts/lua/utilities/test/file_handle.lua
index b3d8907e19..be0619d348 100644
--- a/game/experiment/scripts/lua/utilities/test/file_handle.lua
+++ b/game/experiment/scripts/lua/utilities/test/file_handle.lua
@@ -5,24 +5,24 @@
Modified for Experiment.
--]]
-require("FileSystem")
+require("Files")
local printError = debug.PrintError
-local hFile = FileSystem.Open("gameinfo.txt", "r")
+local hFile = Files.Open("gameinfo.txt", "r")
-- ...ourcemods\experiment\lua\utilities\test\FileHandle_t.lua:14: bad argument #1 to 'Size' (FileHandle_t expected, got FILESYSTEM_INVALID_HANDLE)
-local size = FileSystem.Size(hFile)
+local size = Files.Size(hFile)
MsgN("hFile = " .. tostring(hFile))
-local bytesRead, pOutput = FileSystem.Read(size, hFile)
+local bytesRead, pOutput = Files.Read(size, hFile)
MsgN("bytes: " .. bytesRead)
MsgN("output:\n" .. pOutput)
MsgN("Closing hFile, handle should become invalid!")
-FileSystem.Close(hFile)
+Files.Close(hFile)
MsgN("hFile = " .. tostring(hFile))
MsgN("Testing error handling...")
local failedTest = xpcall(function(strError)
- MsgN("FileSystem.IsOk( hFile ) = " .. tostring(FileSystem.IsOk(hFile)))
+ MsgN("Files.IsOk( hFile ) = " .. tostring(Files.IsOk(hFile)))
end, printError)
if (failedTest) then
@@ -31,7 +31,7 @@ end
MsgN("Testing error handling with non-filehandle type...")
local failedTest = xpcall(function(strError)
- MsgN("FileSystem.IsOk( hFile ) = " .. tostring(FileSystem.IsOk(-1)))
+ MsgN("Files.IsOk( hFile ) = " .. tostring(Files.IsOk(-1)))
end, printError)
if (failedTest) then
diff --git a/src/game/client/lc_baseanimating.cpp b/src/game/client/lc_baseanimating.cpp
index ba25364bc2..323e477231 100644
--- a/src/game/client/lc_baseanimating.cpp
+++ b/src/game/client/lc_baseanimating.cpp
@@ -1,9 +1,3 @@
-//===== Copy right © 1996-2005, Valve Corporation, All rights reserved. ==//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//===========================================================================//
#include "cbase.h"
#include "luamanager.h"
#include "luasrclib.h"
diff --git a/src/game/client/lc_baseanimating.h b/src/game/client/lc_baseanimating.h
index 87c1f8d4bf..7778c6598d 100644
--- a/src/game/client/lc_baseanimating.h
+++ b/src/game/client/lc_baseanimating.h
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $Workfile: $
-// $NoKeywords: $
-//=============================================================================//
#ifndef LC_BASEANIMATING_H
#define LC_BASEANIMATING_H
diff --git a/src/game/client/lc_baseentity.cpp b/src/game/client/lc_baseentity.cpp
index 6b4ec36b46..7d567bbecd 100644
--- a/src/game/client/lc_baseentity.cpp
+++ b/src/game/client/lc_baseentity.cpp
@@ -1,9 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//===========================================================================//
#include "cbase.h"
#include "luamanager.h"
#include "luasrclib.h"
diff --git a/src/game/client/lc_baseplayer.cpp b/src/game/client/lc_baseplayer.cpp
index 76fddbae67..06a7b9b982 100644
--- a/src/game/client/lc_baseplayer.cpp
+++ b/src/game/client/lc_baseplayer.cpp
@@ -1,10 +1,3 @@
-//====== Copyright © 1996-2005, Valve Corporation, All rights reserved. =====//
-//
-// Purpose: Client-side CBasePlayer.
-//
-// - Manages the player's flashlight effect.
-//
-//===========================================================================//
#include "cbase.h"
#include "c_baseplayer.h"
#include "luamanager.h"
diff --git a/src/game/client/lc_recipientfilter.cpp b/src/game/client/lc_recipientfilter.cpp
index 5a0f1094d9..ed66a8edb5 100644
--- a/src/game/client/lc_recipientfilter.cpp
+++ b/src/game/client/lc_recipientfilter.cpp
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-//=============================================================================//
#include "cbase.h"
#include "c_recipientfilter.h"
#include "luamanager.h"
diff --git a/src/game/client/lc_recipientfilter.h b/src/game/client/lc_recipientfilter.h
index e1c48199fb..f8ceaa0e3a 100644
--- a/src/game/client/lc_recipientfilter.h
+++ b/src/game/client/lc_recipientfilter.h
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LC_RECIPIENTFILTER_H
#define LC_RECIPIENTFILTER_H
#ifdef _WIN32
diff --git a/src/game/client/lcdll_util.cpp b/src/game/client/lcdll_util.cpp
index cd6888f1e7..56a5efcf82 100644
--- a/src/game/client/lcdll_util.cpp
+++ b/src/game/client/lcdll_util.cpp
@@ -1,11 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $Workfile: $
-// $NoKeywords: $
-//=============================================================================//
-
#include "cbase.h"
#include "luamanager.h"
#include "luasrclib.h"
diff --git a/src/game/client/liclientshadowmgr.cpp b/src/game/client/liclientshadowmgr.cpp
index bc93fae6be..ef547a3669 100644
--- a/src/game/client/liclientshadowmgr.cpp
+++ b/src/game/client/liclientshadowmgr.cpp
@@ -1,11 +1,3 @@
-//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-//=============================================================================//
-
#include "cbase.h"
#include "luamanager.h"
#include "mathlib/lvector.h"
diff --git a/src/game/client/lprediction.cpp b/src/game/client/lprediction.cpp
index dbc8b0b281..f066a233ff 100644
--- a/src/game/client/lprediction.cpp
+++ b/src/game/client/lprediction.cpp
@@ -1,10 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//===========================================================================//
-
#include "cbase.h"
#include "prediction.h"
#include "luamanager.h"
diff --git a/src/game/client/scripted_controls/lCheckButton.cpp b/src/game/client/scripted_controls/lCheckButton.cpp
index 49599f8ae1..6ced1146f6 100644
--- a/src/game/client/scripted_controls/lCheckButton.cpp
+++ b/src/game/client/scripted_controls/lCheckButton.cpp
@@ -1,11 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved.
-//============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#include
#include
diff --git a/src/game/client/scripted_controls/lCheckButton.h b/src/game/client/scripted_controls/lCheckButton.h
index c9c043f45a..a6d86f3650 100644
--- a/src/game/client/scripted_controls/lCheckButton.h
+++ b/src/game/client/scripted_controls/lCheckButton.h
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef VGUI_LCHECKBUTTON_H
#define VGUI_LCHECKBUTTON_H
diff --git a/src/game/client/scripted_controls/lControls.cpp b/src/game/client/scripted_controls/lControls.cpp
index 92d7b18356..3370f550b7 100644
--- a/src/game/client/scripted_controls/lControls.cpp
+++ b/src/game/client/scripted_controls/lControls.cpp
@@ -1,9 +1,3 @@
-//====== Copyright © 1996-2005, Valve Corporation, All rights reserved. =======
-//
-// Purpose:
-//
-//=============================================================================
-
#include "cbase.h"
#include "lua.hpp"
#include "lControls.h"
diff --git a/src/game/client/scripted_controls/lControls.h b/src/game/client/scripted_controls/lControls.h
index 105868cd45..7b00255692 100644
--- a/src/game/client/scripted_controls/lControls.h
+++ b/src/game/client/scripted_controls/lControls.h
@@ -1,10 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//===========================================================================//
-
#ifndef LCONTROLS_H
#define LCONTROLS_H
diff --git a/src/game/client/scripted_controls/lEditablePanel.cpp b/src/game/client/scripted_controls/lEditablePanel.cpp
index 576d318afa..2fd839edca 100644
--- a/src/game/client/scripted_controls/lEditablePanel.cpp
+++ b/src/game/client/scripted_controls/lEditablePanel.cpp
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#include "cbase.h"
#include
#include "luamanager.h"
diff --git a/src/game/client/scripted_controls/lEditablePanel.h b/src/game/client/scripted_controls/lEditablePanel.h
index 2e3b9e3aca..100dec7811 100644
--- a/src/game/client/scripted_controls/lEditablePanel.h
+++ b/src/game/client/scripted_controls/lEditablePanel.h
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LEDITABLEPANEL_H
#define LEDITABLEPANEL_H
diff --git a/src/game/client/scripted_controls/lFrame.cpp b/src/game/client/scripted_controls/lFrame.cpp
index f926f483cc..b62d84880a 100644
--- a/src/game/client/scripted_controls/lFrame.cpp
+++ b/src/game/client/scripted_controls/lFrame.cpp
@@ -1,10 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//===========================================================================//
-
#include
#include
#include
diff --git a/src/game/client/scripted_controls/lFrame.h b/src/game/client/scripted_controls/lFrame.h
index 1d8e8fb2b2..8d34325a4d 100644
--- a/src/game/client/scripted_controls/lFrame.h
+++ b/src/game/client/scripted_controls/lFrame.h
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef VGUI_LFRAME_H
#define VGUI_LFRAME_H
diff --git a/src/game/client/scripted_controls/lModelImagePanel.cpp b/src/game/client/scripted_controls/lModelImagePanel.cpp
index 44b9e14a16..91c1b384c7 100644
--- a/src/game/client/scripted_controls/lModelImagePanel.cpp
+++ b/src/game/client/scripted_controls/lModelImagePanel.cpp
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#include "cbase.h"
#include
#include "luamanager.h"
diff --git a/src/game/client/scripted_controls/lPropertyDialog.cpp b/src/game/client/scripted_controls/lPropertyDialog.cpp
index f76240656d..923fd45d7d 100644
--- a/src/game/client/scripted_controls/lPropertyDialog.cpp
+++ b/src/game/client/scripted_controls/lPropertyDialog.cpp
@@ -1,11 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved.
-//============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#include
#include
#include
diff --git a/src/game/client/scripted_controls/lPropertyDialog.h b/src/game/client/scripted_controls/lPropertyDialog.h
index 22ad0c2970..09583edad0 100644
--- a/src/game/client/scripted_controls/lPropertyDialog.h
+++ b/src/game/client/scripted_controls/lPropertyDialog.h
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LPROPERTYDIALOG_H
#define LPROPERTYDIALOG_H
diff --git a/src/game/client/scripted_controls/lPropertyPage.cpp b/src/game/client/scripted_controls/lPropertyPage.cpp
index d6c7742975..5c22e782be 100644
--- a/src/game/client/scripted_controls/lPropertyPage.cpp
+++ b/src/game/client/scripted_controls/lPropertyPage.cpp
@@ -1,11 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved.
-//============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#include
#include "vgui/KeyCode.h"
#include
diff --git a/src/game/client/scripted_controls/lPropertyPage.h b/src/game/client/scripted_controls/lPropertyPage.h
index 63b81a2fbb..cae49b6bb1 100644
--- a/src/game/client/scripted_controls/lPropertyPage.h
+++ b/src/game/client/scripted_controls/lPropertyPage.h
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LPROPERTYPAGE_H
#define LPROPERTYPAGE_H
diff --git a/src/game/server/lbaseanimating.cpp b/src/game/server/lbaseanimating.cpp
index a9ae6e67b9..9bae4d246f 100644
--- a/src/game/server/lbaseanimating.cpp
+++ b/src/game/server/lbaseanimating.cpp
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved.
-//============//
-//
-// Purpose: Base class for all animating characters and objects.
-//
-//=============================================================================//
-
#include "cbase.h"
#include "luamanager.h"
#include "lbaseanimating.h"
diff --git a/src/game/server/lbaseanimating.h b/src/game/server/lbaseanimating.h
index 98427c6cb9..d2d3ffec23 100644
--- a/src/game/server/lbaseanimating.h
+++ b/src/game/server/lbaseanimating.h
@@ -1,9 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-//=============================================================================//
-
#ifndef LBASEANIMATING_H
#define LBASEANIMATING_H
#ifdef _WIN32
diff --git a/src/game/server/lbaseentity.cpp b/src/game/server/lbaseentity.cpp
index 598ff5053f..11a6a4d022 100644
--- a/src/game/server/lbaseentity.cpp
+++ b/src/game/server/lbaseentity.cpp
@@ -1,9 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose: The base class from which all game entities are derived.
-//
-//===========================================================================//
-
#include "cbase.h"
#include "luamanager.h"
#include "luasrclib.h"
diff --git a/src/game/server/lbaseentity.h b/src/game/server/lbaseentity.h
index c9ceab2510..dcf7ea2d9d 100644
--- a/src/game/server/lbaseentity.h
+++ b/src/game/server/lbaseentity.h
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LBASEENTITY_H
#define LBASEENTITY_H
#ifdef _WIN32
diff --git a/src/game/server/lplayer.cpp b/src/game/server/lplayer.cpp
index 7899691a6b..61a87d25af 100644
--- a/src/game/server/lplayer.cpp
+++ b/src/game/server/lplayer.cpp
@@ -1,9 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose: Functions dealing with the player.
-//
-//===========================================================================//
-
#include "cbase.h"
#include "luamanager.h"
#include "lbasecombatweapon_shared.h"
diff --git a/src/game/server/lrecipientfilter.cpp b/src/game/server/lrecipientfilter.cpp
index 34ad0d696c..b6d5153f84 100644
--- a/src/game/server/lrecipientfilter.cpp
+++ b/src/game/server/lrecipientfilter.cpp
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-//=============================================================================//
#include "cbase.h"
#include "recipientfilter.h"
#include "luamanager.h"
diff --git a/src/game/server/lrecipientfilter.h b/src/game/server/lrecipientfilter.h
index 217511be45..aaf82479ee 100644
--- a/src/game/server/lrecipientfilter.h
+++ b/src/game/server/lrecipientfilter.h
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LRECIPIENTFILTER_H
#define LRECIPIENTFILTER_H
#ifdef _WIN32
diff --git a/src/game/server/lutil.cpp b/src/game/server/lutil.cpp
index 428f40a983..bf1950a25d 100644
--- a/src/game/server/lutil.cpp
+++ b/src/game/server/lutil.cpp
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose: Utility code.
-//
-// $NoKeywords: $
-//=============================================================================//
-
#include "cbase.h"
#include "luamanager.h"
#include "luasrclib.h"
diff --git a/src/game/server/lutil.h b/src/game/server/lutil.h
index bcb3d10d11..c08475c1b6 100644
--- a/src/game/server/lutil.h
+++ b/src/game/server/lutil.h
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose: Misc utility code.
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LUTIL_H
#define LUTIL_H
#ifdef _WIN32
diff --git a/src/game/shared/experiment/lexperiment_player_shared.cpp b/src/game/shared/experiment/lexperiment_player_shared.cpp
index 195ba58a91..80ff1b3f7a 100644
--- a/src/game/shared/experiment/lexperiment_player_shared.cpp
+++ b/src/game/shared/experiment/lexperiment_player_shared.cpp
@@ -1,11 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved.
-//============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-//=============================================================================//
#include "cbase.h"
#include "luamanager.h"
diff --git a/src/game/shared/experiment/lexperiment_player_shared.h b/src/game/shared/experiment/lexperiment_player_shared.h
index 38b8ca0da8..72757d7e4a 100644
--- a/src/game/shared/experiment/lexperiment_player_shared.h
+++ b/src/game/shared/experiment/lexperiment_player_shared.h
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-//=============================================================================//
#ifndef LExperiment_PLAYER_SHARED_H
#define LExperiment_PLAYER_SHARED_H
#pragma once
diff --git a/src/game/shared/lbaseanimating_shared.h b/src/game/shared/lbaseanimating_shared.h
index 5c3e2dcd09..c27aacef5a 100644
--- a/src/game/shared/lbaseanimating_shared.h
+++ b/src/game/shared/lbaseanimating_shared.h
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LBASEANIMATING_SHARED_H
#define LBASEANIMATING_SHARED_H
#ifdef _WIN32
diff --git a/src/game/shared/lbasecombatweapon_shared.cpp b/src/game/shared/lbasecombatweapon_shared.cpp
index 77f5be0a49..bdb0161b4b 100644
--- a/src/game/shared/lbasecombatweapon_shared.cpp
+++ b/src/game/shared/lbasecombatweapon_shared.cpp
@@ -1,11 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved.
-//============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#include "cbase.h"
#include "luamanager.h"
#include "luasrclib.h"
diff --git a/src/game/shared/lbasecombatweapon_shared.h b/src/game/shared/lbasecombatweapon_shared.h
index fce78b6579..5758d456a9 100644
--- a/src/game/shared/lbasecombatweapon_shared.h
+++ b/src/game/shared/lbasecombatweapon_shared.h
@@ -1,9 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-//===========================================================================//
-
#ifndef LCOMBATWEAPON_SHARED_H
#define LCOMBATWEAPON_SHARED_H
#ifdef _WIN32
@@ -13,15 +7,12 @@
/* type for CBaseCombatWeapon functions */
typedef CBaseCombatWeapon lua_CBaseCombatWeapon;
-
-
/*
** access functions (stack -> C)
*/
LUA_API lua_CBaseCombatWeapon *(lua_toweapon) (lua_State *L, int idx);
-
/*
** push functions (C -> stack)
*/
diff --git a/src/game/shared/lbaseentity_shared.h b/src/game/shared/lbaseentity_shared.h
index 22523fc96b..75275c9c79 100644
--- a/src/game/shared/lbaseentity_shared.h
+++ b/src/game/shared/lbaseentity_shared.h
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LBASEENTITY_SHARED_H
#define LBASEENTITY_SHARED_H
#ifdef _WIN32
diff --git a/src/game/shared/lbaseflex_shared.cpp b/src/game/shared/lbaseflex_shared.cpp
index a65b83ccff..b67ae99ccc 100644
--- a/src/game/shared/lbaseflex_shared.cpp
+++ b/src/game/shared/lbaseflex_shared.cpp
@@ -1,9 +1,3 @@
-//===== Copy right © 1996-2005, Valve Corporation, All rights reserved. ==//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//===========================================================================//
#include "cbase.h"
#include "luamanager.h"
#include "luasrclib.h"
diff --git a/src/game/shared/lbaseflex_shared.h b/src/game/shared/lbaseflex_shared.h
index 930f9faa31..6d750d971a 100644
--- a/src/game/shared/lbaseflex_shared.h
+++ b/src/game/shared/lbaseflex_shared.h
@@ -1,10 +1,3 @@
-//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $Workfile: $
-// $NoKeywords: $
-//=============================================================================//
#ifndef LBASEFLEX_SHARED_H
#define LBASEFLEX_SHARED_H
diff --git a/src/game/shared/lbaseplayer_shared.cpp b/src/game/shared/lbaseplayer_shared.cpp
index 1d17b1d380..78aaa4a3e7 100644
--- a/src/game/shared/lbaseplayer_shared.cpp
+++ b/src/game/shared/lbaseplayer_shared.cpp
@@ -1,11 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved.
-//============//
-//
-// Purpose: Implements shared baseplayer class functionality
-//
-// $NoKeywords: $
-//=============================================================================//
-
#include "cbase.h"
#include "luamanager.h"
#include "luasrclib.h"
diff --git a/src/game/shared/lbaseplayer_shared.h b/src/game/shared/lbaseplayer_shared.h
index 39e418814d..6d39310eee 100644
--- a/src/game/shared/lbaseplayer_shared.h
+++ b/src/game/shared/lbaseplayer_shared.h
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LBASEPLAYER_SHARED_H
#define LBASEPLAYER_SHARED_H
#ifdef _WIN32
diff --git a/src/game/shared/leffect_dispatch_data.cpp b/src/game/shared/leffect_dispatch_data.cpp
index 94a49a9cc6..e2c3424e03 100644
--- a/src/game/shared/leffect_dispatch_data.cpp
+++ b/src/game/shared/leffect_dispatch_data.cpp
@@ -1,9 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
#include "cbase.h"
#if CLIENT_DLL
#include "c_te_effect_dispatch.h"
diff --git a/src/game/shared/leffect_dispatch_data.h b/src/game/shared/leffect_dispatch_data.h
index 014185a511..276ebbbe90 100644
--- a/src/game/shared/leffect_dispatch_data.h
+++ b/src/game/shared/leffect_dispatch_data.h
@@ -1,10 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//===========================================================================//
-
#ifndef LEFFECT_DISPATCH_DATA_H
#define LEFFECT_DISPATCH_DATA_H
#ifdef _WIN32
diff --git a/src/game/shared/limovehelper.cpp b/src/game/shared/limovehelper.cpp
index 7def2b32ab..efae9b2b65 100644
--- a/src/game/shared/limovehelper.cpp
+++ b/src/game/shared/limovehelper.cpp
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#include "cbase.h"
#include "imovehelper.h"
#include "lua.hpp"
diff --git a/src/game/shared/limovehelper.h b/src/game/shared/limovehelper.h
index be47806d4a..add5bb37a6 100644
--- a/src/game/shared/limovehelper.h
+++ b/src/game/shared/limovehelper.h
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LIMOVEHELPER_H
#define LIMOVEHELPER_H
@@ -16,8 +9,6 @@
/* type for IMoveHelper functions */
typedef IMoveHelper lua_IMoveHelper;
-
-
/*
** access functions (stack -> C)
*/
@@ -30,8 +21,6 @@ LUA_API lua_IMoveHelper *(lua_tomovehelper) (lua_State *L, int idx);
*/
LUA_API void (lua_pushmovehelper) (lua_State *L, lua_IMoveHelper *pHelper);
-
-
LUALIB_API lua_IMoveHelper *(luaL_checkmovehelper) (lua_State *L, int narg);
diff --git a/src/game/shared/lin_buttons.cpp b/src/game/shared/lin_buttons.cpp
index dd65e6922e..0f79c559dc 100644
--- a/src/game/shared/lin_buttons.cpp
+++ b/src/game/shared/lin_buttons.cpp
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-//=============================================================================//
#include "cbase.h"
#include "in_buttons.h"
#include "luamanager.h"
diff --git a/src/game/shared/lipredictionsystem.cpp b/src/game/shared/lipredictionsystem.cpp
index 8942a941b7..ad47dbf904 100644
--- a/src/game/shared/lipredictionsystem.cpp
+++ b/src/game/shared/lipredictionsystem.cpp
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#include "cbase.h"
#include "ipredictionsystem.h"
#include "luamanager.h"
diff --git a/src/game/shared/lmovedata.cpp b/src/game/shared/lmovedata.cpp
index baa144b845..cb259d7134 100644
--- a/src/game/shared/lmovedata.cpp
+++ b/src/game/shared/lmovedata.cpp
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#include "cbase.h"
#include "igamemovement.h"
#include "lua.hpp"
diff --git a/src/game/shared/lmovedata.h b/src/game/shared/lmovedata.h
index a8df0245f7..c887836304 100644
--- a/src/game/shared/lmovedata.h
+++ b/src/game/shared/lmovedata.h
@@ -1,10 +1,3 @@
-//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LMOVEDATA_H
#define LMOVEDATA_H
@@ -16,22 +9,17 @@
/* type for CMoveData functions */
typedef CMoveData lua_CMoveData;
-
-
/*
** access functions (stack -> C)
*/
LUA_API lua_CMoveData *(lua_tomovedata) (lua_State *L, int idx);
-
/*
** push functions (C -> stack)
*/
LUA_API void (lua_pushmovedata) (lua_State *L, lua_CMoveData *pHelper);
-
-
LUALIB_API lua_CMoveData *(luaL_checkmovedata) (lua_State *L, int narg);
diff --git a/src/game/shared/lparticle_system.cpp b/src/game/shared/lparticle_system.cpp
index 81928311c4..f62dd975f1 100644
--- a/src/game/shared/lparticle_system.cpp
+++ b/src/game/shared/lparticle_system.cpp
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-//=============================================================================//
#include "cbase.h"
#include "luamanager.h"
#include "luasrclib.h"
diff --git a/src/game/shared/lparticle_system.h b/src/game/shared/lparticle_system.h
index b36d2f832b..0ad8f0db08 100644
--- a/src/game/shared/lparticle_system.h
+++ b/src/game/shared/lparticle_system.h
@@ -1,10 +1,3 @@
-//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef L_PARTICLESYSTEM_H
#define L_PARTICLESYSTEM_H
#ifdef _WIN32
diff --git a/src/game/shared/lrender.cpp b/src/game/shared/lrender.cpp
index 863b303ac7..53013c1e44 100644
--- a/src/game/shared/lrender.cpp
+++ b/src/game/shared/lrender.cpp
@@ -332,7 +332,7 @@ static ShaderTexFilterMode_t FilterModeFromEnumeration( int enumeration )
}
}
-LUA_BINDING_BEGIN( Renders, PushFilterMinification, "library", "Push a minification filter.", "client" )
+LUA_BINDING_BEGIN( Renders, PushFilterMinification, "library", "Push a minification filter. (Non-functional; help wanted)", "client" )
{
int filterMode = LUA_BINDING_ARGUMENT( luaL_checknumber, 1, "filter" );
@@ -351,7 +351,7 @@ LUA_BINDING_BEGIN( Renders, PushFilterMinification, "library", "Push a minificat
"RenderTarget" );
filterTextureHandlesMinification.Push( hTexture );
- //g_pShaderApi->ModifyTexture( hTexture );
+ g_pShaderApi->ModifyTexture( hTexture );
g_pShaderApi->TexMinFilter( FilterModeFromEnumeration( filterMode ) );
return 0;
@@ -386,14 +386,14 @@ LUA_BINDING_BEGIN( Renders, PushFilterMagnification, "library", "Push a magnific
"RenderTarget" );
filterTextureHandlesMagnification.Push( hTexture );
- //g_pShaderApi->ModifyTexture( hTexture );
+ g_pShaderApi->ModifyTexture( hTexture );
g_pShaderApi->TexMagFilter( FilterModeFromEnumeration( filterMode ) );
return 0;
}
LUA_BINDING_END()
-LUA_BINDING_BEGIN( Renders, PopFilterMagnification, "library", "Pop a magnification filter.", "client" )
+LUA_BINDING_BEGIN( Renders, PopFilterMagnification, "library", "Pop a magnification filter. (Non-functional; help wanted)", "client" )
{
g_pShaderApi->DeleteTexture( filterTextureHandlesMagnification.Top() );
filterTextureHandlesMagnification.Pop();
diff --git a/src/game/shared/lresources.h b/src/game/shared/lresources.h
index 246d62cc3c..573e47b416 100644
--- a/src/game/shared/lresources.h
+++ b/src/game/shared/lresources.h
@@ -1,10 +1,3 @@
-//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose: Definitions that are shared by the game DLL and the client DLL.
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LRESOURCES_H
#define LRESOURCES_H
#ifdef _WIN32
diff --git a/src/game/shared/lshareddefs.cpp b/src/game/shared/lshareddefs.cpp
index 17f5c209e3..fb760fd70b 100644
--- a/src/game/shared/lshareddefs.cpp
+++ b/src/game/shared/lshareddefs.cpp
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose: Definitions that are shared by the game DLL and the client DLL.
-//
-// $NoKeywords: $
-//=============================================================================//
-
#include "cbase.h"
#include "ammodef.h"
#include "luamanager.h"
diff --git a/src/game/shared/lshareddefs.h b/src/game/shared/lshareddefs.h
index c5ad2c1f15..a414b2b042 100644
--- a/src/game/shared/lshareddefs.h
+++ b/src/game/shared/lshareddefs.h
@@ -1,26 +1,15 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose: Definitions that are shared by the game DLL and the client DLL.
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LSHAREDDEFS_H
#define LSHAREDDEFS_H
#ifdef _WIN32
#pragma once
#endif
-
/* type for FireBulletsInfo_t in Lua */
typedef FireBulletsInfo_t lua_FireBulletsInfo_t;
-
/* type for EmitSound_t in Lua */
typedef EmitSound_t lua_EmitSound_t;
-
-
/*
** access functions (stack -> C)
*/
@@ -28,5 +17,4 @@ typedef EmitSound_t lua_EmitSound_t;
LUA_API lua_FireBulletsInfo_t (lua_tofirebulletsinfo) (lua_State *L, int idx);
LUA_API void (lua_toemitsound) (lua_State *L, int idx, EmitSound_t &ep);
-
#endif // LSHAREDDEFS_H
diff --git a/src/game/shared/lsrcinit.cpp b/src/game/shared/lsrcinit.cpp
index 2d43471842..5a6ce4cb3e 100644
--- a/src/game/shared/lsrcinit.cpp
+++ b/src/game/shared/lsrcinit.cpp
@@ -49,7 +49,8 @@ static const luaL_RegForState luasrclibs[] = {
{ LUA_ENTITIESLIBNAME, luaopen_Entities, REALM_SHARED }, // ✔ n/a n/a
{ LUA_EXPERIMENTPLAYERLIBNAME, luaopen_CExperiment_Player_shared, REALM_SHARED }, // ✔ n/a n/a
{ LUA_FCVARLIBNAME, luaopen_FCVAR, REALM_SHARED | REALM_GAMEUI },
- { LUA_FILESYSTEMLIBNAME, luaopen_filesystem, REALM_SHARED | REALM_GAMEUI },
+ { LUA_FILEHANDLEMETANAME, luaopen_FileHandle, REALM_SHARED | REALM_GAMEUI }, // ✔ n/a n/a
+ { LUA_FILESYSTEMLIBNAME, luaopen_Files, REALM_SHARED | REALM_GAMEUI }, // ✔ n/a n/a
{ LUA_FLEDICTLIBNAME, luaopen_FL_EDICT, REALM_SHARED | REALM_GAMEUI },
{ LUA_GAMETRACELIBNAME, luaopen_CGameTrace, REALM_SHARED },
{ LUA_GESTURESLOTLIBNAME, luaopen_GESTURE_SLOT, REALM_SHARED | REALM_GAMEUI },
@@ -77,7 +78,7 @@ static const luaL_RegForState luasrclibs[] = {
{ LUA_PHYSICSSURFACEPROPSLIBNAME, luaopen_IPhysicsSurfaceProps, REALM_SHARED },
{ LUA_PREDICTIONSYSTEMLIBNAME, luaopen_IPredictionSystem, REALM_SHARED },
{ LUA_QANGLELIBNAME, luaopen_QAngle, REALM_SHARED | REALM_GAMEUI }, // ✔ n/a n/a
- { LUA_RANDOMLIBNAME, luaopen_random, REALM_SHARED | REALM_GAMEUI },
+ { LUA_RANDOMLIBNAME, luaopen_random, REALM_SHARED | REALM_GAMEUI }, // ✔ n/a n/a
{ LUA_RECIPIENTFILTERLIBNAME, luaopen_CRecipientFilter, REALM_SHARED },
{ LUA_RENDERLIBNAME, luaopen_render, REALM_SHARED | REALM_GAMEUI }, // ✔ n/a n/a
{ LUA_SOLIDFLAGLIBNAME, luaopen_SOLIDFLAG, REALM_SHARED | REALM_GAMEUI },
diff --git a/src/game/shared/ltakedamageinfo.cpp b/src/game/shared/ltakedamageinfo.cpp
index 0e991aaa1f..eb8c13a47d 100644
--- a/src/game/shared/ltakedamageinfo.cpp
+++ b/src/game/shared/ltakedamageinfo.cpp
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#include "cbase.h"
#include "takedamageinfo.h"
#include "lua.hpp"
diff --git a/src/game/shared/ltakedamageinfo.h b/src/game/shared/ltakedamageinfo.h
index 662645a310..4738a1d06a 100644
--- a/src/game/shared/ltakedamageinfo.h
+++ b/src/game/shared/ltakedamageinfo.h
@@ -1,37 +1,23 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LTAKEDAMAGEINFO_H
#define LTAKEDAMAGEINFO_H
#ifdef _WIN32
#pragma once
#endif
-
/* type for CTakeDamageInfo functions */
typedef CTakeDamageInfo lua_CTakeDamageInfo;
-
-
/*
** access functions (stack -> C)
*/
LUA_API lua_CTakeDamageInfo &(lua_todamageinfo) (lua_State *L, int idx);
-
/*
** push functions (C -> stack)
*/
LUA_API void (lua_pushdamageinfo) (lua_State *L, lua_CTakeDamageInfo &info);
-
-
LUALIB_API lua_CTakeDamageInfo &(luaL_checkdamageinfo) (lua_State *L, int narg);
-
#endif // LTAKEDAMAGEINFO_H
diff --git a/src/game/shared/luamanager.cpp b/src/game/shared/luamanager.cpp
index 8d579f3cf6..edc4459d21 100644
--- a/src/game/shared/luamanager.cpp
+++ b/src/game/shared/luamanager.cpp
@@ -1,9 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose: Contains the implementation of Lua for scripting.
-//
-//===========================================================================//
-
#include "cbase.h"
#include "utlbuffer.h"
#include "UtlStringMap.h"
diff --git a/src/game/shared/luamanager.h b/src/game/shared/luamanager.h
index cf6f027fc9..53ff8479e6 100644
--- a/src/game/shared/luamanager.h
+++ b/src/game/shared/luamanager.h
@@ -1,11 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved.
-//============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LUAMANAGER_H
#define LUAMANAGER_H
#ifdef _WIN32
diff --git a/src/game/shared/luasrclib.h b/src/game/shared/luasrclib.h
index 24fa3a27b4..8211cdb349 100644
--- a/src/game/shared/luasrclib.h
+++ b/src/game/shared/luasrclib.h
@@ -92,8 +92,10 @@ LUALIB_API int( luaopen_enginevgui )( lua_State *L );
#define LUA_FCVARLIBNAME "FCVAR"
LUALIB_API int( luaopen_FCVAR )( lua_State *L );
-#define LUA_FILESYSTEMLIBNAME "FileSystem"
-LUALIB_API int( luaopen_filesystem )( lua_State *L );
+#define LUA_FILESYSTEMLIBNAME "Files"
+#define LUA_FILEHANDLEMETANAME "FileHandle"
+LUALIB_API int( luaopen_Files )( lua_State *L );
+LUALIB_API int( luaopen_FileHandle )( lua_State *L );
#define LUA_FONTFLAGLIBNAME "FONTFLAG"
LUALIB_API int( luaopen_FONTFLAG )( lua_State *L );
@@ -293,6 +295,9 @@ struct LuaRegEntry
#define LUA_BINDING_ARGUMENT_NILLABLE( CheckFunction, ArgIndex, DocumentationName ) \
CheckFunction( L, ArgIndex )
+#define LUA_BINDING_ARGUMENT_WITH_EXTRA( CheckFunction, ArgIndex, Extra, DocumentationName ) \
+ CheckFunction( L, ArgIndex, Extra )
+
#define LUA_BINDING_ARGUMENT_WITH_DEFAULT( OptCheckFunction, ArgIndex, OptValue, DocumentationName ) \
OptCheckFunction( L, ArgIndex, OptValue )
diff --git a/src/game/shared/lusercmd.cpp b/src/game/shared/lusercmd.cpp
index b677520256..8b30757aff 100644
--- a/src/game/shared/lusercmd.cpp
+++ b/src/game/shared/lusercmd.cpp
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#include "cbase.h"
#include "igamemovement.h"
#include "lua.hpp"
diff --git a/src/game/shared/lusercmd.h b/src/game/shared/lusercmd.h
index e075626595..a842a23419 100644
--- a/src/game/shared/lusercmd.h
+++ b/src/game/shared/lusercmd.h
@@ -1,10 +1,3 @@
-//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LUSERCMD_H
#define LUSERCMD_H
@@ -12,27 +5,20 @@
#pragma once
#endif
-
/* type for CUserCmd functions */
typedef CUserCmd lua_CUserCmd;
-
-
/*
** access functions (stack -> C)
*/
LUA_API lua_CUserCmd *(lua_tousercmd) (lua_State *L, int idx);
-
/*
** push functions (C -> stack)
*/
LUA_API void (lua_pushusercmd) (lua_State *L, lua_CUserCmd *pHelper);
-
-
LUALIB_API lua_CUserCmd *(luaL_checkusercmd) (lua_State *L, int narg);
-
#endif // LUSERCMD_H
diff --git a/src/game/shared/lutil_shared.cpp b/src/game/shared/lutil_shared.cpp
index a331881f02..ac3e7b0854 100644
--- a/src/game/shared/lutil_shared.cpp
+++ b/src/game/shared/lutil_shared.cpp
@@ -1,9 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-//=============================================================================//
-
#include "cbase.h"
#include "luamanager.h"
#include "luasrclib.h"
diff --git a/src/lib/public/libpng.lib b/src/lib/public/libpng.lib
index fe15e6aaa7..0db0ad8808 100644
--- a/src/lib/public/libpng.lib
+++ b/src/lib/public/libpng.lib
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:b2ec6ba20829c7f179e7bacf21c3c83ec60607d1238828b16d7496a6064835d0
+oid sha256:2e08a74866c1798be117bf62eae8271b9faa5f6db2281f275078dbda120b7945
size 56648
diff --git a/src/lib/public/lua54.lib b/src/lib/public/lua54.lib
index 890d5ee1be..5488fa53bf 100644
--- a/src/lib/public/lua54.lib
+++ b/src/lib/public/lua54.lib
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:1ed237ee4b3c124233c1518b240dc23d8cfbd828d30a6cbe7a9b81f95ed127c1
+oid sha256:616e2359f5106d8c67c451950cceaaca8facc4560c2fff3bb932a1c4eab2036f
size 31674
diff --git a/src/lib/public/luasocket.lib b/src/lib/public/luasocket.lib
index 5e98a224e2..fffafbe513 100644
--- a/src/lib/public/luasocket.lib
+++ b/src/lib/public/luasocket.lib
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:811696ab18d2e75deeae65a537b34f68c234f5a02560f166343a99e4cd56f0db
+oid sha256:34709db4a9db4b9a9a807a0341495ab2420495214d5e4ae1fc929ff5d4c58c55
size 1996
diff --git a/src/lib/public/mathlib.lib b/src/lib/public/mathlib.lib
index eef3922a99..f76ec32db8 100644
--- a/src/lib/public/mathlib.lib
+++ b/src/lib/public/mathlib.lib
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:67d9047fc705d867f62f89f7a6a79616bc86b30a211f293af2cc5d9e518081b2
+oid sha256:19eda204d92f51910abcf9fabaa99f2b388b2b6ffd423ee797f28ea997eade28
size 1602600
diff --git a/src/lib/public/raytrace.lib b/src/lib/public/raytrace.lib
index 5abc173990..4e75df7976 100644
--- a/src/lib/public/raytrace.lib
+++ b/src/lib/public/raytrace.lib
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:140715a2bc35d0e5b3310b5cae71c652ba2e98afd4b1e2d0cf708dbdcb560823
+oid sha256:d5f17bcd69a69c312f0d443df80707eddcfef9a8bd9c5f7ac0b212f0d0af0e94
size 438088
diff --git a/src/lib/public/tier1.lib b/src/lib/public/tier1.lib
index a86e6b5cb1..a6d71d9b57 100644
--- a/src/lib/public/tier1.lib
+++ b/src/lib/public/tier1.lib
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:6a2e35c6466be476ef210800ccc7f426b33b9901d56db7f1d47d29e80ca4f8e7
-size 4694824
+oid sha256:735a5a593fbc9688520a93962e9f4986479e99813d70255e16372628c2c972b4
+size 4694814
diff --git a/src/lib/public/vgui_controls.lib b/src/lib/public/vgui_controls.lib
index 5c7e54193c..7e7a597f77 100644
--- a/src/lib/public/vgui_controls.lib
+++ b/src/lib/public/vgui_controls.lib
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:f5bc875f438652edaca52de7f531c80d0623039d06161c67f36ee27df60ea59e
+oid sha256:2bc6754a433266c1ac092f850b73989d1f0dc6e4389a518127fd6e39fb937477
size 19481326
diff --git a/src/public/SoundEmitterSystem/lisoundemittersystembase.cpp b/src/public/SoundEmitterSystem/lisoundemittersystembase.cpp
index 7bfe477bcd..bdfa149b00 100644
--- a/src/public/SoundEmitterSystem/lisoundemittersystembase.cpp
+++ b/src/public/SoundEmitterSystem/lisoundemittersystembase.cpp
@@ -1,10 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//===========================================================================//
-
#include "cbase.h"
#include "luamanager.h"
#include "lisoundemittersystembase.h"
diff --git a/src/public/SoundEmitterSystem/lisoundemittersystembase.h b/src/public/SoundEmitterSystem/lisoundemittersystembase.h
index 85dba9d3f4..cd52e556e3 100644
--- a/src/public/SoundEmitterSystem/lisoundemittersystembase.h
+++ b/src/public/SoundEmitterSystem/lisoundemittersystembase.h
@@ -1,32 +1,21 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//===========================================================================//
-
#ifndef LISOUNDEMITTERSYSTEMBASE_H
#define LISOUNDEMITTERSYSTEMBASE_H
#ifdef _WIN32
#pragma once
#endif
-
/* type for CSoundParameters in Lua */
typedef CSoundParameters lua_CSoundParameters;
-
-
/*
** access functions (stack -> C)
*/
-LUA_API lua_CSoundParameters (lua_tosoundparameters) (lua_State *L, int idx);
-
+LUA_API lua_CSoundParameters( lua_tosoundparameters )( lua_State *L, int idx );
/*
** push functions (C -> stack)
*/
-LUA_API void (lua_pushsoundparameters) (lua_State *L, lua_CSoundParameters ¶ms);
+LUA_API void( lua_pushsoundparameters )( lua_State *L, lua_CSoundParameters ¶ms );
-#endif // LISOUNDEMITTERSYSTEMBASE_H
+#endif // LISOUNDEMITTERSYSTEMBASE_H
diff --git a/src/public/engine/livdebugoverlay.cpp b/src/public/engine/livdebugoverlay.cpp
index 2f2cc23484..0ef258852f 100644
--- a/src/public/engine/livdebugoverlay.cpp
+++ b/src/public/engine/livdebugoverlay.cpp
@@ -1,17 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-//=============================================================================//
-//
-// cdll_int.h
-//
-// 4-23-98
-// JOHN: client dll interface declarations
-//
-
#include "cbase.h"
#include "engine/ivdebugoverlay.h"
#include "luamanager.h"
diff --git a/src/public/lColor.h b/src/public/lColor.h
index e91f09e697..f3553d1eab 100644
--- a/src/public/lColor.h
+++ b/src/public/lColor.h
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LCOLOR_H
#define LCOLOR_H
diff --git a/src/public/lbspflags.cpp b/src/public/lbspflags.cpp
index 2b6cd73485..05a661257d 100644
--- a/src/public/lbspflags.cpp
+++ b/src/public/lbspflags.cpp
@@ -1,12 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $Workfile: $
-// $Date: $
-// $NoKeywords: $
-//=============================================================================//
-
#include "cbase.h"
#include "bspflags.h"
#include "luamanager.h"
diff --git a/src/public/lcdll_int.cpp b/src/public/lcdll_int.cpp
index 88f4ba8dab..bd56630480 100644
--- a/src/public/lcdll_int.cpp
+++ b/src/public/lcdll_int.cpp
@@ -1,9 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose: Interfaces between the client.dll and engine
-//
-//===========================================================================//
-
#include "cbase.h"
#include "luamanager.h"
#include "luasrclib.h"
diff --git a/src/public/lcmodel.h b/src/public/lcmodel.h
index 8b6a74372a..b7410ea0a4 100644
--- a/src/public/lcmodel.h
+++ b/src/public/lcmodel.h
@@ -1,26 +1,9 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $Workfile: $
-// $Date: $
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LCMODEL_H
#define LCMODEL_H
#ifdef _WIN32
#pragma once
#endif
-/*
-==============================================================
-
-COLLISION DETECTION
-
-==============================================================
-*/
-
LUA_API void lua_pushcsurface( lua_State *L, csurface_t surface )
{
lua_newtable( L );
diff --git a/src/public/lengine.cpp b/src/public/lengine.cpp
index 23b3a4b3bb..3406b541c1 100644
--- a/src/public/lengine.cpp
+++ b/src/public/lengine.cpp
@@ -1,11 +1,3 @@
-//===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-//===========================================================================//
-
#include "cbase.h"
#include "luamanager.h"
#include "luasrclib.h"
diff --git a/src/public/lfilesystem.cpp b/src/public/lfilesystem.cpp
index b59bd21f54..112a0433a8 100644
--- a/src/public/lfilesystem.cpp
+++ b/src/public/lfilesystem.cpp
@@ -1,10 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//===========================================================================//
-
#include "cbase.h"
#include "filesystem.h"
#include "luamanager.h"
@@ -18,9 +11,9 @@
** access functions (stack -> C)
*/
-LUA_API lua_FileHandle_t &lua_tofilehandle( lua_State *L, int idx )
+LUA_API FileHandle_t &lua_tofilehandle( lua_State *L, int idx )
{
- lua_FileHandle_t *phFile = ( lua_FileHandle_t * )luaL_checkudata( L, idx, "FileHandle_t" );
+ FileHandle_t *phFile = ( FileHandle_t * )luaL_checkudata( L, idx, LUA_FILEHANDLEMETANAME );
return *phFile;
}
@@ -28,29 +21,42 @@ LUA_API lua_FileHandle_t &lua_tofilehandle( lua_State *L, int idx )
** push functions (C -> stack)
*/
-LUA_API void lua_pushfilehandle( lua_State *L, lua_FileHandle_t hFile )
+LUA_API void lua_pushfilehandle( lua_State *L, FileHandle_t hFile )
{
- lua_FileHandle_t *phFile = ( lua_FileHandle_t * )lua_newuserdata( L, sizeof( lua_FileHandle_t ) );
+ FileHandle_t *phFile = ( FileHandle_t * )lua_newuserdata( L, sizeof( FileHandle_t ) );
*phFile = hFile;
- LUA_SAFE_SET_METATABLE( L, "FileHandle_t" );
+ LUA_SAFE_SET_METATABLE( L, LUA_FILEHANDLEMETANAME );
}
-LUALIB_API lua_FileHandle_t &luaL_checkfilehandle( lua_State *L, int narg )
+LUALIB_API FileHandle_t &luaL_checkfilehandle( lua_State *L, int narg )
{
- lua_FileHandle_t *d = ( lua_FileHandle_t * )luaL_checkudata( L, narg, "FileHandle_t" );
+ FileHandle_t *d = ( FileHandle_t * )luaL_checkudata( L, narg, LUA_FILEHANDLEMETANAME );
+
if ( *d == FILESYSTEM_INVALID_HANDLE ) /* avoid extra test when d is not 0 */
luaL_argerror( L, narg, "FileHandle_t expected, got FILESYSTEM_INVALID_HANDLE" );
+
return *d;
}
-static int filesystem_AddPackFile( lua_State *L )
+LUA_REGISTRATION_INIT( Files );
+
+LUA_BINDING_BEGIN( Files, AddPackFile, "library", "Add a pack file to the search path." )
{
- lua_pushboolean( L, filesystem->AddPackFile( luaL_checkstring( L, 1 ), luaL_checkstring( L, 2 ) ) );
+ const char *filePath = LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "path" );
+ const char *pathId = LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "pathId" );
+
+ lua_pushboolean( L, filesystem->AddPackFile( filePath, pathId ) );
+
return 1;
}
+LUA_BINDING_END( "boolean", "true if the pack file was added, false otherwise." )
-static int filesystem_AddSearchPath( lua_State *L )
+LUA_BINDING_BEGIN( Files, AddSearchPath, "library", "Add a search path to the filesystem." )
{
+ const char *filePath = LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "path" );
+ const char *pathId = LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "pathId" );
+ SearchPathAdd_t addType = ( SearchPathAdd_t )( int )LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optnumber, 3, PATH_ADD_TO_TAIL, "addType" );
+
char fullpath[512] = { 0 };
bool bGetCurrentDirectory = V_GetCurrentDirectory( fullpath, sizeof( fullpath ) );
if ( bGetCurrentDirectory )
@@ -63,170 +69,252 @@ static int filesystem_AddSearchPath( lua_State *L )
#endif
V_SetCurrentDirectory( gamePath );
}
- filesystem->AddSearchPath( luaL_checkstring( L, 1 ), luaL_checkstring( L, 2 ), ( SearchPathAdd_t )( int )luaL_optnumber( L, 3, PATH_ADD_TO_TAIL ) );
+ filesystem->AddSearchPath( filePath, pathId, addType );
if ( bGetCurrentDirectory )
+ {
V_SetCurrentDirectory( fullpath );
+ }
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_BeginMapAccess( lua_State *L )
+LUA_BINDING_BEGIN( Files, BeginMapAccess, "library", "Begin map access." )
{
filesystem->BeginMapAccess();
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_CancelWaitForResources( lua_State *L )
+LUA_BINDING_BEGIN( Files, CancelWaitForResources, "library", "Cancel waiting for resources." )
{
- filesystem->CancelWaitForResources( luaL_checknumber( L, 1 ) );
+ filesystem->CancelWaitForResources( LUA_BINDING_ARGUMENT( luaL_checknumber, 1, "id" ) );
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_Close( lua_State *L )
+LUA_BINDING_BEGIN( Files, Close, "library", "Close a file." )
{
- filesystem->Close( luaL_checkfilehandle( L, 1 ) );
+ FileHandle_t &file = LUA_BINDING_ARGUMENT( luaL_checkfilehandle, 1, "file" );
+ filesystem->Close( file );
+
// Andrew; this isn't standard behavior or usage, but we do this for the sake
// of things being safe in Lua
- luaL_checkfilehandle( L, 1 ) = FILESYSTEM_INVALID_HANDLE;
+ file = FILESYSTEM_INVALID_HANDLE;
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_CreateDirHierarchy( lua_State *L )
+LUA_BINDING_BEGIN( Files, CreateDirectoryHierarchy, "library", "Create a directory hierarchy." )
{
- filesystem->CreateDirHierarchy( luaL_checkstring( L, 1 ), luaL_optstring( L, 2, 0 ) );
+ const char *path = LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "path" );
+ const char *pathId = LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optstring, 2, 0, "pathId" );
+
+ filesystem->CreateDirHierarchy( path, pathId );
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_DiscardPreloadData( lua_State *L )
+LUA_BINDING_BEGIN( Files, DiscardPreloadData, "library", "Discard preload data." )
{
filesystem->DiscardPreloadData();
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_Disconnect( lua_State *L )
+LUA_BINDING_BEGIN( Files, Disconnect, "library", "Disconnect." )
{
filesystem->Disconnect();
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_EnableWhitelistFileTracking( lua_State *L )
+LUA_BINDING_BEGIN( Files, EnableAllowListFileTracking, "library", "Enable allowlist file tracking." )
{
- filesystem->EnableWhitelistFileTracking( luaL_checkboolean( L, 1 ), luaL_checkboolean( L, 2 ), luaL_checkboolean( L, 3 ) );
+ bool enable = LUA_BINDING_ARGUMENT( luaL_checkboolean, 1, "enable" );
+ bool cacheAllVPKHashes = LUA_BINDING_ARGUMENT( luaL_checkboolean, 2, "cacheAllVPKHashes" );
+ bool recalculateAndCheckHashes = LUA_BINDING_ARGUMENT( luaL_checkboolean, 3, "recalculateAndCheckHashes" );
+
+ filesystem->EnableWhitelistFileTracking( enable, cacheAllVPKHashes, recalculateAndCheckHashes );
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_EndMapAccess( lua_State *L )
+LUA_BINDING_BEGIN( Files, EndMapAccess, "library", "End map access." )
{
filesystem->EndMapAccess();
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_EndOfFile( lua_State *L )
+LUA_BINDING_BEGIN( Files, EndOfFile, "library", "Check if the end of a file has been reached." )
{
- lua_pushboolean( L, filesystem->EndOfFile( luaL_checkfilehandle( L, 1 ) ) );
+ lua_pushboolean( L, filesystem->EndOfFile( LUA_BINDING_ARGUMENT( luaL_checkfilehandle, 1, "file" ) ) );
+
return 1;
}
+LUA_BINDING_END( "boolean", "true if the end of the file has been reached, false otherwise." )
-static int filesystem_FileExists( lua_State *L )
+LUA_BINDING_BEGIN( Files, FileExists, "library", "Check if a file exists." )
{
- lua_pushboolean( L, filesystem->FileExists( luaL_checkstring( L, 1 ), luaL_optstring( L, 2, 0 ) ) );
+ const char *filePath = LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "path" );
+ const char *pathId = LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optstring, 2, 0, "pathId" );
+
+ lua_pushboolean( L, filesystem->FileExists( filePath, pathId ) );
+
return 1;
}
+LUA_BINDING_END( "boolean", "true if the file exists, false otherwise." )
-static int filesystem_Flush( lua_State *L )
+LUA_BINDING_BEGIN( Files, Flush, "library", "Flush a file." )
{
- filesystem->Flush( luaL_checkfilehandle( L, 1 ) );
+ filesystem->Flush( LUA_BINDING_ARGUMENT( luaL_checkfilehandle, 1, "file" ) );
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_GetDVDMode( lua_State *L )
+LUA_BINDING_BEGIN( Files, GetDvdMode, "library", "Get the DVD mode." )
{
lua_pushinteger( L, filesystem->GetDVDMode() );
+
return 1;
}
+LUA_BINDING_END( "integer", "The DVD mode." )
-static int filesystem_GetLocalCopy( lua_State *L )
+LUA_BINDING_BEGIN( Files, GetLocalCopy, "library", "Get a local copy of a file." )
{
- filesystem->GetLocalCopy( luaL_checkstring( L, 1 ) );
+ filesystem->GetLocalCopy( LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "path" ) );
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_GetSearchPath( lua_State *L )
+LUA_BINDING_BEGIN( Files, GetSearchPath, "library", "Get the search path." )
{
char searchPath[MAX_PATH * 25]; // TODO: How do we know how many paths there are? This is a guess.
- filesystem->GetSearchPath_safe( luaL_checkstring( L, 1 ), luaL_optboolean( L, 2, false ), searchPath );
+ filesystem->GetSearchPath_safe( LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "path" ), LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optboolean, 2, false, "bGetPackFiles" ), searchPath );
lua_pushstring( L, searchPath );
+
return 1;
}
+LUA_BINDING_END( "string", "The search path." )
-static int filesystem_GetWhitelistSpewFlags( lua_State *L )
+LUA_BINDING_BEGIN( Files, GetWhitelistSpewFlags, "library", "Get the whitelist spew flags." )
{
lua_pushinteger( L, filesystem->GetWhitelistSpewFlags() );
+
return 1;
}
+LUA_BINDING_END( "integer", "The whitelist spew flags." )
-static int filesystem_HintResourceNeed( lua_State *L )
+LUA_BINDING_BEGIN( Files, HintResourceNeed, "library", "Hint that a resource is needed." )
{
- lua_pushinteger( L, filesystem->HintResourceNeed( luaL_checkstring( L, 1 ), luaL_checknumber( L, 2 ) ) );
+ const char *pFilename = LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "filename" );
+ int iCharacterCount = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "characterCount" );
+
+ lua_pushinteger( L, filesystem->HintResourceNeed( pFilename, iCharacterCount ) );
+
return 1;
}
+LUA_BINDING_END( "integer", "The hint resource need." )
-static int filesystem_IsDirectory( lua_State *L )
+LUA_BINDING_BEGIN( Files, IsDirectory, "library", "Check if a path is a directory." )
{
- lua_pushboolean( L, filesystem->IsDirectory( luaL_checkstring( L, 1 ), luaL_optstring( L, 2, 0 ) ) );
+ const char *filePath = LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "path" );
+ const char *pathId = LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optstring, 2, 0, "pathId" );
+
+ lua_pushboolean( L, filesystem->IsDirectory( filePath, pathId ) );
+
return 1;
}
+LUA_BINDING_END( "boolean", "true if the path is a directory, false otherwise." )
-static int filesystem_IsFileImmediatelyAvailable( lua_State *L )
+LUA_BINDING_BEGIN( Files, IsFileImmediatelyAvailable, "library", "Check if a file is immediately available." )
{
- lua_pushboolean( L, filesystem->IsFileImmediatelyAvailable( luaL_checkstring( L, 1 ) ) );
+ const char *filePath = LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "path" );
+
+ lua_pushboolean( L, filesystem->IsFileImmediatelyAvailable( filePath ) );
+
return 1;
}
+LUA_BINDING_END( "boolean", "true if the file is immediately available, false otherwise." )
-static int filesystem_IsFileWritable( lua_State *L )
+LUA_BINDING_BEGIN( Files, IsFileWritable, "library", "Check if a file is writable." )
{
- lua_pushboolean( L, filesystem->IsFileWritable( luaL_checkstring( L, 1 ), luaL_optstring( L, 2, 0 ) ) );
+ const char *filePath = LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "path" );
+ const char *pathId = LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optstring, 2, 0, "pathId" );
+
+ lua_pushboolean( L, filesystem->IsFileWritable( filePath, pathId ) );
+
return 1;
}
+LUA_BINDING_END( "boolean", "true if the file is writable, false otherwise." )
-static int filesystem_IsOk( lua_State *L )
+LUA_BINDING_BEGIN( Files, IsOk, "library", "Check if a file handle is valid." )
{
- lua_pushboolean( L, filesystem->IsOk( luaL_checkfilehandle( L, 1 ) ) );
+ lua_pushboolean( L, filesystem->IsOk( LUA_BINDING_ARGUMENT( luaL_checkfilehandle, 1, "file" ) ) );
+
return 1;
}
+LUA_BINDING_END( "boolean", "true if the file handle is valid, false otherwise." )
-static int filesystem_IsSteam( lua_State *L )
+LUA_BINDING_BEGIN( Files, IsSteam, "library", "Check if Steam is running." )
{
lua_pushboolean( L, filesystem->IsSteam() );
+
return 1;
}
+LUA_BINDING_END( "boolean", "true if Steam is running, false otherwise." )
-static int filesystem_LoadCompiledKeyValues( lua_State *L )
+LUA_BINDING_BEGIN( Files, LoadCompiledKeyValues, "library", "Load compiled key values." )
{
- filesystem->LoadCompiledKeyValues( ( IFileSystem::KeyValuesPreloadType_t )( int )luaL_checknumber( L, 1 ), luaL_checkstring( L, 2 ) );
+ filesystem->LoadCompiledKeyValues( ( IFileSystem::KeyValuesPreloadType_t )( int )LUA_BINDING_ARGUMENT( luaL_checknumber, 1, "preloadType" ), LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "filename" ) );
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_MarkAllCRCsUnverified( lua_State *L )
+LUA_BINDING_BEGIN( Files, MarkAllCrcsUnverified, "library", "Mark all CRCs as unverified." )
{
filesystem->MarkAllCRCsUnverified();
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_MarkPathIDByRequestOnly( lua_State *L )
+LUA_BINDING_BEGIN( Files, MarkPathIdByRequestOnly, "library", "Mark a path ID as request only." )
{
- filesystem->MarkPathIDByRequestOnly( luaL_checkstring( L, 1 ), luaL_checkboolean( L, 2 ) );
+ const char *pathId = LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "pathId" );
+ bool bRequestOnly = LUA_BINDING_ARGUMENT( luaL_checkboolean, 2, "requestOnly" );
+
+ filesystem->MarkPathIDByRequestOnly( pathId, bRequestOnly );
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_MountSteamContent( lua_State *L )
+LUA_BINDING_BEGIN( Files, MountSteamContent, "library", "Mount Steam content." )
{
- lua_pushinteger( L, filesystem->MountSteamContent( ( int )luaL_optnumber( L, 1, -1 ) ) );
+ lua_pushinteger( L, filesystem->MountSteamContent( LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optnumber, 1, -1, "appId" ) ) );
+
return 1;
}
+LUA_BINDING_END( "integer", "The mount Steam content." )
-static int filesystem_Open( lua_State *L )
+LUA_BINDING_BEGIN( Files, Open, "library", "Open a file." )
{
- char const *readMode = luaL_checkstring( L, 2 );
+ const char *filePath = LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "filePath" );
+ char const *readMode = LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "readMode" );
+ const char *pathId = LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optstring, 3, 0, "pathId" );
// Ensure that the read mode is valid
while ( *readMode )
@@ -240,32 +328,42 @@ static int filesystem_Open( lua_State *L )
readMode = luaL_checkstring( L, 2 );
- lua_pushfilehandle( L, filesystem->Open( luaL_checkstring( L, 1 ), readMode, luaL_optstring( L, 3, 0 ) ) );
+ lua_pushfilehandle( L, filesystem->Open( filePath, readMode, pathId ) );
return 1;
}
+LUA_BINDING_END( "FileHandle", "The file handle." )
-static int filesystem_Precache( lua_State *L )
+LUA_BINDING_BEGIN( Files, Precache, "library", "Precache a file." )
{
- lua_pushboolean( L, filesystem->Precache( luaL_checkstring( L, 1 ), luaL_optstring( L, 2, 0 ) ) );
+ const char *filePath = LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "path" );
+ const char *pathId = LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optstring, 2, 0, "pathId" );
+
+ lua_pushboolean( L, filesystem->Precache( filePath, pathId ) );
+
return 1;
}
+LUA_BINDING_END( "boolean", "true if the file was precached, false otherwise." )
-static int filesystem_PrintOpenedFiles( lua_State *L )
+LUA_BINDING_BEGIN( Files, PrintOpenedFiles, "library", "Print opened files." )
{
filesystem->PrintOpenedFiles();
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_PrintSearchPaths( lua_State *L )
+LUA_BINDING_BEGIN( Files, PrintSearchPaths, "library", "Print search paths." )
{
filesystem->PrintSearchPaths();
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_Read( lua_State *L )
+LUA_BINDING_BEGIN( Files, Read, "library", "Read from a file." )
{
- FileHandle_t file = luaL_checkfilehandle( L, 2 );
- int size = luaL_checknumber( L, 1 );
+ FileHandle_t &file = LUA_BINDING_ARGUMENT( luaL_checkfilehandle, 2, "file" );
+ int size = LUA_BINDING_ARGUMENT( luaL_checknumber, 1, "size" );
if ( size < 0 )
{
@@ -296,110 +394,159 @@ static int filesystem_Read( lua_State *L )
return 2;
}
+LUA_BINDING_END( "integer", "The number of bytes read.", "string", "The data read." )
-static int filesystem_RemoveAllSearchPaths( lua_State *L )
+LUA_BINDING_BEGIN( Files, RemoveAllSearchPaths, "library", "Remove all search paths." )
{
filesystem->RemoveAllSearchPaths();
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_RemoveFile( lua_State *L )
+LUA_BINDING_BEGIN( Files, RemoveFile, "library", "Remove a file." )
{
- filesystem->RemoveFile( luaL_checkstring( L, 1 ), luaL_optstring( L, 2, 0 ) );
+ const char *filePath = LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "path" );
+ const char *pathId = LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optstring, 2, 0, "pathId" );
+
+ filesystem->RemoveFile( filePath, pathId );
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_RemoveSearchPath( lua_State *L )
+LUA_BINDING_BEGIN( Files, RemoveSearchPath, "library", "Remove a search path." )
{
- lua_pushboolean( L, filesystem->RemoveSearchPath( luaL_checkstring( L, 1 ), luaL_optstring( L, 2, 0 ) ) );
+ const char *filePath = LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "path" );
+ const char *pathId = LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optstring, 2, 0, "pathId" );
+
+ lua_pushboolean( L, filesystem->RemoveSearchPath( filePath, pathId ) );
+
return 1;
}
+LUA_BINDING_END( "boolean", "true if the search path was removed, false otherwise." )
-static int filesystem_RemoveSearchPaths( lua_State *L )
+LUA_BINDING_BEGIN( Files, RemoveSearchPaths, "library", "Remove search paths." )
{
- filesystem->RemoveSearchPaths( luaL_checkstring( L, 1 ) );
+ const char *filePath = LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "path" );
+
+ filesystem->RemoveSearchPaths( filePath );
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_RenameFile( lua_State *L )
+LUA_BINDING_BEGIN( Files, RenameFile, "library", "Rename a file." )
{
- lua_pushboolean( L, filesystem->RenameFile( luaL_checkstring( L, 1 ), luaL_checkstring( L, 2 ), luaL_optstring( L, 3, 0 ) ) );
+ const char *pOldPath = LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "oldPath" );
+ const char *pNewPath = LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "newPath" );
+ const char *pathId = LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optstring, 3, 0, "pathId" );
+
+ lua_pushboolean( L, filesystem->RenameFile( pOldPath, pNewPath, pathId ) );
+
return 1;
}
+LUA_BINDING_END( "boolean", "true if the file was renamed, false otherwise." )
-static int filesystem_SetFileWritable( lua_State *L )
+LUA_BINDING_BEGIN( Files, SetFileWritable, "library", "Set a file as writable." )
{
- lua_pushboolean( L, filesystem->SetFileWritable( luaL_checkstring( L, 1 ), luaL_checkboolean( L, 2 ), luaL_optstring( L, 3, 0 ) ) );
+ const char *filePath = LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "path" );
+ bool bWritable = LUA_BINDING_ARGUMENT( luaL_checkboolean, 2, "writable" );
+ const char *pathId = LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optstring, 3, 0, "pathId" );
+
+ lua_pushboolean( L, filesystem->SetFileWritable( filePath, bWritable, pathId ) );
+
return 1;
}
+LUA_BINDING_END( "boolean", "true if the file was set as writable, false otherwise." )
-static int filesystem_SetupPreloadData( lua_State *L )
+LUA_BINDING_BEGIN( Files, SetupPreloadData, "library", "Setup preload data." )
{
filesystem->SetupPreloadData();
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_SetWarningLevel( lua_State *L )
+LUA_BINDING_BEGIN( Files, SetWarningLevel, "library", "Set the warning level." )
{
- filesystem->SetWarningLevel( ( FileWarningLevel_t )( int )luaL_checknumber( L, 1 ) );
+ filesystem->SetWarningLevel( ( FileWarningLevel_t )( int )LUA_BINDING_ARGUMENT( luaL_checknumber, 1, "level" ) );
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_SetWhitelistSpewFlags( lua_State *L )
+LUA_BINDING_BEGIN( Files, SetWhitelistSpewFlags, "library", "Set the whitelist spew flags." )
{
- filesystem->SetWhitelistSpewFlags( luaL_checknumber( L, 1 ) );
+ filesystem->SetWhitelistSpewFlags( LUA_BINDING_ARGUMENT( luaL_checknumber, 1, "flags" ) );
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_Shutdown( lua_State *L )
+LUA_BINDING_BEGIN( Files, Shutdown, "library", "Shutdown the filesystem." )
{
filesystem->Shutdown();
+
return 0;
}
+LUA_BINDING_END()
-static int filesystem_Size( lua_State *L )
+LUA_BINDING_BEGIN( Files, Size, "library", "Get the size of a file." )
{
switch ( lua_type( L, 1 ) )
{
case LUA_TSTRING:
- lua_pushinteger( L, filesystem->Size( luaL_checkstring( L, 1 ), luaL_optstring( L, 2, 0 ) ) );
+ lua_pushinteger( L, filesystem->Size( LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "path" ), LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optstring, 2, 0, "pathId" ) ) );
break;
case LUA_TUSERDATA:
default:
- lua_pushinteger( L, filesystem->Size( luaL_checkfilehandle( L, 1 ) ) );
+ lua_pushinteger( L, filesystem->Size( LUA_BINDING_ARGUMENT( luaL_checkfilehandle, 1, "file" ) ) );
break;
}
+
return 1;
}
+LUA_BINDING_END( "integer", "The size of the file." )
-static int filesystem_UnzipFile( lua_State *L )
+LUA_BINDING_BEGIN( Files, UnzipFile, "library", "Unzip a file." )
{
- lua_pushboolean( L, filesystem->UnzipFile( luaL_checkstring( L, 1 ), luaL_checkstring( L, 2 ), luaL_checkstring( L, 3 ) ) );
+ const char *pSource = LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "source" );
+ const char *pDestination = LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "destination" );
+ const char *pathId = LUA_BINDING_ARGUMENT( luaL_checkstring, 3, "pathId" );
+
+ lua_pushboolean( L, filesystem->UnzipFile( pSource, pDestination, pathId ) );
+
return 1;
}
+LUA_BINDING_END( "boolean", "true if the file was unzipped, false otherwise." )
-static int filesystem_WaitForResources( lua_State *L )
+LUA_BINDING_BEGIN( Files, WaitForResources, "library", "Wait for resources." )
{
- lua_pushinteger( L, filesystem->WaitForResources( luaL_checkstring( L, 1 ) ) );
+ lua_pushinteger( L, filesystem->WaitForResources( LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "path" ) ) );
+
return 1;
}
+LUA_BINDING_END( "integer", "The wait for resources." )
-static int filesystem_Write( lua_State *L )
+LUA_BINDING_BEGIN( Files, Write, "library", "Write to a file." )
{
size_t l;
- const char *pInput = luaL_checklstring( L, 1, &l );
- lua_pushinteger( L, filesystem->Write( pInput, l, luaL_checkfilehandle( L, 2 ) ) );
+ const char *pInput = LUA_BINDING_ARGUMENT_WITH_EXTRA( luaL_checklstring, 1, &l, "input" );
+ lua_pushinteger( L, filesystem->Write( pInput, l, LUA_BINDING_ARGUMENT( luaL_checkfilehandle, 2, "file" ) ) );
+
return 1;
}
+LUA_BINDING_END( "integer", "The number of bytes written." )
-static int filesystem_Find( lua_State *L )
+LUA_BINDING_BEGIN( Files, Find, "library", "Find files." )
{
- const char *path = luaL_checkstring( L, 1 );
- const char *pathID = luaL_optstring( L, 2, "GAME" );
+ const char *path = LUA_BINDING_ARGUMENT( luaL_checkstring, 1, "path" );
+ const char *pathId = LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optstring, 2, "GAME", "pathId" );
FileFindHandle_t fh;
- char const *fn = filesystem->FindFirstEx( path, pathID, &fh );
+ char const *fn = filesystem->FindFirstEx( path, pathId, &fh );
lua_createtable( L, 0, 0 ); // files
lua_createtable( L, 0, 0 ); // directories
@@ -430,67 +577,32 @@ static int filesystem_Find( lua_State *L )
return 2;
}
-
-static const luaL_Reg filesystemlib[] = {
- { "AddPackFile", filesystem_AddPackFile },
- { "AddSearchPath", filesystem_AddSearchPath },
- { "BeginMapAccess", filesystem_BeginMapAccess },
- { "CancelWaitForResources", filesystem_CancelWaitForResources },
- { "Close", filesystem_Close },
- { "CreateDirHierarchy", filesystem_CreateDirHierarchy },
- { "DiscardPreloadData", filesystem_DiscardPreloadData },
- { "Disconnect", filesystem_Disconnect },
- { "EnableWhitelistFileTracking", filesystem_EnableWhitelistFileTracking },
- { "EndMapAccess", filesystem_EndMapAccess },
- { "EndOfFile", filesystem_EndOfFile },
- { "FileExists", filesystem_FileExists },
- { "Flush", filesystem_Flush },
- { "GetDVDMode", filesystem_GetDVDMode },
- { "GetLocalCopy", filesystem_GetLocalCopy },
- { "GetSearchPath", filesystem_GetSearchPath },
- { "GetWhitelistSpewFlags", filesystem_GetWhitelistSpewFlags },
- { "HintResourceNeed", filesystem_HintResourceNeed },
- { "IsDirectory", filesystem_IsDirectory },
- { "IsFileImmediatelyAvailable", filesystem_IsFileImmediatelyAvailable },
- { "IsFileWritable", filesystem_IsFileWritable },
- { "IsOk", filesystem_IsOk },
- { "IsSteam", filesystem_IsSteam },
- { "LoadCompiledKeyValues", filesystem_LoadCompiledKeyValues },
- { "MarkAllCRCsUnverified", filesystem_MarkAllCRCsUnverified },
- { "MarkPathIDByRequestOnly", filesystem_MarkPathIDByRequestOnly },
- { "MountSteamContent", filesystem_MountSteamContent },
- { "Open", filesystem_Open },
- { "Precache", filesystem_Precache },
- { "PrintOpenedFiles", filesystem_PrintOpenedFiles },
- { "PrintSearchPaths", filesystem_PrintSearchPaths },
- { "Read", filesystem_Read },
- { "RemoveAllSearchPaths", filesystem_RemoveAllSearchPaths },
- { "RemoveFile", filesystem_RemoveFile },
- { "RemoveSearchPath", filesystem_RemoveSearchPath },
- { "RemoveSearchPaths", filesystem_RemoveSearchPaths },
- { "RenameFile", filesystem_RenameFile },
- { "SetFileWritable", filesystem_SetFileWritable },
- { "SetupPreloadData", filesystem_SetupPreloadData },
- { "SetWarningLevel", filesystem_SetWarningLevel },
- { "SetWhitelistSpewFlags", filesystem_SetWhitelistSpewFlags },
- { "Size", filesystem_Size },
- { "UnzipFile", filesystem_UnzipFile },
- { "WaitForResources", filesystem_WaitForResources },
- { "Write", filesystem_Write },
- //{"Shutdown", filesystem_Shutdown},
- { "Find", filesystem_Find },
- { NULL, NULL } };
+LUA_BINDING_END( "table", "The files and directories." )
/*
-** Metamethods
+** FileHandle Meta
*/
-static int FileHandle_t_Read( lua_State *L )
+LUA_REGISTRATION_INIT( FileHandle )
+
+#define GET_FILE_SIZE -1
+
+LUA_BINDING_BEGIN( FileHandle, Read, "class", "Read from a file." )
{
- FileHandle_t file;
- file = luaL_checkfilehandle( L, 1 );
+ FileHandle_t &file = LUA_BINDING_ARGUMENT( luaL_checkfilehandle, 1, "file" );
+ int size = LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optnumber, 2, GET_FILE_SIZE, "size" );
+
+ if ( size == GET_FILE_SIZE )
+ {
+ size = filesystem->Size( file );
+ }
+
+ if ( size < 0 )
+ {
+ lua_pushstring( L, "Invalid size parameter" );
+ return lua_error( L );
+ }
- int size = luaL_optinteger( L, 2, filesystem->Size( file ) );
char *buffer = new char[size + 1];
if ( !buffer )
{
@@ -499,6 +611,7 @@ static int FileHandle_t_Read( lua_State *L )
}
int bytesRead = filesystem->Read( buffer, size, file );
+
if ( bytesRead < 0 )
{
delete[] buffer;
@@ -509,85 +622,99 @@ static int FileHandle_t_Read( lua_State *L )
buffer[bytesRead] = '\0'; // Ensure the buffer is null-terminated
lua_pushlstring( L, buffer, bytesRead );
+ lua_pushinteger( L, bytesRead );
+
delete[] buffer;
- return 1;
+ return 2;
}
+LUA_BINDING_END( "integer", "The number of bytes read.", "string", "The data read." )
-static int FileHandle_t_Size( lua_State *L )
+LUA_BINDING_BEGIN( FileHandle, Size, "class", "Get the size of a file." )
{
- lua_pushinteger( L, filesystem->Size( luaL_checkfilehandle( L, 1 ) ) );
+ lua_pushinteger( L, filesystem->Size( LUA_BINDING_ARGUMENT( luaL_checkfilehandle, 1, "file" ) ) );
+
return 1;
}
+LUA_BINDING_END( "integer", "The size of the file." )
-static int FileHandle_t_Write( lua_State *L )
+LUA_BINDING_BEGIN( FileHandle, Write, "class", "Write to a file." )
{
size_t l;
- const char *pInput = luaL_checklstring( L, 2, &l );
- lua_pushinteger( L, filesystem->Write( pInput, l, luaL_checkfilehandle( L, 1 ) ) );
+ const char *pInput = LUA_BINDING_ARGUMENT_WITH_EXTRA( luaL_checklstring, 1, &l, "input" );
+ lua_pushinteger( L, filesystem->Write( pInput, l, LUA_BINDING_ARGUMENT( luaL_checkfilehandle, 2, "file" ) ) );
+
return 1;
}
+LUA_BINDING_END( "integer", "The number of bytes written." )
-static int FileHandle_t___gc( lua_State *L )
+LUA_BINDING_BEGIN( FileHandle, __gc, "class", "Close a file." )
{
- FileHandle_t hFile = lua_tofilehandle( L, 1 );
+ FileHandle_t hFile = LUA_BINDING_ARGUMENT( lua_tofilehandle, 1, "file" );
if ( hFile != FILESYSTEM_INVALID_HANDLE )
filesystem->Close( hFile );
+
return 0;
}
+LUA_BINDING_END()
-static int FileHandle_t___tostring( lua_State *L )
+LUA_BINDING_BEGIN( FileHandle, __tostring, "class", "Get the string representation of a file handle." )
{
- FileHandle_t hFile = lua_tofilehandle( L, 1 );
+ FileHandle_t hFile = LUA_BINDING_ARGUMENT( lua_tofilehandle, 1, "file" );
if ( hFile == FILESYSTEM_INVALID_HANDLE )
lua_pushstring( L, "FILESYSTEM_INVALID_HANDLE" );
else
lua_pushfstring( L, "FileHandle_t: %p", lua_tofilehandle( L, 1 ) );
+
return 1;
}
+LUA_BINDING_END( "string", "The string representation of the file handle." )
-static int FileHandle_t___eq( lua_State *L )
+LUA_BINDING_BEGIN( FileHandle, __eq, "class", "Check if two file handles are equal." )
{
- FileHandle_t hFile1 = lua_tofilehandle( L, 1 );
- FileHandle_t hFile2 = lua_tofilehandle( L, 2 );
+ FileHandle_t hFile1 = LUA_BINDING_ARGUMENT( lua_tofilehandle, 1, "file1" );
+ FileHandle_t hFile2 = LUA_BINDING_ARGUMENT( lua_tofilehandle, 2, "file2" );
lua_pushboolean( L, hFile1 == hFile2 );
+
return 1;
}
+LUA_BINDING_END( "boolean", "true if the file handles are equal, false otherwise." )
-static int FileHandle_t___len( lua_State *L )
+LUA_BINDING_BEGIN( FileHandle, __len, "class", "Get the length of a file." )
{
- if ( lua_tofilehandle( L, 1 ) == FILESYSTEM_INVALID_HANDLE )
+ FileHandle_t hFile = LUA_BINDING_ARGUMENT( lua_tofilehandle, 1, "file" );
+ if ( hFile == FILESYSTEM_INVALID_HANDLE )
lua_pushnil( L );
else
- lua_pushinteger( L, filesystem->Size( lua_tofilehandle( L, 1 ) ) );
+ lua_pushinteger( L, filesystem->Size( hFile ) );
return 1;
}
-
-static const luaL_Reg FileHandle_tmeta[] = {
- { "Read", FileHandle_t_Read },
- { "Size", FileHandle_t_Size },
- { "Write", FileHandle_t_Write },
- { "__gc", FileHandle_t___gc },
- { "__eq", FileHandle_t___eq },
- { "__len", FileHandle_t___len },
- { "__tostring", FileHandle_t___tostring },
- { NULL, NULL } };
+LUA_BINDING_END( "integer", "The length of the file or nil if the file handle is invalid." )
/*
-** Open filesystem library
+** Open filesystem library and meta table
*/
-LUALIB_API int luaopen_filesystem( lua_State *L )
+LUALIB_API int luaopen_Files( lua_State *L )
{
- LUA_PUSH_NEW_METATABLE( L, "FileHandle_t" );
- luaL_register( L, NULL, FileHandle_tmeta );
+ LUA_REGISTRATION_COMMIT_LIBRARY( Files );
+
+ lua_pushfilehandle( L, FILESYSTEM_INVALID_HANDLE );
+ lua_setglobal( L, "FILESYSTEM_INVALID_HANDLE" );
+
+ return 1;
+}
+
+LUALIB_API int luaopen_FileHandle( lua_State *L )
+{
+ LUA_PUSH_NEW_METATABLE( L, LUA_FILEHANDLEMETANAME );
+
+ LUA_REGISTRATION_COMMIT( FileHandle );
+
lua_pushvalue( L, -1 ); /* push metatable */
lua_setfield( L, -2, "__index" ); /* metatable.__index = metatable */
- lua_pushstring( L, "FileHandle" );
+ lua_pushstring( L, LUA_FILEHANDLEMETANAME );
lua_setfield( L, -2, "__type" ); /* metatable.__type = "FileHandle" */
- lua_pop( L, 1 );
- lua_pushfilehandle( L, FILESYSTEM_INVALID_HANDLE );
- lua_setglobal( L, "FILESYSTEM_INVALID_HANDLE" );
- luaL_register( L, LUA_FILESYSTEMLIBNAME, filesystemlib );
+
return 1;
}
diff --git a/src/public/lfilesystem.h b/src/public/lfilesystem.h
index 81e6810f4d..6255f41b3c 100644
--- a/src/public/lfilesystem.h
+++ b/src/public/lfilesystem.h
@@ -1,10 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//===========================================================================//
-
#ifndef LFILESYSTEM_H
#define LFILESYSTEM_H
@@ -15,23 +8,17 @@
/* type for FileHandle_t functions */
typedef FileHandle_t lua_FileHandle_t;
-
-
/*
** access functions (stack -> C)
*/
LUA_API lua_FileHandle_t &(lua_tofilehandle) (lua_State *L, int idx);
-
/*
** push functions (C -> stack)
*/
LUA_API void (lua_pushfilehandle) (lua_State *L, lua_FileHandle_t hFile);
-
-
LUALIB_API lua_FileHandle_t &(luaL_checkfilehandle) (lua_State *L, int narg);
-
#endif // LFILESYSTEM_H
diff --git a/src/public/lgametrace.cpp b/src/public/lgametrace.cpp
index 661636d23f..b5aed1ed20 100644
--- a/src/public/lgametrace.cpp
+++ b/src/public/lgametrace.cpp
@@ -1,9 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-//=============================================================================//
-
#include "cbase.h"
#include "luamanager.h"
#include "luasrclib.h"
diff --git a/src/public/lgametrace.h b/src/public/lgametrace.h
index bcf829ef13..dc78cd12ad 100644
--- a/src/public/lgametrace.h
+++ b/src/public/lgametrace.h
@@ -1,37 +1,23 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-//=============================================================================//
-
#ifndef LGAMETRACE_H
#define LGAMETRACE_H
#ifdef _WIN32
#pragma once
#endif
-
/* type for CGameTrace functions */
typedef CGameTrace lua_CGameTrace;
-
-
/*
** access functions (stack -> C)
*/
LUA_API lua_CGameTrace &(lua_totrace) (lua_State *L, int idx);
-
/*
** push functions (C -> stack)
*/
LUA_API void (lua_pushtrace) (lua_State *L, lua_CGameTrace &tr);
-
-
LUALIB_API lua_CGameTrace &(luaL_checktrace) (lua_State *L, int narg);
-
#endif // LGAMETRACE_H
-
diff --git a/src/public/lglobalvars_base.cpp b/src/public/lglobalvars_base.cpp
index cf68fa401a..3266d2c6f7 100644
--- a/src/public/lglobalvars_base.cpp
+++ b/src/public/lglobalvars_base.cpp
@@ -1,9 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-//=============================================================================//
-
#include "cbase.h"
#include "lua.hpp"
#include "luasrclib.h"
diff --git a/src/public/licvar.cpp b/src/public/licvar.cpp
index c0e18fb9d8..3cfaadc6fa 100644
--- a/src/public/licvar.cpp
+++ b/src/public/licvar.cpp
@@ -1,9 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-//===========================================================================//
-
#include "cbase.h"
#include "luamanager.h"
#include "luasrclib.h"
diff --git a/src/public/licvar.h b/src/public/licvar.h
index fffe6f2f12..498a0788c1 100644
--- a/src/public/licvar.h
+++ b/src/public/licvar.h
@@ -1,9 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-//===========================================================================//
-
#ifndef LICVAR_H
#define LICVAR_H
#ifdef _WIN32
diff --git a/src/public/lienginevgui.cpp b/src/public/lienginevgui.cpp
index 9202ed0af6..2cbd9587f6 100644
--- a/src/public/lienginevgui.cpp
+++ b/src/public/lienginevgui.cpp
@@ -1,12 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $Workfile: $
-// $Date: $
-// $NoKeywords: $
-//=============================================================================//
-
#include "cbase.h"
#include "ienginevgui.h"
#include "lua.hpp"
diff --git a/src/public/linetchannelinfo.cpp b/src/public/linetchannelinfo.cpp
index 74b5791043..c97aaccf71 100644
--- a/src/public/linetchannelinfo.cpp
+++ b/src/public/linetchannelinfo.cpp
@@ -1,15 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $Workfile: $
-// $Date: $
-//
-//-----------------------------------------------------------------------------
-// $Log: $
-//
-// $NoKeywords: $
-//=============================================================================//
#include "cbase.h"
#include "inetchannelinfo.h"
#include "lua.hpp"
diff --git a/src/public/linetchannelinfo.h b/src/public/linetchannelinfo.h
index 5a578d8ae6..33bd00b2ad 100644
--- a/src/public/linetchannelinfo.h
+++ b/src/public/linetchannelinfo.h
@@ -1,44 +1,25 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $Workfile: $
-// $Date: $
-//
-//-----------------------------------------------------------------------------
-// $Log: $
-//
-// $NoKeywords: $
-//=============================================================================//
#if !defined( LINETCHANNELINFO_H )
#define LINETCHANNELINFO_H
#ifdef _WIN32
#pragma once
#endif
-#pragma warning( disable: 4189 )
-
+#pragma warning( disable : 4189 )
/* type for INetChannelInfo functions */
typedef INetChannelInfo lua_INetChannelInfo;
-
-
/*
** access functions (stack -> C)
*/
-LUA_API lua_INetChannelInfo *(lua_tonetchannel) (lua_State *L, int idx);
-
+LUA_API lua_INetChannelInfo *( lua_tonetchannel )( lua_State *L, int idx );
/*
** push functions (C -> stack)
*/
-LUA_API void (lua_pushnetchannel) (lua_State *L, lua_INetChannelInfo *netchannel);
-
-
-
-LUALIB_API lua_INetChannelInfo *(luaL_checknetchannel) (lua_State *L, int narg);
+LUA_API void( lua_pushnetchannel )( lua_State *L, lua_INetChannelInfo *netchannel );
+LUALIB_API lua_INetChannelInfo *( luaL_checknetchannel )( lua_State *L, int narg );
-#endif // LINETCHANNELINFO_H
\ No newline at end of file
+#endif // LINETCHANNELINFO_H
diff --git a/src/public/lnetworkstringtabledefs.cpp b/src/public/lnetworkstringtabledefs.cpp
index cf97656061..8fa0a27a85 100644
--- a/src/public/lnetworkstringtabledefs.cpp
+++ b/src/public/lnetworkstringtabledefs.cpp
@@ -1,9 +1,3 @@
-//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
#include "cbase.h"
#include "networkstringtabledefs.h"
#include "luamanager.h"
diff --git a/src/public/lnetworkstringtabledefs.h b/src/public/lnetworkstringtabledefs.h
index 1d97ebc190..ce080d09f5 100644
--- a/src/public/lnetworkstringtabledefs.h
+++ b/src/public/lnetworkstringtabledefs.h
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LNETWORKSTRINGTABLEDEFS_H
#define LNETWORKSTRINGTABLEDEFS_H
#ifdef _WIN32
@@ -16,23 +9,17 @@
/* type for INetworkStringTable functions */
typedef INetworkStringTable lua_INetworkStringTable;
-
-
/*
** access functions (stack -> C)
*/
-LUA_API lua_INetworkStringTable *(lua_tostringtable) (lua_State *L, int idx);
-
+LUA_API lua_INetworkStringTable *( lua_tostringtable )( lua_State *L, int idx );
/*
** push functions (C -> stack)
*/
-LUA_API void (lua_pushstringtable) (lua_State *L, lua_INetworkStringTable *pNetworkStringTable);
-
-
-
-LUALIB_API lua_INetworkStringTable *(luaL_checkstringtable) (lua_State *L, int narg);
+LUA_API void( lua_pushstringtable )( lua_State *L, lua_INetworkStringTable *pNetworkStringTable );
+LUALIB_API lua_INetworkStringTable *( luaL_checkstringtable )( lua_State *L, int narg );
-#endif // LNETWORKSTRINGTABLEDEFS_H
+#endif // LNETWORKSTRINGTABLEDEFS_H
diff --git a/src/public/lvphysics_interface.cpp b/src/public/lvphysics_interface.cpp
index 600626863c..1b16f42d2b 100644
--- a/src/public/lvphysics_interface.cpp
+++ b/src/public/lvphysics_interface.cpp
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose: Public interfaces to vphysics DLL
-//
-// $NoKeywords: $
-//=============================================================================//
-
#include "cbase.h"
#include "vphysics_interface.h"
#include "vphysics/performance.h"
diff --git a/src/public/lvphysics_interface.h b/src/public/lvphysics_interface.h
index 94e75211e7..b44efef5ac 100644
--- a/src/public/lvphysics_interface.h
+++ b/src/public/lvphysics_interface.h
@@ -1,18 +1,10 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose: Public interfaces to vphysics DLL
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LVPHYSICS_INTERFACE_H
#define LVPHYSICS_INTERFACE_H
#ifdef _WIN32
#pragma once
#endif
-#pragma warning (disable : 4238)
-
+#pragma warning( disable : 4238 )
/* type for IPhysicsObject functions */
typedef IPhysicsObject lua_IPhysicsObject;
@@ -24,38 +16,32 @@ typedef surfacegameprops_t lua_surfacegameprops_t;
typedef surfacedata_t lua_surfacedata_t;
typedef IPhysicsSurfaceProps lua_IPhysicsSurfaceProps;
-
-
/*
** access functions (stack -> C)
*/
-LUA_API lua_IPhysicsObject *(lua_tophysicsobject) (lua_State *L, int idx);
-LUA_API lua_surfacephysicsparams_t (lua_tosurfacephysicsparams) (lua_State *L, int idx);
-LUA_API lua_surfaceaudioparams_t (lua_tosurfaceaudioparams) (lua_State *L, int idx);
-LUA_API lua_surfacesoundnames_t (lua_tosurfacesoundnames) (lua_State *L, int idx);
-LUA_API lua_surfacesoundhandles_t (lua_tosurfacesoundhandles) (lua_State *L, int idx);
-LUA_API lua_surfacegameprops_t (lua_tosurfacegameprops) (lua_State *L, int idx);
-LUA_API lua_surfacedata_t (lua_tosurfacedata) (lua_State *L, int idx);
-LUA_API lua_IPhysicsSurfaceProps *(lua_tophysicssurfaceprops) (lua_State *L, int idx);
-
+LUA_API lua_IPhysicsObject *( lua_tophysicsobject )( lua_State *L, int idx );
+LUA_API lua_surfacephysicsparams_t( lua_tosurfacephysicsparams )( lua_State *L, int idx );
+LUA_API lua_surfaceaudioparams_t( lua_tosurfaceaudioparams )( lua_State *L, int idx );
+LUA_API lua_surfacesoundnames_t( lua_tosurfacesoundnames )( lua_State *L, int idx );
+LUA_API lua_surfacesoundhandles_t( lua_tosurfacesoundhandles )( lua_State *L, int idx );
+LUA_API lua_surfacegameprops_t( lua_tosurfacegameprops )( lua_State *L, int idx );
+LUA_API lua_surfacedata_t( lua_tosurfacedata )( lua_State *L, int idx );
+LUA_API lua_IPhysicsSurfaceProps *( lua_tophysicssurfaceprops )( lua_State *L, int idx );
/*
** push functions (C -> stack)
*/
-LUA_API void (lua_pushphysicsobject) (lua_State *L, lua_IPhysicsObject *pPhysicsObject);
-LUA_API void (lua_pushsurfacephysicsparams) (lua_State *L, lua_surfacephysicsparams_t *pphysics);
-LUA_API void (lua_pushsurfaceaudioparams) (lua_State *L, lua_surfaceaudioparams_t *paudio);
-LUA_API void (lua_pushsurfacesoundnames) (lua_State *L, lua_surfacesoundnames_t *psounds);
-LUA_API void (lua_pushsurfacesoundhandles) (lua_State *L, lua_surfacesoundhandles_t *psoundhandles);
-LUA_API void (lua_pushsurfacegameprops) (lua_State *L, lua_surfacegameprops_t *pgame);
-LUA_API void (lua_pushsurfacedata) (lua_State *L, lua_surfacedata_t *psurface);
-LUA_API void (lua_pushphysicssurfaceprops) (lua_State *L, lua_IPhysicsSurfaceProps *pProps);
-
-
-
-LUALIB_API lua_IPhysicsObject *(luaL_checkphysicsobject) (lua_State *L, int narg);
-LUALIB_API lua_IPhysicsSurfaceProps *(luaL_checkphysicssurfaceprops) (lua_State *L, int narg);
-
-
-#endif // LVPHYSICS_INTERFACE_H
+LUA_API void( lua_pushphysicsobject )( lua_State *L, lua_IPhysicsObject *pPhysicsObject );
+LUA_API void( lua_pushsurfacephysicsparams )( lua_State *L, lua_surfacephysicsparams_t *pphysics );
+LUA_API void( lua_pushsurfaceaudioparams )( lua_State *L, lua_surfaceaudioparams_t *paudio );
+LUA_API void( lua_pushsurfacesoundnames )( lua_State *L, lua_surfacesoundnames_t *psounds );
+LUA_API void( lua_pushsurfacesoundhandles )( lua_State *L, lua_surfacesoundhandles_t *psoundhandles );
+LUA_API void( lua_pushsurfacegameprops )( lua_State *L, lua_surfacegameprops_t *pgame );
+LUA_API void( lua_pushsurfacedata )( lua_State *L, lua_surfacedata_t *psurface );
+LUA_API void( lua_pushphysicssurfaceprops )( lua_State *L, lua_IPhysicsSurfaceProps *pProps );
+
+LUALIB_API lua_IPhysicsObject *( luaL_checkphysicsobject )( lua_State *L, int narg );
+LUALIB_API lua_IPhysicsSurfaceProps *( luaL_checkphysicssurfaceprops )( lua_State *L, int narg );
+
+#endif // LVPHYSICS_INTERFACE_H
diff --git a/src/public/materialsystem/limaterial.cpp b/src/public/materialsystem/limaterial.cpp
index 74a2b1645d..49adb39975 100644
--- a/src/public/materialsystem/limaterial.cpp
+++ b/src/public/materialsystem/limaterial.cpp
@@ -1,10 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-//===========================================================================//
#include "cbase.h"
#include "imaterial.h"
#include "materialsystem/imaterialvar.h"
diff --git a/src/public/materialsystem/limaterial.h b/src/public/materialsystem/limaterial.h
index a5dfd57c56..2041abdccd 100644
--- a/src/public/materialsystem/limaterial.h
+++ b/src/public/materialsystem/limaterial.h
@@ -1,11 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-//===========================================================================//
-
#ifndef LIMATERIAL_H
#define LIMATERIAL_H
@@ -16,23 +8,17 @@
/* type for IMaterial functions */
typedef IMaterial lua_IMaterial;
-
-
/*
** access functions (stack -> C)
*/
-LUA_API lua_IMaterial *(lua_tomaterial) (lua_State *L, int idx);
-
+LUA_API lua_IMaterial *( lua_tomaterial )( lua_State *L, int idx );
/*
** push functions (C -> stack)
*/
-LUA_API void (lua_pushmaterial) (lua_State *L, lua_IMaterial *pMaterial);
-
-
-
-LUALIB_API lua_IMaterial *(luaL_checkmaterial) (lua_State *L, int narg);
+LUA_API void( lua_pushmaterial )( lua_State *L, lua_IMaterial *pMaterial );
+LUALIB_API lua_IMaterial *( luaL_checkmaterial )( lua_State *L, int narg );
-#endif // LIMATERIAL_H
+#endif // LIMATERIAL_H
diff --git a/src/public/mathlib/langle.cpp b/src/public/mathlib/langle.cpp
index d24d0f9cda..ae2a54b1bd 100644
--- a/src/public/mathlib/langle.cpp
+++ b/src/public/mathlib/langle.cpp
@@ -1,11 +1,3 @@
-//====== Copyright © 1996-2005, Valve Corporation, All rights reserved. =======//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-//=============================================================================//
-
#include "cbase.h"
#include "vector.h"
#include "fmtstr.h"
diff --git a/src/public/mathlib/langle.h b/src/public/mathlib/langle.h
index e5acabb5bb..a8400d248f 100644
--- a/src/public/mathlib/langle.h
+++ b/src/public/mathlib/langle.h
@@ -1,11 +1,3 @@
-//====== Copyright © 1996-2005, Valve Corporation, All rights reserved. =======//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-//=============================================================================//
-
#ifndef LANGLE_H
#define LANGLE_H
@@ -20,8 +12,8 @@ typedef QAngle lua_QAngle;
** access functions (stack -> C)
*/
-LUA_API lua_QAngle &(lua_toangle) (lua_State *L, int idx);
-LUA_API bool(lua_isangle) (lua_State *L, int idx);
+LUA_API lua_QAngle &( lua_toangle )( lua_State *L, int idx );
+LUA_API bool( lua_isangle )( lua_State *L, int idx );
/*
** push functions (C -> stack)
@@ -29,12 +21,10 @@ LUA_API bool(lua_isangle) (lua_State *L, int idx);
LUA_API void( lua_pushangle )( lua_State *L, lua_QAngle &v );
LUA_API void lua_pushangle( lua_State *L, const lua_QAngle &v );
-
-LUALIB_API lua_QAngle &(luaL_checkangle) (lua_State *L, int narg);
-LUALIB_API lua_QAngle &(luaL_optangle) (lua_State *L, int narg, lua_QAngle *def);
+LUALIB_API lua_QAngle &( luaL_checkangle )( lua_State *L, int narg );
+LUALIB_API lua_QAngle &( luaL_optangle )( lua_State *L, int narg, lua_QAngle *def );
#define LUA_BINDING_PUSH_RESULT_ANGLE( ReturnPosition, Value ) \
LUA_BINDING_PUSH_RESULT( lua_pushangle, Value.x, Value.y, Value.z );
-#endif // LANGLE_H
-
+#endif // LANGLE_H
diff --git a/src/public/mathlib/lmathlib.cpp b/src/public/mathlib/lmathlib.cpp
index fb37efcdc5..4d4949ad70 100644
--- a/src/public/mathlib/lmathlib.cpp
+++ b/src/public/mathlib/lmathlib.cpp
@@ -1,9 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-//===========================================================================//
-
#include "cbase.h"
#include "mathlib.h"
#include "lua.hpp"
diff --git a/src/public/mathlib/lmathlib.h b/src/public/mathlib/lmathlib.h
index 725af6686c..86895bc259 100644
--- a/src/public/mathlib/lmathlib.h
+++ b/src/public/mathlib/lmathlib.h
@@ -1,9 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-//===========================================================================//
-
#ifndef LMATHLIB_H
#define LMATHLIB_H
@@ -14,24 +8,17 @@
/* type for matrix3x4_t functions */
typedef matrix3x4_t lua_matrix3x4_t;
-
-
/*
** access functions (stack -> C)
*/
-LUA_API lua_matrix3x4_t &(lua_tomatrix) (lua_State *L, int idx);
-
+LUA_API lua_matrix3x4_t &( lua_tomatrix )( lua_State *L, int idx );
/*
** push functions (C -> stack)
*/
-LUA_API void (lua_pushmatrix) (lua_State *L, lua_matrix3x4_t &v);
-
-
-
-LUALIB_API lua_matrix3x4_t &(luaL_checkmatrix) (lua_State *L, int narg);
+LUA_API void( lua_pushmatrix )( lua_State *L, lua_matrix3x4_t &v );
+LUALIB_API lua_matrix3x4_t &( luaL_checkmatrix )( lua_State *L, int narg );
#endif
-
diff --git a/src/public/mathlib/lvector.h b/src/public/mathlib/lvector.h
index 20194baf1f..407ddc656a 100644
--- a/src/public/mathlib/lvector.h
+++ b/src/public/mathlib/lvector.h
@@ -1,11 +1,3 @@
-//====== Copyright © 1996-2005, Valve Corporation, All rights reserved. =======//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-//=============================================================================//
-
#ifndef LVECTOR_H
#define LVECTOR_H
@@ -20,8 +12,8 @@ typedef Vector lua_Vector;
** access functions (stack -> C)
*/
-LUA_API lua_Vector &(lua_tovector) (lua_State *L, int idx);
-LUA_API bool(lua_isvector) (lua_State *L, int idx);
+LUA_API lua_Vector &( lua_tovector )( lua_State *L, int idx );
+LUA_API bool( lua_isvector )( lua_State *L, int idx );
/*
** push functions (C -> stack)
@@ -29,8 +21,8 @@ LUA_API bool(lua_isvector) (lua_State *L, int idx);
LUA_API void( lua_pushvector )( lua_State *L, lua_Vector &v );
LUA_API void lua_pushvector( lua_State *L, const lua_Vector &v );
-LUALIB_API lua_Vector &(luaL_checkvector) (lua_State *L, int narg);
-LUALIB_API lua_Vector &(luaL_optvector) (lua_State *L, int narg, lua_Vector *def);
+LUALIB_API lua_Vector &( luaL_checkvector )( lua_State *L, int narg );
+LUALIB_API lua_Vector &( luaL_optvector )( lua_State *L, int narg, lua_Vector *def );
#define LUA_BINDING_PUSH_RESULT_VECTOR( ReturnPosition, Value ) \
LUA_BINDING_PUSH_RESULT( lua_pushvector, Value.x, Value.y, Value.z );
@@ -38,4 +30,4 @@ LUALIB_API lua_Vector &(luaL_optvector) (lua_State *L, int narg, lua_Vector *def
#define LUA_BINDING_PUSH_RESULT_VECTOR4D( ReturnPosition, Value ) \
LUA_BINDING_PUSH_RESULT( lua_pushvector4d, Value.x, Value.y, Value.z, Value.w );
-#endif // LVECTOR_H
+#endif // LVECTOR_H
diff --git a/src/public/mathlib/lvmatrix.cpp b/src/public/mathlib/lvmatrix.cpp
index ea4e94d690..a78edbb383 100644
--- a/src/public/mathlib/lvmatrix.cpp
+++ b/src/public/mathlib/lvmatrix.cpp
@@ -1,25 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved.
-//============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-//=============================================================================//
-//
-// VMatrix always postmultiply vectors as in Ax = b.
-// Given a set of basis vectors ((F)orward, (L)eft, (U)p), and a (T)ranslation,
-// a matrix to transform a vector into that space looks like this:
-// Fx Lx Ux Tx
-// Fy Ly Uy Ty
-// Fz Lz Uz Tz
-// 0 0 0 1
-
-// Note that concatenating matrices needs to multiply them in reverse order.
-// ie: if I want to apply matrix A, B, then C, the equation needs to look like
-// this: C * B * A * v ie: v = A * v; v = B * v; v = C * v;
-//=============================================================================
-
#include "cbase.h"
#include
#include "mathlib/vmatrix.h"
diff --git a/src/public/mathlib/lvmatrix.h b/src/public/mathlib/lvmatrix.h
index ed65fb1201..aafef180d5 100644
--- a/src/public/mathlib/lvmatrix.h
+++ b/src/public/mathlib/lvmatrix.h
@@ -1,28 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-//=============================================================================//
-//
-// VMatrix always postmultiply vectors as in Ax = b.
-// Given a set of basis vectors ((F)orward, (L)eft, (U)p), and a (T)ranslation,
-// a matrix to transform a vector into that space looks like this:
-// Fx Lx Ux Tx
-// Fy Ly Uy Ty
-// Fz Lz Uz Tz
-// 0 0 0 1
-
-// Note that concatenating matrices needs to multiply them in reverse order.
-// ie: if I want to apply matrix A, B, then C, the equation needs to look like this:
-// C * B * A * v
-// ie:
-// v = A * v;
-// v = B * v;
-// v = C * v;
-//=============================================================================
-
#ifndef LVMATRIX_H
#define LVMATRIX_H
@@ -33,24 +8,17 @@
/* type for VMatrix functions */
typedef VMatrix lua_VMatrix;
-
-
/*
** access functions (stack -> C)
*/
-LUA_API lua_VMatrix &(lua_tovmatrix) (lua_State *L, int idx);
-
+LUA_API lua_VMatrix &( lua_tovmatrix )( lua_State *L, int idx );
/*
** push functions (C -> stack)
*/
-LUA_API void (lua_pushvmatrix) (lua_State *L, lua_VMatrix &matrix);
+LUA_API void( lua_pushvmatrix )( lua_State *L, lua_VMatrix &matrix );
-
-
-LUALIB_API lua_VMatrix &(luaL_checkvmatrix) (lua_State *L, int narg);
+LUALIB_API lua_VMatrix &( luaL_checkvmatrix )( lua_State *L, int narg );
#endif
-
-
diff --git a/src/public/steam/listeamfriends.cpp b/src/public/steam/listeamfriends.cpp
index de431e4e0e..dec350c479 100644
--- a/src/public/steam/listeamfriends.cpp
+++ b/src/public/steam/listeamfriends.cpp
@@ -1,10 +1,3 @@
-
-//====== Copyright � 1996-2004, Valve Corporation, All rights reserved. =======
-//
-// Purpose: interface to friends data in Steam
-//
-//=============================================================================
-
#include "cbase.h"
#include "lua.hpp"
#include "luasrclib.h"
diff --git a/src/public/steam/listeamfriends.h b/src/public/steam/listeamfriends.h
index 3cb4f1d349..5de59e906c 100644
--- a/src/public/steam/listeamfriends.h
+++ b/src/public/steam/listeamfriends.h
@@ -1,10 +1,3 @@
-
-//====== Copyright © 1996-2004, Valve Corporation, All rights reserved. =======
-//
-// Purpose: interface to friends data in Steam
-//
-//=============================================================================
-
#ifndef LISTEAMFRIENDS_H
#define LISTEAMFRIENDS_H
#ifdef _WIN32
@@ -16,23 +9,17 @@
/* type for ISteamFriends functions */
typedef ISteamFriends lua_ISteamFriends;
-
-
/*
** access functions (stack -> C)
*/
-LUA_API lua_ISteamFriends *(lua_tosteamfriends) (lua_State *L, int idx);
-
+LUA_API lua_ISteamFriends *( lua_tosteamfriends )( lua_State *L, int idx );
/*
** push functions (C -> stack)
*/
-LUA_API void (lua_pushsteamfriends) (lua_State *L, lua_ISteamFriends *pSteamFriends);
-
-
-
-LUALIB_API lua_ISteamFriends *(luaL_checksteamfriends) (lua_State *L, int narg);
+LUA_API void( lua_pushsteamfriends )( lua_State *L, lua_ISteamFriends *pSteamFriends );
+LUALIB_API lua_ISteamFriends *( luaL_checksteamfriends )( lua_State *L, int narg );
-#endif // LISTEAMFRIENDS_H
+#endif // LISTEAMFRIENDS_H
diff --git a/src/public/steam/lsteam_api.cpp b/src/public/steam/lsteam_api.cpp
index 3032451835..25eedd2ac7 100644
--- a/src/public/steam/lsteam_api.cpp
+++ b/src/public/steam/lsteam_api.cpp
@@ -1,9 +1,3 @@
-//====== Copyright © 1996-2004, Valve Corporation, All rights reserved. =======
-//
-// Purpose:
-//
-//=============================================================================
-
#include "cbase.h"
#include "steam_api.h"
#include "lua.hpp"
diff --git a/src/public/tier0/ldbg.cpp b/src/public/tier0/ldbg.cpp
index 52639b2a27..e45680739d 100644
--- a/src/public/tier0/ldbg.cpp
+++ b/src/public/tier0/ldbg.cpp
@@ -1,11 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved.
-//========//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-//=============================================================================//
#include "cbase.h"
#include "lua.hpp"
#include "luasrclib.h"
diff --git a/src/public/tier1/LKeyValues.cpp b/src/public/tier1/LKeyValues.cpp
index 386f8f8abc..d4310fbdb1 100644
--- a/src/public/tier1/LKeyValues.cpp
+++ b/src/public/tier1/LKeyValues.cpp
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#include "cbase.h"
#include "KeyValues.h"
#include "filesystem.h"
diff --git a/src/public/tier1/LKeyValues.h b/src/public/tier1/LKeyValues.h
index 22c13b770c..d62ec425e9 100644
--- a/src/public/tier1/LKeyValues.h
+++ b/src/public/tier1/LKeyValues.h
@@ -1,39 +1,24 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LKEYVALUES_H
#define LKEYVALUES_H
#ifdef _WIN32
#pragma once
#endif
-
/* type for KeyValues functions */
typedef KeyValues lua_KeyValues;
-
-
/*
** access functions (stack -> C)
*/
-LUA_API lua_KeyValues *(lua_tokeyvalues) (lua_State *L, int idx);
-
+LUA_API lua_KeyValues *( lua_tokeyvalues )( lua_State *L, int idx );
/*
** push functions (C -> stack)
*/
-LUA_API void (lua_pushkeyvalues) (lua_State *L, lua_KeyValues *pKV);
-
-
-
-LUALIB_API lua_KeyValues *(luaL_checkkeyvalues) (lua_State *L, int narg);
-LUALIB_API lua_KeyValues *(luaL_optkeyvalues) (lua_State *L, int narg,
- lua_KeyValues *def);
+LUA_API void( lua_pushkeyvalues )( lua_State *L, lua_KeyValues *pKV );
+LUALIB_API lua_KeyValues *( luaL_checkkeyvalues )( lua_State *L, int narg );
+LUALIB_API lua_KeyValues *( luaL_optkeyvalues )( lua_State *L, int narg, lua_KeyValues *def );
-#endif // LKEYVALUES_H
+#endif // LKEYVALUES_H
diff --git a/src/public/tier1/liconvar.cpp b/src/public/tier1/liconvar.cpp
index 04c719e804..cf277818e4 100644
--- a/src/public/tier1/liconvar.cpp
+++ b/src/public/tier1/liconvar.cpp
@@ -1,14 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-// $Workfile: $
-// $Date: $
-//
-//-----------------------------------------------------------------------------
-// $NoKeywords: $
-//===========================================================================//
-
#include "cbase.h"
#include "luamanager.h"
#include "luasrclib.h"
diff --git a/src/public/vgui/LIInput.cpp b/src/public/vgui/LIInput.cpp
index 0a71b12fd2..ed5e59dbf8 100644
--- a/src/public/vgui/LIInput.cpp
+++ b/src/public/vgui/LIInput.cpp
@@ -1,10 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//===========================================================================//
-
#include
#include "vgui/iinput.h"
#include "vgui_controls/Controls.h"
diff --git a/src/public/vgui/LIScheme.cpp b/src/public/vgui/LIScheme.cpp
index bce879bc58..308e3d3a56 100644
--- a/src/public/vgui/LIScheme.cpp
+++ b/src/public/vgui/LIScheme.cpp
@@ -1,10 +1,3 @@
-//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#include "cbase.h"
#include "vgui/ischeme.h"
#include "vgui_controls/Controls.h"
diff --git a/src/public/vgui/LIScheme.h b/src/public/vgui/LIScheme.h
index b9baef4c45..ed000adebf 100644
--- a/src/public/vgui/LIScheme.h
+++ b/src/public/vgui/LIScheme.h
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LISCHEME_H
#define LISCHEME_H
@@ -12,27 +5,20 @@
#pragma once
#endif
-
/* type for IScheme functions */
typedef vgui::IScheme lua_IScheme;
-
-
/*
** access functions (stack -> C)
*/
-LUA_API lua_IScheme *(lua_toischeme) (lua_State *L, int idx);
-
+LUA_API lua_IScheme *( lua_toischeme )( lua_State *L, int idx );
/*
** push functions (C -> stack)
*/
-LUA_API void (lua_pushischeme) (lua_State *L, lua_IScheme *pScheme);
-
-
-
-LUALIB_API lua_IScheme *(luaL_checkischeme) (lua_State *L, int narg);
+LUA_API void( lua_pushischeme )( lua_State *L, lua_IScheme *pScheme );
+LUALIB_API lua_IScheme *( luaL_checkischeme )( lua_State *L, int narg );
-#endif // LISCHEME_H
+#endif // LISCHEME_H
diff --git a/src/public/vgui/LISurface.cpp b/src/public/vgui/LISurface.cpp
index 547aa3fa94..c1706b0301 100644
--- a/src/public/vgui/LISurface.cpp
+++ b/src/public/vgui/LISurface.cpp
@@ -1,10 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//===========================================================================//
-
#include "cbase.h"
#include "vgui/isurface.h"
#include "vgui/ILocalize.h"
@@ -224,7 +217,7 @@ static int surface_DrawSetColor( lua_State *L )
lua_Color color = luaL_checkcolor( L, 1 );
surface()->DrawSetColor( color );
- //DevWarning( "surface_DrawSetColor: Setting Color(%s)\n", color ); // <-- TODO: Find out why printing a color like this causes a crash
+ // DevWarning( "surface_DrawSetColor: Setting Color(%s)\n", color ); // <-- TODO: Find out why printing a color like this causes a crash
return 0;
}
@@ -751,7 +744,7 @@ static int surface_FindMaterial( lua_State *L )
//// We need to assign a TextureID to the material, or else the game will crash in MaterialSystem.pdb
//// when shutting down the game, after having created (but never assigning a CreateNewTextureID)
//// a material with this FindMaterial call.
- //g_pMatSystemSurface->DrawSetTextureMaterial( CreateNewAutoDestroyTextureId( true ), pMaterial );
+ // g_pMatSystemSurface->DrawSetTextureMaterial( CreateNewAutoDestroyTextureId( true ), pMaterial );
}
}
diff --git a/src/public/vgui/LVGUI.cpp b/src/public/vgui/LVGUI.cpp
index f53cf49a26..ed6f90adca 100644
--- a/src/public/vgui/LVGUI.cpp
+++ b/src/public/vgui/LVGUI.cpp
@@ -1,10 +1,3 @@
-//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose: Basic header for using vgui
-//
-// $NoKeywords: $
-//=============================================================================//
-
#include "cbase.h"
#include "lua.hpp"
#include "luasrclib.h"
diff --git a/src/public/vgui/LVGUI.h b/src/public/vgui/LVGUI.h
index 655ecc03bb..4fff8250a5 100644
--- a/src/public/vgui/LVGUI.h
+++ b/src/public/vgui/LVGUI.h
@@ -1,10 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose: Basic header for using vgui
-//
-// $NoKeywords: $
-//=============================================================================//
-
#ifndef LVGUI_H
#define LVGUI_H
@@ -15,30 +8,23 @@
/* type for HScheme functions */
typedef vgui::HScheme lua_HScheme;
-
/* type for HFont functions */
typedef vgui::HFont lua_HFont;
-
-
/*
** access functions (stack -> C)
*/
-LUA_API lua_HScheme (lua_toscheme) (lua_State *L, int idx);
-LUA_API lua_HFont (lua_tofont) (lua_State *L, int idx);
-
+LUA_API lua_HScheme( lua_toscheme )( lua_State *L, int idx );
+LUA_API lua_HFont( lua_tofont )( lua_State *L, int idx );
/*
** push functions (C -> stack)
*/
-LUA_API void (lua_pushscheme) (lua_State *L, lua_HScheme hScheme);
-LUA_API void (lua_pushfont) (lua_State *L, lua_HFont hFont);
-
-
-
-LUALIB_API lua_HScheme (luaL_checkscheme) (lua_State *L, int narg);
-LUALIB_API lua_HFont (luaL_checkfont) (lua_State *L, int narg);
+LUA_API void( lua_pushscheme )( lua_State *L, lua_HScheme hScheme );
+LUA_API void( lua_pushfont )( lua_State *L, lua_HFont hFont );
+LUALIB_API lua_HScheme( luaL_checkscheme )( lua_State *L, int narg );
+LUALIB_API lua_HFont( luaL_checkfont )( lua_State *L, int narg );
-#endif // LVGUI_H
+#endif // LVGUI_H
diff --git a/src/public/vphysics/lperformance.cpp b/src/public/vphysics/lperformance.cpp
index c8da2bbe94..42b378404f 100644
--- a/src/public/vphysics/lperformance.cpp
+++ b/src/public/vphysics/lperformance.cpp
@@ -1,9 +1,3 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-//=============================================================================//
-
#include "cbase.h"
#include "performance.h"
#include "lua.hpp"
diff --git a/src/public/vphysics/lperformance.h b/src/public/vphysics/lperformance.h
index 2179d309d7..21ae0a1ae5 100644
--- a/src/public/vphysics/lperformance.h
+++ b/src/public/vphysics/lperformance.h
@@ -1,34 +1,23 @@
-//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-//=============================================================================//
-
#ifndef LPERFORMANCE_H
#define LPERFORMANCE_H
#ifdef _WIN32
#pragma once
#endif
-#pragma warning (disable : 4238)
-
+#pragma warning( disable : 4238 )
/* type for physics_performanceparams_t in Lua */
typedef physics_performanceparams_t lua_Physics_performanceparams_t;
-
-
/*
** access functions (stack -> C)
*/
-LUA_API lua_Physics_performanceparams_t (lua_toperformanceparams) (lua_State *L, int idx);
-
+LUA_API lua_Physics_performanceparams_t( lua_toperformanceparams )( lua_State *L, int idx );
/*
** push functions (C -> stack)
*/
-LUA_API void (lua_pushperformanceparams) (lua_State *L, lua_Physics_performanceparams_t *pOutput);
-
+LUA_API void( lua_pushperformanceparams )( lua_State *L, lua_Physics_performanceparams_t *pOutput );
-#endif // LPERFORMANCE_H
+#endif // LPERFORMANCE_H
diff --git a/src/public/vstdlib/lrandom.cpp b/src/public/vstdlib/lrandom.cpp
index 1be120ba44..d52e11e9d4 100644
--- a/src/public/vstdlib/lrandom.cpp
+++ b/src/public/vstdlib/lrandom.cpp
@@ -1,11 +1,3 @@
-//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
-//
-// Purpose: Random number generator
-//
-// $Workfile: $
-// $NoKeywords: $
-//===========================================================================//
-
#include "cbase.h"
#include "lua.hpp"
#include "luasrclib.h"
@@ -13,83 +5,57 @@
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
+LUA_REGISTRATION_INIT( Randoms );
+LUA_BINDING_BEGIN( Randoms, RandomFloat, "library", "Generate a random float.", "shared" )
+{
+ float min = LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optnumber, 1, 0.0f, "min" );
+ float max = LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optnumber, 2, 0.0f, "max" );
-static int random_RandomFloat (lua_State *L) {
- lua_pushnumber(L, random->RandomFloat(luaL_optnumber(L, 1, 0.0f), luaL_optnumber(L, 2, 0.0f)));
- return 1;
-}
-
-static int random_RandomFloatExp (lua_State *L) {
- lua_pushnumber(L, random->RandomFloatExp(luaL_optnumber(L, 1, 0.0f), luaL_optnumber(L, 2, 0.0f), luaL_optnumber(L, 3, 1.0f)));
- return 1;
-}
+ lua_pushnumber( L, random->RandomFloat( min, max ) );
-static int random_RandomInt (lua_State *L) {
- lua_pushinteger(L, random->RandomInt(luaL_checknumber(L, 1), luaL_checknumber(L, 2)));
- return 1;
+ return 1;
}
+LUA_BINDING_END( "number", "The generated random float." )
-static int random_SetSeed (lua_State *L) {
- random->SetSeed(luaL_checknumber(L, 1));
- return 0;
-}
-
-
-static const luaL_Reg randomlib[] = {
- {"RandomFloat", random_RandomFloat},
- {"RandomFloatExp", random_RandomFloatExp},
- {"RandomInt", random_RandomInt},
- {"SetSeed", random_SetSeed},
- {NULL, NULL}
-};
+LUA_BINDING_BEGIN( Randoms, RandomFloatExponential, "library", "Generate a random float with an exponential distribution.", "shared" )
+{
+ float min = LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optnumber, 1, 0.0f, "min" );
+ float max = LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optnumber, 2, 0.0f, "max" );
+ float exponent = LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optnumber, 3, 1.0f, "exponent" );
+ lua_pushnumber( L, random->RandomFloatExp( min, max, exponent ) );
-#if 0
-static int luasrc_RandomSeed (lua_State *L) {
- RandomSeed(luaL_checknumber(L, 1));
- return 0;
+ return 1;
}
+LUA_BINDING_END( "number", "The generated random float." )
-static int luasrc_RandomFloat (lua_State *L) {
- lua_pushnumber(L, RandomFloat(luaL_optnumber(L, 1, 0.0f), luaL_optnumber(L, 2, 0.0f)));
- return 1;
-}
-
-static int luasrc_RandomFloatExp (lua_State *L) {
- lua_pushnumber(L, RandomFloatExp(luaL_optnumber(L, 1, 0.0f), luaL_optnumber(L, 2, 1.0f), luaL_optnumber(L, 3, 1.0f)));
- return 1;
-}
+LUA_BINDING_BEGIN( Randoms, RandomInteger, "library", "Generate a random integer.", "shared" )
+{
+ int min = LUA_BINDING_ARGUMENT( luaL_checknumber, 1, "min" );
+ int max = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "max" );
-static int luasrc_RandomInt (lua_State *L) {
- lua_pushinteger(L, RandomInt(luaL_checknumber(L, 1), luaL_checknumber(L, 2)));
- return 1;
-}
+ lua_pushinteger( L, random->RandomInt( min, max ) );
-static int luasrc_RandomGaussianFloat (lua_State *L) {
- lua_pushnumber(L, RandomGaussianFloat(luaL_optnumber(L, 1, 0.0f), luaL_optnumber(L, 2, 1.0f)));
- return 1;
+ return 1;
}
+LUA_BINDING_END( "number", "The generated random integer." )
+LUA_BINDING_BEGIN( Randoms, SetSeed, "library", "Set the seed for the random number generator.", "shared" )
+{
+ int seed = LUA_BINDING_ARGUMENT( luaL_checknumber, 1, "seed" );
-static const luaL_Reg random_funcs[] = {
- {"RandomSeed", luasrc_RandomSeed},
- {"RandomFloat", luasrc_RandomFloat},
- {"RandomFloatExp", luasrc_RandomFloatExp},
- {"RandomInt", luasrc_RandomInt},
- {"RandomGaussianFloat", luasrc_RandomGaussianFloat},
- {NULL, NULL}
-};
-#endif
+ random->SetSeed( seed );
+ return 0;
+}
+LUA_BINDING_END()
/*
** Open random library
*/
-LUALIB_API int luaopen_random (lua_State *L) {
- luaL_register(L, LUA_RANDOMLIBNAME, randomlib);
- // UNDONE: this has always been redundant.
- // luaL_register(L, LUA_GNAME, random_funcs);
- return 1;
+LUALIB_API int luaopen_random( lua_State *L )
+{
+ LUA_REGISTRATION_COMMIT_LIBRARY( Randoms );
+ return 1;
}
-
diff --git a/tools/docs-build-functions.js b/tools/docs-build-functions.js
index 9b121796b0..e9d494c480 100644
--- a/tools/docs-build-functions.js
+++ b/tools/docs-build-functions.js
@@ -232,6 +232,10 @@ function fromTypeChecker(typeChecker) {
case 'luaL_optcolor':
case 'lua_tocolor':
return 'Color';
+ case 'luaL_checkfilehandle':
+ case 'luaL_optfilehandle':
+ case 'lua_tofilehandle':
+ return 'FileHandle';
default:
return 'unknown';
}