12 Commits
Author SHA1 Message Date
Deorder 0f114677b1 Added context to FO4 DDS info callback 2019-08-28 14:39:10 +02:00
Deorder f276cd1825 DDS Info callback was missing a pointer for returning the info 2019-08-17 00:30:14 +02:00
Deorder c68e39d2a1 Added way to add files from any source path (without using a shared/common root)
bsa_add_file_from_disk is now bsa_add_file_from_disk_root
Fixed issues with using libbsarch with GCC
2019-05-08 23:48:46 +02:00
Deorder d3d36d2694 Fixed issue with releasing file buffer result causing access violation while extracting 2019-05-01 00:17:42 +02:00
Deorder 3855899330 Added exception handling making the dll more reliable 2019-04-17 01:36:22 +02:00
Deorder 6c3a9234e4 Cleaned up test source 2019-04-15 04:26:29 +02:00
Deorder 322b6c0302 Merge branch 'master' of github-deorder:deorder/libbsarch 2019-04-15 04:17:41 +02:00
Deorder 6fe376e887 Fixed access violation issue in bsarch
Fixed C calls to use UTF-8, wide char
Changed some pointer to pointer to just pointers
Added test project
2019-04-15 04:16:36 +02:00
Deorder bd0ab57f6d Merge pull request #1 from deorder/add-license-1
Create LICENSE
2019-04-10 05:49:33 +02:00
Deorder 08536255ff Create LICENSE 2019-04-10 05:49:07 +02:00
Deorder 30b4a2eb8d Update README.md 2019-04-10 05:45:16 +02:00
Deorder f92b4cdb28 Update README.md 2019-04-10 05:44:17 +02:00
17 changed files with 946 additions and 286 deletions
+3
View File
@@ -442,3 +442,6 @@ healthchecksdb
MigrationBackup/
# End of https://www.gitignore.io/api/vim,delphi,visualstudio,visualstudiocode
libbsarch_delphi*
libbsarch_test.pas
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 Deorder
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+5
View File
@@ -10,3 +10,8 @@ BSArchive Dynamic Link Library and C++ bindings
## How to use
Use the `libbsarch.dll` (The one created by Delphi, not Visual Studio), `libbsarch.lib` and `libbsarch.h` in your project.
## Credits
The original BSArchive can be found at: https://github.com/TES5Edit/TES5Edit/tree/dev/Tools/BSArchive
The version in this project had been modified for better compatibility with C/C++ and allow the users to allocate their own memory in some cases.
+7
View File
@@ -0,0 +1,7 @@
// Hint files help the Visual Studio IDE interpret Visual C++ identifiers
// such as names of functions and macros.
// For more information see https://go.microsoft.com/fwlink/?linkid=865984
#define PACKED(datastructure) datastructure __attribute__((__packed__))
#define PACKED(datastructure) __pragma(pack(push, 1)) datastructure __pragma(pack(pop))
#define BSARCH_DLL_API(ReturnType) extern "C" __declspec(dllexport) ReturnType __stdcall
#define BSARCH_DLL_API(ReturnType) extern "C" __declspec(dllimport) ReturnType __stdcall
View File
+82
View File
@@ -0,0 +1,82 @@
#include <iostream>
#include <windows.h>
#include "libbsarch.h"
#pragma comment(lib, "libbsarch")
static const std::wstring separators(L"\\/");
std::wstring dirname(const std::wstring& path) {
size_t slash_pos = path.find_last_of(separators);
return path.substr(0, slash_pos);
}
std::wstring basename(const std::wstring& path) {
size_t slash_pos = path.find_last_of(separators);
return path.substr(slash_pos + 1);
}
bool mkdirp(const std::wstring& directory, bool basedir = true) {
DWORD attributes = ::GetFileAttributesW(directory.c_str());
if(attributes == INVALID_FILE_ATTRIBUTES) {
std::size_t slash_pos = directory.find_last_of(separators);
if(slash_pos != std::wstring::npos) {
mkdirp(directory.substr(0, slash_pos));
}
return ::CreateDirectoryW(directory.c_str(), nullptr);
} else {
return true;
}
}
int main() {
bsa_result_message_t result = { 0 };
bsa_archive_t archive = bsa_create();
{
result = bsa_load_from_file(archive, L"test_read.bsa");
if(result.code < 0)
printf("%ls\n", result.text);
bsa_entry_list_t entries = bsa_entry_list_create();
bsa_get_resource_list(archive, entries, L"");
for(size_t index = 0; index < bsa_entry_list_count(entries); index++) {
wchar_t filename[2048];
bsa_entry_list_get(entries, index, 2048, filename);
printf("file: %ls\n", filename);
if(mkdirp(dirname(filename))) {
result = bsa_extract_file(archive, filename, filename);
if(result.code < 0)
printf("%ls\n", result.text);
} else {
printf("could not create: %ls\n", dirname(filename).c_str());
}
}
bsa_entry_list_free(entries);
bsa_close(archive);
}
{
bsa_entry_list_t entries = bsa_entry_list_create();
bsa_entry_list_add(entries, L"textures\\grass\\test.dds");
bsa_entry_list_add(entries, L"textures\\grass\\test2.dds");
bsa_create_archive(archive, L"test_write.bsa", baSSE, entries);
bsa_add_file_from_disk_root(archive, L"", L"textures\\grass\\test.dds");
result = bsa_add_file_from_disk(archive, L"textures\\grass\\test2.dds", L"textures\\grass\\test.dds");
if (result.code < 0)
printf("%ls\n", result.text);
bsa_save(archive);
bsa_close(archive);
bsa_entry_list_free(entries);
}
bsa_free(archive);
}
+31
View File
@@ -0,0 +1,31 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.156
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbsarch-visualstudio-test", "libbsarch-visualstudio-test.vcxproj", "{8F73F848-939D-4862-B58B-26572CF20A5F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8F73F848-939D-4862-B58B-26572CF20A5F}.Debug|x64.ActiveCfg = Debug|x64
{8F73F848-939D-4862-B58B-26572CF20A5F}.Debug|x64.Build.0 = Debug|x64
{8F73F848-939D-4862-B58B-26572CF20A5F}.Debug|x86.ActiveCfg = Debug|Win32
{8F73F848-939D-4862-B58B-26572CF20A5F}.Debug|x86.Build.0 = Debug|Win32
{8F73F848-939D-4862-B58B-26572CF20A5F}.Release|x64.ActiveCfg = Release|x64
{8F73F848-939D-4862-B58B-26572CF20A5F}.Release|x64.Build.0 = Release|x64
{8F73F848-939D-4862-B58B-26572CF20A5F}.Release|x86.ActiveCfg = Release|Win32
{8F73F848-939D-4862-B58B-26572CF20A5F}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F05F0FBF-790B-4443-B2EC-E7033074D9E0}
EndGlobalSection
EndGlobal
+176
View File
@@ -0,0 +1,176 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{8F73F848-939D-4862-B58B-26572CF20A5F}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>libbsarchvisualstudiotest</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>libbsarch-visualstudio-test</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<ReferencePath>$(OutDir);$(ReferencePath)</ReferencePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
<ReferencePath>$(OutDir);$(ReferencePath)</ReferencePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<ReferencePath>$(OutDir);$(ReferencePath)</ReferencePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
<ReferencePath>$(OutDir);$(ReferencePath)</ReferencePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="libbsarch-visualstudio-test.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="libbsarch-visualstudio-test.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
+52 -48
View File
@@ -8,19 +8,19 @@ BSARCH_DLL_API(bsa_entry_list_t) bsa_entry_list_create() {
return NULL;
}
BSARCH_DLL_API(void) bsa_entry_list_free(bsa_entry_list_t *entry_list) {
return;
BSARCH_DLL_API(bsa_result_message_t) bsa_entry_list_free(bsa_entry_list_t entry_list) {
return { 0 };
}
BSARCH_DLL_API(uint32_t) bsa_entry_list_count(bsa_entry_list_t *entry_list) {
BSARCH_DLL_API(uint32_t) bsa_entry_list_count(bsa_entry_list_t entry_list) {
return 0;
}
BSARCH_DLL_API(void) bsa_entry_list_add(bsa_entry_list_t *entry_list, char *entry_string) {
return;
BSARCH_DLL_API(bsa_result_message_t) bsa_entry_list_add(bsa_entry_list_t entry_list, const wchar_t *entry_string) {
return { 0 };
}
BSARCH_DLL_API(uint32_t) bsa_entry_list_get(bsa_entry_list_t *entry_list, uint32_t index, uint32_t string_buffer_size, char *string_buffer) {
BSARCH_DLL_API(uint32_t) bsa_entry_list_get(bsa_entry_list_t entry_list, uint32_t index, uint32_t string_buffer_size, const wchar_t *string_buffer) {
return 0;
}
@@ -28,122 +28,126 @@ BSARCH_DLL_API(bsa_archive_t) bsa_create() {
return NULL;
}
BSARCH_DLL_API(void) bsa_free(bsa_archive_t archive) {
return;
BSARCH_DLL_API(bsa_result_message_t) bsa_free(bsa_archive_t archive) {
return { 0 };
}
BSARCH_DLL_API(void) bsa_load_from_file(bsa_archive_t archive, char *filename) {
return;
BSARCH_DLL_API(bsa_result_message_t) bsa_load_from_file(bsa_archive_t archive, const wchar_t *file_path) {
return { 0 };
}
BSARCH_DLL_API(void) bsa_create_archive(bsa_archive_t archive, char *filename, bsa_archive_type_t archive_type, bsa_entry_list_t entry_list) {
return;
BSARCH_DLL_API(bsa_result_message_t) bsa_create_archive(bsa_archive_t archive, const wchar_t *file_path, bsa_archive_type_t archive_type, bsa_entry_list_t entry_list) {
return { 0 };
}
BSARCH_DLL_API(void) bsa_save(bsa_archive_t archive) {
return;
BSARCH_DLL_API(bsa_result_message_t) bsa_save(bsa_archive_t archive) {
return { 0 };
}
BSARCH_DLL_API(void) bsa_add_file_from_disk(bsa_archive_t archive, char *root_dir, char *filename) {
return;
BSARCH_DLL_API(bsa_result_message_t) bsa_add_file_from_disk(bsa_archive_t archive, const wchar_t *file_path, const wchar_t *source_path) {
return { 0 };
}
BSARCH_DLL_API(void) bsa_add_file_from_memory(bsa_archive_t archive, char *filename, uint32_t size, bsa_file_data_t data) {
return;
BSARCH_DLL_API(bsa_result_message_t) bsa_add_file_from_disk_root(bsa_archive_t archive, const wchar_t* root_dir, const wchar_t* source_path) {
return { 0 };
}
BSARCH_DLL_API(bsa_file_record_t) bsa_find_file_record(bsa_archive_t archive, char *filename) {
BSARCH_DLL_API(bsa_result_message_t) bsa_add_file_from_memory(bsa_archive_t archive, const wchar_t *file_path, uint32_t size, bsa_buffer_t data) {
return { 0 };
}
BSARCH_DLL_API(bsa_file_record_t) bsa_find_file_record(bsa_archive_t archive, const wchar_t *file_path) {
return NULL;
}
BSARCH_DLL_API(bsa_file_data_result_t) bsa_extract_file_data_by_record(bsa_archive_t archive, bsa_file_record_t file_record) {
BSARCH_DLL_API(bsa_result_message_buffer_t) bsa_extract_file_data_by_record(bsa_archive_t archive, bsa_file_record_t file_record) {
return { 0 };
}
BSARCH_DLL_API(bsa_file_data_result_t) bsa_extract_file_data_by_filename(bsa_archive_t archive, char *filename) {
BSARCH_DLL_API(bsa_result_message_buffer_t) bsa_extract_file_data_by_filename(bsa_archive_t archive, const wchar_t *file_path) {
return { 0 };
}
BSARCH_DLL_API(void) bsa_file_data_free(bsa_archive_t archive, bsa_file_data_result_t file_data_result) {
return;
BSARCH_DLL_API(bsa_result_message_t) bsa_file_data_free(bsa_archive_t archive, bsa_result_buffer_t file_data_result) {
return { 0 };
}
BSARCH_DLL_API(void) bsa_extract_file(bsa_archive_t archive, char *filename, char *save_as) {
return;
BSARCH_DLL_API(bsa_result_message_t) bsa_extract_file(bsa_archive_t archive, const wchar_t *file_path, const wchar_t *save_as) {
return { 0 };
}
BSARCH_DLL_API(void) bsa_iterate_files(bsa_archive_t archive, bsa_file_iteration_proc_t file_iteration_proc, void *context) {
return;
BSARCH_DLL_API(bsa_result_message_t) bsa_iterate_files(bsa_archive_t archive, bsa_file_iteration_proc_t file_iteration_proc, void *context) {
return { 0 };
}
BSARCH_DLL_API(bool) bsa_file_exists(bsa_archive_t archive, char *filename) {
BSARCH_DLL_API(bool) bsa_file_exists(bsa_archive_t archive, const wchar_t *file_path) {
return false;
}
BSARCH_DLL_API(void) bsa_get_resource_list(bsa_archive_t archive, bsa_entry_list_t entry_result_list, char *folder) {
return;
BSARCH_DLL_API(bsa_result_message_t) bsa_get_resource_list(bsa_archive_t archive, bsa_entry_list_t entry_result_list, const wchar_t *folder) {
return { 0 };
}
BSARCH_DLL_API(void) bsa_resolve_hash(bsa_archive_t archive, uint64_t hash, bsa_entry_list_t entry_result_list) {
return;
BSARCH_DLL_API(bsa_result_message_t) bsa_resolve_hash(bsa_archive_t archive, uint64_t hash, bsa_entry_list_t entry_result_list) {
return { 0 };
}
BSARCH_DLL_API(void) bsa_close(bsa_archive_t archive) {
return;
BSARCH_DLL_API(bsa_result_message_t) bsa_close(bsa_archive_t archive) {
return { 0 };
}
BSARCH_DLL_API(uint32_t) bsa_filename_get(bsa_archive_t *archive, uint32_t string_buffer_size, char *string_buffer) {
BSARCH_DLL_API(uint32_t) bsa_filename_get(bsa_archive_t archive, uint32_t string_buffer_size, const wchar_t *string_buffer) {
return 0;
}
BSARCH_DLL_API(bsa_archive_type_t) bsa_archive_type_get(bsa_archive_t *archive) {
BSARCH_DLL_API(bsa_archive_type_t) bsa_archive_type_get(bsa_archive_t archive) {
return bsa_archive_type_t::baNone;
}
BSARCH_DLL_API(uint32_t) bsa_version_get(bsa_archive_t *archive) {
BSARCH_DLL_API(uint32_t) bsa_version_get(bsa_archive_t archive) {
return 0;
}
BSARCH_DLL_API(uint32_t) bsa_format_name_get(bsa_archive_t *archive, uint32_t string_buffer_size, char *string_buffer) {
BSARCH_DLL_API(uint32_t) bsa_format_name_get(bsa_archive_t archive, uint32_t string_buffer_size, const wchar_t *string_buffer) {
return 0;
}
BSARCH_DLL_API(uint32_t) bsa_file_count_get(bsa_archive_t *archive) {
BSARCH_DLL_API(uint32_t) bsa_file_count_get(bsa_archive_t archive) {
return 0;
}
BSARCH_DLL_API(uint32_t) bsa_archive_flags_get(bsa_archive_t *archive) {
BSARCH_DLL_API(uint32_t) bsa_archive_flags_get(bsa_archive_t archive) {
return 0;
}
BSARCH_DLL_API(void) bsa_archive_flags_set(bsa_archive_t *archive, uint32_t flags) {
BSARCH_DLL_API(void) bsa_archive_flags_set(bsa_archive_t archive, uint32_t flags) {
return;
}
BSARCH_DLL_API(uint32_t) bsa_file_flags_get(bsa_archive_t *archive) {
BSARCH_DLL_API(uint32_t) bsa_file_flags_get(bsa_archive_t archive) {
return 0;
}
BSARCH_DLL_API(void) bsa_file_flags_set(bsa_archive_t *archive, uint32_t flags) {
BSARCH_DLL_API(void) bsa_file_flags_set(bsa_archive_t archive, uint32_t flags) {
return;
}
BSARCH_DLL_API(bool) bsa_compress_get(bsa_archive_t *archive) {
BSARCH_DLL_API(bool) bsa_compress_get(bsa_archive_t archive) {
return false;
}
BSARCH_DLL_API(void) bsa_compress_set(bsa_archive_t *archive, bool flags) {
BSARCH_DLL_API(void) bsa_compress_set(bsa_archive_t archive, bool flags) {
return;
}
BSARCH_DLL_API(bool) bsa_share_data_get(bsa_archive_t *archive) {
BSARCH_DLL_API(bool) bsa_share_data_get(bsa_archive_t archive) {
return false;
}
BSARCH_DLL_API(void) bsa_share_data_set(bsa_archive_t *archive, bool flags) {
BSARCH_DLL_API(void) bsa_share_data_set(bsa_archive_t archive, bool flags) {
return;
}
BSARCH_DLL_API(void) bsa_file_dds_info_callback_set(bsa_archive_t *archive, bsa_file_dds_info_proc_t file_dds_info_proc) {
BSARCH_DLL_API(void) bsa_file_dds_info_callback_set(bsa_archive_t archive, bsa_file_dds_info_proc_t file_dds_info_proc, void *context) {
return;
}
+2 -1
View File
@@ -1,4 +1,4 @@
LIBRARY LIBBSARCH_DLL
LIBRARY LIBBSARCH
;DESCRIPTION "BSArch DLL"
EXPORTS
bsa_entry_list_create
@@ -12,6 +12,7 @@ EXPORTS
bsa_create_archive
bsa_save
bsa_add_file_from_disk
bsa_add_file_from_disk_root
bsa_add_file_from_memory
bsa_find_file_record
bsa_extract_file_data_by_record
+243 -69
View File
@@ -5,206 +5,379 @@ uses
Classes,
Types,
SysUtils,
wbStreams in 'wbStreams.pas',
wbBSArchive in './wbBSArchive.pas';
wbStreams,
wbBSArchive;
{$IFDEF FPC}
{$mode delphi}{$H+}
{$ENDIF}
type
TwbBSResultCode = (
BSA_RESULT_NONE = 0,
BSA_RESULT_EXCEPTION = -1
);
TwbBSResultMessage = packed record
code: ShortInt;
text: array[0..1023] of WideChar;
end;
TwbBSResultMessageBuffer = packed record
buffer: TwbBSResultBuffer;
message: TwbBSResultMessage;
end;
{Shared}
function string_to_cstring(aString: String; const aStringBufferSize: Cardinal;
const aStringBuffer: PChar): Cardinal; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function string_to_cstring(
aString: String;
const aStringBufferSize: Cardinal;
const aStringBuffer: PChar
): Integer; stdcall;
begin
Result := Min(aStringBufferSize, Length(AString));
if (aStringBuffer <> nil) and (Result > 0) then
Move(AString[1], aStringBuffer^, Result * SizeOf(Char));
Move(AString[1], aStringBuffer^, Result * SizeOf(WideChar));
end;
function string_to_cstring_end(
aString: String;
const aStringBufferSize: Cardinal;
const aStringBuffer: PChar
): Integer; stdcall;
begin
Result := Min(aStringBufferSize - 1, Length(AString));
if (aStringBuffer <> nil) and (Result > 0) then
begin
Move(AString[1], aStringBuffer^, Result * SizeOf(WideChar));
aStringBuffer[Result] := #0;
end;
end;
procedure exception_handler(E: Exception; var Result: TwbBSResultMessage); stdcall;
begin
Result.code := ShortInt(BSA_RESULT_EXCEPTION);
string_to_cstring_end(E.Message, Length(Result.text), Result.text);
end;
procedure buffer_exception_handler(E: Exception; var Result: TwbBSResultMessageBuffer); stdcall;
begin
Result.buffer.size := 0;
Result.buffer.data := nil;
Result.message.code := ShortInt(BSA_RESULT_EXCEPTION);
string_to_cstring_end(E.Message, Length(Result.message.text), Result.message.text);
end;
{BSA File List}
function bsa_entry_list_create:Pointer; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_entry_list_create:Pointer; stdcall;
begin
Result := TwbBSEntryList.Create;
try
Result := TwbBSEntryList.Create;
except
Result := nil;
end;
end;
procedure bsa_entry_list_free(obj: Pointer); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_entry_list_free(obj: Pointer): TwbBSResultMessage; stdcall;
begin
TwbBSEntryList(obj).Clear();
TwbBSEntryList(obj).free;
Result.code := Ord(BSA_RESULT_NONE);
try
TwbBSEntryList(obj).Clear();
TwbBSEntryList(obj).free;
except
on E: Exception do
exception_handler(E, Result);
end;
end;
function bsa_entry_list_count(obj: Pointer): Cardinal; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_entry_list_count(obj: Pointer): Integer; stdcall;
begin
Result := TwbBSEntryList(obj).Count;
try
Result := TwbBSEntryList(obj).Count;
except
Result := Ord(BSA_RESULT_EXCEPTION);
end;
end;
procedure bsa_entry_list_add(obj: Pointer; const aEntryString: PChar); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_entry_list_add(obj: Pointer; const aEntryString: PChar): TwbBSResultMessage; stdcall;
begin
TwbBSEntryList(obj).Add(String(aEntryString));
Result.code := Ord(BSA_RESULT_NONE);
try
TwbBSEntryList(obj).Add(String(aEntryString));
except
on E: Exception do
exception_handler(E, Result);
end;
end;
function bsa_entry_list_get(obj: Pointer; const aIndex: Cardinal; const aStringBufferSize: Cardinal; const aStringBuffer: PChar): Cardinal; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_entry_list_get(obj: Pointer; const aIndex: Cardinal; const aStringBufferSize: Cardinal; const aStringBuffer: PChar): Integer; stdcall;
begin
Result := string_to_cstring(TwbBSEntryList(obj).Strings[aIndex], aStringBufferSize, aStringBuffer);
try
Result := string_to_cstring_end(TwbBSEntryList(obj).Strings[aIndex], aStringBufferSize, aStringBuffer);
except
Result := Integer(BSA_RESULT_EXCEPTION);
end;
end;
{BSArchive}
function bsa_create:Pointer; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_create:Pointer; stdcall;
begin
Result := TwbBSArchive.Create;
try
Result := TwbBSArchive.Create;
except
Result := nil;
end;
end;
procedure bsa_free(obj: Pointer); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_free(obj: Pointer): TwbBSResultMessage; stdcall;
begin
TwbBSArchive(obj).free;
Result.code := Ord(BSA_RESULT_NONE);
try
TwbBSArchive(obj).free;
except
on E: Exception do
exception_handler(E, Result);
end;
end;
procedure bsa_load_from_file(obj: Pointer; const aFileName: PChar); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_load_from_file(obj: Pointer; const aFilePath: PChar): TwbBSResultMessage; stdcall;
begin
TwbBSArchive(obj).LoadFromFile(String(aFileName));
Result.code := Ord(BSA_RESULT_NONE);
try
TwbBSArchive(obj).LoadFromFile(String(aFilePath));
except
on E: Exception do
exception_handler(E, Result);
end;
end;
procedure bsa_create_archive(obj: Pointer; const aFileName: PChar; aType: TBSArchiveType; aFileList: TwbBSEntryList); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_create_archive(obj: Pointer; const aFilePath: PChar; aType: TBSArchiveType; aFileList: TwbBSEntryList): TwbBSResultMessage; stdcall;
begin
TwbBSArchive(obj).CreateArchiveCompat(String(aFileName), aType, aFileList);
Result.code := Ord(BSA_RESULT_NONE);
try
TwbBSArchive(obj).CreateArchiveCompat(String(aFilePath), aType, aFileList);
except
on E: Exception do
exception_handler(E, Result);
end;
end;
procedure bsa_save(obj: Pointer); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_save(obj: Pointer): TwbBSResultMessage; stdcall;
begin
TwbBSArchive(obj).Save;
Result.code := Ord(BSA_RESULT_NONE);
try
TwbBSArchive(obj).Save;
except
on E: Exception do
exception_handler(E, Result);
end;
end;
procedure bsa_add_file_from_disk(obj: Pointer; const aRootDir, aFileName: PChar); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_add_file_from_disk_root(obj: Pointer; const aRootDir, aSourcePath: PChar): TwbBSResultMessage; stdcall;
begin
TwbBSArchive(obj).AddFile(String(aRootDir), String(aFileName));
Result.code := Ord(BSA_RESULT_NONE);
try
TwbBSArchive(obj).AddFileDiskRoot(String(aRootDir), String(aSourcePath));
except
on E: Exception do
exception_handler(E, Result);
end;
end;
procedure bsa_add_file_from_memory(obj: Pointer; const aFileName: PChar; const aSize: Cardinal; const aData: PByte); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_add_file_from_disk(obj: Pointer; const aFilePath, aSourcePath: PChar): TwbBSResultMessage; stdcall;
begin
TwbBSArchive(obj).AddFileCompat(String(aFileName), aSize, aData);
Result.code := Ord(BSA_RESULT_NONE);
try
TwbBSArchive(obj).AddFileDisk(String(aFilePath), String(aSourcePath));
except
on E: Exception do
exception_handler(E, Result);
end;
end;
function bsa_find_file_record(obj: Pointer; const aFileName: PChar): Pointer; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_add_file_from_memory(obj: Pointer; const aFilePath: PChar; const aSize: Cardinal; const aData: PByte): TwbBSResultMessage; stdcall;
begin
Result := TwbBSArchive(obj).FindFileRecord(String(aFileName));
Result.code := Ord(BSA_RESULT_NONE);
try
TwbBSArchive(obj).AddFileDataCompat(String(aFilePath), aSize, aData);
except
on E: Exception do
exception_handler(E, Result);
end;
end;
function bsa_extract_file_data_by_record(obj: Pointer; aFileRecord: Pointer): TwbBSFileDataResult; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_find_file_record(obj: Pointer; const aFilePath: PChar): Pointer; stdcall;
begin
Result := TwbBSArchive(obj).ExtractFileDataCompat(aFileRecord);
try
Result := TwbBSArchive(obj).FindFileRecord(String(aFilePath));
except
Result := nil
end;
end;
function bsa_extract_file_data_by_filename(obj: Pointer; const aFileName: PChar): TwbBSFileDataResult; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_extract_file_data_by_record(obj: Pointer; aFileRecord: Pointer): TwbBSResultMessageBuffer; stdcall;
begin
Result := TwbBSArchive(obj).ExtractFileDataCompat(String(aFileName));
Result.message.code := Ord(BSA_RESULT_NONE);
try
Result.buffer := TwbBSArchive(obj).ExtractFileDataCompat(aFileRecord);
except
on E: Exception do
buffer_exception_handler(E, Result);
end;
end;
procedure bsa_file_data_free(obj: Pointer; fileDataResult: TwbBSFileDataResult); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_extract_file_data_by_filename(obj: Pointer; const aFilePath: PChar): TwbBSResultMessageBuffer; stdcall;
begin
TwbBSArchive(obj).ReleaseFileDataCompat(fileDataResult);
Result.message.code := Ord(BSA_RESULT_NONE);
try
Result.buffer := TwbBSArchive(obj).ExtractFileDataCompat(String(aFilePath));
except
on E: Exception do
buffer_exception_handler(E, Result);
end;
end;
procedure bsa_extract_file(obj: Pointer; const aFileName, aSaveAs: PChar); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_file_data_free(obj: Pointer; fileDataResult: TwbBSResultMessageBuffer): TwbBSResultMessage; stdcall;
begin
TwbBSArchive(obj).ExtractFile(String(aFileName), String(aSaveAs));
Result.code := Ord(BSA_RESULT_NONE);
try
TwbBSArchive(obj).ReleaseFileDataCompat(fileDataResult.buffer);
except
on E: Exception do
exception_handler(E, Result);
end;
end;
procedure bsa_iterate_files(obj: Pointer; aProc: TBSFileIterationProcCompat; aContext: Pointer); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_extract_file(obj: Pointer; const aFilePath, aSaveAs: PChar): TwbBSResultMessage; stdcall;
begin
TwbBSArchive(obj).IterateFilesCompat(aProc, aContext);
Result.code := Ord(BSA_RESULT_NONE);
try
TwbBSArchive(obj).ExtractFile(String(aFilePath), String(aSaveAs));
except
on E: Exception do
exception_handler(E, Result);
end;
end;
function bsa_file_exists(obj: Pointer; const aFileName: string): Boolean; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_iterate_files(obj: Pointer; aProc: TBSFileIterationProcCompat; aContext: Pointer): TwbBSResultMessage; stdcall;
begin
Result := TwbBSArchive(obj).FileExists(aFileName);
Result.code := Ord(BSA_RESULT_NONE);
try
TwbBSArchive(obj).IterateFilesCompat(aProc, aContext);
except
on E: Exception do
exception_handler(E, Result);
end;
end;
procedure bsa_get_resource_list(obj: Pointer; const aEntryResultList: TwbBSEntryList; aFolder: PChar); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_file_exists(obj: Pointer; const aFilePath: string): Boolean; stdcall;
begin
TwbBSArchive(obj).ResourceListCompat(aEntryResultList, String(aFolder));
try
Result := TwbBSArchive(obj).FileExists(aFilePath);
except
Result := False;
end;
end;
procedure bsa_resolve_hash(obj: Pointer; const aHash: UInt64; const aEntryResultList: TwbBSEntryList); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_get_resource_list(obj: Pointer; const aEntryResultList: TwbBSEntryList; aFolder: PChar): TwbBSResultMessage; stdcall;
begin
TwbBSArchive(obj).ResolveHashCompat(aHash, aEntryResultList);
Result.code := Ord(BSA_RESULT_NONE);
try
TwbBSArchive(obj).ResourceListCompat(aEntryResultList, String(aFolder));
except
on E: Exception do
exception_handler(E, Result);
end;
end;
procedure bsa_close(obj: Pointer); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_resolve_hash(obj: Pointer; const aHash: UInt64; const aEntryResultList: TwbBSEntryList): TwbBSResultMessage; stdcall;
begin
TwbBSArchive(obj).Close;
Result.code := Ord(BSA_RESULT_NONE);
try
TwbBSArchive(obj).ResolveHashCompat(aHash, aEntryResultList);
except
on E: Exception do
exception_handler(E, Result);
end;
end;
function bsa_close(obj: Pointer): TwbBSResultMessage; stdcall;
begin
Result.code := Ord(BSA_RESULT_NONE);
try
TwbBSArchive(obj).Close;
except
on E: Exception do
exception_handler(E, Result);
end;
end;
function bsa_filename_get(obj: Pointer; const aStringBufferSize: Cardinal; const aStringBuffer: PChar): Cardinal; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_filename_get(obj: Pointer; const aStringBufferSize: Cardinal; const aStringBuffer: PChar): Cardinal; stdcall;
begin
Result := string_to_cstring(TwbBSArchive(obj).FileName, aStringBufferSize, aStringBuffer);
Result := string_to_cstring_end(TwbBSArchive(obj).FileName, aStringBufferSize, aStringBuffer);
end;
function bsa_archive_type_get(obj: Pointer): TBSArchiveType; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_archive_type_get(obj: Pointer): TBSArchiveType; stdcall;
begin
Result := TwbBSArchive(obj).ArchiveType;
end;
function bsa_version_get(obj: Pointer): Cardinal; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_version_get(obj: Pointer): Cardinal; stdcall;
begin
Result := TwbBSArchive(obj).Version;
end;
function bsa_format_name_get(obj: Pointer; const aStringBufferSize: Cardinal; const aStringBuffer: PChar): Cardinal; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_format_name_get(obj: Pointer; const aStringBufferSize: Cardinal; const aStringBuffer: PChar): Cardinal; stdcall;
begin
Result := string_to_cstring(TwbBSArchive(obj).FormatName, aStringBufferSize, aStringBuffer);
Result := string_to_cstring_end(TwbBSArchive(obj).FormatName, aStringBufferSize, aStringBuffer);
end;
function bsa_file_count_get(obj: Pointer): Cardinal; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_file_count_get(obj: Pointer): Cardinal; stdcall;
begin
Result := TwbBSArchive(obj).FileCount;
end;
function bsa_archive_flags_get(obj: Pointer): Cardinal; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_archive_flags_get(obj: Pointer): Cardinal; stdcall;
begin
Result := TwbBSArchive(obj).ArchiveFlags;
end;
procedure bsa_archive_flags_set(obj: Pointer; flags: Cardinal); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
procedure bsa_archive_flags_set(obj: Pointer; flags: Cardinal); stdcall;
begin
TwbBSArchive(obj).ArchiveFlags := flags;
end;
function bsa_file_flags_get(obj: Pointer): Cardinal; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_file_flags_get(obj: Pointer): Cardinal; stdcall;
begin
Result := TwbBSArchive(obj).FileFlags;
end;
procedure bsa_file_flags_set(obj: Pointer; flags: Cardinal); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
procedure bsa_file_flags_set(obj: Pointer; flags: Cardinal); stdcall;
begin
TwbBSArchive(obj).FileFlags := flags;
end;
function bsa_compress_get(obj: Pointer): Boolean; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_compress_get(obj: Pointer): Boolean; stdcall;
begin
Result := TwbBSArchive(obj).Compress;
end;
procedure bsa_compress_set(obj: Pointer; compress: Boolean); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
procedure bsa_compress_set(obj: Pointer; compress: Boolean); stdcall;
begin
TwbBSArchive(obj).Compress := compress;
end;
function bsa_share_data_get(obj: Pointer): Boolean; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function bsa_share_data_get(obj: Pointer): Boolean; stdcall;
begin
Result := TwbBSArchive(obj).ShareData;
end;
procedure bsa_share_data_set(obj: Pointer; shareData: Boolean); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
procedure bsa_share_data_set(obj: Pointer; shareData: Boolean); stdcall;
begin
TwbBSArchive(obj).ShareData := shareData;
end;
procedure bsa_file_dds_info_callback_set(obj: Pointer; aProc: TBSFileDDSInfoProcCompat); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
procedure bsa_file_dds_info_callback_set(obj: Pointer; aProc: TBSFileDDSInfoProcCompat; aContext: Pointer); stdcall;
begin
TwbBSArchive(obj).DDSInfoProc := aProc;
TwbBSArchive(obj).DDSInfoProcContext := aContext;
end;
exports
@@ -240,6 +413,7 @@ exports
bsa_extract_file_data_by_record,
bsa_find_file_record,
bsa_add_file_from_memory,
bsa_add_file_from_disk_root,
bsa_add_file_from_disk,
bsa_save,
bsa_create_archive,
+43 -2
View File
@@ -28,11 +28,29 @@
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
<Cfg_1_Win32>true</Cfg_1_Win32>
<CfgParent>Cfg_1</CfgParent>
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win64)'!=''">
<Cfg_1_Win64>true</Cfg_1_Win64>
<CfgParent>Cfg_1</CfgParent>
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win64)'!=''">
<Cfg_2_Win64>true</Cfg_2_Win64>
<CfgParent>Cfg_2</CfgParent>
@@ -72,22 +90,44 @@
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<DCC_ExeOutput>Win32\Release\</DCC_ExeOutput>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<Manifest_File>(None)</Manifest_File>
<Debugger_HostApplication>Win32\Release\libbsarch-visualstudio-test.exe</Debugger_HostApplication>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
<DCC_ExeOutput>X64\Release\</DCC_ExeOutput>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<Manifest_File>(None)</Manifest_File>
<Debugger_HostApplication>X64\Release\libbsarch-visualstudio-test.exe</Debugger_HostApplication>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<Debugger_HostApplication>Win32\Debug\libbsarch-visualstudio-test.exe</Debugger_HostApplication>
<DCC_ExeOutput>Win32\Debug\</DCC_ExeOutput>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<Manifest_File>(None)</Manifest_File>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win64)'!=''">
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<Manifest_File>(None)</Manifest_File>
<DCC_ExeOutput>X64\Debug\</DCC_ExeOutput>
<Debugger_HostApplication>D:\Projects\libbsarch\x64\Debug\libbsarch-visualstudio-test.exe</Debugger_HostApplication>
<Debugger_CWD>D:\Projects\libbsarch\x64\Debug</Debugger_CWD>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="wbStreams.pas"/>
<DCCReference Include="wbBSArchive.pas"/>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
@@ -117,6 +157,7 @@
<Platform value="Win32">True</Platform>
<Platform value="Win64">True</Platform>
</Platforms>
<ModelSupport>False</ModelSupport>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
+76 -42
View File
@@ -12,8 +12,19 @@
#define BSARCH_DLL_API(ReturnType) extern "C" __declspec(dllimport) ReturnType __stdcall
#endif
#ifdef __GNUC__
#define PACKED(datastructure) datastructure __attribute__((__packed__))
#else
#define PACKED(datastructure) __pragma(pack(push, 1)) datastructure __pragma(pack(pop))
#endif
typedef enum bsa_result_code_e {
BSA_RESULT_NONE = 0,
BSA_RESULT_EXCEPTION = -1
} bsa_result_code_t;
typedef void* bsa_buffer_t;
typedef void* bsa_archive_t;
typedef void* bsa_file_data_t;
typedef void* bsa_entry_list_t;
typedef void* bsa_file_record_t;
typedef void* bsa_folder_record_t;
@@ -22,15 +33,37 @@ typedef struct bsa_dds_info_s {
uint32_t width, height, mipmaps;
} bsa_dds_info_t;
typedef struct bsa_dds_header_s {
PACKED (
struct bsa_dds_header_s {
uint32_t magic; // DDS_MAGIC
struct DirectX::DDS_HEADER header;
} bsa_dds_header_t;
});
typedef struct bsa_file_data_result_s {
typedef struct bsa_dds_header_s bsa_dds_header_t;
PACKED (
struct bsa_result_message_s {
int8_t code; // bsa_result_code_t
wchar_t text[1024];
});
typedef struct bsa_result_message_s bsa_result_message_t;
PACKED (
struct bsa_result_buffer_s {
uint32_t size;
bsa_file_data_t data;
} bsa_file_data_result_t;
bsa_buffer_t data;
});
typedef struct bsa_result_buffer_s bsa_result_buffer_t;
PACKED (
struct bsa_result_message_buffer_s {
bsa_result_buffer_t buffer;
bsa_result_message_t message;
});
typedef struct bsa_result_message_buffer_s bsa_result_message_buffer_t;
typedef enum bsa_archive_state_e {
stReading, stWriting
@@ -40,45 +73,46 @@ typedef enum bsa_archive_type_e {
baNone, baTES3, baTES4, baFO3, baSSE, baFO4, baFO4dds
} bsa_archive_type_t;
typedef void (*bsa_file_dds_info_proc_t)(bsa_archive_t bsa_archive, char **filename, bsa_dds_info_t dds_info);
typedef bool (*bsa_file_iteration_proc_t)(bsa_archive_t bsa_archive, char **filename, bsa_file_record_t file_record, bsa_folder_record_t folder_record, void *context);
typedef void (*bsa_file_dds_info_proc_t)(bsa_archive_t archive, const wchar_t *file_path, bsa_dds_info_t *dds_info, void *context);
typedef bool (*bsa_file_iteration_proc_t)(bsa_archive_t archive, const wchar_t *file_path, bsa_file_record_t file_record, bsa_folder_record_t folder_record, void *context);
BSARCH_DLL_API(bsa_entry_list_t) bsa_entry_list_create();
BSARCH_DLL_API(void) bsa_entry_list_free(bsa_entry_list_t *entry_list);
BSARCH_DLL_API(uint32_t) bsa_entry_list_count(bsa_entry_list_t *entry_list);
BSARCH_DLL_API(void) bsa_entry_list_add(bsa_entry_list_t *entry_list, char *entry_string);
BSARCH_DLL_API(uint32_t) bsa_entry_list_get(bsa_entry_list_t *entry_list, uint32_t index, uint32_t string_buffer_size, char *string_buffer);
BSARCH_DLL_API(bsa_result_message_t) bsa_entry_list_free(bsa_entry_list_t entry_list);
BSARCH_DLL_API(uint32_t) bsa_entry_list_count(bsa_entry_list_t entry_list);
BSARCH_DLL_API(bsa_result_message_t) bsa_entry_list_add(bsa_entry_list_t entry_list, const wchar_t *entry_string);
BSARCH_DLL_API(uint32_t) bsa_entry_list_get(bsa_entry_list_t entry_list, uint32_t index, uint32_t string_buffer_size, const wchar_t *string_buffer);
BSARCH_DLL_API(bsa_archive_t) bsa_create();
BSARCH_DLL_API(void) bsa_free(bsa_archive_t archive);
BSARCH_DLL_API(void) bsa_load_from_file(bsa_archive_t archive, char *filename);
BSARCH_DLL_API(void) bsa_create_archive(bsa_archive_t archive, char *filename, bsa_archive_type_t archive_type, bsa_entry_list_t entry_list);
BSARCH_DLL_API(void) bsa_save(bsa_archive_t archive);
BSARCH_DLL_API(void) bsa_add_file_from_disk(bsa_archive_t archive, char *root_dir, char *filename);
BSARCH_DLL_API(void) bsa_add_file_from_memory(bsa_archive_t archive, char *filename, uint32_t size, bsa_file_data_t data);
BSARCH_DLL_API(bsa_file_record_t) bsa_find_file_record(bsa_archive_t archive, char *filename);
BSARCH_DLL_API(bsa_file_data_result_t) bsa_extract_file_data_by_record(bsa_archive_t archive, bsa_file_record_t file_record);
BSARCH_DLL_API(bsa_file_data_result_t) bsa_extract_file_data_by_filename(bsa_archive_t archive, char *filename);
BSARCH_DLL_API(void) bsa_file_data_free(bsa_archive_t archive, bsa_file_data_result_t file_data_result);
BSARCH_DLL_API(void) bsa_extract_file(bsa_archive_t archive, char *filename, char *save_as);
BSARCH_DLL_API(void) bsa_iterate_files(bsa_archive_t archive, bsa_file_iteration_proc_t file_iteration_proc, void *context);
BSARCH_DLL_API(bool) bsa_file_exists(bsa_archive_t archive, char *filename);
BSARCH_DLL_API(void) bsa_get_resource_list(bsa_archive_t archive, bsa_entry_list_t entry_result_list, char *folder);
BSARCH_DLL_API(void) bsa_resolve_hash(bsa_archive_t archive, uint64_t hash, bsa_entry_list_t entry_result_list);
BSARCH_DLL_API(void) bsa_close(bsa_archive_t archive);
BSARCH_DLL_API(bsa_result_message_t) bsa_free(bsa_archive_t archive);
BSARCH_DLL_API(bsa_result_message_t) bsa_load_from_file(bsa_archive_t archive, const wchar_t *file_path);
BSARCH_DLL_API(bsa_result_message_t) bsa_create_archive(bsa_archive_t archive, const wchar_t *file_path, bsa_archive_type_t archive_type, bsa_entry_list_t entry_list);
BSARCH_DLL_API(bsa_result_message_t) bsa_save(bsa_archive_t archive);
BSARCH_DLL_API(bsa_result_message_t) bsa_add_file_from_disk(bsa_archive_t archive, const wchar_t *file_path, const wchar_t *source_path);
BSARCH_DLL_API(bsa_result_message_t) bsa_add_file_from_disk_root(bsa_archive_t archive, const wchar_t *root_dir, const wchar_t *source_path);
BSARCH_DLL_API(bsa_result_message_t) bsa_add_file_from_memory(bsa_archive_t archive, const wchar_t *file_path, uint32_t size, bsa_buffer_t data);
BSARCH_DLL_API(bsa_file_record_t) bsa_find_file_record(bsa_archive_t archive, const wchar_t *file_path);
BSARCH_DLL_API(bsa_result_message_buffer_t) bsa_extract_file_data_by_record(bsa_archive_t archive, bsa_file_record_t file_record);
BSARCH_DLL_API(bsa_result_message_buffer_t) bsa_extract_file_data_by_filename(bsa_archive_t archive, const wchar_t *file_path);
BSARCH_DLL_API(bsa_result_message_t) bsa_file_data_free(bsa_archive_t archive, bsa_result_buffer_t file_data_result);
BSARCH_DLL_API(bsa_result_message_t) bsa_extract_file(bsa_archive_t archive, const wchar_t *file_path, const wchar_t *save_as);
BSARCH_DLL_API(bsa_result_message_t) bsa_iterate_files(bsa_archive_t archive, bsa_file_iteration_proc_t file_iteration_proc, void *context);
BSARCH_DLL_API(bool) bsa_file_exists(bsa_archive_t archive, const wchar_t *file_path);
BSARCH_DLL_API(bsa_result_message_t) bsa_get_resource_list(bsa_archive_t archive, bsa_entry_list_t entry_result_list, const wchar_t *folder);
BSARCH_DLL_API(bsa_result_message_t) bsa_resolve_hash(bsa_archive_t archive, uint64_t hash, bsa_entry_list_t entry_result_list);
BSARCH_DLL_API(bsa_result_message_t) bsa_close(bsa_archive_t archive);
BSARCH_DLL_API(uint32_t) bsa_filename_get(bsa_archive_t *archive, uint32_t string_buffer_size, char *string_buffer);
BSARCH_DLL_API(bsa_archive_type_t) bsa_archive_type_get(bsa_archive_t *archive);
BSARCH_DLL_API(uint32_t) bsa_version_get(bsa_archive_t *archive);
BSARCH_DLL_API(uint32_t) bsa_format_name_get(bsa_archive_t *archive, uint32_t string_buffer_size, char *string_buffer);
BSARCH_DLL_API(uint32_t) bsa_file_count_get(bsa_archive_t *archive);
BSARCH_DLL_API(uint32_t) bsa_archive_flags_get(bsa_archive_t *archive);
BSARCH_DLL_API(void) bsa_archive_flags_set(bsa_archive_t *archive, uint32_t flags);
BSARCH_DLL_API(uint32_t) bsa_file_flags_get(bsa_archive_t *archive);
BSARCH_DLL_API(void) bsa_file_flags_set(bsa_archive_t *archive, uint32_t flags);
BSARCH_DLL_API(bool) bsa_compress_get(bsa_archive_t *archive);
BSARCH_DLL_API(void) bsa_compress_set(bsa_archive_t *archive, bool flags);
BSARCH_DLL_API(bool) bsa_share_data_get(bsa_archive_t *archive);
BSARCH_DLL_API(void) bsa_share_data_set(bsa_archive_t *archive, bool flags);
BSARCH_DLL_API(uint32_t) bsa_filename_get(bsa_archive_t archive, uint32_t string_buffer_size, const wchar_t *string_buffer);
BSARCH_DLL_API(bsa_archive_type_t) bsa_archive_type_get(bsa_archive_t archive);
BSARCH_DLL_API(uint32_t) bsa_version_get(bsa_archive_t archive);
BSARCH_DLL_API(uint32_t) bsa_format_name_get(bsa_archive_t archive, uint32_t string_buffer_size, const wchar_t *string_buffer);
BSARCH_DLL_API(uint32_t) bsa_file_count_get(bsa_archive_t archive);
BSARCH_DLL_API(uint32_t) bsa_archive_flags_get(bsa_archive_t archive);
BSARCH_DLL_API(void) bsa_archive_flags_set(bsa_archive_t archive, uint32_t flags);
BSARCH_DLL_API(uint32_t) bsa_file_flags_get(bsa_archive_t archive);
BSARCH_DLL_API(void) bsa_file_flags_set(bsa_archive_t archive, uint32_t flags);
BSARCH_DLL_API(bool) bsa_compress_get(bsa_archive_t archive);
BSARCH_DLL_API(void) bsa_compress_set(bsa_archive_t archive, bool flags);
BSARCH_DLL_API(bool) bsa_share_data_get(bsa_archive_t archive);
BSARCH_DLL_API(void) bsa_share_data_set(bsa_archive_t archive, bool flags);
BSARCH_DLL_API(void) bsa_file_dds_info_callback_set(bsa_archive_t *archive, bsa_file_dds_info_proc_t file_dds_info_proc);
BSARCH_DLL_API(void) bsa_file_dds_info_callback_set(bsa_archive_t archive, bsa_file_dds_info_proc_t file_dds_info_proc, void *context);
+44 -6
View File
@@ -22,28 +22,28 @@
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{537F42AD-5B15-4671-B99E-2D1818999A98}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -67,11 +67,15 @@
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(DirectXTexPath)\DirectXTex;$(IncludePath)</IncludePath>
<TargetName>$(ProjectName)</TargetName>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(DirectXTexPath)\DirectXTex;$(IncludePath)</IncludePath>
<TargetName>$(ProjectName)</TargetName>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>$(DirectXTexPath)\DirectXTex;$(IncludePath)</IncludePath>
@@ -91,9 +95,15 @@
</ClCompile>
<Link>
<TargetMachine>MachineX86</TargetMachine>
<GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<ModuleDefinitionFile>libbsarch.def</ModuleDefinitionFile>
</Link>
<CustomBuildStep>
<Command>xcopy /y "$(ProjectDir)libbsarch.h" "$(OutDir)"</Command>
<Message>Copying header file</Message>
<Outputs>$(OutDir)libbsarch.h</Outputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
@@ -108,10 +118,38 @@
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<ModuleDefinitionFile>libbsarch.def</ModuleDefinitionFile>
</Link>
<CustomBuildStep>
<Command>xcopy /y "$(ProjectDir)libbsarch.h" "$(OutDir)"</Command>
<Message>Copying header file</Message>
<Outputs>$(OutDir)libbsarch.h</Outputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Link>
<GenerateDebugInformation>false</GenerateDebugInformation>
<ModuleDefinitionFile>libbsarch.def</ModuleDefinitionFile>
</Link>
<CustomBuildStep>
<Command>xcopy /y "$(ProjectDir)libbsarch.h" "$(OutDir)"</Command>
<Message>Copying header file</Message>
<Outputs>$(OutDir)libbsarch.h</Outputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Link>
<ModuleDefinitionFile>libbsarch.def</ModuleDefinitionFile>
</Link>
<CustomBuildStep>
<Command>xcopy /y "$(ProjectDir)libbsarch.h" "$(OutDir)"</Command>
<Message>Copying header file</Message>
<Outputs>$(OutDir)libbsarch.h</Outputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemGroup>
<None Include=".vscode\ipch\c1c5ff332820ca89\mmap_address.bin" />
<None Include="cpp.hint" />
<None Include="libbsarch.def" />
<None Include="tforge\TFL.inc" />
</ItemGroup>
+1
View File
@@ -24,6 +24,7 @@
<None Include=".vscode\ipch\c1c5ff332820ca89\mmap_address.bin">
<Filter>Resource Files</Filter>
</None>
<None Include="cpp.hint" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="DDS.h">
+138 -118
View File
File diff suppressed because it is too large Load Diff