diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /dedicated/filesystem.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'dedicated/filesystem.cpp')
| -rw-r--r-- | dedicated/filesystem.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/dedicated/filesystem.cpp b/dedicated/filesystem.cpp new file mode 100644 index 0000000..6d908a6 --- /dev/null +++ b/dedicated/filesystem.cpp @@ -0,0 +1,56 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $Workfile: $ +// $Date: $ +// $NoKeywords: $ +//===========================================================================// + +#include "filesystem.h" +#include "dedicated.h" +#include <stdio.h> +#include <stdlib.h> +#include "interface.h" +#include <string.h> +#include <malloc.h> +#include "tier1/strtools.h" +#include "tier0/icommandline.h" +#include "tier0/dbg.h" +#include "../filesystem/basefilesystem.h" +#include "appframework/AppFramework.h" +#include "tier2/tier2.h" + + +extern IFileSystem *g_pFileSystem; +extern IBaseFileSystem *g_pBaseFileSystem; + +// implement our own special factory that we don't export outside of the DLL, to stop +// people being able to get a pointer to a FILESYSTEM_INTERFACE_VERSION stdio interface +void* FileSystemFactory(const char *pName, int *pReturnCode) +{ + { + if ( !Q_stricmp(pName, FILESYSTEM_INTERFACE_VERSION ) ) + { + if ( pReturnCode ) + { + *pReturnCode = IFACE_OK; + } + return g_pFileSystem; + } + if ( !Q_stricmp(pName, BASEFILESYSTEM_INTERFACE_VERSION ) ) + { + if ( pReturnCode ) + { + *pReturnCode = IFACE_OK; + } + return g_pBaseFileSystem; + } + } + + if ( pReturnCode ) + { + *pReturnCode = IFACE_FAILED; + } + return NULL; +} |